Exemplo n.º 1
0
function commenttable_new($rows)
{
    global $CURUSER, $HTTP_SERVER_VARS;
    begin_main_frame();
    begin_frame();
    $count = 0;
    foreach ($rows as $row) {
        $subres = mysql_query("SELECT name from torrents where id=" . unsafeChar($row["torrent"])) or sqlerr(__FILE__, __LINE__);
        $subrow = mysql_fetch_array($subres);
        print "<br /><a href=\"details.php?id=" . safeChar($row["torrent"]) . "\">" . safeChar($subrow["name"]) . "</a><br />\n";
        print "<p class=sub>#" . $row["id"] . " by ";
        if (isset($row["username"])) {
            print "<a name=comm" . $row["id"] . " href=userdetails.php?id=" . safeChar($row["user"]) . "><b>" . safechar($row["username"]) . "</b></a>" . ($row["warned"] == "yes" ? "<img src=" . "pic/warned.gif alt=\"Warned\">" : "");
        } else {
            print "<a name=\"comm" . safeChar($row["id"]) . "\"><i>(orphaned)</i></a>\n";
        }
        print " at " . safeChar($row["added"]) . " GMT" . "- [<a href=comment.php?action=edit&cid={$row['id']}>Edit</a>]" . "- [<a href=deletecomment.php?id={$row['id']}>Delete</a>]</p>\n";
        $avatar = $CURUSER["avatars"] == "yes" ? safechar($row["avatar"]) : "";
        if (!$avatar) {
            $avatar = "pic/default_avatar.gif";
        }
        begin_table(true);
        print "<tr valign=top>\n";
        print "<td align=center width=150 style='padding: 0px'><img width=150 src={$avatar}></td>\n";
        print "<td class=text>" . format_comment($row["text"]) . "</td>\n";
        print "</tr>\n";
        end_table();
    }
    end_frame();
    end_main_frame();
}
Exemplo n.º 2
0
function Do_Edit($cats = array())
{
    if (empty($_POST['option'])) {
        Do_Error("Error", "No option selected <a href='links_admin.php'>Go Back</a>");
    }
    if (!isset($_POST['cat']) || empty($_POST['cat']) || !is_valid_id($_POST['cat'])) {
        Do_Error("Error", "No Section selected");
    }
    $cat_id = (int) $_POST['cat'];
    $option = $_POST['option'] == 'heading' ? 'links_categories' : 'links';
    $sql = sql_query("SELECT * FROM {$option} WHERE cid = {$cat_id}") or stderr("SQL Error", "OOps!");
    if (!mysql_num_rows($sql)) {
        stderr("SQL Error", "Nothing doing here!");
    }
    stdhead("Edit " . safechar($option));
    if ('links_categories' == $option) {
        while ($row = mysql_fetch_assoc($sql)) {
            echo "<div class='faqhead'>heading No.{$row['cid']}</div><div class='faqbody'><form name='inputform' method='post' action='links_admin.php'>" . "<input type='hidden' name='action' value='cat_update' /><input type='hidden' name='cat' value='{$row['cid']}' />" . "<input type='text' value='" . safechar($row['rcat_name'], ENT_QUOTES) . "' name='rcat_name' style='width:380px;' /> " . "<input type='submit' name='submit' value='Edit' class='button'></form></div>";
        }
    } else {
        while ($row = mysql_fetch_assoc($sql)) {
            begin_frame();
            echo "<div class='faqhead'>Link No.{$row['id']}</div><div class='faqbody'>";
            print $row['mtime'];
            echo "<form name='compose' method='post' action='links_admin.php'>";
            echo "<input type='hidden' name='action' value='links_update' />";
            echo "<input type='hidden' name='links_id' value='{$row['id']}' />";
            echo "<input type='text' value='{$row['heading']}' name='heading' style='width:380px;' /> ";
            echo "<select name='cat'><option value=''>--Select One--</option>";
            foreach ($cats as $v) {
                print "<option value='" . $v['cid'] . "'>" . $v['rcat_name'] . '</option>';
            }
            echo "</select><br />";
            //echo "<textarea name='text' rows='5' style='width:380px;'>".htmlentities($row['text'])."</textarea>";
            $body = htmlentities($row['body']);
            textbbcode("compose", "body", $body);
            echo "<br /><input type='submit' name='submit' value='Edit This Entry' class='button'>";
            echo "</form></div>";
            //===added delete
            echo "<form name='deleteform' method='post' action='links_admin.php'>";
            echo "<input type='hidden' name='action' value='links_delete' />";
            echo "<input type='hidden' name='id' value='{$row['id']}' />";
            echo "<br><input type='submit' name='submit' value='Delete This Entry' class='button'>";
            echo "</form></div>";
            end_frame();
        }
    }
    Stdfoot();
    exit;
}
Exemplo n.º 3
0
function Do_Edit($cats = array())
{
    if (empty($_POST['option'])) {
        Do_Error("Error", "No option selected <a href='faqadmin.php'>Go Back</a>");
    }
    if (!isset($_POST['cat']) || empty($_POST['cat']) || !is_valid_id($_POST['cat'])) {
        Do_Error("Error", "No Category selected");
    }
    $cat_id = (int) $_POST['cat'];
    $option = $_POST['option'] == 'category' ? 'faq_categories' : 'faq';
    $sql = sql_query("SELECT * FROM {$option} WHERE cid = {$cat_id}") or stderr("SQL Error", "OOps!");
    if (!mysql_num_rows($sql)) {
        stderr("SQL Error", "Nothing doing here!");
    }
    stdhead("Edit " . safechar($option));
    if ('faq_categories' == $option) {
        while ($row = mysql_fetch_assoc($sql)) {
            echo "<div class='faqhead'>Category No.{$row['cid']}</div><div class='faqbody'>";
            echo "<form name='inputform' method='post' action='faqadmin.php'>";
            echo "<input type='hidden' name='action' value='cat_update' />";
            echo "<input type='hidden' name='cat' value='{$row['cid']}' />";
            echo "<input type='text' value='" . htmlentities($row['fcat_name'], ENT_QUOTES) . "' name='fcat_name' style='width:380px;' /> ";
            echo "<input type='submit' name='submit' value='Edit' class='btns'>";
            echo "</form></div>";
        }
    } else {
        while ($row = mysql_fetch_assoc($sql)) {
            echo "<div class='faqhead'>Faq No.{$row['id']}</div><div class='faqbody'>";
            print $row['mtime'];
            echo "<form name='inputform' method='post' action='faqadmin.php'>";
            echo "<input type='hidden' name='action' value='faq_update' />";
            echo "<input type='hidden' name='faq_id' value='{$row['id']}' />";
            echo "<input type='text' value='{$row['question']}' name='question' style='width:380px;' /> ";
            echo "<select name='cat'><option value=''>--Select One--</option>";
            foreach ($cats as $v) {
                print "<option value='" . $v['cid'] . "'>" . $v['fcat_name'] . '</option>';
            }
            echo "</select><br /><textarea name='Answer' rows='5' style='width:380px;'>" . htmlentities($row['answer']) . "</textarea><br />";
            echo "<input type='submit' name='submit' value='Edit' class='btns'>";
            echo "</form></div>";
        }
    }
    Stdfoot();
    exit;
}
Exemplo n.º 4
0
function sharetable($res, $variant = "index")
{
    global $pic_base_url, $CURUSER;
    $wait = 0;
    if ($CURUSER["class"] < UC_VIP) {
        $gigs = $CURUSER["uploaded"] / (1024 * 1024 * 1024);
        $ratio = $CURUSER["downloaded"] > 0 ? $CURUSER["uploaded"] / $CURUSER["downloaded"] : 0;
        if ($ratio < 0.5 || $gigs < 5) {
            $wait = 48;
        } elseif ($ratio < 0.65 || $gigs < 6.5) {
            $wait = 24;
        } elseif ($ratio < 0.8 || $gigs < 8) {
            $wait = 12;
        } elseif ($ratio < 0.95 || $gigs < 9.5) {
            $wait = 6;
        } else {
            $wait = 0;
        }
    }
    ?>
<p align="center">Icon Legend :
<img alt="Delete Bookmark" src="pic/plus.gif" border="none">
= Delete Bookmark |
<img alt="Download Bookmark" by="" src="pic/download.gif">
= Download Torrent |
<img alt="Bookmark Torrent" src="pic/bookmark.gif" border="none">
= Bookmark Torrent</p>
<table border="1" cellspacing=0 cellpadding=5>
<tr>

<td class="colhead" align="center">Type</td>
<td class="colhead" align=left>Name</td>
<?php 
    echo ($variant == 'index' ? '<td class=colhead align=center>Download</td><td class=colhead align="right">' : '') . 'Bookmark</td>';
    if ($wait) {
        print "<td class=\"colhead\" align=\"center\">Wait</td>\n";
    }
    if ($variant == "mytorrents") {
        print "<td class=\"colhead\" align=\"center\">Edit</td>\n";
        print "<td class=\"colhead\" align=\"center\">Visible</td>\n";
    }
    ?>
<td class="colhead" align=right>Files</td>
<td class="colhead" align=right>Comm.</td>
<!--<td class="colhead" align="center">Rating</td>-->
<td class="colhead" align="center">Added</td>
<td class="colhead" align="center">TTL</td>
<td class="colhead" align="center">Size</td>
<!--
<td class="colhead" align=right>Views</td>
<td class="colhead" align=right>Hits</td>
-->
<td class="colhead" align="center">Snatched</td>
<td class="colhead" align=right>Seeders</td>
<td class="colhead" align=right>Leechers</td>
<?php 
    if ($variant == "index") {
        print "<td class=\"colhead\" align=center>Upped&nbsp;by</td>\n";
    }
    print "</tr>\n";
    while ($row = mysql_fetch_assoc($res)) {
        $id = $row["id"];
        print "<tr>\n";
        print "<td align=center style='padding: 0px'>";
        if (isset($row["cat_name"])) {
            print "<a href=\"browse.php?cat=" . $row["category"] . "\">";
            if (isset($row["cat_pic"]) && $row["cat_pic"] != "") {
                print "<img border=\"0\" src=\"{$pic_base_url}caticons/{$row['cat_pic']}\" alt=\"{$row['cat_name']}\" />";
            } else {
                print $row["cat_name"];
            }
            print "</a>";
        } else {
            print "-";
        }
        print "</td>\n";
        $dispname = safechar($row["name"]);
        print "<td align=left><a href=\"details.php?";
        if ($variant == "mytorrents") {
            print "returnto=" . urlencode($_SERVER["REQUEST_URI"]) . "&amp;";
        }
        print "id={$id}";
        if ($variant == "index") {
            print "&amp;hit=1";
        }
        print "\"><b>{$dispname}</b></a>\n";
        echo $variant == 'index' ? '<td align=center><a href=download.php/' . $id . '/' . rawurlencode($row['filename']) . '><img src="' . $pic_base_url . 'download.gif" border="0" alt="Download Bookmark!" title="Download Bookmark!"></a></td>' : '';
        $bm = mysql_query("SELECT * FROM bookmarks WHERE torrentid={$id} && userid={$CURUSER['id']}");
        $bms = mysql_fetch_assoc($bm);
        $bookmarked = empty($bms) ? '<a href=\'bookmark.php?torrent=' . $id . '&action=add\'><img src=\'' . $pic_base_url . 'bookmark.gif\' border=\'0\' alt=\'Bookmark it!\' title=\'Bookmark it!\'></a>' : '<a href="bookmark.php?torrent=' . $id . '&action=delete"><img src=\'' . $pic_base_url . 'plus.gif\' border=\'0\' alt=\'Delete Bookmark!\' title=\'Delete Bookmark!\'></a>';
        echo $variant == 'index' ? '<td align=center>' . $bookmarked . '</td>' : '';
        if ($wait) {
            $elapsed = floor((gmtime() - strtotime($row["added"])) / 3600);
            if ($elapsed < $wait) {
                $color = dechex(floor(127 * ($wait - $elapsed) / 48 + 128) * 65536);
                print "<td align=center><nobr><a href=\"faq.php#dl8\"><font color=\"{$color}\">" . number_format($wait - $elapsed) . " h</font></a></nobr></td>\n";
            } else {
                print "<td align=center><nobr>None</nobr></td>\n";
            }
        }
        /*
        if ($row["nfoav"] && get_user_class() >= UC_POWER_USER)
        print("<a href=viewnfo.php?id=$row[id]><img src=\"{$pic_base_url}viewnfo.gif" border=0 alt='View NFO'></a>\n");
        
        else */
        if ($variant == "mytorrents") {
            print "<td align=\"center\"><a href=\"edit.php?returnto=" . urlencode($_SERVER["REQUEST_URI"]) . "&amp;id=" . $row["id"] . "\">edit</a>\n";
        }
        print "</td>\n";
        if ($variant == "mytorrents") {
            print "<td align=\"right\">";
            if ($row["visible"] == "no") {
                print "<b>no</b>";
            } else {
                print "yes";
            }
            print "</td>\n";
        }
        if ($row["type"] == "single") {
            print "<td align=\"right\">" . $row["numfiles"] . "</td>\n";
        } else {
            if ($variant == "index") {
                print "<td align=\"right\"><b><a href=\"filelist.php?id={$id}\">" . $row["numfiles"] . "</a></b></td>\n";
            } else {
                print "<td align=\"right\"><b><a href=\"filelist.php?id={$id}\">" . $row["numfiles"] . "</a></b></td>\n";
            }
        }
        if (!$row["comments"]) {
            print "<td align=\"right\">" . $row["comments"] . "</td>\n";
        } else {
            if ($variant == "index") {
                print "<td align=\"right\"><b><a href=\"details.php?id={$id}&amp;hit=1&amp;tocomm=1\">" . $row["comments"] . "</a></b></td>\n";
            } else {
                print "<td align=\"right\"><b><a href=\"details.php?id={$id}&amp;page=0#startcomments\">" . $row["comments"] . "</a></b></td>\n";
            }
        }
        /*
        print("<td align=\"center\">");
        if (!isset($row["rating"]))
        print("---");
        else {
        $rating = round($row["rating"] * 2) / 2;
        $rating = ratingpic($row["rating"]);
        if (!isset($rating))
        print("---");
        else
        print($rating);
        }
        print("</td>\n");
        */
        print "<td align=center><nobr>" . str_replace(" ", "<br />", $row["added"]) . "</nobr></td>\n";
        $ttl = 28 * 24 - floor((gmtime() - sql_timestamp_to_unix_timestamp($row["added"])) / 3600);
        if ($ttl == 1) {
            $ttl .= "<br />hour";
        } else {
            $ttl .= "<br />hours";
        }
        print "<td align=center>{$ttl}</td>\n";
        print "<td align=center>" . str_replace(" ", "<br />", mksize($row["size"])) . "</td>\n";
        // print("<td align=\"right\">" . $row["views"] . "</td>\n");
        // print("<td align=\"right\">" . $row["hits"] . "</td>\n");
        $_s = "";
        if ($row["times_completed"] != 1) {
            $_s = "s";
        }
        print "<td align=center>" . number_format($row["times_completed"]) . "<br />time{$_s}</td>\n";
        if ($row["seeders"]) {
            if ($variant == "index") {
                if ($row["leechers"]) {
                    $ratio = $row["seeders"] / $row["leechers"];
                } else {
                    $ratio = 1;
                }
                print "<td align=right><b><a href=peerlist.php?id={$id}#seeders><font color=" . get_slr_color($ratio) . ">" . $row["seeders"] . "</font></a></b></td>\n";
            } else {
                print "<td align=\"right\"><b><a class=\"" . linkcolor($row["seeders"]) . "\" href=\"peerlist.php?id={$id}#seeders\">" . $row["seeders"] . "</a></b></td>\n";
            }
        } else {
            print "<td align=\"right\"><span class=\"" . linkcolor($row["seeders"]) . "\">" . $row["seeders"] . "</span></td>\n";
        }
        if ($row["leechers"]) {
            if ($variant == "index") {
                print "<td align=right><b><a href=peerlist.php?id={$id}#leechers>" . number_format($row["leechers"]) . "</a></b></td>\n";
            } else {
                print "<td align=\"right\"><b><a class=\"" . linkcolor($row["leechers"]) . "\" href=\"peerlist.php?id={$id}#leechers\">" . $row["leechers"] . "</a></b></td>\n";
            }
        } else {
            print "<td align=\"right\">0</td>\n";
        }
        if ($variant == "index") {
            print "<td align=center>" . (isset($row["username"]) ? "<a href=userdetails.php?id=" . $row["owner"] . "><b>" . safechar($row["username"]) . "</b></a>" : "<i>(unknown)</i>") . "</td>\n";
        }
        print "</tr>\n";
    }
    print "</table>\n";
    // return $rows;
}
Exemplo n.º 5
0
    print "<tr valign=top><td>Result:</td><td>{$result}\n";
    if ($remarks != "") {
        print "<tr><td>Remarks:</td><td>{$remarks}\n";
    }
    print "</table>\n";
}
stdhead("Tags");
begin_main_frame();
begin_frame("Tags");
$test = $_POST["test"];
?>
<p>The Yoursite forums supports a number of <i>BB tags</i> which you can embed to modify how your posts are displayed.</p>

