Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Downloads (http://www.bvlist.com/forumdisplay.php?f=16)
-   -   HDPure Source v1 (http://www.bvlist.com/showthread.php?t=6168)

Fynnon 5th December 2011 22:06

Quote:

Originally Posted by BaHKoCeKca (Post 31505)
yeah micro take the credits you mf i modded the entire source and i gave it you so that you could start a tracker and now i you post it here with only the style changet .. thats fd up man :shock:

or you could ask someone to add credits :clown:

BaHKoCeKca 5th December 2011 22:14

yeah im aware of the concept of the site .. and all i wanted was for him to at least add credits .. and as above somebody asked the basis of this tracker are of D3SI's probably first source - i can't quite remember. And here, he, as i can see has fd the source up a lot .. soon ill fix it and upload it as it should be .. cheers :drink:

Kewm 13th December 2011 00:01

Quote:

Originally Posted by BaHKoCeKca (Post 31508)
yeah im aware of the concept of the site .. and all i wanted was for him to at least add credits .. and as above somebody asked the basis of this tracker are of D3SI's probably first source - i can't quite remember. And here, he, as i can see has fd the source up a lot .. soon ill fix it and upload it as it should be .. cheers :drink:

Whens that gonna to happen?
I'd really like this source etc.

kapel12 14th February 2012 20:01

Salved

dj_otrov 25th February 2012 02:13

error
 
Error install

wMan 1st November 2012 17:10

Quote:

Originally Posted by micro (Post 27175)
attention

Attention


tracker source MODDED by BaHKoCeKca





Install:

Extract to your root
Import DB
Edit secret.php and bittorrent.php to your settings
Register new account and change class from DB to 6

That's it. :)

going have a look at this i have over 100 mods for this 08

Bump:
Quote:

Originally Posted by micro (Post 27175)
attention

Attention


tracker source MODDED by BaHKoCeKca





Install:

Extract to your root
Import DB
Edit secret.php and bittorrent.php to your settings
Register new account and change class from DB to 6

That's it. :)

what lag is this ?

\n");
}

function trala($x,$y,$noesc=0) {
  if ($noesc)
          $a = $y;
  print("\n");
}

function validfilename($name) {
    return preg_match('/^[^\0-\x1f:\\\\\/?*\xff#<>|]+$/si', $name);
}

function validemail($email) {
    return preg_match('/^[\w.-]+@([\w.-]+\.)+[a-z]{2,6}$/is', $email);
}

function sqlesc($x) {
    return "'".mysql_real_escape_string($x)."'";
}

function sqlwildcardesc($x) {
    return str_replace(array("%","_"), array("\\%","\\_"), mysql_real_escape_string($x));
}

function urlparse($m) {
    $t = $m[0];
    if (preg_match(',^\w+://,', $t))
        return "$t";
    return "$t";
}

function parsedescr($d, $html) {
    if (!$html)
    {
      $d = htmlspecialchars($d);
      $d = str_replace("\n", "\n", $d);
    }
    return $d;
}

function stdhead($title = "", $msgalert = true) {
    global $CURUSER, $SITE_ONLINE, $FUNDS, $SITENAME;

  if (!$SITE_ONLINE)
    die("Site is down for maintenance, please check back again later... thanks");

    header("Content-Type: text/html; charset=windows-1251");
    //header("Pragma: No-cache");
    if ($title == "")
        $title = $SITENAME .(isset($_GET['tbv'])?" (".TBVERSION.")":'');
    else
        $title = $SITENAME .(isset($_GET['tbv'])?" (".TBVERSION.")":''). " | " . htmlspecialchars($title);


  if ($CURUSER)
  {
    $ss_a = @mysql_fetch_array(@mysql_query("select uri from stylesheets where id=" . $CURUSER["stylesheet"]));
    if ($ss_a) $ss_uri = $ss_a["uri"];
  }
  if (!$ss_uri)
  {
    ($r = mysql_query("SELECT uri FROM stylesheets WHERE id=1")) or die(mysql_error());
    ($a = mysql_fetch_array($r)) or die(mysql_error());
    $ss_uri = $a["uri"];
  }
  if ($msgalert && $CURUSER)
  {
    $res = mysql_query("SELECT COUNT(*) FROM messages WHERE receiver=" . $CURUSER["id"] . " && unread='yes'") or die("OopppsY!");
    $arr = mysql_fetch_row($res);
    $unread = $arr[0];
  }

  if ($CURUSER["fader"] == "yes")
  {
  ?>
 
    }

?>

<?= $title ?>







 
 














repxe 27th March 2013 17:12

I was not a member of this error "Not Found Sorry pal :("

how to edit "bittorrent.php"

Code:


// PHP5 with register_long_arrays off?
if (!isset($HTTP_POST_VARS) && isset($_POST))
{
$HTTP_POST_VARS = $_POST;
$HTTP_GET_VARS = $_GET;
$HTTP_SERVER_VARS = $_SERVER;
$HTTP_COOKIE_VARS = $_COOKIE;
$HTTP_ENV_VARS = $_ENV;
$HTTP_POST_FILES = $_FILES;
}

function strip_magic_quotes($arr)
{
foreach ($arr as $k => $v)
{
if (is_array($v))
{ $arr[$k] = strip_magic_quotes($v); }
else
{ $arr[$k] = stripslashes($v); }
}

return $arr;
}

if (get_magic_quotes_gpc())
{
if (!empty($_GET)) { $_GET = strip_magic_quotes($_GET); }
if (!empty($_POST)) { $_POST = strip_magic_quotes($_POST); }
if (!empty($_COOKIE)) { $_COOKIE = strip_magic_quotes($_COOKIE); }
}


// addslashes to vars if magic_quotes_gpc is off
// this is a security precaution to prevent someone
// trying to break out of a SQL statement.
//

if( !get_magic_quotes_gpc() )
{
if( is_array($HTTP_GET_VARS) )
{
while( list($k, $v) = each($HTTP_GET_VARS) )
{
if( is_array($HTTP_GET_VARS[$k]) )
{
while( list($k2, $v2) = each($HTTP_GET_VARS[$k]) )
{
$HTTP_GET_VARS[$k][$k2] = addslashes($v2);
}
@reset($HTTP_GET_VARS[$k]);
}
else
{
$HTTP_GET_VARS[$k] = addslashes($v);
}
}
@reset($HTTP_GET_VARS);
}

if( is_array($HTTP_POST_VARS) )
{
while( list($k, $v) = each($HTTP_POST_VARS) )
{
if( is_array($HTTP_POST_VARS[$k]) )
{
while( list($k2, $v2) = each($HTTP_POST_VARS[$k]) )
{
$HTTP_POST_VARS[$k][$k2] = addslashes($v2);
}
@reset($HTTP_POST_VARS[$k]);
}
else
{
$HTTP_POST_VARS[$k] = addslashes($v);
}
}
@reset($HTTP_POST_VARS);
}

if( is_array($HTTP_COOKIE_VARS) )
{
while( list($k, $v) = each($HTTP_COOKIE_VARS) )
{
if( is_array($HTTP_COOKIE_VARS[$k]) )
{
while( list($k2, $v2) = each($HTTP_COOKIE_VARS[$k]) )
{
$HTTP_COOKIE_VARS[$k][$k2] = addslashes($v2);
}
@reset($HTTP_COOKIE_VARS[$k]);
}
else
{
$HTTP_COOKIE_VARS[$k] = addslashes($v);
}
}
@reset($HTTP_COOKIE_VARS);
}
}


function local_user()
{
  return $_SERVER["SERVER_ADDR"] == $_SERVER["REMOTE_ADDR"];
}

$FUNDS = "$0";

$SITE_ONLINE = true;
//$SITE_ONLINE = local_user();
//$SITE_ONLINE = false;

$max_torrent_size = 1000000;
$announce_interval = 60 * 60;
$signup_timeout = 86400 * 3;
$minvotes = 1;
$max_dead_torrent_time = 6 * 3600;

// Max users on site
$maxusers = 5000;

////////Site donation email
$DONATEMAIL = "hdpure@jabse.com";

// ONLY USE ONE OF THE FOLLOWING DEPENDING ON YOUR O/S!!!
$torrent_dir = "torrents";    # FOR UNIX ONLY - must be writable for httpd user
//$torrent_dir = "torrents";    # FOR WINDOWS ONLY - must be writable for httpd user

# the first one will be displayed on the pages
$announce_urls = array();
$announce_urls[] = "http://localhost/announce.php";

if ($_SERVER["HTTP_HOST"] == "")
  $_SERVER["HTTP_HOST"] = $_SERVER["SERVER_NAME"];
$BASEURL = "http://" . $_SERVER["HTTP_HOST"];

// Set this to your site URL... No ending slash!
$DEFAULTBASEURL = "http://localhost";

//set this to true to make this a tracker that only registered users may use
$MEMBERSONLY = true;

//maximum number of peers (seeders+leechers) allowed before torrents starts to be deleted to make room...
//set this to something high if you don't require this feature
$PEERLIMIT = 50000;

// Email for sender/return path.
$SITEEMAIL = "noreply@domain.com";

$SITENAME = "HDPure";

$autoclean_interval = 900;
$pic_base_url = "/pic/";
$imgdir = "/pic/";

// Maximum size of files uploaded into the BitBucket in bytes
$GLOBALS["MAX_UPLOAD_FILESIZE"] = 1024 * 1024;

// Maximum size of the BitBucket per user in bytes
$GLOBALS["MAX_BITBUCKET_SIZE_USER"] = 1024 * 1024;

// Maximum size of the BitBucket for uploaders in bytes
$GLOBALS["MAX_BITBUCKET_SIZE_UPLOADER"] = 5 * 1024 * 1024;

// Path where all Bit-Bucket files are stored. These are:
// User's files, torrent and NFO images
// This path MUST be a subdir of the tracker root, and MUST be
// publicly available, optionally with referrer check
// Webserver MUST have write permission on this directory!
// No trailing slash.
$GLOBALS["BITBUCKET_DIR"] = "bitbucket";

// Relative or absolute URL where all images for the interface are stored.
// MUST include a trailing slash!
$GLOBALS["PIC_BASE_URL"] = "pic/";

require_once("secrets.php");
require_once("cleanup.php");

//Do not modify -- versioning system
//This will help identify code for support issues at tbdev.net
define ('TBVERSION','TBDEV.NET-12-09-05');

//---------------------------------
//---- Max. Sysops Added by D3SI
//---------------------------------

function maxsysop () {
        global $CURUSER;
        // Check Staff Names
        $lmaxclass  = 9;
        $lsysopnames = array("BaHKoCeKca"); // Case sensitive. Change this (YOUR SYSOP-ADMIN NAMES GOES HERE) (example: array("adminname1","adminname2","adminname3","adminname4","so far")
        if ($CURUSER["class"] >= $lmaxclass)
        if (!in_array($CURUSER["username"], $lsysopnames, true)) { // true for strict comparison
                $msg = "Fake Account Detected: Username: ".$CURUSER["username"]." - UserID: ".$CURUSER["id"]." - UserIP : ".getip();
                write_log($msg);
                mysql_query("INSERT INTO messages (poster, sender, receiver, added, msg) VALUES(0, 0, '1', '" . get_date_time() . "', " .sqlesc($msg) . ")") or sqlerr(__FILE__, __LINE__);
                stderr("Access Denied!","We come to believe you are using a fake account, therefore we've logged this action!");
        }
        // Check Staff IDS
        define ('UC_STAFF', 9); // Minumum Staff Level (50= UC_MODERATOR)
        if ($CURUSER['class'] >= UC_STAFF) {
                $allowed_ID = array(1,2); // Change this (YOUR SYSOP-ADMIN IDS GOES HERE) (example: array(1,2,3,4,5))
                if (!in_array((int)$CURUSER['id'], $allowed_ID, true)) { // true for strict comparison
                        $msg = "Fake Account Detected: Username: ".$CURUSER["username"]." - UserID: ".$CURUSER["id"]." - UserIP : ".getip();
                        write_log($msg);
                        stderr("Access Denied!","We come to believe you are using a fake account, therefore we've logged this action!");
                }
        }
}

//---------------------------------
//---- Max. Sysops Added by D3SI
//---------------------------------

function failedloginscheck () {
    global $maxloginattempts;   
    $total = 0;
    $ip = sqlesc(getip());
    $Query = mysql_query("SELECT SUM(attempts) FROM loginattempts WHERE ip=$ip") or sqlerr(__FILE__, __LINE__);
    list($total) = mysql_fetch_array($Query);
    if ($total >= $maxloginattempts) {
            mysql_query("UPDATE loginattempts SET banned = 'yes' WHERE ip=$ip") or sqlerr(__FILE__, __LINE__);
            stderr("Login Locked!", "You have been exceed maximum login attempts, therefore your ip address (".htmlspecialchars($ip).") has been banned.");   
        }
}
function failedlogins () {   
    $ip = sqlesc(getip());
    $added = sqlesc(get_date_time());
    $a = (@mysql_fetch_row(@mysql_query("select count(*) from loginattempts where ip=$ip"))) or sqlerr(__FILE__, __LINE__);
    if ($a[0] == 0)
        mysql_query("INSERT INTO loginattempts (ip, added, attempts) VALUES ($ip, $added, 1)") or sqlerr(__FILE__, __LINE__);
    else
        mysql_query("UPDATE loginattempts SET attempts = attempts + 1 where ip=$ip") or sqlerr(__FILE__, __LINE__);       
       
    stderr("Login failed!","Error: Username or password incorrectDon't remember your password? Recover your password!");
}


/**** validip/getip courtesy of manolete ****/

// IP Validation
function validip($ip)
{
        if (!empty($ip) && $ip == long2ip(ip2long($ip)))
        {
                // reserved IANA IPv4 addresses
                // http://www.iana.org/assignments/ipv4-address-space
                $reserved_ips = array (
                                array('0.0.0.0','2.255.255.255'),
                                array('10.0.0.0','10.255.255.255'),
                                array('127.0.0.0','127.255.255.255'),
                                array('169.254.0.0','169.254.255.255'),
                                array('172.16.0.0','172.31.255.255'),
                                array('192.0.2.0','192.0.2.255'),
                                array('192.168.0.0','192.168.255.255'),
                                array('255.255.255.0','255.255.255.255')
                );

                foreach ($reserved_ips as $r)
                {
                                $min = ip2long($r[0]);
                                $max = ip2long($r[1]);
                                if ((ip2long($ip) >= $min) && (ip2long($ip) <= $max)) return false;
                }
                return true;
        }
        else return false;
}

// Patched function to detect REAL IP address if it's valid
function getip() {
  if (isset($_SERVER)) {
    if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && validip($_SERVER['HTTP_X_FORWARDED_FOR'])) {
      $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    } elseif (isset($_SERVER['HTTP_CLIENT_IP']) && validip($_SERVER['HTTP_CLIENT_IP'])) {
      $ip = $_SERVER['HTTP_CLIENT_IP'];
    } else {
      $ip = $_SERVER['REMOTE_ADDR'];
    }
  } else {
    if (getenv('HTTP_X_FORWARDED_FOR') && validip(getenv('HTTP_X_FORWARDED_FOR'))) {
      $ip = getenv('HTTP_X_FORWARDED_FOR');
    } elseif (getenv('HTTP_CLIENT_IP') && validip(getenv('HTTP_CLIENT_IP'))) {
      $ip = getenv('HTTP_CLIENT_IP');
    } else {
      $ip = getenv('REMOTE_ADDR');
    }
  }

  return $ip;
 }

function dbconn($autoclean = false)
{
    global $mysql_host, $mysql_user, $mysql_pass, $mysql_db;

    if (!@mysql_connect($mysql_host, $mysql_user, $mysql_pass))
    {
          switch (mysql_errno())
          {
                case 1040:
                case 2002:
                        if ($_SERVER[REQUEST_METHOD] == "GET")
                                die("

The server load is very high at the moment. Retrying, please wait...

");
                        else
                                die("Too many users. Please press the Refresh button in your browser to retry.");
        default:
                die("[" . mysql_errno() . "] dbconn: mysql_connect: " . mysql_error());
      }
    }
    mysql_select_db($mysql_db)
        or die('dbconn: mysql_select_db: ' + mysql_error());

    userlogin();

    if ($autoclean)
        register_shutdown_function("autoclean");
}


function userlogin() {
    global $SITE_ONLINE;
    unset($GLOBALS["CURUSER"]);

    $ip = getip();
        $nip = ip2long($ip);
    $res = mysql_query("SELECT * FROM bans WHERE $nip >= first AND $nip <= last") or sqlerr(__FILE__, __LINE__);
    if (mysql_num_rows($res) > 0)
    {
      header("HTTP/1.0 403 Forbidden");
      print("

403 Forbidden

Unauthorized IP address.\n");
      die;
    }

    if (!$SITE_ONLINE || empty($_COOKIE["uid"]) || empty($_COOKIE["pass"]))
        return;
    $id = 0 + $_COOKIE["uid"];
    if (!$id || strlen($_COOKIE["pass"]) != 32)
        return;
    $res = mysql_query("SELECT * FROM users WHERE id = $id AND enabled='yes' AND status = 'confirmed'");// or die(mysql_error());
    $row = mysql_fetch_array($res);
    if (!$row)
        return;
    $sec = hash_pad($row["secret"]);
    if ($_COOKIE["pass"] !== md5($row["passhash"].$_SERVER["REMOTE_ADDR"]))
        return;
    mysql_query("UPDATE users SET last_access='" . get_date_time() . "', ip=".sqlesc($ip)." WHERE id=" . $row["id"]);// or die(mysql_error());
    $row['ip'] = $ip;
    $GLOBALS["CURUSER"] = $row;
}

function autoclean() {
    global $autoclean_interval;

    $now = time();
    $docleanup = 0;

    $res = mysql_query("SELECT value_u FROM avps WHERE arg = 'lastcleantime'");
    $row = mysql_fetch_array($res);
    if (!$row) {
        mysql_query("INSERT INTO avps (arg, value_u) VALUES ('lastcleantime',$now)");
        return;
    }
    $ts = $row[0];
    if ($ts + $autoclean_interval > $now)
        return;
    mysql_query("UPDATE avps SET value_u=$now WHERE arg='lastcleantime' AND value_u = $ts");
    if (!mysql_affected_rows())
        return;

    docleanup();
}

function unesc($x) {
    if (get_magic_quotes_gpc())
        return stripslashes($x);
    return $x;
}

function mksize($bytes)
{
        if ($bytes < 1000 * 1024)
                return number_format($bytes / 1024, 2) . " kB";
        elseif ($bytes < 1000 * 1048576)
                return number_format($bytes / 1048576, 2) . " MB";
        elseif ($bytes < 1000 * 1073741824)
                return number_format($bytes / 1073741824, 2) . " GB";
        else
                return number_format($bytes / 1099511627776, 2) . " TB";
}

function mksizeint($bytes)
{
        $bytes = max(0, $bytes);
        if ($bytes < 1000)
                return floor($bytes) . " B";
        elseif ($bytes < 1000 * 1024)
                return floor($bytes / 1024) . " kB";
        elseif ($bytes < 1000 * 1048576)
                return floor($bytes / 1048576) . " MB";
        elseif ($bytes < 1000 * 1073741824)
                return floor($bytes / 1073741824) . " GB";
        else
                return floor($bytes / 1099511627776) . " TB";
}

function deadtime() {
    global $announce_interval;
    return time() - floor($announce_interval * 1.3);
}

function mkprettytime($s) {
    if ($s < 0)
        $s = 0;
    $t = array();
    foreach (array("60:sec","60:min","24:hour","0:day") as $x) {
        $y = explode(":", $x);
        if ($y[0] > 1) {
            $v = $s % $y[0];
            $s = floor($s / $y[0]);
        }
        else
            $v = $s;
        $t[$y[1]] = $v;
    }

    if ($t["day"])
        return $t["day"] . "d " . sprintf("%02d:%02d:%02d", $t["hour"], $t["min"], $t["sec"]);
    if ($t["hour"])
        return sprintf("%d:%02d:%02d", $t["hour"], $t["min"], $t["sec"]);
//    if ($t["min"])
        return sprintf("%d:%02d", $t["min"], $t["sec"]);
//    return $t["sec"] . " secs";
}

function mkglobal($vars) {
    if (!is_array($vars))
        $vars = explode(":", $vars);
    foreach ($vars as $v) {
        if (isset($_GET[$v]))
            $GLOBALS[$v] = unesc($_GET[$v]);
        elseif (isset($_POST[$v]))
            $GLOBALS[$v] = unesc($_POST[$v]);
        else
            return 0;
    }
    return 1;
}

function tr($x,$y,$noesc=0) {
    if ($noesc)
        $a = $y;
    else {
        $a = htmlspecialchars($y);
        $a = str_replace("\n", "\n", $a);
    }
    print("
$x$a
$x$a





header


















$res3 = mysql_query("SELECT connectable FROM peers WHERE userid=" . sqlesc($CURUSER["id"]) . " LIMIT 1") or print(mysql_error());
if($row = mysql_fetch_row($res3)){
$connect = $row[0];
if($connect == "yes"){
  $connectable = "Connectable";
}else{
  $connectable = "Unconnectable";
}
}else{
$connectable = "";
}

$usrclass = " [ ".get_user_class_name($CURUSER['class'])." ] ";

$datum = getdate();

$datum[hours] = sprintf("%02.0f", $datum[hours]);

$datum[minutes] = sprintf("%02.0f", $datum[minutes]);

$uped = mksize($CURUSER['uploaded']);

$downed = mksize($CURUSER['downloaded']);

if ($CURUSER["downloaded"] > 0)

{

$ratio = $CURUSER['uploaded'] / $CURUSER['downloaded'];

$ratio = number_format($ratio, 3);

$color = get_ratio_color($ratio);

if ($color)

$ratio = "$ratio";

}

else

if ($CURUSER["uploaded"] > 0)

$ratio = "Inf.";

else

$ratio = "---";



if ($CURUSER['donor'] == "yes")

$medaldon = "donor";



if ($CURUSER['warned'] == "yes")

$warn = "warned";



//// check for messages //////////////////

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

$arr1 = mysql_fetch_row($res1);

$messages = $arr1[0];

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

$arr1 = mysql_fetch_row($res1);

$unread = $arr1[0];

$res1 = mysql_query("SELECT COUNT(*) FROM messages WHERE sender=" . $CURUSER["id"] . " AND location IN ('out', 'both')") or print(mysql_error());

$arr1 = mysql_fetch_row($res1);

$outmessages = $arr1[0];

$res1 = mysql_query("SELECT COUNT(*) FROM messages WHERE receiver=" . $CURUSER["id"] . " && unread='yes'") or die("OopppsY!");

$arr1 = mysql_fetch_row($res1);

$unread = $arr1[0];

if ($unread)

$inboxpic = "inbox";

else

$inboxpic = "inbox";



//// check active torrents ///////////////////////

$res2 = mysql_query("SELECT COUNT(*) FROM peers WHERE userid=" . $CURUSER["id"] . " AND seeder='yes'") or print(mysql_error());

$row = mysql_fetch_row($res2);

$activeseed = $row[0];

$res2 = mysql_query("SELECT COUNT(*) FROM peers WHERE userid=" . $CURUSER["id"] . " AND seeder='no'") or print(mysql_error());

$row = mysql_fetch_row($res2);

$activeleech = $row[0];

//// end

?>



$w = "width=970";
//if ($_SERVER["REMOTE_ADDR"] == $_SERVER["SERVER_ADDR"]) $w = "width=970";

?>



align="center" border="1" cellspacing="0" cellpadding="10">























         Torrents seeding      Torrents leeching          Ratio:        Bonus Points      Invites: 
The time is:    



if ($messages){

print("$inboxpic $messages ($unread New)");

if ($outmessages)

print("  sentbox $outmessages");

else

print("  sentbox 0");

}

else

{

print("inbox 0");

if ($outmessages)

print("  sentbox $outmessages");

else

print("  sentbox 0   ");

}

?>



 if (get_user_class() >= UC_MODERATOR)
{
$rese = mysql_query("SELECT COUNT(id) as nummessages from staffmessages WHERE answered='no'");
$arre = mysql_fetch_assoc($rese);
$nummessages = $arre[nummessages];
if ($nummessages){
print("

\n");
print("There is $nummessages Staff message" . ($nummessages > 1 ? "s" : "") . "!");
print("

\n");}
}

$announcement = $CURUSER['announce'];
if ($announcement == "yes")
  print("Announcement");
  print("");

$res = mysql_query("SELECT COUNT(*) FROM peers WHERE userid=".sqlesc($CURUSER['id'])." AND connectable='no'") or sql_error();
$row = mysql_fetch_row($res);
     
if($row[0] > 0) {
print("

\n");
print("You are showing as Unconnectable on ".$row[0]." of your torrents.Please visit the forum for Advice on how to make yourself Connectable.");
print("

\n");
}

if ($unread)
{
  print("

\n");
  print("Имате $unread ново съобщение(я)" . ($unread > 1 ? "" : "") . "!");
  print("

\n");
}

//=== report link for big red box thanks carphunter18 :)
if (get_user_class() >= UC_MODERATOR) {
$res_reports = mysql_query("SELECT COUNT(*) FROM reports WHERE delt_with = '0'");
$arr_reports = mysql_fetch_row($res_reports);
$num_reports = $arr_reports[0];
if ($num_reports > 0)
echo"

Hey $CURUSER[username]! $num_reports Report" . ($num_reports > 1 ? "s" : "") . " to be dealt withclick HERE to view reports

\n";
}

}
function stdfoot() {
 ?>












        © Based On TBDev / Some Rights Reserved


?>



print("
\n");
print("\n");

}

function genbark($x,$y) {
    stdhead($y);
    print("

" . htmlspecialchars($y) . "

\n");
    print("

" . htmlspecialchars($x) . "

\n");
    stdfoot();
    exit();
}

function mksecret($len = 20) {
    $ret = "";
    for ($i = 0; $i < $len; $i++)
        $ret .= chr(mt_rand(0, 255));
    return $ret;
}

function httperr($code = 404) {
    header("HTTP/1.0 404 Not found");
    print("

Not Found

\n");
    print("

Sorry pal :(

\n");
    exit();
}

function gmtime()
{
    return strtotime(get_date_time());
}

/*
function logincookie($id, $password, $secret, $updatedb = 1, $expires = 0x7fffffff) {
    $md5 = md5($secret . $password . $secret);
    setcookie("uid", $id, $expires, "/");
    setcookie("pass", $md5, $expires, "/");

    if ($updatedb)
        mysql_query("UPDATE users SET last_login = NOW() WHERE id = $id");
}
*/

function logincookie($id, $passhash, $updatedb = 1, $expires = 0x7fffffff)
{
        setcookie("uid", $id, $expires, "/");
        setcookie("pass", $passhash, $expires, "/");

  if ($updatedb)
          mysql_query("UPDATE users SET last_login = NOW() WHERE id = $id");
}


function logoutcookie() {
    setcookie("uid", "", 0x7fffffff, "/");
    setcookie("pass", "", 0x7fffffff, "/");
}

function loggedinorreturn() {
    global $CURUSER;
    if (!$CURUSER) {
        header("Location: $BASEURL/login.php?returnto=" . urlencode($_SERVER["REQUEST_URI"]));
        exit();
    }
}


function deletetorrent($id) {
  global $torrent_dir;
  mysql_query("DELETE FROM torrents WHERE id = $id");
  mysql_query("DELETE FROM snatched WHERE torrentid = $id");
  foreach(explode(".","peers.files.comments.ratings") as $x)
      mysql_query("DELETE FROM $x WHERE torrent = $id");
  unlink("$torrent_dir/$id.torrent");
}

function pager($rpp, $count, $href, $opts = array()) {
    $pages = ceil($count / $rpp);

    if (!$opts["lastpagedefault"])
        $pagedefault = 0;
    else {
        $pagedefault = floor(($count - 1) / $rpp);
        if ($pagedefault < 0)
            $pagedefault = 0;
    }

    if (isset($_GET["page"])) {
        $page = 0 + $_GET["page"];
        if ($page < 0)
            $page = $pagedefault;
    }
    else
        $page = $pagedefault;

    $pager = "";

    $mp = $pages - 1;
    $as = "<< Prev";
    if ($page >= 1) {
        $pager .= "";
        $pager .= $as;
        $pager .= "
";
    }
    else
        $pager .= $as;
    $pager .= "      ";
    $as = "Next >>";
    if ($page < $mp && $mp >= 0) {
        $pager .= "";
        $pager .= $as;
        $pager .= "
";
    }
    else
        $pager .= $as;

    if ($count) {
        $pagerarr = array();
        $dotted = 0;
        $dotspace = 3;
        $dotend = $pages - $dotspace;
        $curdotend = $page - $dotspace;
        $curdotstart = $page + $dotspace;
        for ($i = 0; $i < $pages; $i++) {
            if (($i >= $dotspace && $i <= $curdotend) || ($i >= $curdotstart && $i < $dotend)) {
                if (!$dotted)
                    $pagerarr[] = "...";
                $dotted = 1;
                continue;
            }
            $dotted = 0;
            $start = $i * $rpp + 1;
            $end = $start + $rpp - 1;
            if ($end > $count)
                $end = $count;
            $text = "$start - $end";
            if ($i != $page)
                $pagerarr[] = "$text";
            else
                $pagerarr[] = "$text";
        }
        $pagerstr = join(" | ", $pagerarr);
        $pagertop = "

$pager$pagerstr

\n";
        $pagerbottom = "

$pagerstr$pager

\n";
    }
    else {
        $pagertop = "

$pager

\n";
        $pagerbottom = $pagertop;
    }

    $start = $page * $rpp;

    return array($pagertop, $pagerbottom, "LIMIT $start,$rpp");
}

function downloaderdata($res) {
    $rows = array();
    $ids = array();
    $peerdata = array();
    while ($row = mysql_fetch_assoc($res)) {
        $rows[] = $row;
        $id = $row["id"];
        $ids[] = $id;
        $peerdata[$id] = array(downloaders => 0, seeders => 0, comments => 0);
    }

    if (count($ids)) {
        $allids = implode(",", $ids);
        $res = mysql_query("SELECT COUNT(*) AS c, torrent, seeder FROM peers WHERE torrent IN ($allids) GROUP BY torrent, seeder");
        while ($row = mysql_fetch_assoc($res)) {
            if ($row["seeder"] == "yes")
                $key = "seeders";
            else
                $key = "downloaders";
            $peerdata[$row["torrent"]][$key] = $row["c"];
        }
        $res = mysql_query("SELECT COUNT(*) AS c, torrent FROM comments WHERE torrent IN ($allids) GROUP BY torrent");
        while ($row = mysql_fetch_assoc($res)) {
            $peerdata[$row["torrent"]]["comments"] = $row["c"];
        }
    }

    return array($rows, $peerdata);
}

function commenttable($rows)
{
        global $CURUSER;
        begin_main_frame();
        begin_frame();
        $count = 0;
        foreach ($rows as $row)
        {

 //Sort shit out
  if ($row["downloaded"] > 0)
 {
  $ratio = number_format($row["uploaded"] / $row["downloaded"], 3);
  $ratio = "$ratio";
 }
 else
  if ($arr2["uploaded"] > 0)
  $ratio = "Inf.";
 else
  $ratio = "---";
 
 $uploaded = mksize($row["uploaded"]);
 $downloaded = mksize($row["downloaded"]);
 
 $posterid = $row["user"];
 //end sort shit out

  //add popup to display
echo ("
style=\"position:absolute; width:140px; height:40px; border:1px solid black; display:none;
background-color:COCOCO\" align='center'> Downloaded: $downloaded
  Uploaded: $uploaded  Ratio: $ratio
\n");
// end add popup to display
 
              print("

#" . $row["id"] . " by ");
    if (isset($row["username"]))
                {
                      $clas = get_user_class_name($row["class"]);
            $title = $row["title"];
            if ($title == "")
                $title = ($row["class"]);
            else
                $title = htmlspecialchars($title);
print("             " href=userdetails.php?id=" . $row["user"] . ">" .
            htmlspecialchars($row["username"]) . "
" . ($row["donor"] == "yes" ? "Donor" : "") . ($row["warned"] == "yes" ? "\"Warned\"" : "") . " ($title) [$clas]\n");

                }
                else
                  print("(orphaned)\n");

                print(" at " . $row["added"] . " GMT" .
                        ($row["user"] == $CURUSER["id"] || get_user_class() >= UC_MODERATOR ? "- [Edit]" : "") .
                        (get_user_class() >= UC_MODERATOR ? "- [Delete]" : "") .
                        ($row["editedby"] && get_user_class() >= UC_MODERATOR ? "- [View original]" : "") . "

\n");
                $avatar = ($CURUSER["avatars"] == "yes" ? htmlspecialchars($row["avatar"]) : "");
                if (!$avatar)
                        $avatar = "/pic/default_avatar.gif";
                $text = format_comment($row["text"]);
    if ($row["editedby"])
            $text .= "

Last edited by $row[username] at $row[editedat] GMT

\n";
                begin_table(true);
                print("\n");
                print("\n");
                print("$text\n");
                print("\n");
    end_table();
  }
        end_frame();
        end_main_frame();
}

function searchfield($s) {
    return preg_replace(array('/[^a-z0-9]/si', '/^\s*/s', '/\s*$/s', '/\s+/s'), array(" ", "", "", " "), $s);
}

function genrelist() {
    $ret = array();
    $res = mysql_query("SELECT id, name FROM categories ORDER BY name");
    while ($row = mysql_fetch_array($res))
        $ret[] = $row;
    return $ret;
}

function linkcolor($num) {
    if (!$num)
        return "red";
//    if ($num == 1)
//        return "yellow";
    return "green";
}

function ratingpic($num) {
    global $pic_base_url;
    $r = round($num * 2) / 2;
    if ($r < 1 || $r > 5)
        return;
    return "\"rating:";
}

function CutName ($txt, $len)
{ return (strlen($txt)>$len ? substr($txt,0,$len-4) .'...':$txt);
}


function torrenttable($res, $variant = "index") {
        global $pic_base_url, $CURUSER;
       
        $browse_res = mysql_query("SELECT last_browse FROM users WHERE id='".$CURUSER['id']."'");

$browse_arr = mysql_fetch_row($browse_res);

$last_browse = $browse_arr[0];

$time_now = gmtime();

if ($last_browse > $time_now) {

  $last_browse=$time_now;

}?>


= UC_VIP) { ?>















$count_get = 0;

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)));

$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 . "&" . $get_name . "=" . $get_value;
} else {
$oldlink = $oldlink . $get_name . "=" . $get_value;
}
$count_get++;
}

}

if ($count_get > 0) {
$oldlink = $oldlink . "&";
}


if ($_GET['sort'] == "1") {
if ($_GET['type'] == "desc") {
$link1 = "asc";
} else {
$link1 = "desc";
}
}

if ($_GET['sort'] == "2") {
if ($_GET['type'] == "desc") {
$link2 = "asc";
} else {
$link2 = "desc";
}
}

if ($_GET['sort'] == "3") {
if ($_GET['type'] == "desc") {
$link3 = "asc";
} else {
$link3 = "desc";
}
}

if ($_GET['sort'] == "4") {
if ($_GET['type'] == "desc") {
$link4 = "asc";
} else {
$link4 = "desc";
}
}

if ($_GET['sort'] == "5") {
if ($_GET['type'] == "desc") {
$link5 = "asc";
} else {
$link5 = "desc";
}
}

if ($_GET['sort'] == "6") {
if ($_GET['type'] == "desc") {
$link6 = "asc";
} else {
$link6 = "desc";
}
}

if ($_GET['sort'] == "7") {
if ($_GET['type'] == "desc") {
$link7 = "asc";
} else {
$link7 = "desc";
}
}

if ($_GET['sort'] == "8") {
if ($_GET['type'] == "desc") {
$link8 = "asc";
} else {
$link8 = "desc";
}
}

if ($_GET['sort'] == "9") {
if ($_GET['type'] == "desc") {
$link9 = "asc";
} else {
$link9 = "desc";
}
}

if ($_GET['sort'] == "10") {
if ($_GET['type'] == "desc") {
$link10 = "asc";
} else {
$link10 = "desc";
}
}

if ($link1 == "") { $link1 = "asc"; } // for torrent name
if ($link2 == "") { $link2 = "desc"; }
if ($link3 == "") { $link3 = "desc"; }
if ($link4 == "") { $link4 = "desc"; }
if ($link5 == "") { $link5 = "desc"; }
if ($link6 == "") { $link6 = "desc"; }
if ($link7 == "") { $link7 = "desc"; }
if ($link8 == "") { $link8 = "desc"; }
if ($link9 == "") { $link9 = "desc"; }
if ($link10 == "") { $link10 = "desc"; }

?>





#if ($wait)
##{
#print("\n");
#}

if ($variant == "mytorrents")
{
//print("\n");
//print("\n");

}

?>
















= UC_MODERATOR) {
if ($variant == "index")
print("\n"); } ?>

print("\n");

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

        $id = $row["id"];


    print("  onMouseover=this.style.backgroundColor='#252525';
 onMouseout=this.style.backgroundColor='';>\n");

if ($row["sticky"] == "yes"){
 print("
\n");
} else {
print("\n");
}

            print("\n");

if (!empty($row['smalld'])) {
$smalld = "Genre: " . htmlspecialchars($row["smalld"]) . "";        }
        else {
        $smalld = "";
        }

$thisisfree = ($row[free]=="yes" ? "
":"");
$sticky = ($row[sticky]=="yes" ? "
sticky
" : "");
$dispname = htmlspecialchars($row["name"]);
$fullname = htmlspecialchars($row["name"]);
$file = htmlspecialchars($row["filename"]);
$download = ("");

$ban = ($row[banned]=="yes" ? " ":"");


if ($row["nfo"]) {
$nfo = "NFO"; } else {
$nfo = ""; }

//if ($row["smalld"]) {
//$genre = "$row[smalld]"; }



if ($row["smalld"]) {
$genre2 = "
Type Name Wait EditВидим Rating Added Uploader
");
              if (isset($row["cat_name"])) {
            print("");
            if (isset($row["cat_pic"]) && $row["cat_pic"] != "")
                print("\"{$row['cat_name']}\"");
            else
                print($row["cat_name"]);
            print("
");
        }
        else
            print("-");
        print("
Жанğ:".$row["smalld"]."
";
} else {
$genre2 = ""; }

                        $bgsubs_res = mysql_query("SELECT bgsubs FROM torrents WHERE id=$id") or
sqlerr(__FILE__, __LINE__);
                        $bgsubs_row = mysql_fetch_assoc($bgsubs_res);
                       
                        $bgaudio_res = mysql_query("SELECT bgaudio FROM torrents WHERE id=$id") or
sqlerr(__FILE__, __LINE__);
                        $bgaudio_row = mysql_fetch_assoc($bgaudio_res);


$subs = ($row[bgsubs]=="yes" ? "
":"");
$audio = ($row[bgaudio]=="yes" ? "
":"");

$poster = ("
");

                ////// cut name
                $nos_garums=strlen($dispname);
                $nos_pielaujamais="53"; // maximum lenght
                if($nos_garums > $nos_pielaujamais){
                $nos_alt="title=\"$dispname\"";
                $dispname=substr($dispname,0,$nos_pielaujamais)."...";
                }

                print("$ban$dispname $download $nfo   $thisisfree $subs $audio$smalld\n");
 

                //print("$poster\n");


//print("Download Download\n");


        print("         if ($variant == "mytorrents")
            print("returnto=" . urlencode($_SERVER["REQUEST_URI"]) . "&");
        print("id=$id");
        if ($variant == "index")
           

              if ($variant == "mytorrents")

            print("
edit\n");
print("\n");
        /*if ($variant == "mytorrents") {
            print("");
            if ($row["visible"] == "no")
                print("no");
            else
                print("yes");
            print("\n");
        }*/

        /*if ($row["type"] == "single")
          print("" . $row["numfiles"] . "\n");
        else {
            if ($variant == "index")
                print("" . $row["numfiles"] . "\n");
            else
                print("" . $row["numfiles"] . "\n");
        }*/

      if (!$row["comments"])
            print("" . $row["comments"] . "\n");
        else {
            if ($variant == "index")
                print("" . $row["comments"] . "\n");
            else
                print("" . $row["comments"] . "\n");
        }

        print("");
        if (!isset($row["rating"]))
        print("---");        else {  $rating = round($row["rating"] * 2) / 2;
        $rating = ratingpic($row["rating"]);
        if (!isset($rating))               
        print("---");
        else
        print($rating); } print("\n");

        print("" . str_replace(" ", "", $row["added"]) . "\n");
                #$ttl = (28*24) - floor((gmtime() - sql_timestamp_to_unix_timestamp($row["added"])) / 3600);
                #if ($ttl == 1) $ttl .= "hour"; else $ttl .= "hours";
        #print("$ttl\n");

        print("" . str_replace(" ", " ", mksize($row["size"])) . "\n");

//      print("" . $row["views"] . "\n");
//        print("" . $row["hits"] . "\n");


        $_s = "";
        if ($row["times_completed"] != 1)
          $_s = "s";
        if (get_user_class() >= UC_MODERATOR) { #Made Link Clickable for Mod+ [ D3SI ]
          print("" . number_format($row["times_completed"]) . "times\n");
         
  }else{
         
          print("" . number_format($row["times_completed"]) . "пъти\n");
         
  }

        if ($row["seeders"]) {
            if ($variant == "index")
            {
              if ($row["leechers"]) $ratio = $row["seeders"] / $row["leechers"]; else $ratio = 1;
                print("" . $row["seeders"] . "\n");
            }
            else
                print("" . $row["seeders"] . "\n");
        }
        else
            print("" . $row["seeders"] . "\n");


        if ($row["leechers"]) {
            if ($variant == "index")
                print("" .
                  number_format($row["leechers"]) . ($peerlink ? "" : "") .
                  "
\n");
            else
                print("" . $row["leechers"] . "\n");
        }
        else
            print("0\n");

 
if ($row["avatar"]) {
$avatar = ("onmouseover=\"{Tip('');}\" onmouseout=\"UnTip();\"");
                    } else {
$avatar = (""); }

        if (get_user_class() >= UC_MODERATOR) {
        if ($variant == "index")
            print("" . (isset($row["username"]) ? ("
" . htmlspecialchars($row["username"]) . "") : "Анонимен") . "\n"); }
       

        print("\n");
    }


    print("\n");

    return $rows;
}


function hash_pad($hash) {
    return str_pad($hash, 20);
}

function hash_where($name, $hash) {
    $shhash = preg_replace('/ *$/s', "", $hash);
    return "($name = " . sqlesc($hash) . " OR $name = " . sqlesc($shhash) . ")";
}

function get_user_icons($arr, $big = false)
{
        if ($big)
        {
                $donorpic = "starbig.png";
                $warnedpic = "warnedbig.gif";
                $disabledpic = "disabledbig.gif";
                $style = "style='margin-left: 4pt'";
        }
        else
        {
                $donorpic = "star.png";
                $warnedpic = "warning.png";
                $disabledpic = "disabled.gif";
                $style = "style=\"margin-left: 2pt\"";
        }
        $pics = $arr["donor"] == "yes" ? "Donor" : "";
        if ($arr["enabled"] == "yes")
                $pics .= $arr["warned"] == "yes" ? "\"Warned\"" : "";
        else
                $pics .= "\"Disabled\"\n";
        return $pics;
}

function parked()
{
      global $CURUSER;
      if ($CURUSER["parked"] == "yes")
 stderr("Error", "Your account is parked.");
}

require "global.php";

?>

whunterjr83 13th April 2015 03:32

Error
 
1 Attachment(s)
i get this error after install on a localhost

Code:

Parse error: syntax error, unexpected end of file in C:\wamp\www\index.php on line 386
i can go to localhost/signup or login but soon as i type localhost it just comes up with the error . secrets.php and bittorrent.php are all matched with the site of localhost

any help greatful please

BamBam0077 13th April 2015 06:16

NOT TESTED BUT I DID FIND YOU HAD AN EXTRA { below line 112 that didn't need to be there

Try This:
Code:

ob_start("ob_gzhandler");

require "include/bittorrent.php";
dbconn(true);

loggedinorreturn();


if ($_SERVER["REQUEST_METHOD"] == "POST") {
    //$choice = (int)$_POST["choice"];
    #$choice = (int) $_POST["choice"];
    $choice = $_POST["choice"];
    #if ($CURUSER && $choice != "" && $choice < 256 && $choice == floor($choice)) { Original
    if ($CURUSER && ctype_digit($choice) != "" && $choice < 256 && $choice == floor($choice)) { #From TBDEV Fixes
        $res = do_mysql_query("SELECT * FROM polls ORDER BY added DESC LIMIT 1") or sqlerr();
        $arr = mysql_fetch_assoc($res) or die("No poll");
        $pollid = $arr["id"];
        $userid = $CURUSER["id"];
        $insert_pollvote = do_mysql_query("INSERT DELAYED INTO pollanswers VALUES(0, $pollid, $userid, $choice)");
        //Check the error we get if the user has already voted
        if (mysql_errno() == 1062) {
            stderr("Error", "Dupe vote");
        }
        if (mysql_affected_rows() != 1)
        stderr("Error", "An error occured. Your vote has not been counted.");
        header("Location: ".$GLOBALS['DEFAULTBASEURL']);
        die;
    }
    else
    stderr("Error", "Please select an option.");
}

/*
$a = @mysql_fetch_assoc(@mysql_query("SELECT id,username FROM users WHERE status='confirmed' ORDER BY id DESC LIMIT 1")) or die(mysql_error());
if ($CURUSER)
  $latestuser = "" . $a["username"] . "";
else
  $latestuser = $a['username'];
*/

$registered = number_format(get_row_count("users"));
//$unverified = number_format(get_row_count("users", "WHERE status='pending'"));
$torrents = number_format(get_row_count("torrents"));
//$dead = number_format(get_row_count("torrents", "WHERE visible='no'"));

$r = mysql_query("SELECT value_u FROM avps WHERE arg='seeders'") or sqlerr(__FILE__, __LINE__);
$a = mysql_fetch_row($r);
$seeders = 0 + $a[0];
$r = mysql_query("SELECT value_u FROM avps WHERE arg='leechers'") or sqlerr(__FILE__, __LINE__);
$a = mysql_fetch_row($r);
$leechers = 0 + $a[0];
$seeders = get_row_count("peers", "WHERE seeder='yes'");
$leechers = get_row_count("peers", "WHERE seeder='no'");
$peers = number_format($seeders + $leechers);
$seeders = number_format($seeders);
$leechers = number_format($leechers);

stdhead();


/*?>

print("
");


/*?>


if (get_user_class() >= UC_ADMINISTRATOR) {
print("News - Admin");
 } else {
print("News");
        }


print("\n");
$res = mysql_query("SELECT * FROM news WHERE ADDDATE(added, INTERVAL 45 DAY) > NOW() ORDER BY added DESC LIMIT 10") or sqlerr(__FILE__, __LINE__);
if (mysql_num_rows($res) > 0)
{

    print("
    \n");
        while($array = mysql_fetch_array($res)) {
       

          print("
  • " . gmdate("Y.m.d",strtotime($array['added'])) . "");

          print(" - ".format_comment($array['body'])."");

        if (get_user_class() >= UC_MODERATOR)
        {
            print(" [E]");
            print(" [D]");
        }


        print("
  • ");
      }
      print("
\n"); }

 if ($CURUSER)
{

  // Get current poll
  $res = mysql_query("SELECT * FROM polls ORDER BY added DESC LIMIT 1") or sqlerr();
  if($pollok=(mysql_num_rows($res)))
  {
      $arr = mysql_fetch_assoc($res);
      $pollid = $arr["id"];
      $userid = $CURUSER["id"];
      $question = $arr["question"];
      $o = array($arr["option0"], $arr["option1"], $arr["option2"], $arr["option3"], $arr["option4"],
        $arr["option5"], $arr["option6"], $arr["option7"], $arr["option8"], $arr["option9"],
        $arr["option10"], $arr["option11"], $arr["option12"], $arr["option13"], $arr["option14"],
        $arr["option15"], $arr["option16"], $arr["option17"], $arr["option18"], $arr["option19"]);

  // Check if user has already voted
      $res = mysql_query("SELECT * FROM pollanswers WHERE pollid=$pollid AND userid=$userid") or sqlerr();
      $arr2 = mysql_fetch_assoc($res);
  }


  if (get_user_class() >= UC_MODERATOR) {
print("Poll - New - Edit - Delete");
          } else {
print("Poll"); }


   
    if($pollok) {
        print("
\n");
      print("
");
      print("

$question

\n");
      $voted = $arr2;
      if ($voted)
      {
        // display results
        if ($arr["selection"])
          $uservote = $arr["selection"];
        else
          $uservote = -1;
            // we reserve 255 for blank vote.
        $res = mysql_query("SELECT selection FROM pollanswers WHERE pollid=$pollid AND selection < 20") or sqlerr();

        $tvotes = mysql_num_rows($res);

        $vs = array(); // array of
        $os = array();

        // Count votes
        while ($arr2 = mysql_fetch_row($res))
          $vs[$arr2[0]] += 1;

        reset($o);
        for ($i = 0; $i < count($o); ++$i)
          if ($o[$i])
            $os[$i] = array($vs[$i], $o[$i]);

        function srt($a,$b)
        {
          if ($a[0] > $b[0]) return -1;
          if ($a[0] < $b[0]) return 1;
          return 0;
        }

        // now os is an array like this: array(array(123, "Option 1"), array(45, "Option 2"))
        if ($arr["sort"] == "yes")
            usort($os, srt);

        print("\n");
        $i = 0;
        while ($a = $os[$i])
        {
          if ($i == $uservote)
            $a[1] .= " *";
          if ($tvotes == 0)
              $p = 0;
          else
              $p = round($a[0] / $tvotes * 100);
          if ($i % 2)
            $c = "";
          else
            $c = " bgcolor=";
          print("\n");
          ++$i;
        }
        print("
" . $a[1] . "  " .
            " $p%
\n");
            $tvotes = number_format($tvotes);
        print("

Votes: $tvotes

\n");
      }
      else
      {
        print("
\n");
        $i = 0;
        while ($a = $o[$i])
        {
          print("$a\n");
          ++$i;
        }
        print("");
        print("Blank vote (a.k.a. \"I just want to see the results!\")\n");
        print("

");
      }
?>

if ($voted)
  print("

Previous Polls

\n");
?>


    } else {
        echo "
\n";
      echo "
";
      echo"

No new poll

\n";
      echo "
";
    }
}
?>

= UC_VIP) {

$dt = gmtime() - 180;
$dt = sqlesc(get_date_time($dt));
$result = mysql_query("SELECT SUM(last_access >= $dt) AS totalol FROM users") or sqlerr(__FILE__, __LINE__);

while ($row = mysql_fetch_array ($result))
{
$totalonline      = $row["totalol"];
}

$a = @mysql_fetch_assoc(@mysql_query("SELECT id, username, donor FROM users WHERE status='confirmed' ORDER BY id DESC LIMIT 1")) or die(mysql_error());
if ($CURUSER)
  $latestuser = "" . $a["username"] . "";
else
  $latestuser = $a['username'];


$dt = gmtime() - 180;
$dt = sqlesc(get_date_time($dt));
$res = mysql_query("SELECT id, username, class, donor, avatar FROM users WHERE last_access >= $dt ORDER BY username") or print(mysql_error());
while ($arr = mysql_fetch_assoc($res))
{
if ($activeusers) $activeusers .= " - \n";
switch ($arr["class"])
{
case UC_STAFF_LEADER:
$arr["username"] = "" . $arr["username"] . "";
break;
case UC_SYSOP:
$arr["username"] = "" . $arr["username"] . "";
break;
case UC_ADMINISTRATOR:
$arr["username"] = "" . $arr["username"] . "";
break;
case UC_MODERATOR:
$arr["username"] = "" . $arr["username"] . "";
break;
case UC_UPLOADER:
$arr["username"] = "" . $arr["username"] . "";
break;
case UC_VIP:
$arr["username"] = "" . $arr["username"] . "";
break;
case UC_POWER_USER:
$arr["username"] = "" . $arr["username"] . "";
break;
case UC_USER:
$arr["username"] = "" . $arr["username"] . "";
break;
}


$donator = $arr["donated"] > 0;
if ($donator)
$activeusers .= "";
if ($CURUSER)

if ($arr["avatar"]) {
$activeusers .= "');}\" onmouseout=\"UnTip();\">" . $arr["username"] . "";
} else {
$activeusers .= "');}\" onmouseout=\"UnTip();\">" . $arr["username"] . ""; }

else
$activeusers .= "$arr[username]";
if ($donator)
$activeusers .= "Donated $$arr[donated]
";


}
if (!$activeusers)
$activeusers = "Активни Потребители за последните 15 минути.";
print("Active users ($totalonline)");
?>





    


 














= UC_VIP) {?>
Stats");?>


















Max users
Registered users
Torrents
Peers
Seeders
Leechers















stdfoot();
?>

Dani18 4th February 2024 17:50

Why can't I register my first account? it gives me this error! help

https://i.postimg.cc/gjXXNKzr/Immagine.png


All times are GMT +2. The time now is 09:17.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.