Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
User Posts

Go to Profile

open shoutbox.php and find:

if (isset($_GET['history'])) {

if (isset($_GET['page'])) {

if($_GET['page'] > '1') {

$lowerlimit = $_GET['page'] * 100 - 100;

$upperlimit = $_GET['page'] * 100;

}else{

$lowerlimit = 0;

$upperlimit = 100;

}

}else{

$lowerlimit = 0;

$upperlimit = 100;

}

$query = 'SELECT * FROM shoutbox ORDER BY msgid DESC LIMIT '.$lowerlimit.','.$upperlimit;

}else{

$query = 'SELECT * FROM shoutbox ORDER BY msgid DESC LIMIT 20';

}
add after:




if ($CURUSER) {

//check for new pm's

$res = mysql_query("SELECT COUNT(*) FROM messages WHERE receiver=" . $CURUSER["id"] . " and unread='yes' AND location IN ('in','both')") or print(mysql_error());

$arr = mysql_fetch_row($res);

$unreadmail = $arr[0];

if ($unreadmail)

print("<font color=#FF0000 size=3><B><center><blink>You Got A New PM </font>[<a href=mailbox.php?inbox class=link2 target=_blank><font color=#FF0000> $unreadmail </font></a>]</blink></center></b></a></font>&nbsp;&nbsp;");

}



* Staff Edit: it's supposed to have if ($CURUSER) { } round it.
icons can be found in this post

[url="http://www.torrenttrader.pw/index.php?showtopic=7775"]http://www.torrenttrader.pw/index.php?showtopic=7775[/url]
ok what i did was add it to the staff panel and it uses mysql database to check. i took the email ban code and modified it to this so there may be some things that could be left out. you will have to find a pic for the category in the staff panel. i tested it on  TorrentTrader v2.03 and it works.

create this in your mysql:

CREATE TABLE `username_bans` (

 `id` int(10) unsigned NOT NULL auto_increment,

 `userid` int(11) default '0',

 `added` datetime NOT NULL default '0000-00-00 00:00:00',

 `addedby` int(10) unsigned NOT NULL default '0',

 `comment` varchar(255) NOT NULL default '',

 `badname` varchar(255) default NULL,

 PRIMARY KEY  (`id`)

) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3;







find in admincp.php:





<td align="center"><a href=admincp.php?action=emailbans><img src="images/admin/mail.gif" border=0 width=32 height=32><br>Email Bans</a><BR></td>





add after





<td align="center"><a href=admincp.php?action=usernamebans><img src="images/admin/settings.png" border=0 width=32 height=32><BR>Tracker settings</a><BR></td>





then find in admincp.php:





if ($action=="emailbans"){

stdhead("Email Bans");

navmenu();



$remove = $HTTP_GET_VARS['remove'];



if (is_valid_id($remove)){

mysql_query("DELETE FROM email_bans WHERE id=$remove") or die(mysql_error());

write_log("Email Ban $remove was removed by ($CURUSER[username])");

}



if ($_GET["add"] == '1'){

$mail_domain = trim($_POST["mail_domain"]);

$comment = trim($_POST["comment"]);



if (!$mail_domain || !$comment){

show_error_msg("Error", "Missing form data.",0);

stdfoot();

die;

}

$mail_domain= sqlesc($mail_domain);

$comment = sqlesc($comment);

$added = sqlesc(get_date_time());



mysql_query("INSERT INTO email_bans (added, addedby, mail_domain, comment) VALUES($added, $CURUSER[id], $mail_domain, $comment)") or die(mysql_error());



write_log("Email Ban $mail_domain was added by ($CURUSER[username])");

show_error_msg("Complete", "Email Ban Added",0);

stdfoot();

die;

}



begin_frame("Emails Or Domains Adress Bans");

print("You can block specific email addresses or domains from signing up to your tracker<BR><BR><BR><b>&nbsp;Add Emails OR Domains Ban</b>\n");

print("<table border=0 cellspacing=0 cellpadding=5 align=center>\n");

print("<form method=post action=admincp.php?action=emailbans&add=1>\n");

print("<tr><td align=right>Email Address OR Domain To Ban</td><td><input type=text name=mail_domain size=40></td>\n");

print("<tr><td align=right>Comment</td><td><input type=text name=comment size=40></td>\n");

print("<tr><td colspan=2 align=center><input type=submit value='Add Ban'></td></tr>\n");

print("</form>\n</table>\n<br>");

//}



$res2 = mysql_query("SELECT count(id) FROM email_bans") or die(mysql_error());

$row = mysql_fetch_array($res2);

$url = " .$_SERVER[PHP_SELF]";

$count = $row[0];

$perpage = 40;list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, $url);

print("<BR><b>&nbsp;Current Email Bans ($count)</b>\n");



if ($count == 0){

print("<p align=center><b>Nothing found</b></p><br>\n");

}else{

echo $pagertop;

print("<table border=0 cellspacing=0 cellpadding=5 width=90% align=center class=table_table>\n");

print("<tr><td class=table_head>Added</td><td  class=table_head align=left>Mail Address Or Domain</td>"."<td class=table_head align=left>Banned By</td><td  class=table_head align=left>Comment</td><td class=table_head>Remove</td></tr>\n");

$res = mysql_query("SELECT * FROM email_bans ORDER BY added DESC $limit") or die(mysql_error());



while ($arr = mysql_fetch_assoc($res)){

$r2 = mysql_query("SELECT username FROM users WHERE id=$arr[userid]") or die(mysql_error());

$a2 = mysql_fetch_assoc($r2);



$r4 = mysql_query("SELECT username,id FROM users WHERE id=$arr[addedby]") or die(mysql_error());

$a4 = mysql_fetch_assoc($r4);

print("<tr><td class=table_col1>".utc_to_tz($arr['added'])."</td><td align=left class=table_col2>$arr[mail_domain]</td><td align=left class=table_col1><a href=account-details.php?id=$a4[id]>$a4[username]"."</a></td><td align=left class=table_col2>$arr[comment]</td><td class=table_col1><a href=admincp.php?action=emailbans&remove=$arr[id]>Remove</a></td></tr>\n");

}



print("</table>\n");



echo $pagerbottom;

echo "<br>";

}