<form method=post action=?>
<textarea name=test cols=60 rows=3><?php 
print $test ? safechar($test) : "";
?>
</textarea>
<input type=submit value="Test this code!" style='height: 23px; margin-left: 5px'>
</form>
<?php 
if ($test != "") {
    print "<p><hr>" . format_comment($test) . "<hr></p>\n";
}
insert_tag("Bold", "Makes the enclosed text bold.", "[b]<i>Text</i>[/b]", "[b]This is bold text.[/b]", "");
insert_tag("Italic", "Makes the enclosed text italic.", "[i]<i>Text</i>[/i]", "[i]This is italic text.[/i]", "");
insert_tag("Underline", "Makes the enclosed text underlined.", "[u]<i>Text</i>[/u]", "[u]This is underlined text.[/u]", "");
insert_tag("Color (alt. 1)", "Changes the color of the enclosed text.", "[color=<i>Color</i>]<i>Text</i>[/color]", "[color=blue]This is blue text.[/color]", "What colors are valid depends on the browser. If you use the basic colors (red, green, blue, yellow, pink etc) you should be safe.");
insert_tag("Color (alt. 2)", "Changes the color of the enclosed text.", "[color=#<i>RGB</i>]<i>Text</i>[/color]", "[color=#0000ff]This is blue text.[/color]", "<i>RGB</i> must be a six digit hexadecimal number.");
insert_tag("Size", "Sets the size of the enclosed text.", "[size=<i>n</i>]<i>text</i>[/size]", "[size=4]This is size 4.[/size]", "<i>n</i> must be an integer in the range 1 (smallest) to 7 (biggest). The default size is 2.");
insert_tag("Font", "Sets the type-face (font) for the enclosed text.", "[font=<i>Font</i>]<i>Text</i>[/font]", "[font=Impact]Hello world![/font]", "You specify alternative fonts by separating them with a comma.");
Exemplo n.º 6
0
?>
	</tr>
       </table>
      </td>
     </tr>
    </table>
   </td>
  </tr>
 </table>

	<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="border2" style="height:109px; background:url(themes/NB-Revolt/pic/logo-bkg.jpg);" align="center" valign="middle"><img src="themes/NB-Revolt/pic/cyberfun_tracker.png" width="649" height="109" /></td>
    <td width="109" style="height:109px; background:url(themes/NB-Revolt/pic/avatar-bkg.jpg);" align="center" valign="middle" class="border3"><span class="avat_m">
<?php 
$avatar = safechar($CURUSER["avatar"]);
if (!$avatar) {
    $avatar = "themes/NB-Revolt/pic/noavatar.png";
}
if (!$CURUSER) {
    $avatar = "themes/NB-Revolt/pic/Guest.png";
    $salt = "";
} else {
    $salt = "'s avatar";
}
echo '<img src="' . $avatar . '" alt="' . $CURUSER[username] . $salt . ' " title="' . $CURUSER[username] . $salt . '" border="0" width="80" height="80" style="opacity:0.8" />';
?>
 </span></td>
 </tr>
</table><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
Exemplo n.º 7
0
    stderr("Error", "Invalid ID");
}
if (get_user_class() < UC_USER || $CURUSER["id"] != $userid && get_user_class() < UC_MODERATOR) {
    stderr("Error", "Permission denied");
}
// === subscribe to thread
if ($_GET["subscribe"]) {
    $subscribe = 0 + $_GET["subscribe"];
    if ($subscribe != '1') {
        stderr("Error", "I smell a rat!");
    }
    if (!isset($_GET[topicid])) {
        stderr("Error", "No forum selected!");
    }
    if ($_GET["topicid"]) {
        $topicid = 0 + safechar($_GET["topicid"]);
        if (ereg("^[0-9]+\$", !$topicid)) {
            stderr("Error", "Bad Topic Id!");
        }
    }
    if (get_row_count("subscriptions", "WHERE userid={$CURUSER['id']} AND topicid = {$topicid}") > 0) {
        stderr("Error", "Already subscribed to thread number <b> {$topicid}</b><br><br>Click <a href=forums.php?action=viewtopic&topicid={$topicid}><b>HERE</b></a> to go back to the thread. Or click <a href=subscriptions.php><b>HERE</b></a> to view your subscriptions.");
    }
    sql_query("INSERT INTO subscriptions (userid, topicid) VALUES ({$CURUSER['id']}, {$topicid})") or sqlerr(__FILE__, __LINE__);
    $res = sql_query("SELECT subject FROM `topics` WHERE id={$topicid}") or sqlerr(__FILE__, __LINE__);
    $arr = mysql_fetch_assoc($res) or stderr("Error", "Bad forum id!");
    $forumname = $arr["subject"];
    stderr("Sucksex", "Successfully subscribed to thread <b>{$forumname}</b><br><br>Click <a href=forums.php?action=viewtopic&topicid={$topicid}><b>HERE</b></a> to go back to the thread. Or click <a href=subscriptions.php><b>HERE</b></a> to view your subscriptions.");
}
// === end subscribe to thread
// === Action: Delete subscription
Exemplo n.º 8
0
$res = mysql_query("SELECT b.*, u.username FROM bans b LEFT JOIN users u on b.addedby = u.id ORDER BY added DESC") or sqlerr(__FILE__, __LINE__);
$configfile = "<" . "?php\n\n\$bans = array(\n";
stdhead("Bans");
echo "<h1>Current Bans</h1>\n";
if (mysql_num_rows($res) == 0) {
    echo "<p align=center><b>Nothing found</b></p>\n";
} else {
    echo "<table border=1 cellspacing=0 cellpadding=5>\n";
    echo "<tr><td class=colhead>Added</td><td class=colhead align=left>First IP</td><td class=colhead align=left>Last IP</td>" . "<td class=colhead align=left>By</td><td class=colhead align=left>Comment</td><td class=colhead>Remove</td></tr>\n";
    while ($arr = mysql_fetch_assoc($res)) {
        if ($doUpdate) {
            $configfile .= "array('id'=> '{$arr['id']}', 'first'=> {$arr['first']}, 'last'=> {$arr['last']}),\n";
        }
        $arr["first"] = long2ip($arr["first"]);
        $arr["last"] = long2ip($arr["last"]);
        echo "<tr><td>{$arr['added']}</td><td align=left>{$arr['first']}</td><td align=left>{$arr['last']}</td><td align=left><a href=userdetails.php?id={$arr['addedby']}>{$arr['username']}" . "</a></td><td align=left>" . safechar($arr['comment'], ENT_QUOTES) . "</td><td><a href=bans.php?remove={$arr['id']}>Remove</a></td></tr>\n";
    }
    echo "</table>\n";
}
if ($doUpdate) {
    $configfile .= "\n);\n\n?" . ">";
    $filenum = fopen("cache/bans_cache.php", "w");
    ftruncate($filenum, 0);
    fwrite($filenum, $configfile);
    fclose($filenum);
}
if (get_user_class() >= UC_ADMINISTRATOR) {
    echo "<h2>Add ban</h2>\n";
    echo "<table border=1 cellspacing=0 cellpadding=5>\n";
    echo "<form method=post action=bans.php>\n";
    echo "<tr><td class=rowhead>First IP</td><td><input type=text name=first size=40></td>\n";
Exemplo n.º 9
0
        ?>
</td></tr>
    <?php 
    }
    //===end free upload / staff stuff
    if (get_user_class() >= UC_UPLOADER) {
        tr("" . $language['vip'] . "", "<input type='checkbox' name='vip'" . ($row["vip"] == "yes" ? " checked='checked'" : "") . " value='1' /> If this one is checked, only VIPs can download this torrent", 1);
    }
    if (get_user_class() > UC_MODERATOR) {
        tr("" . $language['sticky'] . "", "<input type='checkbox' name='sticky'" . ($row["sticky"] == "yes" ? " checked='checked'" : "") . " value='yes' />Set sticky this torrent!", 1);
    }
    if (get_user_class() >= UC_ADMINISTRATOR) {
        tr("" . $language['multi'] . "", "<input type=radio name=multiplicator" . ($row["multiplicator"] == "0" ? " checked='checked'" : "") . " value=0>No Multiplicator\n    <input type=radio name=multiplicator " . ($row["multiplicator"] == "2" ? " checked='checked'" : "") . " value=2>Upload x 2\n    <input type=radio name=multiplicator " . ($row["multiplicator"] == "3" ? " checked='checked'" : "") . " value=3>Upload x 3\n    <input type=radio name=multiplicator " . ($row["multiplicator"] == "4" ? " checked='checked'" : "") . " value=4>Upload x 4\n    <input type=radio name=multiplicator " . ($row["multiplicator"] == "5" ? " checked='checked'" : "") . " value=5>Upload x 5", 1);
    }
    tr("" . $language['nuked'] . "", "<input type=radio name=nuked" . ($row["nuked"] == "yes" ? " checked" : "") . " value=yes>Yes <input type=radio name=nuked" . ($row["nuked"] == "no" ? " checked" : "") . " value=no>No <input type=radio name=nuked" . ($row["nuked"] == "unnuked" ? " checked" : "") . " value=unnuked>Unnuked", 1);
    tr("" . $language['nuker'] . "", "<input type=\"text\" name=\"nukereason\" value=\"" . safechar($row["nukereason"]) . "\" size=\"80\" />", 1);
    ?>
