Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev
Reply
  #1  
Old 3rd July 2019, 19:25
BamBam0077 BamBam0077 is offline
Banned
 
Join Date: Jul 2013
P2P
Posts: 410
Default tutorial part 1
PHP Code:
if( sql_query("SELECT id FROM users WHERE seedbonus='35' ") ) {
// START CODE HERE

if ($do == "add") {
        
$first trim($_POST["first"]);
        
$last trim($_POST["last"]);
        
$comment trim($_POST["comment"]);
        if (
$first == "" || $last == "" || $comment == "")
            
show_error_msg("Error""Missing form data. Go back and try again"1);
        
$first ip2long($first);
        
$last ip2long($last);
        if (
$first <= || $last <= 0)
            
show_error_msg("Error""Bad IP address.");
        
$comment sqlesc($comment);
        
$added sqlesc(get_date_time());
        
mysql_query("INSERT INTO bans (added, addedby, first, last, comment) VALUES($added$CURUSER[id]$first$last$comment)");
        switch (
mysql_errno()) {
            case 
1062:
                
show_error_msg("Error""Duplicate ban."0);
            break;
            case 
0:
                
show_error_msg("Success""Ban added."0);
            break;
            default:
                
show_error_msg("Error""Database error: ".htmlspecialchars(mysql_error()), 0);
        }
    }
}

begin_frame("Banned IPs""center");
    echo 
"<p align=\"justify\">This page allows you to prevent individual users or groups of users from accessing your tracker by placing a block on their IP or IP range.<BR>
    If you wish to temporarily disable an account, but still wish a user to be able to view your tracker, you can use the 'Disable Account' option which is found in the user's profile page.</p><BR>"
;
    
$count get_row_count("bans");
    if (
$count == 0)
    print(
"<b>No Bans Found</b><br />\n");
    else {
        list(
$pagertop$pagerbottom$limit) = pager(50$count"admincp.php?action=ipbans&"); // 50 per page
        
echo $pagertop;
        echo 
"<form action='admincp.php?action=ipbans&do=del' method='POST'><table border=1 cellspacing=0 cellpadding=5 align=center class=ttable_headinner>
        <tr>
            <td class=ttable_head>"
.DATE_ADDED."</td>
            <td class=table_head align=left>First IP</td>
            <td class=ttable_head align=left>Last IP</td>
            <td class=ttable_head align=left>"
.ADDED_BY."</td>
            <td class=ttable_head align=left>Comment</td>
            <td class=ttable_head>Del?</td>
        </tr>"
;
        
$res mysql_query("SELECT bans.*, users.username FROM bans LEFT JOIN users ON bans.addedby=users.id ORDER BY added $limit");
        while (
$arr mysql_fetch_assoc($res)) {
            
$arr["first"] = long2ip($arr["first"]);
            
$arr["last"] = long2ip($arr["last"]);
            echo 
"<tr>
                <td align=center class=ttable_col1>"
.date('d/m/Y<\B\R>H:i:s'utc_to_tz_time($arr["added"]))."</td>
                <td align=center class=ttable_col2>
$arr[first]</td>
                <td align=center class=ttable_col1>
$arr[last]</td>
                <td align=center class=ttable_col2><a href='account-details.php?id=
$arr[addedby]'>$arr[username]</a></td>
                <td align=center class=ttable_col1>
$arr[comment]</td>
                <td align=center class=ttable_col2><input type='checkbox' name='delids[]' value='
$arr[id]'></td>
            </tr>"
;
        }
        echo 
"</table><BR><input type='submit' value='Delete Checked'>&nbsp;<input type='button' onclick='this.value=check(form)' value='Check All'></form>";
        echo 
$pagerbottom;
    }
    echo 
"<BR><BR>";
    
begin_frame("Add Ban""center");
    print(
"<table border=1 cellspacing=0 cellpadding=5>\n");
    print(
"<form method=post action=admincp.php?action=ipbans&do=add>\n");
    print(
"<tr><td class=rowhead>First IP</td><td><input type=text name=first size=40></td>\n");
    print(
"<tr><td class=rowhead>Last IP</td><td><input type=text name=last size=40></td>\n");
    print(
"<tr><td class=rowhead>Comment</td><td><input type=text name=comment size=40></td>\n");
    print(
"<tr><td colspan=2><input type=submit value='Okay' class=btn></td></tr>\n");
    print(
"</form>\n</table>\n");
    
end_frame();
    
end_frame();
    
stdfoot();
}
// End IP Bans (TorrentialStorm) 

Last edited by BamBam0077; 3rd July 2019 at 19:35.
Reply With Quote
  #2  
Old 4th July 2019, 09:05
Napon Napon is offline
Banned
 
Join Date: Feb 2016
P2P
Posts: 522
Default
whats with the hard lag lol taken from torrenttrader as always lol
this not lang for TBDev
<td class=ttable_head>".DATE_ADDED."</td>
<td class=table_head align=left>First IP</td>
<td class=ttable_head align=left>Last IP</td>
<td class=ttable_head align=left>".ADDED_BY."</td>
<td class=ttable_head align=left>Comment</td>
<td class=ttable_head>Del?</td>
also this
<td align=center class=ttable_col2><a href='account-details.php?id=$arr[addedby]'>$arr[username]</a></td> now you know in TBDev noone as this you should clean it up before posting your shit

also why tutorial part 1 when it should be Banned IPs
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 16:09. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.