Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Community Cafe (http://www.bvlist.com/forumdisplay.php?f=18)
-   -   Logout Problem (http://www.bvlist.com/showthread.php?t=3763)

\n");
}

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

function validemail($email)
{
  // First, we check that there's one @ symbol, and that the lengths are right
  if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) {
    // Email invalid because wrong number of characters in one section, or wrong number of @ symbols.
    return false;
  }
  // Split it into sections to make life easier
  $email_array = explode("@", $email);
  $local_array = explode(".", $email_array[0]);
  for ($i = 0; $i < sizeof($local_array); $i++) {
    if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) {
      return false;
    }
  }
  if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) { // Check if domain is IP. If not, it should be valid domain name
    $domain_array = explode(".", $email_array[1]);
    if (sizeof($domain_array) < 2) {
        return false; // Not enough parts to domain
    }
    for ($i = 0; $i < sizeof($domain_array); $i++) {
      if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) {
        return false;
      }
    }
  }
  return true;
}

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, $FUNDS, $SITENAME, $pic_base_url, $default_theme;
   
$res = mysql_query("SELECT * FROM siteonline") or sqlerr(__FILE__, __LINE__);//Select values from database
$row = mysql_fetch_array($res);

//Variables for the notification of the closure site (see stdhead.php)
if ($row["onoff"] !=1){
$my_siteoff = 1;
$my_siteopenfor = $row['class_name'];
}
//

//========================================================================================//
//$row["onoff"] = 1;//EMERGENCY SIGN: uncomment if you can not enter !!! //
//======================================================================================//

if (($row["onoff"] !=1) && (!$CURUSER)){                                              //Check: Does the site is closed and, if the guest:
        die("The site is closed!
       
devilsyard 10th November 2009 22:01

Logout Problem
 
Code:

Warning:  Cannot modify header information - headers already sent by (output started at C:\AppServ\www\include\global.php:1) in C:\AppServ\www\include\bittorrent.php on line 496

Warning:  Cannot modify header information - headers already sent by (output started at C:\AppServ\www\include\global.php:1) in C:\AppServ\www\include\bittorrent.php on line 497

Warning:  Cannot modify header information - headers already sent by (output started at C:\AppServ\www\include\global.php:1) in C:\AppServ\www\logout.php on line 8



bittorrent.php
Code:


// DEFINE IMPORTANT CONSTANTS
define('IN_TRACKER', true);

// SET PHP ENVIRONMENT
@error_reporting(E_ALL & ~E_NOTICE);
@ini_set('error_reporting', E_ALL & ~E_NOTICE);
@ini_set('display_errors', '1');
@ini_set('display_startup_errors', '0');
@ini_set('ignore_repeated_errors', '1');
@ignore_user_abort(1);
@set_time_limit(0);
@set_magic_quotes_runtime(0);
@session_start();
define ('ROOT_PATH', dirname(dirname(__FILE__))."/");

// INCLUDE BACK-END
if (empty($rootpath))
    $rootpath = ROOT_PATH;
require_once($rootpath . 'include/core.php');

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

//$FUNDS = "$2,610.31"; //^_^

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

// Max users on site
$maxusers = 75000; // LoL Who we kiddin' here?

//Pic dir
$pic_base_url = "" . $DEFAULTBASEURL . "/pic/";

// Max users on site
$announce_urls = array();
$announce_urls[] = "$DEFAULTBASEURL/announce.php";

if ($_SERVER["HTTP_HOST"] == "")                        // Root Based Installs Comment Out if in Sub-Dir
  $_SERVER["HTTP_HOST"] = $_SERVER["SERVER_NAME"];      // Comment out for Sub-Dir Installs
$BASEURL = "$DEFAULTBASEURL";          // Comment out for Sub-Dir Installs


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

$autoclean_interval = 900;

require_once("cleanup.php");

// 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, $mysql_charset;

    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());
       
    mysql_query('SET NAMES '.$mysql_charset);

    userlogin();

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


function userlogin() {
    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 (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"] !== $row["passhash"])
        return;
        $time = time();
    if($time - $row['last_access_numb'] < 300){
      $onlinetime = time() - $row['last_access_numb'];
        $userupdate[] = "onlinetime = onlinetime + ".sqlesc($onlinetime);
    }
    $userupdate[] = "last_access_numb = ".sqlesc($time);
    //end online-time
   
    $userupdate[] = "last_access = ".sqlesc(get_date_time());
    $userupdate[] = "ip = ".sqlesc($ip);
   
    ///----Hide members IP address----///
    include('include/hideip.php');
    ///---End Hide members IP address----///
    mysql_query("UPDATE users SET ".implode(", ", $userupdate)." WHERE id=" . $row["id"]);$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

       

".$row['reason']."


       


        Please come back later...


       

       
       
       
       
       
       
       
       
       

        User login:
Name:
Password:

       

       

       
");
    }
    elseif (($row["onoff"] !=1) and (($CURUSER["class"] < $row["class"]) && ($CURUSER["id"] != 1))){ //Check: Does the site is closed, the class nick less
                                                                                                //than the permissible and not whether you are by Admin (ID=1)
    die("The site is closed!                                                       
       

       

".$row['reason']."


       


            Please come back later...

");
}


  header("Content-Type: text/html; charset=iso-8859-1");
  eval(base64_decode("ZGVmaW5lICgnVEJWRVJTSU9OJywnVEJERVZfUlVfdl9bMy4xXScpOw=="));
  eval(base64_decode("aWYgKCR0aXRsZSA9PSAiIikNCiAgICAgICAgJHRpdGxlID0gJFNJVEVOQU1FIC4oaXNzZXQoJF9HRVRbJ25lb24nXSk/IiAoIi5UQlZFUlNJT04uIikiOicnKTsNCiAgICBlbHNlDQogICAgICAgICR0aXRsZSA9ICRTSVRFTkFNRSAuKGlzc2V0KCRfR0VUWyduZW9uJ10pPyIgKCIuVEJWRVJTSU9OLiIpIjonJykuICIgOjogIiAuIGh0bWxzcGVjaWFsY2hhcnMoJHRpdGxlKTs="));
 
    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"];
        else
            $ss_uri = $default_theme;
    } else
        $ss_uri = $default_theme;
 
  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];
  }