<script type="text/javascript">
window.onload = function() {
    setupDependencies('edit'); //name of form(s). Seperate each with a comma (ie: 'weboptions', 'myotherform' )
  };
</script>
<tr><td align=right><b><?php 
    echo $language['genre'];
    ?>
</b><br><?php 
    echo $language['opt'];
    ?>
</td><td align=left>
<table><tr><input type=radio name=genre value="keep" checked>Dont touch it (Current: <?php 
    echo $row["newgenre"];
Exemplo n.º 10
0
        $a = mysql_fetch_row(mysql_query("SELECT userid,date FROM shoutbox ORDER by id DESC LIMIT 1 ")) or print "bad thing in query";
        if (empty($text) || strlen($text) == 1) {
            print "<font class=\"small\" color=\"red\">Shout can't be empty</font>";
        } elseif ($a[0] == $userid && time() - $a[1] < $limit && get_user_class() < UC_MODERATOR) {
            print "<font class=\"small\" color=\"red\">{$limit} seconds between shouts <font class=\"small\">Seconds Remaining : (" . ($limit - (time() - $a[1])) . ")</font></font>";
        } else {
            sql_query("INSERT INTO shoutbox (id, userid, date, text, text_parsed) VALUES ('id'," . sqlesc($userid) . ", {$date}, " . sqlesc($text) . "," . sqlesc($text_parsed) . ")") or sqlerr(__FILE__, __LINE__);
            print "<script type=\"text/javascript\">parent.document.forms[0].shbox_text.value='';</script>";
        }
    }
}
// //////////////////////
$res = sql_query("SELECT s.id, s.userid, s.date , s.text,u.username,u.class,u.donor,u.warned,u.downloadpos,u.chatpost,u.forumpost,u.uploadpos,u.parked  FROM shoutbox as s LEFT JOIN users as u ON s.userid=u.id ORDER BY s.date DESC LIMIT 30") or sqlerr(__FILE__, __LINE__);
if (mysql_num_rows($res) == 0) {
    print "No shouts here ";
} else {
    print "<table border=0 cellspacing=0 cellpadding=2 width='100%' align='left' class='small'>\n";
    while ($arr = mysql_fetch_assoc($res)) {
        $edit = get_user_class() >= UC_MODERATOR ? "<a href=/shoutbox.php?edit=" . $arr['id'] . "><img src=" . $pic_base_url . "button_edit2.gif border=0 title=\"Edit Shout\" /></a> " : "";
        $del = get_user_class() >= UC_MODERATOR ? "<a href=/shoutbox.php?del=" . $arr['id'] . "><img src=" . $pic_base_url . "button_delete2.gif border=0 title=\"Delete Single Shout\" /></a> " : "";
        $delall = get_user_class() >= UC_SYSOP ? "<a href=/shoutbox.php?delall onclick=\"confirm_delete(); return false;\" ><img src=" . $pic_base_url . "del.png border=0 title=\"Empty Shout\" /></a> " : "";
        $pm = "<font  class='date' style=\"color:{$dtcolor}\"><a target=_blank href=sendmessage.php?receiver={$arr['userid']}><img src=" . $pic_base_url . "button_pm2.gif border=0 title=\"Pm User\"/></a></font>\n";
        $datum = gmdate("d M H:i", $arr["date"] + ($CURUSER['dst'] + $CURUSER["timezone"]) * 60);
        print "<tr {$bg}><td><font class='date' color={$fontcolor}>['{$datum}']</font>\n{$del} {$delall} {$edit} {$pm} <a href='userdetails.php?id=" . $arr["userid"] . "' target='_blank'><font color='#" . get_user_class_color($arr['class']) . "'>" . safechar($arr['username']) . "</font></a>\n" . ($arr["donor"] == "yes" ? "<img src=pic/star.gif alt='DONOR' />\n" : "") . ($arr["warned"] == "yes" ? "<img src=" . "pic/warned.gif alt='Warned' />\n" : "") . ($arr["chatpost"] == "no" ? "<img src=pic/chatpos.gif alt='No Chat' />\n" : "") . ($arr["downloadpos"] == "no" ? "<img src=pic/downloadpos.gif alt='No Downloads' />\n" : "") . ($arr["forumpost"] == "no" ? "<img src=pic/forumpost.gif alt='No Posting' />\n" : "") . ($arr["uploadpos"] == "no" ? "<img src=pic/uploadpos.gif alt='No upload' />\n" : "") . ($arr["parked"] == "yes" ? "<img src=pic/parked.gif alt='Account Parked' />\n" : "") . "<font color={$fontcolor}> " . format_comment($arr["text"]) . "\n</font></td></tr>\n";
    }
    print "</table>";
}
?>

</body>
</html>
Exemplo n.º 11
0
    die;
} elseif ($action == "vieworiginal") {
    if (get_user_class() < UC_MODERATOR) {
        stderr("Error", "Permission denied.");
    }
    $commentid = 0 + $_GET["cid"];
    if (!is_valid_id($commentid)) {
        stderr("Error", "Invalid ID.");
    }
    $res = sql_query("SELECT c.*, t.name FROM comments AS c LEFT JOIN torrents AS t ON c.torrent = t.id WHERE c.id={$commentid}") or sqlerr(__FILE__, __LINE__);
    $arr = mysql_fetch_array($res);
    if (!$arr) {
        stderr("Error", "Invalid ID {$commentid}.");
    }
    stdhead("Original comment");
    print "<h1>Original contents of comment #{$commentid}</h1><p>\n";
    print "<table width=500 border=1 cellspacing=0 cellpadding=5>";
    print "<tr><td class=comment>\n";
    echo safechar($arr["ori_text"]);
    print "</td></tr></table>\n";
    $returnto = $_SERVER["HTTP_REFERER"];
    // $returnto = "details.php?id=$torrentid&amp;viewcomm=$commentid#$commentid";
    if ($returnto) {
        print "<p><font size=small>(<a href={$returnto}>back</a>)</font></p>\n";
    }
    stdfoot();
    die;
} else {
    stderr("Error", "Unknown action");
}
die;
Exemplo n.º 12
0
$dict = bdec(benc($dict));
// double up on the becoding solves the occassional misgenerated infohash
$dict['value']['comment'] = bdec(benc_str("In using this torrent you are bound by the '{$SITENAME}' Confidentiality Agreement By Law"));
// change torrent comment
list($ann, $info) = dict_check($dict, "announce(string):info");
unset($dict['value']['created by']);
$infohash = pack("H*", sha1($info["string"]));
// Replace punctuation characters with spaces
$torrent = str_replace("_", " ", $torrent);
$nfo = sqlesc(str_replace("\r\r\n", "\r\n", @file_get_contents($nfofilename)));
$ret = mysql_query("INSERT INTO torrents (search_text, filename, owner, visible, anonymous, info_hash, name, size, numfiles, type, descr, ori_descr, category, save_as, added, last_action, nfo) VALUES (" . implode(",", array_map("sqlesc", array(searchfield("{$shortfname} {$dname} {$torrent}"), $fname, $CURUSER["id"], "no", $anonymous, $infohash, $torrent, $totallen, count($filelist), $type, $descr, $descr, 0 + $_POST["type"], $dname))) . ", '" . get_date_time() . "', '" . get_date_time() . "', {$nfo})");
// //////new torrent upload detail sent to shoutbox//////////
if ($CURUSER["anonymous"] == 'yes') {
    $message = "New Torrent : ({$torrent}) Uploaded - Anonymous User";
} else {
    $message = "New Torrent : ({$torrent}) Uploaded by " . safechar($CURUSER["username"]) . "";
}
// ///////////////////////////END///////////////////////////////////
if (!$ret) {
    if (mysql_errno() == 1062) {
        stderr("Error", "torrent already uploaded!");
    }
    stderr("Error", "mysql puked!");
}
$id = mysql_insert_id();
@mysql_query("DELETE FROM files WHERE torrent = {$id}");
function file_list($arr, $id)
{
    foreach ($arr as $v) {
        $new[] = "({$id}," . sqlesc($v[0]) . "," . $v[1] . ")";
    }
Exemplo n.º 13
0
                       </tbody>
                       </table>
                       <?php 
        } else {
            echo '<p><b>Query OK:</b> ' . safeChar(mysql_affected_rows()) . ' rows affected.</p>';
        }
    } else {
        echo '<p><b>Query Failed:</b> ' . safeChar(mysql_error()) . '</p>';
    }
    echo '<hr />';
}
?>
<form action="<?php 
echo $_SERVER['PHP_SELF'];
?>
" method="POST">

<p>SQL Query:<br />
<textarea onFocus="this.select()" cols="60" rows="5" name="query">
<?php 
echo safechar($_POST['query']);
?>
</textarea>
</p>
<p><input type="submit" name="submitquery" value="Submit Query (Alt-S)" accesskey="S" /></p>
</form>