end_frame();

stdfoot();

}





add after:





if ($action=="usernamebans"){

stdhead("Username Bans");

navmenu();



$remove = $HTTP_GET_VARS['remove'];



if (is_valid_id($remove)){

mysql_query("DELETE FROM username_bans WHERE id=$remove") or die(mysql_error());

write_log("Username Ban $remove was removed by ($CURUSER[username])");

}



if ($_GET["add"] == '1'){

$badname = trim($_POST["badname"]);

$comment = trim($_POST["comment"]);



if (!$badname || !$comment){

show_error_msg("Error", "Missing form data.",0);

stdfoot();

die;

}

$badname= sqlesc($badname);

$comment = sqlesc($comment);

$added = sqlesc(get_date_time());



mysql_query("INSERT INTO username_bans (added, addedby, badname, comment) VALUES($added, $CURUSER[id], $badname, $comment)") or die(mysql_error());



write_log("Username Ban $badname was added by ($CURUSER[username])");

show_error_msg("Complete", "Username Ban Added",0);

stdfoot();

die;

}



begin_frame("Username Bans");

print("You can block specific usernames from signing up to your tracker<BR><BR><BR><b>&nbsp;Add Usernames to Ban</b>\n");

print("<table border=0 cellspacing=0 cellpadding=5 align=center>\n");

print("<form method=post action=admincp.php?action=usernamebans&add=1>\n");

print("<tr><td align=right>Username To Ban</td><td><input type=text name=badname size=40></td>\n");

print("<tr><td align=right>Comment</td><td><input type=text name=comment size=40></td>\n");

print("<tr><td colspan=2 align=center><input type=submit value='Add Ban'></td></tr>\n");

print("</form>\n</table>\n<br>");

//}



$res2 = mysql_query("SELECT count(id) FROM username_bans") or die(mysql_error());

$row = mysql_fetch_array($res2);

$url = " .$_SERVER[PHP_SELF]";

$count = $row[0];

$perpage = 40;list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, $url);

print("<BR><b>&nbsp;Current Username Bans ($count)</b>\n");



if ($count == 0){

print("<p align=center><b>Nothing found</b></p><br>\n");

}else{

echo $pagertop;

print("<table border=0 cellspacing=0 cellpadding=5 width=90% align=center class=table_table>\n");

print("<tr><td class=table_head>Added</td><td  class=table_head align=left>Usernames</td>"."<td class=table_head align=left>Banned By</td><td  class=table_head align=left>Comment</td><td class=table_head>Remove</td></tr>\n");

$res = mysql_query("SELECT * FROM username_bans ORDER BY added DESC $limit") or die(mysql_error());



while ($arr = mysql_fetch_assoc($res)){

$r2 = mysql_query("SELECT username FROM users WHERE id=$arr[userid]") or die(mysql_error());

$a2 = mysql_fetch_assoc($r2);



$r4 = mysql_query("SELECT username,id FROM users WHERE id=$arr[addedby]") or die(mysql_error());

$a4 = mysql_fetch_assoc($r4);

print("<tr><td class=table_col1>".utc_to_tz($arr['added'])."</td><td align=left class=table_col2>$arr[badname]</td><td align=left class=table_col1><a href=account-details.php?id=$a4[id]>$a4[username]"."</a></td><td align=left class=table_col2>$arr[comment]</td><td class=table_col1><a href=admincp.php?action=usernamebans&remove=$arr[id]>Remove</a></td></tr>\n");

}



print("</table>\n");



echo $pagerbottom;

echo "<br>";

}

end_frame();

stdfoot();

}





now find in account-signup.php:





// check if email addy is already in use

 $a = (@mysql_fetch_row(@mysql_query("select count(*) from users where email='$email'"))) or die(mysql_error());

 if ($a[0] != 0)

$message = "The e-mail address $email is already in use.";





add after that:





//check username isnt banned

$a = (@mysql_fetch_row(@mysql_query("select count(*) from username_bans where badname='$wantusername'"))) or die(mysql_error());

if ($a[0] != 0)

 $message = "Sorry, the username $badname is not allowed, please try another one.";
"TorrentialStorm, post: 38033":
or...blocks/login_block.php, find:

 print ("<center><img width=80 height=80 src=$avatar></center><br>" . DOWNLOADED . ": $userdownloaded<br>" . UPLOADED . ": $useruploaded<BR>" . ACCOUNT_PRIVACY_LV . ": $privacylevel<BR>". RATIO .": $userratio");
add below:


$connectable = get_row_count("peers", "WHERE connectable='yes' AND userid=$CURUSER[id]");

$unconnectable = get_row_count("peers", "WHERE connectable='no' AND userid=$CURUSER[id]");

if ($unconnectable)

print "<b>Connectable: <font color='#FF0000'>NO</font></b>";

elseif ($connectable)

print "<b>Connectable: <font color='#00FF00'>YES</font></b>";

else

print "<b>Connectable: <font color='#FF9900'>N/A</font></b>";




thank you. i ran into a problem with this, the connectable was showing on the same line as the ratio, but i fixed it. i added a <br> after ": $userratio" in the part that you said to find.
thanks for the addon but i get a warning

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in

index.php on line 29
it worked for me thank you very much   :P  :)
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728