require_once("./themes/" . $ss_uri . "/head.php");
require_once("./themes/" . $ss_uri . "/main.php");

if ($my_siteoff){
    print("
\n");
    print("The site is currently disabled!".$my_siteopenfor.".
             
    To activate the site and (or) change the access class, click here!
");
    print("

\n");
    }

if ($unread)
{
  print("

\n");
  print("You have $unread new message" . ($unread > 1 ? "s" : "") . "!");
  print("

\n");
}}
// stdhead

function stdfoot() {
 
 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"];
 }
    require_once("themes/$ss_uri/foot.php");
}
// stdfoot
   
   
function genbark($x,$y) {
    stdhead($y);
    print("

" . htmlspecialchars($y) . "

\n");
    print("

" . htmlspecialchars($x) . "

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

function cpfooter() {
$referring_url = $_SERVER['HTTP_REFERER'];   
print("\n");
print("\n");
print("

Return to whence you came

\n");
}

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, $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, $DEFAULTBASEURL;
    if (!$CURUSER) {
        header("Location: $DEFAULTBASEURL/login.php?returnto=" . urlencode($_SERVER["REQUEST_URI"]));
        exit();
    }
}

function deletetorrent($id) {
    global $torrent_dir;
    mysql_query("DELETE FROM torrents WHERE id = $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, $pic_base_url;
    begin_main_frame();
    begin_frame();
    $count = 0;
    foreach ($rows as $row)
    {
        print("

#" . $row["id"] . " by ");
    if (isset($row["username"]))
        {

            $title = $row["title"];
            if ($title == "")
                $title = get_user_class_name($row["class"]);
            else
                $title = htmlspecialchars($title);
        print("             " href=userdetails.php?id=" . $row["user"] . ">" . get_user_class_color($row["class"], $row["username"]) . "" . ($row["donor"] == "yes" ? "Donor" : "") . ($row["warned"] == "yes" ? "\"Warned\"" : "") . " ($title)\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_base_url}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 torrenttable($res, $variant = "index") {
    global $pic_base_url, $CURUSER;
   
    ?>





    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;
  }
?>






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

?>









    if ($variant == "index")
        print("\n");

    print("\n");

    while ($row = mysql_fetch_assoc($res)) {
        $id = $row["id"];
        print("\n");

        print("");
    }
        // allocate releases by days
        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("\n");
       
        $dispname = htmlspecialchars($row["name"]);
        $image1 = htmlspecialchars($row["image1"]);
        print("\n");
        if ($variant == "mytorrents") {
            print("\n");
        }

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

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

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

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

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

        if ($variant == "index")
            print("\n");

        print("\n");
        $oldday = $day;
        print("");
    }

    print("
Type Name Edit.Visible Files Comm. Added TTL Size Snatched Upped by
");
        //    allocate releases by days
        $day = get_date_time(sql_timestamp_to_unix_timestamp($row["added"])); // new date
        $day = (int)date("d", strtotime($day)); // new date
       
        if ($variant == "index" and $row["sticky"] == "no" and ($oldday != $day)){

    if (get_user_class() >= UC_MODERATOR) {
        $collspansday = 9;
    } else {
        $collspansday = 7;
    }
               
        $addeddate = get_date_time(sql_timestamp_to_unix_timestamp($row["added"])); // new date
        $addeddate = date("d-m-Y", strtotime($addeddate)); // new date
               
        print("
Added: ".$addeddate."

        ".($row["sticky"] == "yes" ? "      : " : "")."
        \"Preview\"
');\" onmouseout=\"return nd();\" href=\"details.php?");
        if ($variant == "mytorrents")
            print("returnto=" . urlencode($_SERVER["REQUEST_URI"]) . "&");
        print("id=$id");
        if ($variant == "index")
            print("&hit=1");
        $freeleech = mysql_result(mysql_query("SELECT freeleech FROM torrents WHERE id = '$id'"), 0);
               
        if ($freeleech == 1)
        {
            $freeimage = "";
        }
        else
        {
            $freeimage = "";
        }

        print("\">$dispname
$freeimage\n");

        if ($variant == "mytorrents")
            print("
edit\n");
        print("
");
            if ($row["visible"] == "no")
                print("no");
            else
                print("yes");
            print("
" . $row["numfiles"] . "" . $row["numfiles"] . "" . $row["numfiles"] . " " . $row["comments"] . "" . $row["comments"] . "" . $row["comments"] . " " . str_replace(" ", "", $row["added"]) . "$ttl" . str_replace(" ", "", mksize($row["size"])) . "" . number_format($row["times_completed"]) . "times " . $row["seeders"] . "" .
                  $row["seeders"] . "
" . $row["seeders"] . " " .
                  number_format($row["leechers"]) . ($peerlink ? "
" : "") .
                  "
" .
                  $row["leechers"] . "
0 " . (isset($row["username"]) ? ("" . htmlspecialchars($row["username"]) . "") : "(unknown)") . "
\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)
{
    global $pic_base_url;
    if ($big)
    {
        $donorpic = "starbig.gif";
        $warnedpic = "warnedbig.gif";
        $disabledpic = "disabledbig.gif";
        $style = "style='margin-left: 4pt'";
    }
    else
    {
        $donorpic = "star.gif";
        $warnedpic = "warned.gif";
        $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;
}

require "global.php";
?>
logout.php

Code:


require_once("include/bittorrent.php");
dbconn();

logoutcookie();

Header("Location: $BASEURL/");

?>

anyone have any ideas?
Fynnon 10th November 2009 23:39

dude, what source are you using and what were you doing when this issue occured ?

devilsyard 11th November 2009 03:01

iv fixed it i changed the value in global and user was the same number as leech.

Phogo 11th November 2009 03:33

Why not post what source it is and your fix, so others can learn?


All times are GMT +2. The time now is 08:31.

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