<?php 
// cpfooter();
end_frame();
stdfoot();
function torrenttable($records, $variant = "index")
{
    global $pic_base_url, $DEFAULTBASEURL, $config, $php_file, $page_find, $lang_off, $language, $CURUSER, $ss_uri, $waiton, $wait1, $wait2, $wait3, $wait4, $oldtorrents, $progress, $cat_ico_uri;
    $q = sql_query("select count(id) as num, YEAR(added) as year, MONTH(added) as month , DAY(added) as day FROM torrents  group by year,month,day ORDER BY day,month,year DESC") or print "error";
    while ($a = mysql_fetch_assoc($q)) {
        $split[$a["year"] . $a["month"] . $a["day"]] = $a["num"];
    }
    if ((bool) $waiton) {
        if ($CURUSER["class"] < UC_VIP) {
            $gigs = $CURUSER["uploaded"] / (1024 * 1024 * 1024);
            $ratio = $CURUSER["downloaded"] > 0 ? $CURUSER["uploaded"] / $CURUSER["downloaded"] : 0;
            if ($ratio < 0.5 || $gigs < 5) {
                $wait = $wait1;
            } elseif ($ratio < 0.65 || $gigs < 6.5) {
                $wait = $wait2;
            } elseif ($ratio < 0.8 || $gigs < 8) {
                $wait = $wait3;
            } elseif ($ratio < 0.95 || $gigs < 9.5) {
                $wait = $wait4;
            } else {
                $wait = 0;
            }
        }
    }
    if (get_user_class() >= UC_MODERATOR) {
        echo "<form method=post action=deltorrent.php?mode=delete>";
    }
    ?>
<table border="1" cellspacing=0 cellpadding=5 onMouseover="changeto(event, '#1E1E2A')" onMouseout="changeback(event, 'black')">
<tr>
<?php 
    // sorting by MarkoStamcar // modified by xuzo :))
    $oldlink = '';
    $count_get = 0;
    $char = '';
    if (!isset($wait)) {
        $wait = 0;
    }
    $description = '';
    $preres = '';
    $type = '';
    $sort = '';
    $row = '';
    foreach ($_GET as $get_name => $get_value) {
        $get_name = mysql_escape_string(strip_tags(str_replace(array("\"", "'"), array("", ""), $get_name)));
        $get_value = mysql_escape_string(strip_tags(str_replace(array("\"", "'"), array("", ""), $get_value)));
        if ($get_name != "sort" && $get_name != "type") {
            if ($count_get > 0) {
                $oldlink = $oldlink . "&amp;" . $get_name . "=" . $get_value;
            } else {
                $oldlink = $oldlink . $get_name . "=" . $get_value;
            }
            $count_get++;
        }
    }
    if ($count_get > 0) {
        $oldlink = $oldlink . "&amp;";
    }
    if (isset($_GET["sort"]) && $_GET["sort"] == "1") {
        if (isset($_GET["type"]) && $_GET["type"] == "desc") {
            $link1 = "asc";
        } else {
            $link1 = "desc";
        }
    }
    if (isset($_GET["sort"]) && $_GET["sort"] == "2") {
        if (isset($_GET["type"]) && $_GET["type"] == "desc") {
            $link2 = "asc";
        } else {
            $link2 = "desc";
        }
    }
    if (isset($_GET["sort"]) && $_GET["sort"] == "3") {
        if (isset($_GET["type"]) && $_GET["type"] == "desc") {
            $link3 = "asc";
        } else {
            $link3 = "desc";
        }
    }
    if (isset($_GET["sort"]) && $_GET["sort"] == "4") {
        if (isset($_GET["type"]) && $_GET["type"] == "desc") {
            $link4 = "asc";
        } else {
            $link4 = "desc";
        }
    }
    if (isset($_GET["sort"]) && $_GET["sort"] == "5") {
        if (isset($_GET["type"]) && $_GET["type"] == "desc") {
            $link5 = "asc";
        } else {
            $link5 = "desc";
        }
    }
    if (isset($_GET["sort"]) && $_GET["sort"] == "6") {
        if (isset($_GET["type"]) && $_GET["type"] == "desc") {
            $link6 = "asc";
        } else {
            $link6 = "desc";
        }
    }
    if (isset($_GET["sort"]) && $_GET["sort"] == "7") {
        if (isset($_GET["type"]) && $_GET["type"] == "desc") {
            $link7 = "asc";
        } else {
            $link7 = "desc";
        }
    }
    if (isset($_GET["sort"]) && $_GET["sort"] == "8") {
        if (isset($_GET["type"]) && $_GET["type"] == "desc") {
            $link8 = "asc";
        } else {
            $link8 = "desc";
        }
    }
    if (isset($_GET["sort"]) && $_GET["sort"] == "9") {
        if (isset($_GET["type"]) && $_GET["type"] == "desc") {
            $link9 = "asc";
        } else {
            $link9 = "desc";
        }
    }
    if (isset($_GET["sort"]) && $_GET["sort"] == "10") {
        if (isset($_GET["type"]) && $_GET["type"] == "desc") {
            $link10 = "asc";
        } else {
            $link10 = "desc";
        }
    }
    if (empty($link1)) {
        $link1 = "asc";
    }
    // for torrent name
    if (empty($link2)) {
        $link2 = "desc";
    }
    if (empty($link3)) {
        $link3 = "desc";
    }
    if (empty($link4)) {
        $link4 = "desc";
    }
    if (empty($link5)) {
        $link5 = "desc";
    }
    if (empty($link6)) {
        $link6 = "desc";
    }
    if (empty($link7)) {
        $link7 = "desc";
    }
    if (empty($link8)) {
        $link8 = "desc";
    }
    if (empty($link9)) {
        $link9 = "desc";
    }
    if (empty($link10)) {
        $link10 = "desc";
    }
    ?>
<td class="colhead" align="center"><?php 
    echo $language['type'];
    ?>
</td>
<td class="colhead" align="left"><a href="browse.php?<?php 
    echo $oldlink;
    ?>
sort=1&amp;type=<?php 
    echo $link1;
    ?>
"><?php 
    echo $language['name'];
    ?>
</a></td>
    <td class="colhead" align="left"><?php 
    echo $language['subs'];
    ?>
</td>
    <?php 
    echo $variant == 'index' ? '<td class=colhead align=center><a href="bookmarks.php"><img src="' . $pic_base_url . 'bookmark.gif"  border="0" alt="Bookmark" title="Bookmark" /></a></td>' : '';
    if ((bool) $waiton) {
        print "<td class=\"colhead\" align=\"center\">" . $language['wait'] . "</td>\n";
    }
    if ($oldtorrents) {
        ?>
    <td class="colhead" align="center"><a href="browse.php?<?php 
        echo $oldlink;
        ?>
sort=4&amp;type=<?php 
        echo $link4;
        ?>
">&nbsp;&nbsp;<img src=pic/added.gif border=0 alt=TTL /></a></td>
    <?php 
    }
    ?>
    <td class="colhead" align="left"><a href="browse.php?<?php 
    echo $oldlink;
    ?>
sort=2&amp;type=<?php 
    echo $link2;
    ?>
">&nbsp;&nbsp;&nbsp;<img src=pic/files.gif border=0 alt=Files /></a></td>
    <td class="colhead" align="left"><a href="browse.php?<?php 
    echo $oldlink;
    ?>
sort=3&amp;type=<?php 
    echo $link3;
    ?>
"><img src=pic/comments.gif border=0 alt=Comments /></a></td>
<td class="colhead" align="center"><img src="pic/download.gif" border=0 alt=download /></td>
<td class="colhead" align="center"><?php 
    echo $language['prog'];
    ?>
</td>
<td class="colhead" align="center"><a href="browse.php?<?php 
    echo $oldlink;
    ?>
sort=6&amp;type=<?php 
    echo $link6;
    ?>
"><?php 
    echo $language['size'];
    ?>
</a></td>
<td class="colhead" align="center"><a href="browse.php?<?php 
    echo $oldlink;
    ?>
sort=7&amp;type=<?php 
    echo $link7;
    ?>
">&nbsp;&nbsp;<img src=pic/top2.gif border=0 alt=Snatched /></a></td>
<td class="colhead" align="center"><a href="browse.php?<?php 
    echo $oldlink;
    ?>
sort=8&amp;type=<?php 
    echo $link8;
    ?>
">&nbsp;&nbsp;<img src=pic/arrowup2.gif border="0" alt=Seeders />&nbsp;&nbsp;</a></td>
<td class="colhead" align="center"><a href="browse.php?<?php 
    echo $oldlink;
    ?>
sort=9&amp;type=<?php 
    echo $link9;
    ?>
">&nbsp;&nbsp;<img src=pic/arrowdown2.gif border="0" alt=Leechers />&nbsp;&nbsp;</a></td>
<?php 
    if ($variant == "index") {
        echo "<td class=\"colhead\" align=\"center\"><a href=\"browse.php?{$oldlink}sort=9&amp;type={$link9}\"><img border=0 src=\"/pic/upper.gif\" alt=\"Upped By\" /></a></td>\n";
    }
    if (get_user_class() >= UC_MODERATOR) {
        echo "<td class=\"colhead\" align=center>" . $language['delete'] . "</td>\n";
    }
    echo "</tr>\n";
    foreach ($records as $row) {
        // while ($row = mysql_fetch_assoc($res)) {
        if ($CURUSER['split'] == "yes" && $_SERVER["REQUEST_URI"] == "/browse.php" && !isset($_GET["page"])) {
            /**
             *
             * @author StarionTurbo
             * @copyright 2007
             * @modname Show torrents by day
             * @version v1.0
             */
            /**
             * * Make some date varibles *
             */
            $day_added = $row['added'];
            $day_show = strtotime($day_added);
            $thisdate = date('Y-m-d', $day_show);
            $thisdate2 = date("Ynj", $day_show);
            /**
             * * If date already exist, disable $cleandate varible *
             */
            // if($thisdate==$prevdate){
            if (isset($prevdate) && $thisdate == $prevdate) {
                $cleandate = '';
                /**
                 * * If date does not exist, make some varibles *
                 */
            } else {
                $num = isset($split[$thisdate2]) ? $split[$thisdate2] : 0;
                $day_added = 'Upped on ' . date('l, j. M', strtotime($row['added']));
                // You can change this to something else
                $cleandate = "<tr><td colspan=\"15\"><b>{$day_added} (" . $num . " torrent" . ($num > 1 ? "s" : "") . ")</b></td></tr>\n";
                // This also...
            }
            /**
             * * Prevent that "torrents added..." wont appear again with the same date *
             */
            $prevdate = $thisdate;
            $man = array('Jan' => 'January', 'Feb' => 'February', 'Mar' => 'March', 'Apr' => 'April', 'May' => 'May', 'Jun' => 'June', 'Jul' => 'July', 'Aug' => 'August', 'Sep' => 'September', 'Oct' => 'October', 'Nov' => 'November', 'Dec' => 'December');
            foreach ($man as $eng => $ger) {
                $cleandate = str_replace($eng, $ger, $cleandate);
            }
            $dag = array('Mon' => 'Monday', 'Tues' => 'Tuesday', 'Wednes' => 'Wednesday', 'Thurs' => 'Thursday', 'Fri' => 'Friday', 'Satur' => 'Saturday', 'Sun' => 'Sunday');
            foreach ($dag as $eng => $ger) {
                $cleandate = str_replace($eng . 'day', $ger . '', $cleandate);
            }
            /**
             * * If torrents not listed by added date *
             */
            if ($row["sticky"] == "no") {
                // delete this line if you dont have sticky torrents or you want to display the addate for them also
                if (!isset($_GET['sort']) && !isset($_GET['d'])) {
                    echo $cleandate . "\n";
                }
            }
        }
        //ends the condition
        // ///standard sticky torrent hlight////////
        /*
                    $id = $row["id"];
                    if ($row["sticky"] == "yes"){
                    echo("<tr class=highlight>\n");
                    } else {
                    echo("<tr>\n");
                    }*/
        // ////End Sticky only highlight/////////////////
        // /////highlight torrenttable////////////////
        $id = $row['id'];
        if ($CURUSER["ttablehl"] != "yes") {
            echo '<tr>';
        } else {
            $countstatsclr = ($CURUSER['stylesheet'] == "1" ? "teal" : "") . ($CURUSER['stylesheet'] == "2" ? "teal" : "") . ($CURUSER['stylesheet'] == "3" ? "teal" : "") . ($CURUSER['stylesheet'] == "4" ? "teal" : "") . ($CURUSER['stylesheet'] == "5" ? "teal" : "") . ($CURUSER['stylesheet'] == "6" ? "teal" : "") . ($CURUSER['stylesheet'] == "7" ? "teal" : "");
            $nukedclr = ($CURUSER['stylesheet'] == "1" ? "red" : "") . ($CURUSER['stylesheet'] == "2" ? "red" : "") . ($CURUSER['stylesheet'] == "3" ? "red" : "") . ($CURUSER['stylesheet'] == "4" ? "red" : "") . ($CURUSER['stylesheet'] == "5" ? "red" : "") . ($CURUSER['stylesheet'] == "6" ? "red" : "") . ($CURUSER['stylesheet'] == "7" ? "red" : "");
            $sceneclr = ($CURUSER['stylesheet'] == "1" ? "orange" : "") . ($CURUSER['stylesheet'] == "2" ? "orange" : "") . ($CURUSER['stylesheet'] == "3" ? "orange" : "") . ($CURUSER['stylesheet'] == "4" ? "orange" : "") . ($CURUSER['stylesheet'] == "5" ? "orange" : "") . ($CURUSER['stylesheet'] == "6" ? "orange" : "") . ($CURUSER['stylesheet'] == "7" ? "orange" : "");
            $requestclr = ($CURUSER['stylesheet'] == "1" ? "#777777" : "") . ($CURUSER['stylesheet'] == "2" ? "#777777" : "") . ($CURUSER['stylesheet'] == "3" ? "#777777" : "") . ($CURUSER['stylesheet'] == "4" ? "#777777" : "") . ($CURUSER['stylesheet'] == "5" ? "#777777" : "") . ($CURUSER['stylesheet'] == "6" ? "#777777" : "") . ($CURUSER['stylesheet'] == "7" ? "#777777" : "");
            $stickyclr = ($CURUSER['stylesheet'] == "1" ? "gold" : "") . ($CURUSER['stylesheet'] == "2" ? "gold" : "") . ($CURUSER['stylesheet'] == "3" ? "gold" : "") . ($CURUSER['stylesheet'] == "4" ? "gold" : "") . ($CURUSER['stylesheet'] == "5" ? "gold" : "") . ($CURUSER['stylesheet'] == "6" ? "gold" : "") . ($CURUSER['stylesheet'] == "7" ? "gold" : "");
            $hl = ($row['countstats'] == "no" && $row['nuked'] == "no" ? $countstatsclr : "") . ($row['scene'] == "yes" && $row['request'] == "no" && $row['nuked'] == "no" ? $sceneclr : "") . ($row['request'] == "yes" && $row['scene'] == "no" && $row['nuked'] == "no" ? $requestclr : "") . ($row['sticky'] == "yes" ? $stickyclr : "") . ($row['nuked'] == "yes" ? $nukedclr : "");
            // //comment out to use gif indicate for seeding/leeching lower//////
            $req = sql_query("SELECT torrent, seeder FROM peers WHERE userid={$CURUSER['id']} AND torrent={$id}") or sqlerr();
            if (mysql_num_rows($req) > 0) {
                $peerid = mysql_fetch_assoc($req);
            }
            if ($peerid['seeder'] == 'yes' && $peerid['torrent'] == $id) {
                $hl = '#00AB3F';
            }
            if ($peerid['seeder'] == 'no' && $peerid['torrent'] == $id) {
                $hl = '#b22222 ';
            }
            $bgc = "bgcolor=" . $hl . "";
            echo '<tr ' . $bgc . '>';
        }
        // //////////////////end highlight torrenttable - comment out to use standard or gif indicator code lower/////////
        echo "<td align=center style='padding: 0px'>";
        // cached category icons
        include 'include/cache/categories.php';
        foreach ($categories as $cat) {
            if ($cat["id"] == $row["category"]) {
                echo "<a href=\"browse.php?cat=" . $cat["id"] . "\"><img src=\"pic/caticons/{$cat_ico_uri}/" . $cat["image"] . "\" border=\"0\" title=\"category " . $cat["name"] . "\" /></a>";
            }
        }
        echo "</td>\n";
        // end cat icon cache
        // ///////added under torrent name - uncomment out to use////
        //$added = "$row[added] (" . get_elapsed_time(sql_timestamp_to_unix_timestamp($row["added"])) . " ago)";
        // ////////////////////////////////////end added///////////
        $genre = safeChar($row["newgenre"]);
        $nukereason = safeChar($row["nukereason"]);
        $scene = $row["scene"] == "yes" ? "&nbsp;<img src='pic/scene.gif' border=0 title='Scene' alt='Scene'/>" : "";
        $request = $row["request"] == "yes" ? "&nbsp;<img src='pic/request.gif' border=0 title='Request' alt='Request'/>" : "";
        $nuked = $row["nuked"] == "yes" ? "&nbsp;<img src='pic/nuked.gif' border=0 title='nuked' alt='Nuked'/>" : "";
        $newtag = sql_timestamp_to_unix_timestamp($row['added']) >= $_SESSION['browsetime'] ? '&nbsp;<img src=' . $pic_base_url . 'new.gif alt=NEW!>' : '';
        $viponly = $row["vip"] == "yes" ? "<img src='pic/star.gif' border=0 title='Vip Torrent' />" : "";
        // ///////freeslot in use on browse//////////
        $freeimg = '<img src="/pic/freedownload.gif" border=0"/>';
        $doubleimg = '<img src="/pic/doubleseed.gif" border=0"/>';
        $isdlfree = $row['doubleslot'] == 'yes' ? ' ' . $doubleimg . ' slot in use' : '';
        $isdouble = $row['freeslot'] == 'yes' ? ' ' . $freeimg . ' slot in use' : '';
        $uclass = '';
        // torrent name
        $dispname = $CURUSER["view_uclass"] == 'no' ? safeChar($row["name"]) : "<font color=\"#" . get_user_class_color($row["uclass"]) . "\">" . safeChar($row["name"]) . "</font>";
        // checked mod by pdq
        $checked = !empty($row['checked_by']) && $CURUSER['class'] >= UC_MODERATOR ? "&nbsp;<img src='" . $pic_base_url . "mod.gif' width='15' border='0' title='Checked - by " . safeChar($row['checked_by']) . "' />" : "";
        $sticky = $row["sticky"] == "yes" ? "<img src='pic/sticky.gif' border='0' alt='sticky' title='Sticky'>" : "";
        $countstats = $row["countstats"] == "no" ? "<img src='pic/freedownload.gif' border='0' alt='Free' title='Free Torrent'>" : "";
        $half = $row["half"] == "yes" ? "<img src='pic/halfdownload.png' border='0' alt='Half Leech' title='Half Leech'>" : "";
        // ///
        ///////////small description
        if (!empty($row['description'])) {
            $description = "(" . safeChar($row["description"]) . ")";
        } else {
            $description = "";
        }
        // ////////////////////////////////////////////////////////////////////////
        // ////////////////////////////////////////////////////////////////////////
        if ($row["poster"]) {
            $poster = "<img src=" . $row["poster"] . " width=150 border=0 />";
        }
        if ($row["descr"]) {
            $descr = ereg_replace("\"", "&quot;", readMore($row["descr"], 350, "details.php?id=" . $row["id"] . "&amp;hit=1"));
        }
        // userclass color mod ==end
        $dispname = ereg_replace('\\.', ' ', $dispname);
        echo "<td align=left><a href=details.php?id={$id} onmouseover=\"Tip('{$poster}');\" onmouseout=\"UnTip();\"><b>" . CutName($dispname, $char) . "</b></a>&nbsp;<a href=\"javascript:klappe_descr('descr" . $row["id"] . "');\" ><img src=\"/pic/plus.gif\" border=\"0\" title=\"Show torrent info in this page\"/></a>&nbsp;{$sticky}&nbsp;{$request}&nbsp;{$scene}&nbsp;{$nuked}<br />{$nukereason}&nbsp;{$newtag}&nbsp;{$viponly}&nbsp;{$countstats}&nbsp;{$half}&nbsp;{$description}\n";
        // //////////multiplicator///
        if ($row["multiplicator"] == "2") {
            $multiplicator = "&nbsp;<img src=\"pic/multi2.gif\" title=\"X2 Upload\">&nbsp;";
        } elseif ($row["multiplicator"] == "3") {
            $multiplicator = "&nbsp;<img src=\"pic/multi3.gif\" title=\"X3 Upload\">&nbsp;";
        } elseif ($row["multiplicator"] == "4") {
            $multiplicator = "&nbsp;<img src=\"pic/multi4.gif\" title=\"X4 Upload\">&nbsp;";
        } elseif ($row["multiplicator"] == "5") {
            $multiplicator = "&nbsp;<img src=\"pic/multi5.gif\" title=\"X5 Upload\">&nbsp;";
        }
        if ($row["multiplicator"] != "0") {
            echo "" . $multiplicator . "";
        }
        if ($row["pweb"] > 0) {
            echo "<img border=0 src=pic/seeder.gif onmouseover=\"Tip('web seeded by " . $row["pweb"] . " users');\" onmouseout=\"UnTip();\"/>";
        }
        // ////torrent added/genre/checked////
        //echo ($added);
        echo $genre;
        echo $checked;
        echo $isdlfree . '' . $isdouble;
        /////////////////subtitles
        $movie_cat = array("3", "5", "10", "11");
        //add here your movie category
        print "<td align=\"center\" nowrap=\"nowrap\" >\n";
        if (in_array($row["category"], $movie_cat) && !empty($row["subs"])) {
            $subs_array = explode(",", $row["subs"]);
            include 'cache/subs.php';
            foreach ($subs_array as $k => $sid) {
                foreach ($subs as $sub) {
                    if ($sub["id"] == $sid) {
                        print "<img border=\"0\" width=\"16px\" style=\"padding:3px;\"src=\"" . $sub["pic"] . "\" alt=\"" . $sub["name"] . "\" title=\"" . $sub["name"] . "\" />";
                    }
                }
            }
        } else {
            echo "---";
        }
        echo "</td>";
        ///////////////////end subs/////////
        //////////////////bookmarks/////////
        $bookmarked = !isset($row["bookmark"]) ? '<a href=\'bookmark.php?torrent=' . $id . '&amp;action=add\'><img src=\'' . $pic_base_url . 'bookmark.gif\' border=\'0\' alt=\'Bookmark it!\' title=\'Bookmark it!\' /></a>' : '<a href="bookmark.php?torrent=' . $id . '&amp;action=delete"><img src=\'' . $pic_base_url . 'plus2.gif\' border=\'0\' alt=\'Delete Bookmark!\' title=\'Delete Bookmark!\' /></a>';
        echo $variant == 'index' ? '<td align=right>' . $bookmarked . '</td>' : '';
        // == wait times on/off from admincp
        if ((bool) $waiton) {
            if ((int) $wait > 0) {
                $elapsed = floor((gmtime() - strtotime($row["added"])) / 3600);
                if ($elapsed < $wait) {
                    $color = dechex(floor(127 * ($wait - $elapsed) / 48 + 128) * 65536);
                    print "<td align=center nowrap=\"nowrap\"><a href=\"faq.php#dl8\"><font color=\"{$color}\">" . number_format($wait - $elapsed) . " h</font></a></td>\n";
                } else {
                    print "<td align=center>None</td>\n";
                }
            } else {
                print "<td align=center>None</td>\n";
            }
        }
        /////////////////ttl on/off from admincp
        if ($oldtorrents) {
            $ttl = 28 * 24 - floor((gmtime() - sql_timestamp_to_unix_timestamp($row["added"])) / 3600);
            if ($ttl == 1) {
                $ttl .= "<br />hour";
            } else {
                $ttl .= "<br />hours";
            }
            echo '<td align=center>' . $ttl . '</td>';
        }
        /////////////////////////////////
        if (isset($row['type']) && $row['type'] == "single") {
            // if ($row["type"] == "single")
            echo "<td align=\"right\">" . $row["numfiles"] . "</td>\n";
        } else {
            if ($variant == "index") {
                echo "<td align=\"right\"><b><a href=\"details.php?id={$id}&amp;hit=1\">" . $row["numfiles"] . "</a></b></td>\n";
            }
        }
        //////////////////////////////////////////
        if (!$row["comments"]) {
            echo "<td align=\"right\">" . $row["comments"] . "</td>\n";
        } else {
            if ($variant == "index") {
                echo "<td align=\"right\"><b><a href=\"details.php?id={$id}&amp;hit=1&amp;tocomm=1\">" . $row["comments"] . "</a></b></td>\n";
            } else {
                echo "<td align=\"right\"><b><a href=\"details.php?id={$id}&amp;page=0#startcomments\">" . $row["comments"] . "</a></b></td>\n";
            }
        }
        // ////Hide the quick download if download disabled/////
        if ($CURUSER["downloadpos"] == 'no') {
            echo "<td class=embedded><img src=" . $pic_base_url . "downloadpos.gif alt='no download' style='margin-left: 4pt' /></td>\n";
        } else {
            if ($CURUSER["downloadpos"] == 'yes') {
                echo "<td align=\"center\"><a href=\"/download.php/{$id}/" . rawurlencode($row["filename"]) . "\"><img src=pic/download.gif border=0 alt=Download /></a></td>\n";
            }
        }
        // Progressbar Mod
        // /comment out to remove indicator on browse//////
        $seedersProgressbar = array();
        $leechersProgressbar = array();
        $progressPerTorrent = 0;
        $iProgressbar = 0;
        if (isset($progress[$row["id"]])) {
            foreach ($progress[$row["id"]] as $rowProgressbar) {
                $progressPerTorrent += sprintf("%.2f", 100 * (1 - $rowProgressbar["to_go"] / $rowProgressbar["size"]));
                $iProgressbar++;
            }
        }
        if ($iProgressbar == 0) {
            $iProgressbar = 1;
        }
        $progressTotal = sprintf("%.2f", $progressPerTorrent / $iProgressbar);
        $picProgress = get_percent_completed_image(floor($progressTotal)) . "<br/>(" . round($progressTotal) . "%)";
        echo "<td align=center>{$picProgress}</td>\n";
        // End Progress Bar mod//////////////////////////
        echo "<td align=center>" . str_replace(" ", "<br/>", prefixed($row["size"])) . "</td>\n";
        $_s = "";
        if ($row["times_completed"] != 1) {
            $_s = "s";
        }
        if (get_user_class() >= UC_MODERATOR) {
            echo "<td align=center>" . ($row["times_completed"] > 0 ? "<a href=snatches.php?id={$id}>" . safeChar(number_format($row["times_completed"])) . "<br/>time{$_s}</a>" : "0 times") . "</td>\n";
        } else {
            echo "<td align=center>" . ($row["times_completed"] > 0 ? "" . safeChar(number_format($row["times_completed"])) . "<br/>time{$_s}</a>" : "0 times") . "</td>\n";
        }
        if ($row["seeders"]) {
            if ($variant == "index") {
                if ($row["leechers"]) {
                    $ratio = $row["seeders"] / $row["leechers"];
                } else {
                    $ratio = 1;
                }
                echo "<td align=right><b><a href=details.php?id={$id}&amp;hit=1#seeders><font color=" . get_slr_color($ratio) . ">" . $row["seeders"] . "</font></a></b></td>\n";
            } else {
                echo "<td align=\"right\"><b><a class=\"" . linkcolor($row["seeders"]) . "\" href=\"details.php?id={$id}#seeders\">" . $row["seeders"] . "</a></b></td>\n";
            }
        } else {
            echo "<td align=\"right\"><span class=\"" . linkcolor($row["seeders"]) . "\">" . $row["seeders"] . "</span></td>\n";
        }
        $peerlink = '';
        if ($row["leechers"]) {
            if ($variant == "index") {
                echo "<td align=right><b><a href=details.php?id={$id}&amp;hit=1&amp;#leechers>" . number_format($row["leechers"]) . ($peerlink ? "</a>" : "") . "</b></td>\n";
            } else {
                echo "<td align=\"right\"><b><a class=\"" . linkcolor($row["leechers"]) . "\" href=\"details.php?id={$id}#leechers\">" . $row["leechers"] . "</a></b></td>\n";
            }
        } else {
            echo "<td align=\"right\">0</td>\n";
        }
        // //Anonymous and delete torrent begin
        if ($variant == "index") {
            if ($row["anonymous"] == "yes") {
                echo "<td align=center><i>Anonymous</i></td>\n";
                if (get_user_class() >= UC_MODERATOR) {
                    echo "<td align=\"center\" bgcolor=\"#FF0000\"><input type=\"checkbox\" name=\"delete[]\" value=\"" . safeChar($id) . "\" /></td>\n";
                }
            } else {
                if ($variant == "index") {
                    if ($CURUSER["view_uclass"] == 'yes') {
                        echo "<td align=center>" . (isset($row["username"]) ? "<a href=userdetails.php?id=" . $row["owner"] . "><font color=\"#" . get_user_class_color($row["uclass"]) . "\">" . safeChar($row["username"]) . "</font></a>" : "<i>(unknown)</i>") . "</td>\n";
                    } else {
                        echo "<td align=center>" . (isset($row["username"]) ? "<a href=userdetails.php?id=" . $row["owner"] . "><b>" . safechar($row["username"]) . "</b></a>" : "<i>(unknown)</i>") . "</td>\n";
                    }
                }
                // ///////modified Delete torrent with anonymous uploader
                if (get_user_class() >= UC_MODERATOR) {
                    echo "<td align=\"center\" bgcolor=\"#FF0000\"><input type=\"checkbox\" name=\"delete[]\" value=\"" . safeChar($id) . "\" /></td>\n";
                }
            }
        }
        echo "</tr>\n";
        echo "<tr id=\"kdescr" . $row["id"] . "\"style=\"display:none;\"><td width=\"90%\"  colspan=\"" . (get_user_class() >= UC_MODERATOR ? "15" : "13") . "\">" . $descr . "</td></tr>\n";
    }
    if (get_user_class() >= UC_MODERATOR) {
        echo "<tr ><td align=\"center\" colspan=16><input type=submit value=Delete /></td></tr>\n";
    }
    echo "</table></form>\n";
}
Exemplo n.º 15
0
    header("HTTP/1.0 404 Not Found");
    // moddifed logginorreturn by retro//Remember to change the following line to match your server
    print "<html><h1>Not Found</h1><p>The requested URL /{$_SERVER['PHP_SELF']} was not found on this server.</p><hr /><address>Apache/1.1.11 (xxxxx) Server at " . $_SERVER['SERVER_NAME'] . " Port 80</address></body></html>\n";
    die;
}
//optimized, secured, added options, fixed some typos by Alex2005 for TBDEV.NET\\
if (get_user_class() < UC_SYSOP) {
    hacker_dork("Db Admin - Nosey C**t !");
}
$postperpage = 0 + $_GET["postperpage"];
$returnto = $_POST["returnto"];
if (isset($_POST["delmp"])) {
    $do = "DELETE FROM messages WHERE id IN (" . implode(", ", $_POST['delmp']) . ")";
    $res = sql_query($do);
    if ($returnto) {
        header("Location: " . safechar($returnto));
        die;
    } else {
        header("Refresh: 0; url=/msgspy.php");
        stderr("Success", "The messages where successfully deleted!");
    }
}
//===start page===//
stdhead("Administrative message overview");
?>
<script language="Javascript" type="text/javascript">
<!-- Begin
var checkflag = "false";
var marked_row = new Array;
function check(field) {
if (checkflag == "false") {
Exemplo n.º 16
0
<td class=tabletorrent align=center width="1%">Marked</td>
<td class=tabletorrent align=center width="1%">Announced</td>
<td class=tabletorrent align=center width="1%">Upload</td>
<td class=tabletorrent align=center width="1%">Download</td>
<td class=tabletorrent align=center width="1%">Seedtime</td>
<td class=tabletorrent align=center width="1%">leechtime</td>
<td class=tabletorrent align=center width="1%">Start Date</td>
<td class=tabletorrent align=center width="1%">End Date</td>
<td class=tabletorrent align=center width="1%">Seeding</td>
<td class=tabletorrent align=center width="1%">Delete</td>
</tr>
<?php 
    while ($row = mysql_fetch_assoc($result)) {
        echo '<tr>' . '<td><a href="/userdetails.php?id=' . $row['userid'] . '"><b>' . $row['username'] . '</b></a></td>';
        $smallname = substr(safechar($row["name"]), 0, 25);
        if ($smallname != safechar($row["name"])) {
            $smallname .= '...';
        }
        echo '<td align=center><a href="/details.php?id=' . $row['torrentid'] . '"><b>' . $smallname . '</b></a></td>', '<td align=center><b>' . $row['hit_and_run'] . '</b></td>' . '<td align=center><b>' . $row['mark_of_cain'] . '</b></td>' . '<td align=center><b>' . $row['timesann'] . '</b></td>' . '<td align=center><b>' . prefixed($row['uploaded']) . '</b></td>' . '<td align=center><b>' . prefixed($row['downloaded']) . '</b></td>' . '<td align=center><b>' . get_snatched_color($row["seedtime"]) . '</b></td>' . '<td align=center>' . mkprettytime($row["leechtime"]) . '</td>' . '<td align=center><nobr><b>' . $row['start_date'] . '</b></td>';
        if ($row['complete_date'] > 0) {
            echo '<td align=center><nobr><b>' . "" . get_elapsed_time(sql_timestamp_to_unix_timestamp($row[complete_date])) . " ago" . '</b></td>';
        } else {
            echo '<td align=center><nobr><b><font color=red>Not Completed</font></b></td>';
        }
        echo '<td align=center><b>' . ($row['seeder'] == 'yes' ? "<img src=/pic/online.gif>" : "<img src=/pic/offline.gif>") . '</b></td>' . '</td>';
        //}
        if (get_user_class() >= UC_SYSOP) {
            print "<td align=center><font size=\"-2\">[<a class=altlink href=delsnatch.php?action=delete&id=" . $row['id'] . "&returnto=" . urlencode($_SERVER['PHP_SELF']) . "><b>Delete</b></a>]</font></td></tr>";
        } else {
            print "<td align=center><b><font size=\"-2\">[Not Allowed]</font></b></td></tr>";
        }
Exemplo n.º 17
0
function offcommenttable($rows)
{
    global $CURUSER, $HTTP_SERVER_VARS;
    begin_main_frame();
    begin_frame();
    $count = 0;
    $count2 = '';
    $id = '';
    foreach ($rows as $row) {
        // =======change colors
        if ($count2 == 0) {
            $count2 = $count2 + 1;
            $class = "clearalt6";
        } else {
            $count2 = 0;
            $class = "clearalt7";
        }
        print "<br>";
        begin_table(true);
        print "<tr><td class=colhead colspan=2><p class=sub><a name=comment_" . $row["id"] . ">#" . $row["id"] . "</a> by: ";
        if (isset($row["username"])) {
            $username = $row["username"];
            $ratres = sql_query("SELECT uploaded, downloaded from users where username='******'");
            $rat = mysql_fetch_array($ratres);
            if ($rat["downloaded"] > 0) {
                $ratio = $rat['uploaded'] / $rat['downloaded'];
                $ratio = number_format($ratio, 3);
                $color = get_ratio_color($ratio);
                if ($color) {
                    $ratio = "<font color={$color}>{$ratio}</font>";
                }
            } else {
                if ($rat["uploaded"] > 0) {
                    $ratio = "Inf.";
                } else {
                    $ratio = "---";
                }
            }
            $title = $row["title"];
            if ($title == "") {
                $title = get_user_class_name($row["class"]);
            } else {
                $title = safechar($title);
            }
            print "<a name=comm" . $row["id"] . " href=userdetails.php?id=" . $row["user"] . "><b>" . safechar($row["username"]) . "</b></a>" . ($row["donor"] == "yes" ? "<img src=pic/star.gif alt='Donor'>" : "") . ($row["warned"] == "yes" ? "<img src=" . "pic/warned.gif alt=\"Warned\">" : "") . " ({$title}) (ratio: {$ratio})\n";
        } else {
            print "<a name=\"comm" . $row["id"] . "\"><i>(orphaned)</i></a>\n";
        }
        print " at " . $row["added"] . " GMT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . ($row["user"] == $CURUSER["id"] || get_user_class() >= UC_MODERATOR ? "[ <a href=offcomment.php?action=edit&amp;cid={$row['id']}>Edit</a> ] " : "") . (get_user_class() >= UC_MODERATOR ? "[ <a href=offcomment.php?action=delete&amp;cid={$row['id']}>Delete</a> ]" : "") . ($row["editedby"] && get_user_class() >= UC_MODERATOR ? "" : "") . " [ <a href=userdetails.php?id=" . $row["user"] . ">Profile</a> ] [ <a href=sendmessage.php?receiver=" . $row["user"] . ">PM</a> ] [ <a href=report.php?type=Offer_Comment&id={$row['id']}>Report</a> ]</p>\n";
        $avatar = $CURUSER["avatars"] == "yes" ? safechar($row["avatar"]) : "";
        if (!$avatar) {
            $avatar = "pic/default_avatar.gif";
        }
        $text = format_comment($row["text"]);
        if ($row["editedby"]) {
            $text .= "<p><font size=1 class=small>Edited by <a href=userdetails.php?id={$row['editedby']}><b>{$row['username']}</b></a>  {$row['editedat']} GMT</font></p>\n";
        }
        print "</td></tr><tr valign=top><td align=center width=150 class={$class}><img width=150 src={$avatar}></td><td class={$class}>{$text}</td></tr>\n";
        end_table();
    }
    end_frame();
    end_main_frame();
    // stdfoot();
}
Exemplo n.º 18
0
    }
    $message = '<h1>Success! <b>' . $arr_name['username'] . '</b> deleted from your shit list!</h1>';
}
// === default page
stdhead("Shit list for " . $CURUSER['username']);
echo $message . '<br><table width=750 border=0 cellspacing=0 cellpadding=0><tr><td class=colhead align=center valigh=top><h1>Shit List for ' . $CURUSER['username'] . '</h1>' . '<img src=pic/smilies/shit.gif alt=shit> shittiest at the top <img src=pic/smilies/shit.gif alt=shit></td></tr>' . '<tr><td class=embedded><table width=750 border=1 cellspacing=0 cellpadding=5><tr><td>';
$i = 0;
$res = mysql_query("SELECT s.suspect as id, s.text, s.shittyness, s.added AS shit_list_added, u.username AS name, u.added, u.class, u.avatar, u.donor, u.warned, u.enabled, u.last_access FROM shit_list AS s LEFT JOIN users as u ON s.suspect = u.id WHERE userid={$CURUSER['id']} ORDER BY shittyness DESC") or sqlerr(__FILE__, __LINE__);
if (mysql_num_rows($res) == 0) {
    $shit_list = '<p align=center>Your shit list is empty.</p>';
} else {
    while ($shit_list = mysql_fetch_array($res)) {
        $class_name = get_user_class_name($shit_list['class']);
        $poop = 1;
        while ($poop <= $shit_list['shittyness']) {
            $shit .= ' <img src=pic/smilies/shit.gif title="' . $shit_list['shittyness'] . ' out of 10 on the sittyness scale">';
            $poop++;
        }
        $main = '<a class=altlink href=userdetails.php?id=' . $shit_list['id'] . '><b>' . $shit_list['name'] . '</b></a>' . get_user_icons($shit_list) . '<b> [ ' . $class_name . ' ]</b> ' . $shit . '<br><b>joined:</b> ' . $shit_list['added'] . ' [ ' . get_elapsed_time(sql_timestamp_to_unix_timestamp($shit_list['added'])) . ' ago ]' . '<br><b>added to shit list:</b> ' . $shit_list['shit_list_added'] . ' [ ' . get_elapsed_time(sql_timestamp_to_unix_timestamp($shit_list['shit_list_added'])) . ' ago ]<br>' . '<b>last seen:</b> ' . display_date_time($shit_list['last_access']) . ' [ ' . get_elapsed_time(sql_timestamp_to_unix_timestamp($shit_list['last_access'])) . ' ago ]<hr>' . format_comment($shit_list['text']);
        $buttons = '<br><a class=altlink href=?action=delete&shit_list_id=' . $shit_list['id'] . '>remove</a>' . '<br><br><a class=altlink href=sendmessage.php?receiver=' . $shit_list['id'] . '>PM</a>';
        $avatar = !$shit_list['avatar'] ? 'pic/default_avatar.gif' : safechar($shit_list['avatar']);
        $avatar = $CURUSER['avatars'] == 'yes' ? $avatar : '';
        echo $i % 2 == 0 ? '<table width=100% hight=100%><tr><td width=50% align=center>' : '<td width=50% align=center hight=100%>';
        echo '<table width=100% hight=100%><tr valign=top><td width=80 align=center valign=top>' . ($avatar ? '<img width=80px src=' . $avatar . '>' : '') . '</td><td><table width=420 hight=100%><tr><td class=embedded>' . $main . '</td>' . '<td class=embedded valign=top align=center>' . $buttons . '</td></tr></table></td></tr></td></tr></table>';
        echo $i % 2 == 1 ? '</td></tr></table>' : '</td>';
        $shit = '';
        $i++;
    }
}
echo ($i % 2 == 1 ? '<td width=50%>&nbsp;</td></tr></table>' : '') . $shit_list . '</td></tr></table>' . '</td></tr></table><p align=center><a class=altlink href=users.php><b>Find User/Browse User List</b></a></p>';
stdfoot();
Exemplo n.º 19
0
echo $link12;
?>
" title="Order by">Shout</a></td>
<td class=colhead width='1%'><a href="userspos.php?<?php 
echo $oldlink;
?>
sort=13&type=<?php 
echo $link13;
?>
" title="Order by">SeedBonus</a></td>
</tr>
<?php 
for ($i = 1; $i <= $num; $i++) {
    $arr = mysql_fetch_assoc($res);
    $last_access = substr($arr['last_access'], 0, 10);
    $class = get_user_class_name($arr["class"]);
    $download = $arr['downloadpos'] == 'yes' ? "<font color=green><b>Yes</b></font>" : "<font color=red><b>No</b></font>";
    $upload = $arr['uploadpos'] == 'yes' ? "<font color=green><b>Yes</b></font>" : "<font color=red><b>No</b></font>";
    $post = $arr['forumpost'] == 'yes' ? "<font color=green><b>Yes</b></font>" : "<font color=red><b>No</b></font>";
    $ttablehl = $arr['ttablehl'] == 'yes' ? "<font color=green><b>Yes</b></font>" : "<font color=red><b>No</b></font>";
    $invite_on = $arr['invite_on'] == 'yes' ? "<font color=green><b>Yes</b></font>" : "<font color=red><b>No</b></font>";
    $tohp = $arr['tohp'] == 'yes' ? "<font color=green><b>Yes</b></font>" : "<font color=red><b>No</b></font>";
    $imagecats = $arr['imagecats'] == 'yes' ? "<font color=green><b>Yes</b></font>" : "<font color=red><b>No</b></font>";
    $tenpercent = $arr['tenpercent'] == 'yes' ? "<font color=green><b>Yes</b></font>" : "<font color=red><b>No</b></font>";
    $chatpost = $arr['chatpost'] == 'no' ? "<font color=red><b>No</b></font>" : "<font color=green><b>Yes</b></font>";
    $seedbonus = $arr["seedbonus"];
    echo "<tr>\r\n<td align=center><a href=/userdetails.php?id=" . $arr['id'] . "><b>" . $arr['username'] . "</b></a>" . ($arr['donor'] == "yes" ? "<img src={$pic_base_url}/star.gif alt=Donor title=Donor>" : "") . ($arr['leechwarn'] == "yes" ? "<img src={$pic_base_url}/leechwarn.gif alt=\"Leech Warned\" title=\"Leech Warned\">" : "") . ($arr['warned'] == "yes" ? "<img src={$pic_base_url}/warned.gif alt=Warned title=Warned>" : "") . "</td>\r\n<td align=center>{$last_access}</td>\r\n<td align=center>{$class}</td>\r\n<td align=center>{$download}</td>\r\n<td align=center>{$upload}</td>\r\n<td align=center>{$post}</td>\r\n<td align=center>{$ttablehl}</td>\r\n<td align=center>{$invite_on}</td>\r\n<td align=center>{$tohp}</td>\r\n<td align=center>{$imagecats}</td>\r\n<td align=center>{$tenpercent}</td>\r\n<td align=center>{$chatpost}</td>\r\n<td align=center>" . safechar($seedbonus) . " </td>\r\n</tr>\n";
}
echo "</table><p>{$pagemenu}<br>{$browsemenu}</p>";
end_main_frame();
stdfoot();
Exemplo n.º 20
0
        <input type="text" maxlength="6" name="captcha" id="captcha" onBlur="check(); return false;"/>
      </td>
  </tr>
  <tr>
    <td colspan="2" align="center">
      <input type="submit" value="Log in!" class=btn>
       </td>
<p>Signup: <a href="signup.php">here</a> | Recover: <a href="resetpw.php">here</a></p>
</tr>
</table>
       </form>


<?php 
if (isset($returnto)) {
    print "<input type=\"hidden\" name=\"returnto\" value=\"" . safechar($returnto) . "\" />\n";
}
stdfoot();
?>
</td>
</tr>
<tr>
<table style="background:transparent" border="0" cellpadding="0" cellspacing="0" align=center>
</table>
</td>
</table>

</td>
</tr>
</table>
</body>
Exemplo n.º 21
0
            $usercolor = " <font color='#" . get_user_class_color($rowowner['class']) . "'>" . safechar($rowowner['username']) . "</font>";
        }
        if ($rowowner["class"] == "4") {
            $usercolor = " <font color='#" . get_user_class_color($rowowner['class']) . "'>" . safechar($rowowner['username']) . "</font>";
        }
        if ($rowowner["class"] == "3") {
            $usercolor = " <font color='#" . get_user_class_color($rowowner['class']) . "'>" . safechar($rowowner['username']) . "</font>";
        }
        if ($rowowner["class"] == "2") {
            $usercolor = " <font color='#" . get_user_class_color($rowowner['class']) . "'>" . safechar($rowowner['username']) . "</font>";
        }
        if ($rowowner["class"] == "1") {
            $usercolor = " <font color='#" . get_user_class_color($rowowner['class']) . "'>" . safechar($rowowner['username']) . "</font>";
        }
        if ($rowowner["class"] == "0") {
            $usercolor = " <font color='#" . get_user_class_color($rowowner['class']) . "'>" . safechar($rowowner['username']) . "</font>";
        }
        $pm = "<span class='date'>[<a target=_blank href=sendmessage.php?receiver={$arr['userid']}>pm</a>]</span>\n";
        if ($i % 2 == 0) {
            $bg = 'bgcolor=#555555';
        } else {
            $bg = 'bgcolor=#777777';
        }
        print "<tr {$bg}><td><font color=white>[<span class='date'>" . strftime("%d.%m %H:%M", $arr["date"]) . "]</font></span>\n{$del} {$edit} {$pm} <a href='userdetails.php?id=" . $arr["userid"] . "' target='_blank'>{$usercolor}</a>\n" . ($arr2["donor"] == "yes" ? "<img src=pic/star.gif alt='DONOR'>\n" : "") . ($arr2["warned"] == "yes" ? "<img src=" . "pic/warned.gif alt='Warned'>\n" : "") . ($arr2["chatpost"] == "no" ? "<img src=pic/chatpos.gif alt='No Chat'>\n" : "") . ($arr2["downloadpos"] == "no" ? "<img src=pic/downloadpos.gif alt='No Downloads'>\n" : "") . ($arr2["forumpost"] == "no" ? "<img src=pic/forumpost.gif alt='No Posting'>\n" : "") . ($arr2["uploadpos"] == "no" ? "<img src=pic/uploadpos.gif alt='No upload'>\n" : "") . ($arr2["parked"] == "yes" ? "<img src=pic/parked.gif alt='Account Parked'>\n" : "") . " " . format_comment($arr["text"]) . "\n</td></tr>\n";
        $i++;
    }
    print "</table><br />";
}
print "{$pagerbottom}";
end_main_frame();
stdfoot();
Exemplo n.º 22
0
    @fwrite($fp, benc($dict), strlen(benc($dict)));
    fclose($fp);
}
// ===add karma
mysql_query("UPDATE users SET seedbonus = seedbonus+15.0 WHERE id = {$CURUSER['id']}") or sqlerr(__FILE__, __LINE__);
// ///writelog/////////
if ($CURUSER["anonymous"] == 'yes') {
    write_log("torrentupload", "Torrent {$id} ({$torrent}) was uploaded by Anonymous");
} else {
    write_log("torrentupload", "Torrent {$id} ({$torrent}) was uploaded by {$CURUSER['username']}");
}
// //////new torrent upload detail sent to shoutbox//////////
if ($CURUSER["anonymous"] == 'yes') {
    $message = "New Torrent : [url={$DEFAULTBASEURL}/details.php?id={$id}] " . safeChar($torrent) . "[/url] Uploaded - Anonymous User";
} else {
    $message = "New Torrent : [url={$DEFAULTBASEURL}/details.php?id={$id}] " . safeChar($torrent) . "[/url] Uploaded by " . safechar($CURUSER["username"]) . "";
}
// ///////////////////////////END///////////////////////////////////
// //////new torrent upload detail sent to shoutbox//////////
autoshout($message);
// ///////////////////////////end///////////////////////////////////
// ===notify people who voted on offer total credit to S4NE
if (isset($_POST['offer'])) {
    if ($_POST['offer'] > 0) {
        $res = mysql_query("SELECT `userid` FROM `offervotes` WHERE `offerid` = " . ($_POST['offer'] + 0)) or sqlerr(__FILE__, __LINE__);
        $pn_msg = "The Offer you voted for: \"{$torrent}\" was uploaded by " . $CURUSER["username"] . ".\nYou can Download the Torrent here";
        while ($row = mysql_fetch_assoc($res)) {
            // ===use this line if you DO HAVE subject in your PM system
            mysql_query("INSERT INTO messages (poster, sender, subject, receiver, added, msg) VALUES(0, 0, 'Offer {$torrent} was just uploaded', {$row['userid']}, '" . get_date_time() . "', " . sqlesc($pn_msg) . ")") or sqlerr(__FILE__, __LINE__);
            // ===use this line if you DO NOT HAVE subject in your PM system
            // mysql_query("INSERT INTO messages (poster, sender, receiver, added, msg) VALUES(0, 0, $row[userid], '" . get_date_time() . "', " . sqlesc($pn_msg) . ")") or sqlerr(__FILE__, __LINE__);
Exemplo n.º 23
0
                <?php 
                }
                ?>
			<tr align="center">
				<td align="left">
                	<a href="/<?php 
                echo rawurlencode($arr['file_name']);
                ?>
.php"  title="<?php 
                echo safechar($arr['page_name']);
                ?>
"><?php 
                echo safechar($arr['page_name']);
                ?>
</a><br /><font class="small"><?php 
                echo safechar($arr['description']);
                ?>
</font>
				</td>
                <td>
					<a href="/userdetails.php?id=<?php 
                echo (int) $arr['added_by'];
                ?>
"><?php 
                echo $arr['username'];
                ?>
</a>
                </td>
                <td nowrap="nowrap">
                	<?php 
                echo function_exists('display_date_time') ? display_date_time(get_date_time($arr['added'])) : get_date_time($arr['added']);
Exemplo n.º 24
0
}
if ($hiddentor == 'yes') {
    sql_query("DELETE FROM comments WHERE hidden={$id}");
}
if ($stafftor == 'yes') {
    sql_query("DELETE FROM comments WHERE staff={$id}");
}
//===end
// ===remove karma
sql_query("UPDATE users SET seedbonus = seedbonus-15.0 WHERE id = {$CURUSER['id']}") or sqlerr(__FILE__, __LINE__);
// ===end
if ($CURUSER['deletepm'] == 'yes') {
    $datum = get_date_time();
    $idup = $row["owner"];
    $msg = "Your torrent [b]{$row['name']}[/b] has been deleted.\n\nReason: {$reasonstr}";
    sql_query("INSERT INTO messages (sender, receiver, added, msg, subject) VALUES ('0', '{$idup}', '{$datum}', '{$msg}', " . sqlesc("Your torrent has been deleted") . ")");
}
stdhead("Torrent deleted!");
if (isset($_POST["returnto"])) {
    $ret = "<a href=\"" . safechar($_POST["returnto"]) . "\">Go back to whence you came</a>";
} else {
    $ret = "<a href=\"./\">Back to index</a>";
}
?>
<h2>Torrent deleted!</h2>
<p><?php 
echo $ret;
?>
</p>
<?php 
stdfoot();
Exemplo n.º 25
0
?>
 &#37; sql</b></p></div>
<?php 
if (get_user_class() >= UC_SYSOP) {
    ?>
<h2><a href="javascript:klappe('query')"><?php 
    echo $SITENAME;
    ?>
 Query's</a></h2>

<div id="kquery" class="generated" style="display:none; text-align:left;">
<?php 
    if (get_user_class() >= UC_SYSOP) {
        if (DEBUG_MODE && $query_stat) {
            foreach ($query_stat as $key => $value) {
                print "[" . safechar($key + 1) . "] => <b>" . ($value["seconds"] > 0.01 ? "<font color=\"red\" title=\"You should optimize this query.\">" . safechar($value["seconds"]) . "</font>" : "<font color=\"green\" title=\"This query doesn't need optimized.\">" . safechar($value["seconds"]) . "</font>") . "</b> [" . str_replace("&", "&amp;", $value["query"]) . "]<br />\n";
            }
        }
    }
}
?>
<br />
</div>
</table>

<!-- build the footer -->
    <td style="width:6px; background:url(themes/NB-Revolt/pic/05.png);"><img src="themes/NB-Revolt/pic/blank.gif" width="6" height="1" /></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
Exemplo n.º 26
0
                    $res_who2 = sql_query("SELECT name FROM torrents WHERE id = {$arr_info['reporting_what']}");
                    $arr_who2 = mysql_fetch_assoc($res_who2);
                    $link_to_thing = "<a class=altlink href=details.php?id={$arr_info['reporting_what']}><b>" . safechar($arr_who2['name']) . "</b></a>";
                    break;
                case "Hit_And_Run":
                    $res_who2 = sql_query("SELECT users.username, torrents.name, r.2nd_value FROM users, torrents LEFT JOIN reports AS r ON r.2nd_value = torrents.id WHERE users.id={$arr_info['reporting_what']}");
                    $arr_who2 = mysql_fetch_assoc($res_who2);
                    $link_to_thing = "<b>user:</b> <a class=altlink href=userdetails.php?id=" . $arr_info['reporting_what'] . "&completed=1><b>" . $arr_who2['username'] . "</b></a><br>hit and run on:<br> <a class=altlink href=details.php?id=" . $arr_info['2nd_value'] . "&page2=0#snatched><b>" . safechar($arr_who2['name']) . "</b></a>";
                    break;
                case "Post":
                    $res_who2 = sql_query("SELECT subject FROM topics WHERE id = " . $arr_info['2nd_value']);
                    $arr_who2 = mysql_fetch_assoc($res_who2);
                    $link_to_thing = "<b>post:</b> <a class=altlink href=forums.php?action=viewtopic&topicid=" . $arr_info['2nd_value'] . "&page=last#" . $arr_info['reporting_what'] . "><b>" . safechar($arr_who2['subject']) . "</b></a>";
                    break;
            }
        }
        echo "<tr><td align=left valign=top class={$class}>" . $arr_info['added'] . "</td><td align=left valign=top class={$class}><a class=altlink href=userdetails.php?id=" . $arr_info['reported_by'] . ">" . "<b>" . $arr_info['username'] . "</b></a></td><td align=left valign=top class={$class}>{$link_to_thing}</td><td align=left valign=top class={$class}><b>" . str_replace("_", " ", $arr_info["reporting_type"]) . "</b>" . "</td><td align=left valign=top class={$class}>" . safechar($arr_info['reason']) . "</td><td align=center valign=top class={$class}>{$dealtwith} {$delt_link}</td><td align=center valign=middle class={$class}>{$checkbox}</td>" . (get_user_class() == UC_SYSOP ? "<td align=center valign=middle class={$class}><a class=altlink href=reports.php?id=" . $arr_info['id'] . "&delete=1><font color=red>Delete</font></a></td>" : "") . "</tr>\n";
        // ===how was it delt with?
        if ($arr_info['how_delt_with']) {
            echo "<tr><td colspan=" . (get_user_class() == UC_SYSOP ? "8" : "7") . " class={$class} align=left><b>Delt with by " . $arr_who['username'] . ":</b> on: " . $arr_info['when_delt_with'] . " (" . get_elapsed_time(sql_timestamp_to_unix_timestamp($arr_info['when_delt_with'])) . " ago)</td></tr><tr><td colspan=" . (get_user_class() == UC_SYSOP ? "8" : "7") . " class={$class} align=left>" . safechar($arr_info['how_delt_with']) . "<br><br></td></tr>";
        }
    }
}
echo "</table>";
if ($count > '0') {
    // === deal with it
    echo "<br><br><p align=center><b>How {$CURUSER['username']} Delt with this report:</b> [ required ] </p><textarea name=how_delt_with cols=70 rows=5 ></textarea><br><br>" . "<input type=submit class=button value=Confirm><br><br></form></td></tr></table>";
}
//=== end if count
stdfoot();
die;
Exemplo n.º 27
0
 $infohash[$i] = pack("H*", sha1($info[$i]["string"]));
 /* ...... end of Private Tracker mod */
 $torrent[$i] = str_replace("_", " ", $torrent[$i]);
 $torrent[$i] = str_replace("'", " ", $torrent[$i]);
 $torrent[$i] = str_replace("\"", " ", $torrent[$i]);
 $torrent[$i] = str_replace(",", " ", $torrent[$i]);
 $nfo[$i] = sqlesc(str_replace("\r\r\n", "\r\n", @file_get_contents($nfofilename[$i])));
 $first = $shortfname[$i][1];
 $second = $dname[$i];
 $third = $torrent[$i][1];
 $ret = mysql_query("INSERT INTO torrents (search_text, filename, owner, visible, info_hash, name, size, numfiles, type, descr, ori_descr, category, save_as, added, last_action, nfo) VALUES (" . implode(",", array_map("sqlesc", array(searchfield("{$first} {$second} {$third}"), $fname[$i], $CURUSER["id"], "no", $infohash[$i], $torrent[$i][1], $totallen, count($filelist[$i]), $type, $descr, $descr, $cat[$i], $dname[$i]))) . ", '" . get_date_time() . "', '" . get_date_time() . "', {$nfo[$i]})");
 // //////new torrent upload detail sent to shoutbox//////////
 if ($CURUSER["anonymous"] == 'yes') {
     $message = "[url={$BASEURL}/multidetails.php?id1={$ids['0']}&id2={$ids['1']}&id3={$ids['2']}&id4={$ids['3']}&id5={$ids['4']}]Multiple Torrents were just uploaded! Click here to see them[/url] - Anonymous User";
 } else {
     $message = "[url={$BASEURL}/multidetails.php?id1={$ids['0']}&id2={$ids['1']}&id3={$ids['2']}&id4={$ids['3']}&id5={$ids['4']}]Multiple Torrents were just uploaded! Click here to see them[/url]  Uploaded by " . safechar($CURUSER["username"]) . "";
 }
 // ///////////////////////////END///////////////////////////////////
 if (!$ret) {
     if (mysql_errno() == 1062) {
         bark("#{$i} torrent was already uploaded!");
     }
     bark("mysql puked: " . mysql_error());
 }
 $id = mysql_insert_id();
 $ids[] = $id;
 @mysql_query("DELETE FROM files WHERE torrent = {$id}");
 foreach ($filelist as $file) {
     @mysql_query("INSERT INTO files (torrent, filename, size) VALUES ({$id}, " . sqlesc($file[0]) . "," . $file[1] . ")");
 }
 $fp = fopen("{$torrent_dir}/{$id}.torrent", "w");
