All pastes #106575 Raw Edit

Untitled

public php v1 · immutable
#106575 ·published 2006-07-30 10:56 UTC
rendered paste body
<? if ($CURUSER) {    // Get the torrents with leechers but no seed.    $sn_lines = array();    $tnsr = mysql_query("SELECT t1.id, t1.name, t1.size, t1.leechers, t2.to_go FROM torrents AS t1, peers AS t2 WHERE t2.torrent = t1.id AND seeders = 0 AND leechers > 0 AND t1.access = ".AL_COMMON." ORDER BY t1.leechers DESC, t2.to_go DESC") or sqlerr();    while ($tnsa = mysql_fetch_assoc($tnsr)) {        if($tnsa['to_go'] >= $tnsa['size'])            continue;        $perc = round((($tnsa['size'] - $tnsa['to_go']) / $tnsa['size']) * 100, 2) . "%";        $work[$tnsa['id']] = $tnsa['to_go'];        $sn_lines[$tnsa['id']] = '<b><a href="details.php?id=' . $tnsa['id'] . '&hit=1">' . $tnsa['name'] . '</a><font color=#0099FF><b> (' . $tnsa['leechers'] . ($tnsa['leechers'] == 1 ? " &#1050;&#1072;&#1095;&#1072;&#1102;&#1090;, $perc" : " &#1050;&#1072;&#1095;&#1072;&#1102;&#1090;, $perc ") . " &#1079;&#1072;&#1074;&#1077;&#1088;&#1096;&#1077;&#1085;&#1086;)</b></font>";    }    print("<h2>&#1056;&#1077;&#1083;&#1080;&#1079;&#1099;, &#1082;&#1086;&#1090;&#1086;&#1088;&#1099;&#1084; &#1085;&#1091;&#1078;&#1085;&#1099; &#1088;&#1072;&#1079;&#1076;&#1072;&#1102;&#1097;&#1080;&#1077;</h2>");    if (count($st_lines)) {        foreach ($st_lines as $line) {            echo("$line\n");        }    }    if (count($sn_lines)) {        echo('<b><center><font color=#ff0000>&#1057;&#1082;&#1072;&#1095;&#1072;&#1083; &#1089;&#1072;&#1084;, &#1076;&#1072;&#1081; &#1089;&#1082;&#1072;&#1095;&#1072;&#1090;&#1100; &#1076;&#1088;&#1091;&#1075;&#1086;&#1084;&#1091;!!!</font></center>' . "\n");        echo("<table width=100% border=1 cellspacing=0 cellpadding=10><tr><td class=text>");        foreach ($sn_lines as $line) {            echo("$line<br>\n");        }        echo("</p>\n");        echo("</td></tr></table>");    }    if (count($vip_lines) && get_user_class() >= UC_VIP) {        foreach ($vip_lines as $line) {            echo("$line\n");        }    }} ?>