With this mode you can divide the STAFF CP into different categories (eg members, torrents, spy, site management,...), place the links in these categories and choose which class from Staff has access to the links
do a backup of your files before
SQL
[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=5416"]new_admin_cp.patch[/url]
2) take a coffee before :)
find and remove this part:
some screens:
Satff cp for admin
staf fcp for smodo:
staff cp for moderators:




Do not forget to give access to the control panel for staff
do a backup of your files before
SQL
[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=5416"]new_admin_cp.patch[/url]
2) take a coffee before :)
find and remove this part:
CREATE TABLE IF NOT EXISTS `staff_categorie` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`nom` varchar(60) NOT NULL DEFAULT '',
`tri` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
--
-- Contenu de la table `staff_categorie`
--
INSERT INTO `staff_categorie` (`id`, `nom`, `tri`) VALUES
(1, 'Torrents', 1),
(2, 'Members', 2),
(3, 'MP-MAIL-IP', 3),
(4, 'SEARCH_SPY', 4),
(5, 'SITE_MANAGEMENT', 5),
(6, 'SYSOP', 6);
CREATE TABLE IF NOT EXISTS `staffnavigate` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`lien` varchar(100) NOT NULL DEFAULT '',
`nom` varchar(100) NOT NULL DEFAULT '',
`tri` tinyint(3) unsigned NOT NULL DEFAULT '0',
`classe` tinyint(3) unsigned NOT NULL DEFAULT '10',
`categorie` tinyint(2) NOT NULL DEFAULT '0',
`image` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
--
-- Contenu de la table `staffnavigate`
--
INSERT INTO `staffnavigate` (`id`, `lien`, `nom`, `tri`, `classe`, `categorie`, `image`) VALUES
(1, 'admincp.php?action=staff_liens', 'STAFF_LINK', 1, 7, 6, 'liens_staff.png'),
(2, 'admincp.php?action=categories&do=view', 'TORRENT_CAT_VIEW', 1, 5, 1, 'torrent_cats.png'),
(3, 'admincp.php?action=avatars', 'AVATAR_LOG', 2, 5, 2, 'avatar_log.png'),
(4, 'admincp.php?action=staffcategorie', 'STAFF_CAT', 2, 7, 6, 'staff_cat.png'),
(5, 'admincp.php?action=torrentlangs&do=view', 'TORRENT_LANG', 2, 5, 1, 'torrent_lang.png'),
(6, 'admincp.php?action=ipbans', 'BANNED_IPS', 1, 6, 3, 'ip_block.png'),
(7, 'admincp.php?action=backups', 'BACKUPS', 3, 7, 6, 'db_backup.png'),
(8, 'admincp.php?action=usersearch', 'ADVANCED_USER_SEARCH', 1, 5, 2, 'user_search.png'),
(9, 'admincp.php?action=bannedtorrents', 'BANNED_TORRENTS', 3, 5, 1, 'banned_torrents.png'),
(10, 'admincp.php?action=blocks&do=view', 'BLOCKS', 4, 7, 6, 'blocks.png'),
(11, 'admincp.php?action=cheats', 'DETECT_POSS_CHEATS', 1, 6, 4, 'cheats.png'),
(12, 'admincp.php?action=emailbans', 'EMAIL_BANS', 2, 5, 3, 'mail_bans.png'),
(13, 'faq-manage.php', 'FAQ', 1, 5, 5, 'faq.png'),
(14, 'admincp.php?action=freetorrents', 'FREE_LEECH_TORRENTS', 4, 6, 1, 'free_leech.png'),
(15, 'admincp.php?action=lastcomm', 'LATEST_COMMENTS', 2, 5, 4, 'comments.png'),
(16, 'admincp.php?action=masspm', 'MASS_PM', 3, 5, 3, 'mass_pm.png'),
(17, 'admincp.php?action=messagespy', 'MESSAGE_SPY', 3, 7, 4, 'message_spy.png'),
(18, 'admincp.php?action=news&do=view', 'NEWS', 2, 5, 5, 'news.png'),
(19, 'admincp.php?action=peers', 'PEERS_LIST', 3, 5, 2, 'peer_list.png'),
(20, 'admincp.php?action=polls&do=view', 'POLLS', 3, 5, 5, 'polls.png'),
(21, 'admincp.php?action=reports&do=view', 'REPORTS', 4, 5, 5, 'report_system.png'),
(22, 'admincp.php?action=rules&do=view', 'RULES', 5, 7, 5, 'rules.png'),
(23, 'admincp.php?action=sitelog', 'SITELOG', 4, 5, 4, 'site_log.png'),
(24, 'teams-create.php', 'TEAMS', 6, 5, 5, 'teams.png'),
(25, 'admincp.php?action=style', 'THEME_MANAGEMENT', 7, 6, 5, 'themes.png'),
(26, 'admincp.php?action=torrentmanage', 'TORRENTS', 5, 5, 1, 'torrents.png'),
(27, 'admincp.php?action=groups&do=view', 'USER_GROUPS_VIEW', 5, 7, 6, 'user_groups.png'),
(28, 'admincp.php?action=warned', 'WARNED_USERS', 4, 5, 2, 'warned_user.png'),
(29, 'admincp.php?action=whoswhere', 'WHOS_WHERE', 5, 6, 4, 'whos_where.png'),
(30, 'admincp.php?action=censor', 'WORD_CENSOR', 8, 5, 5, 'word_censor.png'),
(31, 'admincp.php?action=forum', 'FORUM_MANAGEMENT', 9, 6, 5, 'forums.png'),
(32, 'admincp.php?action=pendinginvite', 'PENDING_INVITED_USERS', 5, 7, 2, 'pending_invited_user.png'),
(33, 'admincp.php?action=users', 'SIMPLE_USERS_SEARCH', 6, 5, 2, 'simple_user_search.png'),
(34, 'admincp.php?action=forceclean', 'FORCE_CLEAN', 6, 7, 6, 'force_clean.png'),
(35, 'admincp.php?action=confirmreg', 'PENDING_USERS', 7, 7, 6, 'pending_users.png'),
(36, 'admincp.php?action=privacylevel', 'Strong Privacy', 7, 5, 2, 'privacy_level.png');In backend/functions.php before :?>
add:
function verif_acces($i){
GLOBAL $CURUSER;
$res=SQL_Query_exec("SELECT classe FROM staffnavigate WHERE lien LIKE '$i'");
$num_rows = mysql_num_rows($res);
if($num_rows != '1'){
show_error_msg(T_("ERROR"),"". T_("ERROR_LINK") .": <font color='#ff0000'>$i</font> ",1);
}else{
$row=mysql_fetch_row($res);
if($CURUSER["class"] < $row[0])
die(show_error_msg(T_("ERROR"),T_("SORRY_NO_RIGHTS_TO_ACCESS"),1));
}
}
function navmenu(){
global $site_config,$CURUSER;
//Get Last Cleanup
$res = SQL_Query_exec("SELECT last_time FROM tasks WHERE task = 'cleanup'");
$row = mysql_fetch_array($res);
if (!$row){
$lastclean="never done...";
}else{
$row[0]=gmtime()-$row[0]; $days=intval($row[0] / 86400);$row[0]-=$days*86400;
$hours=intval($row[0] / 3600); $row[0]-=$hours*3600; $mins=intval($row[0] / 60);
$secs=$row[0]-($mins*60);
$lastclean = "$days days, $hours hrs, $mins minutes, $secs seconds ago.";
}
begin_frame(T_("MENU"));
print "Last cleanup performed: ".$lastclean." [<a href='admincp.php?action=forceclean'>".T_("FORCE_CLEAN")."</a>]<br /><br />";
if ($site_config["ttversion"] != "2-svn") {
$file = @file_get_contents('http://www.torrenttrader.org/tt2version.php');
if ($site_config['ttversion'] >= $file){
echo "<br /><center><b>".T_("YOU_HAVE_LATEST_VER_INSTALLED")." v$site_config[ttversion]</b></center>";
}else{
echo "<br /><center><b><font color='#ff0000'>".T_("NEW_VERSION_OF_TT_NOW_AVAIL").": v".$file." you have v".$site_config['ttversion']."<br /> Please visit <a href=http://www.torrenttrader.org>TorrentTrader.org</a> to upgrade.</font></b></center>";
}
}
$res = SQL_Query_exec("SELECT VERSION() AS mysql_version");
$row = mysql_fetch_array($res);
$mysqlver = $row['mysql_version'];
$pending = get_row_count("users", "WHERE status = 'pending' AND invited_by = '0'");
echo "<center><b>".T_("USERS_AWAITING_VALIDATION").":</b> <a href='admincp.php?action=confirmreg'>($pending)</a></center><br />";
echo "<center>".T_("VERSION_MYSQL").": <b>" . $mysqlver . "</b><br />".T_("VERSION_PHP").": <b>" . phpversion() . "</b></center>";
$affiche_menu = SQL_Query_exec("SELECT * FROM staff_categorie ORDER BY tri");
while($menu=mysql_fetch_array($affiche_menu)) {
$num_rows_class = get_row_count("staffnavigate", "WHERE categorie = $menu[id] AND $CURUSER[class] >= classe");
if ($num_rows_class != '0') {
print(" <fieldset>>
<legend style='color:#800000;'>". T_("$menu[nom]") ."</legend>
");
$affiche_sous_menu = SQL_Query_exec("SELECT * FROM staffnavigate WHERE categorie = $menu[id] AND $CURUSER[class] >= classe ORDER BY tri");
print(" <table border='0' width='100%' cellspacing='0' cellpadding='0'>
<tr>");
$i= 1;
while($sous_menu=mysql_fetch_assoc($affiche_sous_menu)) {
$classe = $sous_menu[classe];
switch($classe){//change case by your level for staff
case '5' : $icone= '<font color="#9a4e65" size="1">[M]</font>';break;//modo
case '6' : $icone= '<font color="#f688af" size="1">[S]</font>';break;//smodo
case '7' : $icone= '<font color="#ff0000" size="1">[A]</font>';break;//admin
}
if ($CURUSER['class'] == "7")//if 7 is admin level
{
print(" <td width='20%'><img src='images/admin/$sous_menu[image]' border='0' width='32' height='32' alt='' /><br /><a href=\"$sous_menu[lien]\">". T_("$sous_menu[nom]") ." $icone</a></td>");
}else{
print(" <td width='20%'><img src='images/admin/$sous_menu[image]' border='0' width='32' height='32' alt='' /><br /><a href=\"$sous_menu[lien]\">". T_("$sous_menu[nom]") ." </a></td>");
}
if($i%5== 0){
print(" </tr>
<tr>");
}
$i++;
}//while $sous_menu
print(" </tr>
</table>
</fieldset><br/>");
}///$num_rows
}//while $menu
end_frame();
}
in english.php add and adapt for you :
$LANG["ERROR_LINK"] = "The link doesn't exist in the database";
$LANG["STAFF_LINK"] = "Links Staff CP";
$LANG["STAFF_CAT"] = "Staff CP Categories";
$LANG["PENDING_USERS"] = "Pending users";
$LANG["PENDING_INVITED_USERS"] = "Pending invited users";
$LANG["LINK_ADDED"] = "Link added in Staff CP";
$LANG["NAME_EMPTY"] = "Name was empty";
$LANG["LINK_EMPTY"] = "Link was empty";
$LANG["ORDER_EMPTY"] = "Sort order was empty";
$LANG["CLASS_EMPTY"] = "Min class to access was empty";
$LANG["CAT_EMPTY"] = "Category was empty";
$LANG["IMAGE_EMPTY"] = "Image was empty";
$LANG["LINK_DELETED"] = "Link was deleted in Staff CP";
$LANG["ADD_LINK"] = "Add a link";
$LANG["EDIT_LINKS"] = "Edit links";
$LANG["LINK"] = "Link";
$LANG["MAIN_CATEGORY"] = "Main category";
$LANG["ORDER"] = "Order";
$LANG["MIN_CLASS_ACCESS"] = "Min class to access";
$LANG["LINK_STAFF"] = "Link in Staff CP";
$LANG["NEW_CAT_ADDED"] = "New category added in staff CP";
$LANG["CAT_DELETED"] = "Category deleted in Staff CP";
$LANG["CATEGORY_STAFF"] = "Category in Staff CP";
$LANG["CHANGE_LINK_CATEGORY"] = "Don't forget to modify the link category before the deleting";
$LANG["CAT_EDIT"] = "Edit categories";
$LANG["ADD_NEW_CATEGORY"] = "Add a new category";
$LANG["CAT_NAME"] = "Category name";
in faq-manage.php : find
stdhead(T_("FAQ_MANAGEMENT"));
after add:
navmenu();
verif_acces("faq-manage.php");
in teams-create.php find:
stdhead(T_("TEAMS"));
after add:
navmenu();
verif_acces("teams-create.php");
now admincp.php
two choices :
1) if you use tortoise here's a patch based on last svn :function navmenu(){
global $site_config;
//Get Last Cleanup
$res = SQL_Query_exec("SELECT last_time FROM tasks WHERE task = 'cleanup'");
$row = mysql_fetch_array($res);
if (!$row){
$lastclean="never done...";
}else{
$row[0]=gmtime()-$row[0]; $days=intval($row[0] / 86400);$row[0]-=$days*86400;
$hours=intval($row[0] / 3600); $row[0]-=$hours*3600; $mins=intval($row[0] / 60);
$secs=$row[0]-($mins*60);
$lastclean = "$days days, $hours hrs, $mins minutes, $secs seconds ago.";
}
begin_frame(T_("MENU"));
print "Last cleanup performed: ".$lastclean." [<a href='admincp.php?action=forceclean'>".T_("FORCE_CLEAN")."</a>]<br /><br />";
if ($site_config["ttversion"] != "2-svn") {
$file = @file_get_contents('http://www.torrenttrader.org/tt2version.php');
if ($site_config['ttversion'] >= $file){
echo "<br /><center><b>".T_("YOU_HAVE_LATEST_VER_INSTALLED")." v$site_config[ttversion]</b></center>";
}else{
echo "<br /><center><b><font color='#ff0000'>".T_("NEW_VERSION_OF_TT_NOW_AVAIL").": v".$file." you have v".$site_config['ttversion']."<br /> Please visit <a href=http://www.torrenttrader.org>TorrentTrader.org</a> to upgrade.</font></b></center>";
}
}
$res = SQL_Query_exec("SELECT VERSION() AS mysql_version");
$row = mysql_fetch_array($res);
$mysqlver = $row['mysql_version'];
$pending = get_row_count("users", "WHERE status = 'pending' AND invited_by = '0'");
echo "<center><b>".T_("USERS_AWAITING_VALIDATION").":</b> <a href='admincp.php?action=confirmreg'>($pending)</a></center><br />";
echo "<center>".T_("VERSION_MYSQL").": <b>" . $mysqlver . "</b><br />".T_("VERSION_PHP").": <b>" . phpversion() . "</b></center>";
?>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><a href="admincp.php?action=usersearch"><img src="images/admin/user_search.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("ADVANCED_USER_SEARCH"); ?></a><br /></td>
<td align="center"><a href="admincp.php?action=avatars"><img src="images/admin/avatar_log.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("AVATAR_LOG"); ?></a><br /></td>
<td align="center"><a href="admincp.php?action=backups"><img src="images/admin/db_backup.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("BACKUPS"); ?></a><br /></td>
<td align="center"><a href="admincp.php?action=ipbans"><img src="images/admin/ip_block.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("BANNED_IPS"); ?></a><br /></td>
<td align="center"><a href="admincp.php?action=bannedtorrents"><img src="images/admin/banned_torrents.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("BANNED_TORRENTS"); ?></a><br /></td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td align="center"><a href="admincp.php?action=blocks&do=view"><img src="images/admin/blocks.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("BLOCKS"); ?></a><br /></td>
<td align="center"><a href="admincp.php?action=cheats"><img src="images/admin/cheats.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("DETECT_POSS_CHEATS"); ?></a><br /></td>
<td align="center"><a href="admincp.php?action=emailbans"><img src="images/admin/mail_bans.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("EMAIL_BANS"); ?></a><br /></td>
<td align="center"><a href="faq-manage.php"><img src="images/admin/faq.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("FAQ"); ?></a><br /></td>
<td align="center"><a href="admincp.php?action=freetorrents"><img src="images/admin/free_leech.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("FREE_LEECH_TORRENTS"); ?></a><br /></td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td align="center"><a href="admincp.php?action=lastcomm"><img src="images/admin/comments.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("LATEST_COMMENTS"); ?></a><br /></td>
<td align="center"><a href="admincp.php?action=masspm"><img src="images/admin/mass_pm.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("MASS_PM"); ?></a><br /></td>
<td align="center"><a href="admincp.php?action=messagespy"><img src="images/admin/message_spy.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("MESSAGE_SPY"); ?></a><br /></td>
<td align="center"><a href="admincp.php?action=news&do=view"><img src="images/admin/news.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("NEWS"); ?></a><br /></td>
<td align="center"><a href="admincp.php?action=peers"><img src="images/admin/peer_list.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("PEERS_LIST"); ?></a><br /></td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td align="center"><a href="admincp.php?action=polls&do=view"><img src="images/admin/polls.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("POLLS"); ?></a><br /></td>
<td align="center"><a href="admincp.php?action=reports&do=view"><img src="images/admin/report_system.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("REPORTS"); ?></a><br /></td>
<td align="center"><a href="admincp.php?action=rules&do=view"><img src="images/admin/rules.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("RULES"); ?></a><br /></td>
<td align="center"><a href="admincp.php?action=sitelog"><img src="images/admin/site_log.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("SITELOG"); ?></a><br /></td>
<td align="center"><a href="teams-create.php"><img src="images/admin/teams.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("TEAMS"); ?></a><br /></td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td align="center"><a href="admincp.php?action=style"><img src="images/admin/themes.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("THEME_MANAGEMENT"); ?></a><br /></td>
<td align="center"><a href="admincp.php?action=categories&do=view"><img src="images/admin/torrent_cats.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("TORRENT_CAT_VIEW"); ?></a><br /></td>
<td align="center"><a href="admincp.php?action=torrentlangs&do=view"><img src="images/admin/torrent_lang.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("TORRENT_LANG"); ?></a><br /></td>
<td align="center"><a href="admincp.php?action=torrentmanage"><img src="images/admin/torrents.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("TORRENTS"); ?></a><br /></td>
<td align="center"><a href="admincp.php?action=groups&do=view"><img src="images/admin/user_groups.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("USER_GROUPS_VIEW"); ?></a><br /></td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td align="center"><a href="admincp.php?action=warned"><img src="images/admin/warned_user.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("WARNED_USERS"); ?></a><br /></td>
<td align="center"><a href="admincp.php?action=whoswhere"><img src="images/admin/whos_where.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("WHOS_WHERE"); ?></a><br /></td>
<td align="center"><a href="admincp.php?action=censor"><img src="images/admin/word_censor.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("WORD_CENSOR"); ?></a><br /></td>
<td align="center"><a href="admincp.php?action=forum"><img src="images/admin/forums.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("FORUM_MANAGEMENT"); ?><br /></a></td>
<td align="center"><a href="admincp.php?action=pendinginvite"><img src="images/admin/pending_invited_user.png" border="0" width="32" height="32" alt="" /><br />Pending Invited Users<br /></a></td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td align="center"><a href="admincp.php?action=users"><img src="images/admin/simple_user_search.png" border="0" width="32" height="32" alt="" /><br />Simple User Search<br /></a></td>
<td align="center"><a href="admincp.php?action=privacylevel"><img src="images/admin/privacy_level.png" border="0" width="32" height="32" alt="" /><br />Strong Privacy<br /></a></td>
</tr>
</table>
<?php
end_frame();
}
find:
if ($action=="groups" && $do=="view"){
stdhead(T_("GROUPS_MANAGEMENT"));
navmenu();
underneath add:
verif_acces("admincp.php?action=groups&do=view");
find:
if ($action=="groups" && $do=="edit"){
underneath add:
verif_acces("admincp.php?action=groups&do=view");
find:
if ($action=="groups" && $do=="update"){
stdhead(T_("GROUPS_MANAGEMENT"));
navmenu();
underneath add:
verif_acces("admincp.php?action=groups&do=view");
find:
if ($action=="groups" && $do=="delete"){
underneath add:
verif_acces("admincp.php?action=groups&do=view");
find:
if ($action=="groups" && $do=="add") {
stdhead(T_("GROUPS_MANAGEMENT"));
navmenu();
underneath add:
verif_acces("admincp.php?action=groups&do=view");
find:
if ($action=="groups" && $do=="addnew") {
stdhead(T_("GROUPS_MANAGEMENT"));
underneath add:
verif_acces("admincp.php?action=groups&do=view");
find:
if ($action == "style") {
underneath add:
verif_acces("admincp.php?action=style");
find:
if ($action=="news" && $do=="view"){
stdhead(T_("NEWS_MANAGEMENT"));
navmenu();
underneath add:
verif_acces("admincp.php?action=news&do=view");
find:
if ($action=="news" && $do=="takeadd"){
underneath add:
verif_acces("admincp.php?action=news&do=view");
find:
if ($action=="news" && $do=="add"){
stdhead(T_("NEWS_MANAGEMENT"));
navmenu();
underneath add:
verif_acces("admincp.php?action=news&do=view");
find:
if ($action=="news" && $do=="edit"){
stdhead(T_("NEWS_MANAGEMENT"));
navmenu();
underneath add:
verif_acces("admincp.php?action=news&do=view");
find:
if ($action=="news" && $do=="delete"){
underneath add:
verif_acces("admincp.php?action=news&do=view");
find:
if ($action=="blocks" && $do=="view") {
stdhead(T_("_BLC_MAN_"));
underneath add:
verif_acces("admincp.php?action=blocks&do=view");
find:
if ($action=="categories" && $do=="view"){
stdhead(T_("Categories Management"));
navmenu()
underneath add:
verif_acces("admincp.php?action=categories&do=view");
find:
if ($action=="categories" && $do=="edit"){
stdhead(T_("Categories Management"));
navmenu();
underneath add:
verif_acces("admincp.php?action=categories&do=view");
find:
if ($action=="categories" && $do=="delete"){
stdhead(T_("Categories Management"));
navmenu();
underneath add:
verif_acces("admincp.php?action=categories&do=view");
find:
if ($action=="categories" && $do=="takeadd")
underneath add:
verif_acces("admincp.php?action=categories&do=view");
find:
stdhead(T_("CATEGORY_MANAGEMENT"));
navmenu()
underneath add:
verif_acces("admincp.php?action=categories&do=view")
find:
if ($action == "whoswhere")
{
stdhead("Where are members");
navmenu()
underneath add:
verif_acces("admincp.php?action=whoswhere");
find:
if ($action=="peers"){
stdhead("Peers List");
navmenu()
underneath add:
verif_acces("admincp.php?action=peers");
find:
stdhead("Latest Comments");
navmenu();
underneath add:
verif_acces("admincp.php?action=lastcomm"
find:
if ($action=="messagespy"){
underneath add:
verif_acces("admincp.php?action=messagespy");
find:
if ($action == "torrentmanage") {
underneath add:
verif_acces("admincp.php?action=torrentmanage");
find:
if ($action == "sitelog") {
underneath add:
verif_acces("admincp.php?action=sitelog");
find:
if ($action == "cheats") {
stdhead("Possible Cheater Detection");
navmenu();
underneath add:
verif_acces("admincp.php?action=cheats");
find:
if ($action=="emailbans"){
stdhead(T_("EMAIL_BANS"));
navmenu();
underneath add:
verif_acces("admincp.php?action=emailbans")
find:
if ($action=="polls" && $do=="view"){
stdhead(T_("POLLS_MANAGEMENT"));
navmenu()
underneath add:
verif_acces("admincp.php?action=polls&do=view")
find:
if ($action=="polls" && $do=="results"){
stdhead("Polls");
navmenu()
underneath add:
verif_acces("admincp.php?action=polls&do=view")
find:
if ($action=="polls" && $do=="delete"){
$id = (int)$_GET["id"];
underneath add:
verif_acces("admincp.php?action=polls&do=view");
find:
if ($action=="polls" && $do=="add"){
stdhead("Polls");
navmenu();
underneath add:
verif_acces("admincp.php?action=polls&do=view")
find:
if ($action=="polls" && $do=="save"){
underneath add:
verif_acces("admincp.php?action=polls&do=view")
find:
if ($action=="backups"){
stdhead("Backups");
navmenu();
underneath add:
verif_acces("admincp.php?action=backups");
find:
if ($action=="forceclean"){
underneath add:
verif_acces("admincp.php?action=forceclean");
find:
if ($action=="torrentlangs" && $do=="view"){
stdhead(T_("TORRENT_LANGUAGES"));
navmenu();
underneath add:
verif_acces("admincp.php?action=torrentlangs&do=view");
find:
if ($action=="torrentlangs" && $do=="edit"){
stdhead(T_("TORRENT_LANG_MANAGEMENT"));
navmenu();
underneath add:
verif_acces("admincp.php?action=torrentlangs&do=view");
find:
if ($action=="torrentlangs" && $do=="delete"){
stdhead(T_("TORRENT_LANG_MANAGEMENT"));
navmenu();
underneath add:
verif_acces("admincp.php?action=torrentlangs&do=view")
find:
if ($action=="torrentlangs" && $do=="takeadd"){
underneath add:
verif_acces("admincp.php?action=torrentlangs&do=view");
find:
if ($action=="torrentlangs" && $do=="add"){
stdhead(T_("TORRENT_LANG_MANAGEMENT"));
navmenu();
underneath add:
verif_acces("admincp.php?action=torrentlangs&do=view");
find:
if ($action=="avatars"){
stdhead("Avatar Log");
navmenu();
underneath add:
verif_acces("admincp.php?action=avatars");
find:
stdhead("Free Leech ".T_("TORRENT_MANAGEMENT"));
navmenu();
underneath add:
verif_acces("admincp.php?action=freetorrents");
find:
if ($action=="bannedtorrents"){
stdhead("Banned Torrents");
navmenu();
underneath add:
verif_acces("admincp.php?action=bannedtorrents");
find:
if ($action=="masspm"){
stdhead("Mass Private Message");
navmenu();
underneath add:
verif_acces("admincp.php?action=masspm");
find:
if ($action=="rules" && $do=="edit"){
underneath add:
verif_acces("admincp.php?action=rules&do=view");
find:
if ($action=="rules" && $do=="addsect"){
underneath add:
verif_acces("admincp.php?action=rules&do=view");
find:
if ($action == "reports" && $do == "view") {
underneath add:
verif_acces("admincp.php?action=reports&do=view");
find:
if ($action == "confirmreg")
{
underneath add:
verif_acces("admincp.php?action=confirmreg");
find:
if ($action == "pendinginvite")
{
underneath add:
verif_acces("admincp.php?action=pendinginvite");
find:
if ($action == "privacylevel")
{
underneath add:
verif_acces("admincp.php?action=privacylevel");
find:
if($action == "censor") {
stdhead("Censor");
navmenu();
underneath add:
verif_acces("admincp.php?action=censor");
find:
if ($action == "ipbans") {
stdhead("Banned IPs");
navmenu();
underneath add:
verif_acces("admincp.php?action=ipbans");
find:
if ($action == "usersearch") {
underneath add:
verif_acces("admincp.php?action=usersearch");
before
?>
add:
#======================================================================#
# Staff cat
#======================================================================#
if ($action == "staffcategorie") {
verif_acces("admincp.php?action=staffcategorie");
$error_ac == "";
if ($_POST["do"] == "ajouter_cat") {
$nom_cat = $_POST["nom_cat"];
$tri = (int) $_POST["tri"];
if ($nom_cat == "") $error_ac .= "<li>".T_("NAME_EMPTY")."\n";
if ($tri == "") $error_ac .= "<li>".T_("ORDER_EMPTY")."\n";
if ($error_ac == "") {
$res = SQL_Query_exec("INSERT INTO staff_categorie (`nom`, `tri`) VALUES (".sqlesc($nom_cat).", '$tri')");
if ($res)
autolink("admincp.php?action=staffcategorie", T_("NEW_CAT_ADDED"));
else
echo "<h4>Error!</h4>";
}
else{
autolink("admincp.php?action=staffcategorie", " ".T_("ERROR") .": ".$error_ac." ...");
}
}
if ($_POST["do"] == "sauver_edition_cat") {
$id = (int) $_POST["id"];
$edition_tri = (int) $_POST["edition_tri"];
$edition_nom = $_POST["edition_nom"];
SQL_Query_exec("UPDATE staff_categorie SET tri = '$edition_tri', nom = ".sqlesc($edition_nom)." WHERE id='$id'");
autolink("admincp.php?action=staffcategorie", "<center><b>".T_("UPDATE_COMPLETED")."</b></center>");
}
if ($_POST["do"] == "supprimer_cat" && is_valid_id($_POST["id"])) {
SQL_Query_exec("DELETE FROM staff_categorie WHERE id = $_POST[id]");
autolink("admincp.php?action=staffcategorie",T_("CAT_DELETED"));
}
stdhead(T_("CATEGORY_STAFF"));
navmenu();
if ($_GET["do"] == "effacer_staff_cat") {
$id = (int) $_GET["id"];
begin_frame("Confir");
$t = SQL_Query_exec("SELECT * FROM staff_categorie WHERE id = '$id'");
$v = mysql_fetch_array($t);
if (!$v)
autolink("admincp.php?action=staffcategorie", "Invalid Staff Category.");
?>
<form action="admincp.php" method="post">
<input type="hidden" name="action" value="staffcategorie" />
<input type="hidden" name="do" value="supprimer_cat" />
<input type="hidden" name="id" value="<?php echo $id;?>" />
Really delete the category in Staff CP?<?php echo "<b>$v[nom] with order : ID$v[tri]?".T_("CHANGE_LINK_CATEGORY")."";?>
<input type="submit" name="suppcat" class="button" value="<?php echo T_("DELETE");?>" />
</form>
<?php
end_frame();
}
if ($_GET["do"] == "edition_staff_cat") {
$id = (int) $_GET["id"];
begin_frame(T_("CAT_EDIT"));
$q = SQL_Query_exec("SELECT * FROM staff_categorie WHERE id = '$id'");
$r = mysql_fetch_assoc($q);
if (!$r)
autolink("admincp.php?action==staffcategorie", "Invalid Staff Category.");
?>
<table align='center' width='80%' cellspacing='2' cellpadding='2' style='border: 3px solid black'>
<form action="admincp.php" method="post">
<input type="hidden" name="action" value="staffcategorie" />
<input type="hidden" name="do" value="sauver_edition_cat" />
<input type="hidden" name="id" value="<?php echo $id;?>" />
<tr>
<td><?php echo T_("CAT_NAME");?>:</td>
</tr>
<tr>
<td><input type="text" name="edition_nom" class="option" size="35" value="<?php echo $r[nom];?>" /></td></tr>
<tr>
<td><?php echo T_("ORDER");?>:</td></tr>
<tr>
<td><input type="text" name="edition_tri" class="option" size="35" value="<?php echo $r[tri];?>" /></td></tr>
<tr>
<td><input type="submit" class="button" value="<?php echo T_("SUBMIT");?>"></td></tr>
</form>
</table>
<?php
end_frame();
}
begin_frame("Category");
$q = SQL_Query_exec("SELECT * FROM staff_categorie order by tri");
echo " <table align='center' width='80%' cellspacing='2' cellpadding='2'>
<tr>
<th class='table_head'>ID</td>
<th class='table_head'>".T_("CAT_NAME")."</td>
<th class='table_head'>".T_("ORDER")."</td>
<th class='table_head'>".T_("MODO")."</td>
</tr>";
while ($row = mysql_fetch_array($q)) {
echo " <tr>
<td class='table_col1' width='10' align='center'>$row[id]</td>
<td class='table_col2' width='120' align='center'> $row[nom]</td>
<td class='table_col1' width='10'><font size='2'><b>$row[tri]</b></font></td>
<td class='table_col2' width='18' align='center'><a href='admincp.php?action=staffcategorie&do=edition_staff_cat&id=$row[id]'>[Edition]</a> <a href='admincp.php?action=staffcategorie&do=effacer_staff_cat&id=$row[id]'>[<img src='images/delete.png' alt='Supprimer' width='17' height='17' border='0'>]</a></td>
</tr>\n";
}
echo" </table>";
end_frame();
begin_frame(T_("ADD_NEW_CATEGORY"));
echo " <table align='center' width='80%' cellspacing='2' cellpadding='2' >
<form action='admincp.php' method='post'>
<input type='hidden' name='action' value='staffcategorie' />
<input type='hidden' name='do' value='ajouter_cat' />
<tr>
<td>".T_("CAT_NAME").":</td>
<td align='left'><input type='text' name='nom_cat' size='30' maxlength='30' /></td>
</tr>
<tr>
<td>".T_("ORDER").":</td>
<td align='left'><input type='text' name='tri' size='10' maxlength='10' value='$tri' /></td>
</tr>
<tr>
<td colspan='2' align='center'>
<input type='submit' value='".T_("SUBMIT")."' />
<input type='reset' value='".T_("RESET")."' />
</td>
</tr>
</form>
</table>
";
end_frame();
stdfoot();
}
#======================================================================#
# Staff liens
#======================================================================#
if ($action == "staff_liens") {
verif_acces("admincp.php?action=staff_liens");
if ($_POST["do"] == "ajouter_lien") {
$nom = $_POST["nom"];
$lien = $_POST["lien"];
$tri = $_POST["tri"];
$classe = $_POST["classe"];
$categorie = $_POST["categorie"];
$image = $_POST["image"];
if ($nom == "") $error_ac .= "<li>".T_("NAME_EMPTY")."\n";
if ($lien == "") $error_ac .= "<li>".T_("LINK_EMPTY")."\n";
if ($tri == "") $error_ac .= "<li>".T_("ORDER_EMPTY")."\n";
if ($classe == "") $error_ac .= "<li>".T_("CLASS_EMPTY")."\n";
if ($categorie == "") $error_ac .= "<li>".T_("CAT_EMPTY")."\n";
if ($image == "") $error_ac .= "<li>".T_("IMAGE_EMPTY")."\n";
if ($error_ac == "") {
$res = SQL_Query_exec("INSERT INTO staffnavigate (`lien`, `nom`, `tri`, `classe`,`categorie`,`image`) VALUES ('$lien',".sqlesc($nom).", '$tri', '$classe', '$categorie',".sqlesc($image).")");
if ($res)
autolink("admincp.php?action=staff_liens", T_("LINK_ADDED"));
else
echo "<h4>Error!</h4>";
}else{
autolink("admincp.php?action=staff_liens", " ".T_("ERROR") .": ".$error_ac." ...");
}
}
if ($_POST["do"] == "edition_sauver") {
$edition_lien = $_POST["edition_lien"];
$edition_nom = $_POST["edition_nom"];
$edition_tri = $_POST["edition_tri"];
$edition_classe = $_POST["edition_classe"];
$edition_cat = $_POST["edition_cat"];
$edition_image = $_POST["edition_image"];
$id = (int) $_POST["id"];
if($edition_lien !="" && $edition_nom !="" && $edition_tri !="" && $edition_classe !="" && $edition_cat !=""){
SQL_Query_exec("UPDATE staffnavigate SET lien = '$edition_lien', nom = ".sqlesc($edition_nom)." , tri= '$edition_tri', classe = '$edition_classe', categorie = '$edition_cat', image = ".sqlesc($edition_image)." WHERE id='$id'");
autolink("admincp.php?action=staff_liens", "<center><b>".T_("UPDATE_COMPLETED")."</b></center>");
}else{
autolink("admincp.php?action=staff_liens&do=edition&id=$id","Erreur<br/>".T_("MISSING_FORM_DATA")."");
}
}//if do edition sauver
if ($_POST["do"] == "supprimer_lien" && $_POST["supplien"] != "" && is_valid_id($_POST["id"])) {
$id = (int) $_POST["id"];
SQL_Query_exec("DELETE FROM staffnavigate WHERE id = $id");
autolink("admincp.php?action=staff_liens",T_("LINK_DELETED"));
}
stdhead(T_("LINK_STAFF"));
navmenu();
$groupe = SQL_Query_exec("SELECT group_id, level FROM groups WHERE group_id >= '5' ORDER BY group_id ASC");///5 is first class in staff (modo) by defalt
while ($groupsrow=mysql_fetch_row($groupe))
$groupes[$groupsrow[0]] = $groupsrow[1];
if ($_GET["do"] == "effacer") {
$id = (int) $_GET["id"];
begin_frame("Confirm");
$t = SQL_Query_exec("SELECT nom FROM staffnavigate WHERE id = '$id'");
$v = mysql_fetch_array($t);
?>
<form action="admincp.php" method="post">
<input type="hidden" name="action" value="staff_liens" />
<input type="hidden" name="do" value="supprimer_lien" />
<input type="hidden" name="id" value="<?php echo $id;?>" />
Really delete the link in Staff CP?<br/>
<?php echo "Name: $v[nom]";?>
<input type="submit" name="supplien" class="button" value="<?php echo T_("DELETE");?>" />
</form>
<?php
end_frame();
}
if ($_GET["do"] == "edition") {
$id = (int) $_GET["id"];
$cat = (int) $_GET["cat"];
begin_frame(T_("EDIT_LINKS"));
$staff_lien= SQL_Query_exec("SELECT * FROM staffnavigate WHERE id = $id");
$liens= mysql_fetch_assoc($staff_lien);
$staff_cat = SQL_Query_exec("SELECT id, nom FROM staff_categorie ORDER BY tri, nom");
while ($stafcat=mysql_fetch_row($staff_cat))
$categ[$stafcat[0]] = $stafcat[1];
?>
<table align='center' width='80%' cellspacing='2' cellpadding='2' style='border: 3px solid black'>
<form action="admincp.php" method="post">
<input type="hidden" name="action" value="staff_liens" />
<input type="hidden" name="do" value="edition_sauver" />
<input type="hidden" name="id" value="<?php echo $id;?>" />
<tr>
<td align='right'><?php echo T_("TITLE");?>:</td>
<td align='left'><input type="text" name="edition_nom" class="option" size="35" value="<?php echo $liens[nom];?>" /></td>
</tr>
<tr>
<td align='right'><?php echo T_("LINK");?>:</td>
<td align='left'><input type="text" name="edition_lien" class="option" size="50" value="<?php echo $liens[lien];?>" /></td>
</tr>
<tr>
<td align='right'><?php echo T_("MAIN_CATEGORY");?>:</td>
<td align='left'><select name='edition_cat'>";
<?php
foreach ($categ as $id => $nom) {
$a = $cat == $id ? " selected" : "";
echo "<option value='$id' $a>$nom</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td align='right'><?php echo T_("ORDER");?>:</td>
<td align='left'><input type="text" name="edition_tri" class="option" size="5" value="<?php echo $liens[tri];?>" /></td>
</tr>
<tr>
<td align='right'><?php echo T_("MIN_CLASS_ACCESS");?>:</td>
<td align='left'><select name='edition_classe'>";
<?php
foreach ($groupes as $id => $level) {
$s = $liens[classe] == $id ? " selected" : "";
echo "<option value='$id' $s>$level</option>";
}
?>
</select>
</td>
<tr>
<td align='right'>Image:</td>
<td align='left'><input type="text" name="edition_image" class="option" size="50" value="<?php echo $liens[image];?>" /></td>
</tr>
</tr>
<tr>
<td colspan=2 align='center'><input type="submit" class="button" value="Submit"></td></tr>
</form>
</table>
<?php
end_frame();
}
begin_frame("Links Staff CP");
?>
<table align="center" cellpadding="3" cellspacing="3" width="100%" >
<tr>
<th class="table_head" align="center" width="10">ID</th>
<th class="table_head" align="center"><?php echo T_("TITLE");?></th>
<th class="table_head" align="center"><?php echo T_("LINK");?></th>
<th class="table_head" align="center"><?php echo T_("MAIN_CATEGORY");?></th>
<th class="table_head" align="center" width="10"><?php echo T_("ORDER");?></th>
<th class="table_head" align="center"><?php echo T_("MIN_CLASS_ACCESS");?></th>
<th class="table_head" align="center"><?php echo T_("MODO");?></th>
</tr>
<?php
$res=SQL_Query_exec("SELECT * FROM staffnavigate ORDER BY categorie,tri");
while($row=mysql_fetch_array($res)){
$id=$row["id"];
$lien=$row["lien"];
$nom=$row["nom"];
$tri=$row["tri"];
$classe=$row["classe"];
$cat=$row["categorie"];
$classe_min =get_user_class_name($classe);
$image=$row["image"];
echo " <tr>
<td class='table_col1'>$id</td>
<td class='table_col2'><img src='images/admin/$image' border='0' width='32' height='32' alt='' />".T_("$nom")."</td>
<td class='table_col1'>$lien</td>
<td class='table_col2'>$cat</td>
<td class='table_col1'>$tri</td>
<td class='table_col2'>$classe_min</td>
<td class='table_col1'><a href='admincp.php?action=staff_liens&do=edition&id=$id&cat=$cat'><img src='images/edit.png' alt='Edit' width='17' height='17' border='0'></a> <a href='admincp.php?action=staff_liens&do=effacer&id=$id'><img src='images/delete.png' alt='Del' width='17' height='17' border='0'></a>
</tr>\n";
}
echo "</table>\n";
end_frame();
begin_frame(T_("ADD_LINK"));
echo " <table align='center' width='80%' cellspacing='2' cellpadding='2' >
<form action='admincp.php' method='post'>
<input type='hidden' name='action' value='staff_liens' />
<input type='hidden' name='do' value='ajouter_lien' />
<tr>
<td>".T_("TITLE").":</td>
<td align='left'><input type='text' name='nom' size='30' /></td>
</tr>
<tr>
<td>". T_("LINK").":</td>
<td align='left'><input type='text' name='lien' size='50' maxlength='50' /></td>
</tr>
<tr>
<td>".T_("MAIN_CATEGORY").":</td>
<td align='left'>
<select name='categorie' />";
$query = SQL_Query_exec("SELECT * FROM staff_categorie ORDER BY tri, nom");
while ($row=mysql_fetch_array($query))
echo " <option value={$row['id']}>{$row['nom']}</option>";
echo" </select>
</td>
</tr>
<tr>
<td>".T_("ORDER").":</td>
<td align='left'><input type='text' name='tri' size='3' maxlength='3' /></td>
</tr>
<tr>
<td>".T_("MIN_CLASS_ACCESS")." :</td>
<td align='left'>
<select name='classe'>";
foreach ($groupes as $id => $level) {
$s = $r["classe"] == $id ? " selected" : "";
echo "<option value='$id' $s>$level</option>";
}
echo" </select>
</td>
</tr>
<tr>
<td>Image:</td>
<td align='left'><input type='text' name='image' size='50' maxlength='50' /></td>
</tr>
<tr>
<td colspan='2' align='center'>
<input type='submit' value='".T_("Submit")."' />
<input type='reset' value='".T_("Reset")."' />
</td>
</tr>
</form>
</table>
";
end_frame();
stdfoot();
}
#======================================================================#
# FIN Staff liens
#======================================================================#some screens:
Satff cp for admin
staf fcp for smodo:
staff cp for moderators:




Do not forget to give access to the control panel for staff