Exemplo n.º 28
0
    $cats = "";
    $res = sql_query("SELECT id, name FROM categories");
    while ($arr = mysql_fetch_assoc($res)) {
        $cats[$arr["id"]] = $arr["name"];
    }
    $s = "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n<rss version=\"0.91\">\n<channel>\n" . "<title>TorrentBits</title>\n<description>0-week torrents</description>\n<link>{$DEFAULTBASEURL}/</link>\n";
    @fwrite($fd1, $s);
    @fwrite($fd2, $s);
    $r = sql_query("SELECT id,name,descr,filename,category FROM torrents ORDER BY added DESC LIMIT 15") or sqlerr(__FILE__, __LINE__);
    while ($a = mysql_fetch_assoc($r)) {
        $cat = $cats[$a["category"]];
        $s = "<item>\n<title>" . safechar($a["name"] . " ({$cat})") . "</title>\n" . "<description>" . safechar($a["descr"]) . "</description>\n";
        @fwrite($fd1, $s);
        @fwrite($fd2, $s);
        @fwrite($fd1, "<link>{$DEFAULTBASEURL}/details.php?id={$a['id']}&amp;hit=1</link>\n</item>\n");
        $filename = safechar($a["filename"]);
        @fwrite($fd2, "<link>{$DEFAULTBASEURL}/download.php/{$a['id']}/{$filename}</link>\n</item>\n");
    }
    $s = "</channel>\n</rss>\n";
    @fwrite($fd1, $s);
    @fwrite($fd2, $s);
    @fclose($fd1);
    @fclose($fd2);
}
/* Email notifs */
/**
* $res = sql_query("SELECT name FROM categories WHERE id=$catid") or sqlerr();
* $arr = mysql_fetch_assoc($res);
* $cat = $arr["name"];
* $res = sql_query("SELECT email FROM users WHERE enabled='yes' AND notifs LIKE '%[cat$catid]%'") or sqlerr();
* $uploader = $CURUSER['username'];
Exemplo n.º 29
0
loggedinorreturn();
// /////////latest user - comment out if not required/////
if ($CURUSER) {
    $cache_newuser = "******";
    $cache_newuser_life = 2 * 60;
    //2 min
    if (file_exists($cache_newuser) && is_array(unserialize(file_get_contents($cache_newuser))) && time() - filemtime($cache_newuser) < $cache_newuser_life) {
        $arr = unserialize(@file_get_contents($cache_newuser));
    } else {
        $r_new = sql_query("select id , username FROM users order by id desc limit 1 ") or sqlerr(__FILE__, __LINE__);
        $arr = mysql_fetch_assoc($r_new);
        $handle = fopen($cache_newuser, "w+");
        fwrite($handle, serialize($arr));
        fclose($handle);
    }
    $new_user = "******"userdetails.php?id=" . $arr["id"] . "\">" . safechar($arr["username"]) . "</a></b> !</font>\n";
}
// end latest user///////////
// cache for stats
$cache_stats = "{$CACHE}/stats.txt";
$cache_stats_life = 5 * 60;
// 5min
if (file_exists($cache_stats) && is_array(unserialize(file_get_contents($cache_stats))) && time() - filemtime($cache_stats) < $cache_stats_life) {
    $row = unserialize(@file_get_contents($cache_stats));
} else {
    $stats = sql_query("SELECT *, seeders + leechers AS peers, seeders / leechers AS ratio, unconnectables / (seeders + leechers) AS ratiounconn FROM stats WHERE id = '1' LIMIT 1") or sqlerr(__FILE__, __LINE__);
    $row = mysql_fetch_assoc($stats);
    $handle = fopen($cache_stats, "w+");
    fwrite($handle, serialize($row));
    fclose($handle);
}
Exemplo n.º 30
0
     $trows = mysql_fetch_array($tsql);
     $t_ab = $trows[0];
     if ($t_ab == "0") {
         $freepollby = $freepollby . " <form action=\"freepoll.php\" method=\"post\">\r\n    <br />\r\n    <input type=\"submit\" name=\"submit\" value=\"Vote\">\r\n    <input type=\"hidden\" name=\"torrentid\" value=\"{$torrentid}\">\r\n    </form>";
     } else {
         $t_userid == $row["owner"];
         $freepollby = $freepollby . " <form action=\"freepoll.php\" method=\"post\">\r\n    <br />\r\n    <input type=\"submit\" name=\"submit\" value=\"Already voted\" disabled>\r\n    <input type=\"hidden\" name=\"torrentid\" value=\"{$torrentid}\">\r\n    </form>";
     }
 } else {
     $freepollcount = "0";
     $freepollby = "\r\n    <form action=\"freepoll.php\" method=\"post\">\r\n    <br />\r\n    <input type=\"submit\" name=\"submit\" value=\"Vote\">\r\n    <input type=\"hidden\" name=\"torrentid\" value=\"{$torrentid}\">\r\n    </form>\r\n    ";
 }
 $votesrequired = "15";
 $count = $votesrequired - $freepollcount;
 if ($row["countstats"] == 'yes') {
     tr("<b>" . $language['dtfp7'] . "</b>", "" . safechar($freepollcount) . " " . $language['dtfp8'] . " " . safeChar($count) . " " . $language['dtfp9'] . "", 1);
 }
 if ($elapsed < $wait and $row["countstats"] == 'yes') {
     if ($t_ab == "0" and $row["countstats"] == 'yes') {
         if ($freepollcount < $votesrequired) {
             echo "<tr><td class=rowhead><div align='right'>" . $language['dtfp7'] . "</div></td><td align=left>{$freepollby}";
         }
     } else {
         echo "<tr><td class=rowhead><div align='right'>" . $language['dtfp4'] . "</div></td><td align=left>" . $language['dtfp5'] . " <b><a href=rules.php><font color=red>" . number_format($wait1 - $elapsed1) . " " . $language['dtfp6'] . "</font></b></a>!";
     }
 } elseif ($row["countstats"] == 'yes') {
     echo "<tr><td class=rowhead><div align='right'>" . $language['dtfp3'] . "</div></td><td align=left>{$freepollby}";
 }
 $tid = $row["id"];
 if ($freepollcount == $votesrequired || $row["countstats"] == 'no') {
     echo "<tr><td class=rowhead><div align='right'>" . $language['dtfp'] . "</div></td><td align=left>" . $language['dtfp2'] . "";