$max_classeby :$CURUSER[class]
and Quote:and after add:
CODE
)
} 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
#======================================================================#
staf fcp for smodo:
staff cp for moderators:




Quote:try this:QUOTE (thedarklord @ Aug 19 2011, 02:39 PM) ill check it but im sure it used to write into the mod comment box in account details unless im thinking of the donate upload credits mod
no mods installed v2.07 the code i posted see screen
Hi The Darklord,
Many thanks for replying but we were thinking about adding these features to this MOD to finish it:
1) Send a PM to the member that received the GIGS and by WHO from the staff? Eventlually the PM should include the STAFF MEMBER NAME who add the gigs and the amount!
2) Site Log add up?
3) Lastly, a drop down or a search option? It happened to often to type wrongly the MEMBER NAME.
And yes, to answer your question, this MOD adds the informatoin in the comment box... and that's all it does.
Thanx. Regards.
mysql_query("UPDATE users SET modcomment = '$modcomment', uploaded=uploaded + $nobits WHERE username=$username") or sqlerr(__FILE__, __LINE__);
underneath add:
write_log("$CURUSER[username] has given ".mksize($nobits)." to ".$username."");
find:
if (!$arr)
show_error_msg("Error", "Unable to update account.");
replace by :
if (!$arr) {
show_error_msg("Error", "Unable to update account.");
}else{
$msg ="$CURUSER[username] has given ".mksize($nobits)." to you";
mysql_query("INSERT INTO messages (sender, receiver, added, subject, msg) VALUES ('0', $arr[0], '" . get_date_time() . "','Add gigs', " . sqlesc($msg) .")");
}
find:
<tr><td class="rowhead"><b>User name</b></td><td class="row1"><input type="text" name="username" size="40"/></td></tr>
replace by :
<?php
$res = mysql_query("SELECT username FROM users ORDER BY username");
$pseudo = "<select name=\"username\">\n";
while ($arr = mysql_fetch_assoc($res))
$pseudo .= "<option value=\"$arr[username]\">$arr[username]</option>\n";
$pseudo .= "</select>\n";
?>
<tr>
<td class="rowhead"><b>User name</b></td>
<td class="row1"><?php echo $pseudo;?></td>
</tr> Quote:[url="http://www.torrenttrader.org/index.php?showtopic=13344"]http://www.torrenttrader.org/index.php?showtopic=13344[/url]
Quote:of course it's for the mod with pagination.js above.merci beaucoup thib,mais je trouve pas ces ligne dans account.php
~~~~~~~~~~~~~~~~~
thib thank you very much, but I do not find these online account.php
$torrent = mysql_query("SELECT * FROM completed WHERE userid = ".$id." ORDER BY torrentid ASC ");replace by :$torrent = mysql_query("SELECT completed.torrentid,completed.date,torrents.visible, torrents.banned FROM completed LEFT JOIN torrents on completed.torrentid=torrents.id WHERE completed.userid = ".$id." AND torrents.visible = 'yes' and torrents.banned = 'no' ORDER BY completed.torrentid ASC ");
find :
$torrent2 = mysql_query("SELECT * FROM torrents WHERE id = ".$tor["torrentid"]." and (torrents.seeders > 0 OR torrents.leechers > 0) ");
replace by :
$torrent2 = mysql_query("SELECT * FROM torrents WHERE id = ".$tor["torrentid"]." ");
after i thing you have some mistakes in your code to see ratio downloaded and uploaded
try this:
find and remove:
//Ratio sur chaque torrent
if($tor["downloaded"] == 0) {
$ratio = "Inf.";
}elseif($tor["uploaded"] == 0) {
$ratio = "<font color=red>0.00</font>";
}else{
$ratio = number_format($tor["uploaded"] / $tor["downloaded"], 2);
$ratio = "<font color=" . get_ratio_color($ratio) . ">$ratio</font>";
//$ratio = "$ratio";
}
//Fin ratio
find:
if (mysql_num_rows($res) > 0){
$arr = mysql_fetch_array($res);
replace by :
$arr = mysql_fetch_array($res);
if (mysql_num_rows($res) > 0){
find :
$fin=$tor["date"];
$down=mksize($tor["downloaded"]);
$up=mksize($tor["uploaded"]);
replace by :
//Ratio sur chaque torrent
if($arr["downloaded"] == 0) {
$ratio = "Inf.";
}elseif($arr["uploaded"] == 0) {
$ratio = "<font color=red>0.00</font>";
}else{
$ratio = number_format($arr["uploaded"] / $arr["downloaded"], 2);
$ratio = "<font color=" . get_ratio_color($ratio) . ">$ratio</font>";
//$ratio = "$ratio";
}
//Fin ratio
$fin=$tor["date"];
$down=mksize($arr["downloaded"]);
$up=mksize($arr["uploaded"]);Quote:STp vous pourriez me dire quoi faire pour qui reste pas de torrent mort!?~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
STp you could tell me what to do for whom death is not torrent!?
where completed.userid='" . $CURUSER["id"] ."'
replace by
where completed.userid='" . $CURUSER["id"] ."' and (torrents.seeders > 0 OR torrents.leechers > 0)
in account-details.php find:
where completed.userid='$id'
replace by
where completed.userid='$id' and (torrents.seeders > 0 OR torrents.leechers > 0) Quote:I think the problem is because the 2000 file sharing.have tested me and my m8's your code on version 2.06. This is exacctly what I want. Unfortunately, under IE 8.0, the page completely freezes up and under firefox, I have attached an image of the problem. But you are close to the solution.
var page_courante=1;var nb_pages=1;$fn = "$torrent_dir/$id.torrent";
add after:
$com = mysql_query("SELECT id FROM comments WHERE torrent =".intval($id)." and user ='" . $CURUSER["id"] ."'");
$verif_com = mysql_num_rows($com);
find :
$name = $row['filename'];
add before:
if ($verif_com < 1 && $CURUSER["id"] != $row["owner"] && $row["owner"] != 0)
show_error_msg("Error", "You must add a comment before download.",1); var page_courante=1;var nb_pages=1;
/////////////// MY TORRENTS ///////////////////
if ($action=="mytorrents"){
begin_frame("".ACCOUNT_YOUR_TORRENTS."", center);
navmenu();
//page numbers
$page = $_GET['page'];
$perpage = 200;
$res = mysql_query("SELECT COUNT(*) FROM torrents WHERE torrents.owner = " . $CURUSER["id"] ."") or die(mysql_error());
$arr = mysql_fetch_row($res);
$pages = floor($arr[0] / $perpage);
if ($pages * $perpage < $arr[0])
++$pages;
if ($page < 1)
$page = 1;
else
if ($page > $pages)
$page = $pages;
for ($i = 1; $i <= $pages; ++$i)
if ($i == $page)
$pagemenu .= "$i\n";
else
$pagemenu .= "<a href=account.php?action=mytorrents&page=$i>$i</a>\n";
if ($page == 1)
$browsemenu .= "";
else
$browsemenu .= "<a href=account.php?action=mytorrents&page=" . ($page - 1) . ">[Prev]</a>";
$browsemenu .= " ";
if ($page == $pages)
$browsemenu .= "";
else
$browsemenu .= "<a href=account.php?action=mytorrents&page=" . ($page + 1) . ">[Next]</a>";
$offset = ($page * $perpage) - $perpage;
//end page numbers
$where = "WHERE torrents.owner = " . $CURUSER["id"] ."";
$orderby = "ORDER BY added DESC";
$query = mysql_query("SELECT torrents.id, torrents.category, torrents.name, torrents.added, torrents.hits, torrents.banned, torrents.comments, torrents.seeders, torrents.leechers, torrents.times_completed, categories.name AS cat_name, categories.parent_cat AS cat_parent FROM torrents LEFT JOIN categories ON category = categories.id $where $orderby LIMIT $offset,$perpage")or die(mysql_error());
$allcats = mysql_num_rows($query);
if($allcats == 0) {
echo "<h4>".NO_UPLOADS."</h4>\n";
}else{
print("<p align=center>$pagemenu<br />$browsemenu</p>");
?><table align=center cellpadding="0" cellspacing="0" class="ttable_headouter" width=100%>
<td>
<table align=center cellpadding="0" cellspacing="0" class="ttable_headinner" width="100%">
<tr>
<td class=ttable_head><? echo "" . TYPE . "";?></td>
<td class=ttable_head><? echo "" . NAME . "";?></td>
<td class=ttable_head><? echo "" .COMMENTS . "";?></td>
<td class=ttable_head><? echo "" .HITS. "";?></td>
<td class=ttable_head><? echo "".SEEDS."";?></td>
<td class=ttable_head><? echo "" .LEECH. "";?></td>
<td class=ttable_head><? echo "" .COMPLETED. "";?></td>
<td class=ttable_head><? echo "" .ADDED. "";?></font></td>
<td class=ttable_head><? echo "" . EDIT . "";?></td>
</tr>
<?
while($row = MYSQL_FETCH_ARRAY($query))
{
$char1 = 35; //cut length
$smallname = CutName(htmlspecialchars($row["name"]), $char1);
echo "<tr><td class=ttable_col2 align=center>$row[cat_parent]: $row[cat_name]</td><td class=ttable_col1 align=left><a href='torrents-details.php?id=$row[id]'>$smallname</A></td><td class=ttable_col2 align=center><a href=comments.php?type=torrent&id=$row[id]>$row[comments]</a></td><td class=ttable_col1 align=center>$row[hits]</td><td class=ttable_col2 align=center>$row[seeders]</td><td class=ttable_col1 align=center>$row[leechers]</td><td class=ttable_col2 align=center>$row[times_completed]</td><td class=ttable_col1 align=center>".get_elapsed_time(sql_timestamp_to_unix_timestamp($row["added"]))."</td><td class=ttable_col2><a href='torrents-edit.php?id=$row[id]'>EDIT</td></tr>\n";
}
echo "</td></table></td></tr></table><BR>";
print("<p align=center>$pagemenu<br />$browsemenu</p>");
}
end_frame();
}replace by ://///////////// MY TORRENTS ///////////////////
if ($action=="mytorrents"){
begin_frame("".My_Torrents."", center);
navmenu();
begin_block("".Torrents_Uploaded."");
$page = $_GET['page'];
$perpage = 25;
$where = "AND anon='no'";
$res = mysql_query("SELECT COUNT(*) FROM torrents WHERE owner = " . $CURUSER["id"] ." $where") or die(mysql_error());
$row = mysql_fetch_array($res);
$count = $row[0];
unset($where);
$orderby = "ORDER BY id DESC";
//get sql info
if ($count) {
list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, "mon_activiter.php?id=$id&" . $addparam);
$query = "SELECT torrents.id, torrents.category, torrents.leechers, torrents.nfo, torrents.seeders, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.comments, torrents.numfiles, torrents.filename, torrents.owner, torrents.external, torrents.freeleech, categories.name AS cat_name, categories.parent_cat AS cat_parent, categories.image AS cat_pic, users.username, users.privacy, torrents.anon, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating, torrents.announce FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id WHERE owner = " . $CURUSER["id"] ." $orderby $limit";
$res = mysql_query($query) or die(mysql_error());
}else{
unset($res);
}
if ($count) {
print($pagerbottom);
torrenttable($res,torrents,$addparam);
print($pagerbottom);
}else {
print("<B>".I_have_not_uploaded_any_torrents."<BR><BR>");
}
end_block();
function peerstable($res){
$ret = "<table align=center cellpadding=\"3\" cellspacing=\"0\" class=\"table_table\" width=\"95%\" border=\"1\">
<tr>
<td class=table_head>" .CATEGORY . "</td>
<td class=table_head>" . NAME . "</td>
<td class=table_head>" . UPLOADER . "</td>
<td class=table_head align=center>" . SIZE . "</td>
<td class=table_head align=center>S</td>
<td class=table_head align=center>L</td>
<td class=table_head align=center>C</td>
<td class=table_head align=center>" . UPLOADED . "</td>\n
<td class=table_head align=center>" . DOWNLOADED . "</td>
<td class=table_head align=center>" . RATIO . "</td>
</tr>\n";
while ($arr = mysql_fetch_assoc($res)){
$res2 = mysql_query("SELECT name, size, category, seeders, leechers, times_completed,owner FROM torrents WHERE id=$arr[torrent] ORDER BY name");
$arr2 = mysql_fetch_assoc($res2);
if ($arr["downloaded"] > 0){
$ratio = number_format($arr["uploaded"] / $arr["downloaded"], 2);
}else{
$ratio = "---";
}
$image = mysql_query("SELECT name,image FROM categories WHERE id = ".$arr2["category"]." ");
$image_cat = mysql_fetch_assoc($image);
$image_categorie = "<img src=\"images/categories/$image_cat[image]\" alt=\"$image_cat[name]\">";
$uploader = mysql_query("SELECT username FROM users WHERE id = ".$arr2["owner"]." ");
$name_uploader = mysql_fetch_assoc($uploader);
$uploadeur = "<a href='account-details.php?id=$arr2[owner]'target=_blank>$name_uploader[username]</a>";
$ret .= "<tr>
<td align=center class=table_col1>$image_categorie</td>
<td class=table_col2><a href=torrents-details.php?id=$arr[torrent]&hit=1><b>" . htmlspecialchars($arr2[name]) . "</b></a></td>
<td align=center class=table_col2>" . mksize($arr2["size"]) . "</td>
<td align=center class=table_col1>$uploadeur</td>
<td align=center class=table_col2><font color=green>" . $arr2["seeders"] . "</font></td>
<td align=center class=table_col2><font color=red>" . $arr2["leechers"] . "</font></td>
<td align=center class=table_col2><font color=orange>" . $arr2["times_completed"] . "</font></td>
<td align=center class=table_col1>" . mksize($arr["uploaded"]) . "</td>
<td align=center class=table_col2>" . mksize($arr["downloaded"]) . "</td>
<td align=center class=table_col1>$ratio</td>
</tr>\n";
}
$ret .= "</table>\n";
return $ret;
}
$res = mysql_query("SELECT torrent,uploaded,downloaded FROM peers WHERE userid= " . $CURUSER["id"] ." AND seeder='yes'");
if (mysql_num_rows($res) > 0)
$seeding = peerstable($res);
$res = mysql_query("SELECT torrent,uploaded,downloaded FROM peers WHERE userid= " . $CURUSER["id"] ." AND seeder='no'");
if (mysql_num_rows($res) > 0)
$leeching = peerstable($res);
begin_block("".CURRENTLY_LEECHING."");
if ($leeching)
print("<B>" . CURRENTLY_LEECHING . ":</B><BR>$leeching<BR><BR>");
if (!$leeching)
print("<B>You download anything <BR><BR>");
end_block();
begin_block("".CURRENTLY_SEEDING."");
if ($seeding)
print("<B>" . CURRENTLY_SEEDING . ":</B><BR>$seeding<BR><BR>");
if (!$seeding)
print("<B>You seed nothing<BR><BR>");
end_block();
begin_block("Torrents Completed");
$query=mysql_query("select completed.date, completed.torrentid, torrents.id, torrents.name, torrents.comments, torrents.seeders, torrents.leechers, torrents.category, torrents.times_completed, categories.name AS cat_name, categories.image AS cat_img, categories.parent_cat AS cat_parent from completed LEFT JOIN torrents on completed.torrentid=torrents.id LEFT JOIN categories ON torrents.category = categories.id where completed.userid='" . $CURUSER["id"] ."' order by completed.date desc")or die(mysql_error());
$numcomp=mysql_num_rows($query);
if ($numcomp==0) {
echo("<center><b>Aucun telechargement completer</b></center>");
} else {?>
<table align=center cellpadding="0" cellspacing="0" class="ttable_headouter" width=100%>
<td>
<table align=center cellpadding="0" cellspacing="0" class="ttable_headinner" width="100%">
<tr>
<td class=ttable_head width='60'><? echo "" . TYPE . "";?></td>
<td class=ttable_head><? echo "" . NAME . "";?></td>
<td class=ttable_head>Comm</td>
<td class=ttable_head>Seed</td>
<td class=ttable_head>Leech</td>
<td class=ttable_head>Comp</td>
<td class="ttable_head">Date</td>
</tr>
<? while ($row=mysql_fetch_array($query)) {
$char1 = 35; //cut length
$smallname = CutName(htmlspecialchars($row["name"]), $char1);
if ($row["cat_img"]!="") {
echo "<tr><td class=ttable_col2 align=center><img src=images/categories/$row[cat_img] border=0></td><td class=ttable_col1 align=left><a href='torrents-details.php?id=$row[id]'>$smallname</A></td><td class=ttable_col2 align=center><a href=comments.php?type=torrent&id=$row[id]>$row[comments]</a></td><td class=ttable_col1 align=center>$row[seeders]</td><td class=ttable_col2 align=center>$row[leechers]</td><td class=ttable_col1 align=center>$row[times_completed]</td><td class=ttable_col2 align=center>$row[date]</td></tr>\n";
}
}
echo "</td></table></td></tr></table><BR>";
}
end_block();
end_frame();
}
Quote:sure because the code was for account-detailsHi Thib,
Sorry , this CODE didn't work. I don't have any error message but I still get the info the same way as the original. Thought, I am wondering if I have SNATCHED LIST MOD to be installed? I have attached snapshot.
Thanx. Regards.
Attached thumbnail(s)
/////////////// MY TORRENTS ///////////////////
if ($action=="mytorrents"){
begin_frame("".ACCOUNT_YOUR_TORRENTS."", center);
navmenu();
//page numbers
$page = $_GET['page'];
$perpage = 200;
$res = mysql_query("SELECT COUNT(*) FROM torrents WHERE torrents.owner = " . $CURUSER["id"] ."") or die(mysql_error());
$arr = mysql_fetch_row($res);
$pages = floor($arr[0] / $perpage);
if ($pages * $perpage < $arr[0])
++$pages;
if ($page < 1)
$page = 1;
else
if ($page > $pages)
$page = $pages;
for ($i = 1; $i <= $pages; ++$i)
if ($i == $page)
$pagemenu .= "$i\n";
else
$pagemenu .= "<a href=account.php?action=mytorrents&page=$i>$i</a>\n";
if ($page == 1)
$browsemenu .= "";
else
$browsemenu .= "<a href=account.php?action=mytorrents&page=" . ($page - 1) . ">[Prev]</a>";
$browsemenu .= " ";
if ($page == $pages)
$browsemenu .= "";
else
$browsemenu .= "<a href=account.php?action=mytorrents&page=" . ($page + 1) . ">[Next]</a>";
$offset = ($page * $perpage) - $perpage;
//end page numbers
$where = "WHERE torrents.owner = " . $CURUSER["id"] ."";
$orderby = "ORDER BY added DESC";
$query = mysql_query("SELECT torrents.id, torrents.category, torrents.name, torrents.added, torrents.hits, torrents.banned, torrents.comments, torrents.seeders, torrents.leechers, torrents.times_completed, categories.name AS cat_name, categories.parent_cat AS cat_parent FROM torrents LEFT JOIN categories ON category = categories.id $where $orderby LIMIT $offset,$perpage")or die(mysql_error());
$allcats = mysql_num_rows($query);
if($allcats == 0) {
echo "<h4>".NO_UPLOADS."</h4>\n";
}else{
print("<p align=center>$pagemenu<br />$browsemenu</p>");
?><table align=center cellpadding="0" cellspacing="0" class="ttable_headouter" width=100%>
<td>
<table align=center cellpadding="0" cellspacing="0" class="ttable_headinner" width="100%">
<tr>
<td class=ttable_head><? echo "" . TYPE . "";?></td>
<td class=ttable_head><? echo "" . NAME . "";?></td>
<td class=ttable_head><? echo "" .COMMENTS . "";?></td>
<td class=ttable_head><? echo "" .HITS. "";?></td>
<td class=ttable_head><? echo "".SEEDS."";?></td>
<td class=ttable_head><? echo "" .LEECH. "";?></td>
<td class=ttable_head><? echo "" .COMPLETED. "";?></td>
<td class=ttable_head><? echo "" .ADDED. "";?></font></td>
<td class=ttable_head><? echo "" . EDIT . "";?></td>
</tr>
<?
while($row = MYSQL_FETCH_ARRAY($query))
{
$char1 = 35; //cut length
$smallname = CutName(htmlspecialchars($row["name"]), $char1);
echo "<tr><td class=ttable_col2 align=center>$row[cat_parent]: $row[cat_name]</td><td class=ttable_col1 align=left><a href='torrents-details.php?id=$row[id]'>$smallname</A></td><td class=ttable_col2 align=center><a href=comments.php?type=torrent&id=$row[id]>$row[comments]</a></td><td class=ttable_col1 align=center>$row[hits]</td><td class=ttable_col2 align=center>$row[seeders]</td><td class=ttable_col1 align=center>$row[leechers]</td><td class=ttable_col2 align=center>$row[times_completed]</td><td class=ttable_col1 align=center>".get_elapsed_time(sql_timestamp_to_unix_timestamp($row["added"]))."</td><td class=ttable_col2><a href='torrents-edit.php?id=$row[id]'>EDIT</td></tr>\n";
}
echo "</td></table></td></tr></table><BR>";
print("<p align=center>$pagemenu<br />$browsemenu</p>");
}
end_frame();
}
replace by :
/////////////// MY TORRENTS ///////////////////
if ($action=="mytorrents"){
begin_frame("".ACCOUNT_YOUR_TORRENTS."", center);
navmenu();
begin_block("".ACCOUNT_YOUR_TORRENTS."");
//page numbers;
$page = $_GET['page'];
$perpage = 200;
$res = mysql_query("SELECT COUNT(*) FROM torrents WHERE torrents.owner = " . $CURUSER["id"] ."") or die(mysql_error());
$arr = mysql_fetch_row($res);
$pages = floor($arr[0] / $perpage);
if ($pages * $perpage < $arr[0])
++$pages;
if ($page < 1)
$page = 1;
else
if ($page > $pages)
$page = $pages;
for ($i = 1; $i <= $pages; ++$i)
if ($i == $page)
$pagemenu .= "$i\n";
else
$pagemenu .= "<a href=account.php?action=mytorrents&page=$i>$i</a>\n";
if ($page == 1)
$browsemenu .= "";
else
$browsemenu .= "<a href=account.php?action=mytorrents&page=" . ($page - 1) . ">[Prev]</a>";
$browsemenu .= " ";
if ($page == $pages)
$browsemenu .= "";
else
$browsemenu .= "<a href=account.php?action=mytorrents&page=" . ($page + 1) . ">[Next]</a>";
$offset = ($page * $perpage) - $perpage;
//end page numbers
$where = "WHERE torrents.owner = " . $CURUSER["id"] ."";
$orderby = "ORDER BY added DESC";
$query = mysql_query("SELECT torrents.id, torrents.category, torrents.name, torrents.added, torrents.hits, torrents.banned, torrents.comments, torrents.seeders, torrents.leechers, torrents.times_completed, categories.name AS cat_name, categories.parent_cat AS cat_parent FROM torrents LEFT JOIN categories ON category = categories.id $where $orderby LIMIT $offset,$perpage")or die(mysql_error());
$allcats = mysql_num_rows($query);
if($allcats == 0) {
echo "<h4>".NO_UPLOADS."</h4>\n";
}else{
print("<p align=center>$pagemenu<br />$browsemenu</p>");
?><table align=center cellpadding="0" cellspacing="0" class="ttable_headouter" width=100%>
<td>
<table align=center cellpadding="0" cellspacing="0" class="ttable_headinner" width="100%">
<tr>
<td class=ttable_head><? echo "" . TYPE . "";?></td>
<td class=ttable_head><? echo "" . NAME . "";?></td>
<td class=ttable_head><? echo "" .COMMENTS . "";?></td>
<td class=ttable_head><? echo "" .HITS. "";?></td>
<td class=ttable_head><? echo "".SEEDS."";?></td>
<td class=ttable_head><? echo "" .LEECH. "";?></td>
<td class=ttable_head><? echo "" .COMPLETED. "";?></td>
<td class=ttable_head><? echo "" .ADDED. "";?></font></td>
<td class=ttable_head><? echo "" . EDIT . "";?></td>
</tr>
<?
while($row = MYSQL_FETCH_ARRAY($query))
{
$char1 = 35; //cut length
$smallname = CutName(htmlspecialchars($row["name"]), $char1);
echo "<tr><td class=ttable_col2 align=center>$row[cat_parent]: $row[cat_name]</td><td class=ttable_col1 align=left><a href='torrents-details.php?id=$row[id]'>$smallname</A></td><td class=ttable_col2 align=center><a href=comments.php?type=torrent&id=$row[id]>$row[comments]</a></td><td class=ttable_col1 align=center>$row[hits]</td><td class=ttable_col2 align=center>$row[seeders]</td><td class=ttable_col1 align=center>$row[leechers]</td><td class=ttable_col2 align=center>$row[times_completed]</td><td class=ttable_col1 align=center>".get_elapsed_time(sql_timestamp_to_unix_timestamp($row["added"]))."</td><td class=ttable_col2><a href='torrents-edit.php?id=$row[id]'>EDIT</td></tr>\n";
}
echo "</td></table></td></tr></table><BR>";
print("<p align=center>$pagemenu<br />$browsemenu</p>");
}
end_block();
function peerstable($res){
$ret = "<table align=center cellpadding=\"3\" cellspacing=\"0\" class=\"table_table\" width=\"95%\" border=\"1\"><tr><td class=table_head>" . NAME . "</td><td class=table_head align=center>" . SIZE . "</td><td class=table_head align=center>" . UPLOADED . "</td>\n<td class=table_head align=center>" . DOWNLOADED . "</td><td class=table_head align=center>" . RATIO . "</td></tr>\n";
while ($arr = mysql_fetch_assoc($res)){
$res2 = mysql_query("SELECT name,size FROM torrents WHERE id=$arr[torrent] ORDER BY name");
$arr2 = mysql_fetch_assoc($res2);
if ($arr["downloaded"] > 0){
$ratio = number_format($arr["uploaded"] / $arr["downloaded"], 2);
}else{
$ratio = "---";
}
$ret .= "<tr><td class=table_col1><a href=torrents-details.php?id=$arr[torrent]&hit=1><b>" . htmlspecialchars($arr2[name]) . "</b></a></td><td align=center class=table_col2>" . mksize($arr2["size"]) . "</td><td align=center class=table_col1>" . mksize($arr["uploaded"]) . "</td><td align=center class=table_col2>" . mksize($arr["downloaded"]) . "</td><td align=center class=table_col1>$ratio</td></tr>\n";
}
$ret .= "</table>\n";
return $ret;
}
$res = mysql_query("SELECT torrent,uploaded,downloaded FROM peers WHERE userid= " . $CURUSER["id"] ." AND seeder='yes'");
if (mysql_num_rows($res) > 0)
$seeding = peerstable($res);
$res = mysql_query("SELECT torrent,uploaded,downloaded FROM peers WHERE userid= " . $CURUSER["id"] ." AND seeder='no'");
if (mysql_num_rows($res) > 0)
$leeching = peerstable($res);
begin_block("CURRENTLY LEECHING");
if ($leeching)
print("<B>" . CURRENTLY_LEECHING . ":</B><BR>$leeching<BR><BR>");
if (!$leeching)
print("<B>You download anything <BR><BR>");
end_block();
begin_block("CURRENTLY SEEDING");
if ($seeding)
print("<B>" . CURRENTLY_SEEDING . ":</B><BR>$seeding<BR><BR>");
if (!$seeding)
print("<B>You seed nothing<BR><BR>");
end_block();
end_frame();
} Quote:Hi Guys,
I was wondering if it's possible to adapt the the MOD from THIB ( wich is BTW excellent ) to show the same way under the account.php?action=mytorrents. The problem is that under MY TORRENT, it shows the UPLOAD and DOWNLOAD in burden way. Would it be possible to distinguised the UPLOAD, DOWNLOAD and the CURRENTLY SEEDING? In other words, the same way we see it in the TORRENT-DETAILS with adding the CURRENTLY SEEDING!
Thanx. Regards.
function peerstable($res){
$ret = "<table align=center cellpadding=\"3\" cellspacing=\"0\" class=\"table_table\" width=\"95%\" border=\"1\"><tr><td class=table_head>" . NAME . "</td><td class=table_head align=center>" . SIZE . "</td><td class=table_head align=center>" . UPLOADED . "</td>\n<td class=table_head align=center>" . DOWNLOADED . "</td><td class=table_head align=center>" . RATIO . "</td></tr>\n";
while ($arr = mysql_fetch_assoc($res)){
$res2 = mysql_query("SELECT name,size FROM torrents WHERE id=$arr[torrent] ORDER BY name");
$arr2 = mysql_fetch_assoc($res2);
if ($arr["downloaded"] > 0){
$ratio = number_format($arr["uploaded"] / $arr["downloaded"], 2);
}else{
$ratio = "---";
}
$ret .= "<tr><td class=table_col1><a href=torrents-details.php?id=$arr[torrent]&hit=1><b>" . htmlspecialchars($arr2[name]) . "</b></a></td><td align=center class=table_col2>" . mksize($arr2["size"]) . "</td><td align=center class=table_col1>" . mksize($arr["uploaded"]) . "</td><td align=center class=table_col2>" . mksize($arr["downloaded"]) . "</td><td align=center class=table_col1>$ratio</td></tr>\n";
}
$ret .= "</table>\n";
return $ret;
}
and replace by this:
function peerstable($res){
$ret = "<table align=center cellpadding=\"3\" cellspacing=\"0\" class=\"table_table\" width=\"95%\" border=\"1\">
<tr>
<td class=table_head>" .CATEGORY . "</td>
<td class=table_head>" . NAME . "</td>
<td class=table_head>" . UPLOADER . "</td>
<td class=table_head align=center>" . SIZE . "</td>
<td class=table_head align=center>S</td>
<td class=table_head align=center>L</td>
<td class=table_head align=center>C</td>
<td class=table_head align=center>" . UPLOADED . "</td>\n
<td class=table_head align=center>" . DOWNLOADED . "</td>
<td class=table_head align=center>" . RATIO . "</td>
</tr>\n";
while ($arr = mysql_fetch_assoc($res)){
$res2 = mysql_query("SELECT name, size, category, seeders, leechers, times_completed,owner FROM torrents WHERE id=$arr[torrent] ORDER BY name");
$arr2 = mysql_fetch_assoc($res2);
if ($arr["downloaded"] > 0){
$ratio = number_format($arr["uploaded"] / $arr["downloaded"], 2);
}else{
$ratio = "---";
}
$image = mysql_query("SELECT name,image FROM categories WHERE id = ".$arr2["category"]." ");
$image_cat = mysql_fetch_assoc($image);
$image_categorie = "<img src=\"images/categories/$image_cat[image]\" alt=\"$image_cat[name]\">";
$uploader = mysql_query("SELECT username FROM users WHERE id = ".$arr2["owner"]." ");
$name_uploader = mysql_fetch_assoc($uploader);
$uploadeur = "<a href='account-details.php?id=$arr2[owner]'target=_blank>$name_uploader[username]</a>";
$ret .= "<tr>
<td align=center class=table_col1>$image_categorie</td>
<td class=table_col2><a href=torrents-details.php?id=$arr[torrent]&hit=1><b>" . htmlspecialchars($arr2[name]) . "</b></a></td>
<td align=center class=table_col2>" . mksize($arr2["size"]) . "</td>
<td align=center class=table_col1>$uploadeur</td>
<td align=center class=table_col2><font color=green>" . $arr2["seeders"] . "</font></td>
<td align=center class=table_col2><font color=red>" . $arr2["leechers"] . "</font></td>
<td align=center class=table_col2><font color=orange>" . $arr2["times_completed"] . "</font></td>
<td align=center class=table_col1>" . mksize($arr["uploaded"]) . "</td>
<td align=center class=table_col2>" . mksize($arr["downloaded"]) . "</td>
<td align=center class=table_col1>$ratio</td>
</tr>\n";
}
$ret .= "</table>\n";
return $ret;
} $r = mysql_query("SELECT snatched.torrentid, snatched.uploaded, snatched.downloaded, snatched.complete_date, snatched.last_action, snatched.start_date, torrents.seeders, torrents.leechers, UNIX_TIMESTAMP(snatched.start_date) AS st, UNIX_TIMESTAMP(snatched.last_action) AS lt, UNIX_TIMESTAMP(snatched.complete_date) AS ct, snatched.start_date, snatched.recorded_time FROM snatched JOIN torrents ON torrents.id = snatched.torrentid WHERE snatched.finished='yes' AND userid=$id ORDER BY last_action") or sqlerr();replace by : $total = mysql_query("SELECT COUNT(*) FROM snatched WHERE userid = ". $user[id] ." AND finished='yes'") or die(mysql_error());
$row = mysql_fetch_array($total);
$count = $row[0];
list($pagertop, $pagerbottom, $limit) = pager(10, $count, "account-details.php?id=$id&" . $addparam);
$r = mysql_query("SELECT snatched.torrentid, snatched.uploaded, snatched.downloaded, snatched.complete_date, snatched.last_action, snatched.start_date, torrents.seeders, torrents.leechers, UNIX_TIMESTAMP(snatched.start_date) AS st, UNIX_TIMESTAMP(snatched.last_action) AS lt, UNIX_TIMESTAMP(snatched.complete_date) AS ct, snatched.start_date, snatched.recorded_time FROM snatched JOIN torrents ON torrents.id = snatched.torrentid WHERE snatched.finished='yes' AND userid=$id ORDER BY last_action $limit") or sqlerr();
find :
<div id='k1' style='display: none;'>$completed</div>
replace by :
<div id='k1' style='display: none;'>$pagertop<br/>$completed<br/>$pagerbottom</div>if ($user["privacy"] != "strong" || ($CURUSER["control_panel"] == "yes")) {
begin_frame("Local Activity");
$total = mysql_query("SELECT COUNT(*) FROM peers WHERE userid='$id' AND seeder='yes'") or die(mysql_error());
$row = mysql_fetch_array($total);
$count = $row[0];
if ($count) {
list($pagertop, $pagerbottom, $limit) = pager(10, $count, "account-details.php?id=$id&" . $addparam);
$res = mysql_query("SELECT torrent,uploaded,downloaded FROM peers WHERE userid='$id' AND seeder='yes'$limit");
$seeding = peerstable($res);
}
$total = mysql_query("SELECT COUNT(*) FROM peers WHERE userid='$id' AND seeder='no'") or die(mysql_error());
$row = mysql_fetch_array($total);
$count = $row[0];
if ($count) {
list($pagertop, $pagerbottom, $limit) = pager(10, $count, "account-details.php?id=$id&" . $addparam);
$res = mysql_query("SELECT torrent,uploaded,downloaded FROM peers WHERE userid='$id' AND seeder='no'$limit");
$leeching = peerstable($res);
}
if ($seeding) {
print($pagertop);
print("<B>" . CURRENTLY_SEEDING . ":</B><BR>$seeding<BR><BR>");
print($pagerbottom);
}
if ($leeching) {
print($pagertop);
print("<B>" . CURRENTLY_LEECHING . ":</B><BR>$leeching<BR><BR>");
print($pagerbottom);
}
if (!$leeching && !$seeding)
print("<B>This member currently has no active transfers<BR><BR>");
end_frame();mysql_query("INSERT INTO shoutbox VALUES('', 'System', 'New Torrent: [url=".$site_config['SITEURL']."/torrents-details.php?id=".$id."]".$torrent."[/url] has been uploaded by [url=".$site_config['SITEURL']."/account-details.php?id=".$CURUSER['id']."]" .$CURUSER['username']. "[/url]', now(), '0')") or sqlerr(__FILE__,__LINE__);
by :
$anonyupload = unesc($_POST["anonycheck"]);
if ($anonyupload == "yes" || $CURUSER["privacy"] == "strong")
{
$uploader = "anonyme";
}else{
$uploader = "[url=".$site_config['SITEURL']."/account-details.php?id=".$CURUSER['id']."]" .$CURUSER['username']. "[/url]";
}
mysql_query("INSERT INTO shoutbox VALUES('', 'System', 'New Torrent: [url=".$site_config['SITEURL']."/torrents-details.php?id=".$id."]".$torrent."[/url] has been uploaded by ".$uploader."', now(), '0')") or sqlerr(__FILE__,__LINE__);