Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Torrent Strike (http://www.bvlist.com/forumdisplay.php?f=21)
-   -   how can I fix the poll to -->> Last 10 Torrents (http://www.bvlist.com/showthread.php?t=1700)

";
end_table();
?>


Sysop |
Administator |
Moderator |
Uploader |
VIP |
PowerUser | User


echo "
Welcome to our newest member $latestuser!
\n";
end_frame ();
// -------------------------------


?>




Disclaimer: None of the files shown here are actually hosted on this server. The links are provided solely by this site's users.
The administrator of this site (torrentstrike.info) cannot be held responsible for what its users post, or any other actions of its users.
You may not use this site to distribute or download any material when you do not have the legal rights to do so.
It is your own responsibility to adhere to these terms.




marc234 2nd January 2009 20:57

how can I fix the poll to -->> Last 10 Torrents
 
help :-)

how can I fix the poll to -->> Last 10 Torrents ( torrentstrikefull ) from index

my index:
Code:

ob_start("ob_gzhandler");

require "include/bittorrent.php";
loggedinorreturn();

if ($_SERVER["REQUEST_METHOD"] == "POST")
{
  $choice = $_POST["choice"];
  if ($CURUSER && $choice != "" && $choice < 256 && $choice == floor($choice))
  {
    $res = 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"];
    $res = mysql_query("SELECT * FROM pollanswers WHERE pollid=$pollid && userid=$userid") or sqlerr();
    $arr = mysql_fetch_assoc($res);
    if ($arr) die("Dupe vote");
    mysql_query("INSERT INTO pollanswers VALUES(0, $pollid, $userid, $choice)") or sqlerr();
    if (mysql_affected_rows() != 1)
      stderr("Error", "An error occured. Your vote has not been counted.");
    header("Location: $BASEURL/");
    die;
  }
  else
    //////////////////////////FlashGames/////////////////////////////

$user = $CURUSER['id'];
if($_GET["act"]=="Arcade")
{
if($_POST['gname'] == "asteroids")
{
$game = 1;
$level = 1;
$score = $_POST['score'];
}
if($_POST['gname'] == "breakout")
{
$game = 2;
$level = 1;
$score = $_POST['gscore'];
}
if($_POST['gname'] == "hexxagon")
{
$game = 3;
$level = 1;
$score = $_POST['gscore'];
}
if($_POST['gname'] == "invaders")
{
$game = 4;
$level = 1;
$score = $_POST['score'];
}
if($_POST['gname'] == "moonlander")
{
$game = 5;
$level = 1;
$score = $_POST['gscore'];
}
if($_POST['gname'] == "pacman")
{
$game = 6;
$level = 1;
$score = $_POST['gscore'];
}
if($_POST['gname'] == "psol")
{
$game = 7;
$level = 1;
$score = $_POST['gscore'];
}
if($_POST['gname'] == "simon")
{
$game = 8;
$level = 1;
$score = $_POST['gscore'];
}
if($_POST['gname'] == "snake")
{
$game = 9;
if($_POST['levelName'] == "LEVEL: SLUG")
{
$level = 1;
}
if($_POST['levelName'] == "LEVEL: WORM")
{
$level = 2;
}
if($_POST['levelName'] == "LEVEL: PYTHON")
{
$level = 3;
}
$score = $_POST['score'];
}
if($_POST['gname'] == "tetris")
{
$game = 10;
$level = $_POST['level'];
$score = $_POST['gscore'];
}
mysql_query("INSERT INTO `flashscores` ( `ID` , `game` , `user` , `level` , `score` ) VALUES ( '', '".$game."', '".$user."', '".$level."', '".$score."');") OR DIE(MySQL_ERROR());
$url="flashscores.php";
print("\n");

}else{
stderr("Error", "An error occured.");
}
}

///////////////////////////////End//////////////////////////////


if ($CURUSER)
{
$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)
{
$file2 = "$CACHE/index/newestuser.txt";
$expire = 2*60; // 2 minutes
if (file_exists($file2) && filemtime($file2) > (time() - $expire)) {
    $newestuser = unserialize(file_get_contents($file2));
} else {

$res = mysql_query("SELECT id,username FROM users WHERE status='confirmed' ORDER BY id DESC LIMIT 1") or die(mysql_error());
while ($user = mysql_fetch_array($res) ) {
        $newestuser[] = $user;
    }
    $OUTPUT = serialize($newestuser);
    $fp = fopen($file2,"w");
    fputs($fp, $OUTPUT);
    fclose($fp);
} // end else
foreach ($newestuser as $a)
{
  $latestuser = "" . $a["username"] . "";
}
}

$file = "$CACHE/index/stats.txt";
$expire = 10*60; // 10 minutes
if (file_exists($file) &&
    filemtime($file) > (time() - $expire)) {
$a=unserialize(file_get_contents($file));
$male = $a[1];
$female= $a[2];
$registered = $a[3];
$unverified = $a[4];
$torrents = $a[5];
$ratio = $a[6];
$peers = $a[7];
$seeders = $a[8];
$leechers = $a[9];
$dead = $a[10];
$NAT = $a[11];
} else {
$male = number_format(get_row_count("users", "WHERE gender='Male'")); 
$female = number_format(get_row_count("users", "WHERE gender='Female'"));
$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'"));
$NAT    = number_format(get_row_count("peers", "WHERE connectable='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'");
if ($leechers == 0)
  $ratio = 0;
else
  $ratio = round($seeders / $leechers * 100);
$peers = number_format($seeders + $leechers);
$seeders = number_format($seeders);
$leechers = number_format($leechers);
$stats1 = array(1 => "$male", "$female", "$registered", "$unverified", "$torrents", "$ratio", "$peers", "$seeders", "$leechers", "$dead", "$NAT");
$stats2 = serialize($stats1);
$fh = fopen($file, "w");
fwrite($fh,$stats2);
fclose($fh);
}
}

stdhead();
//echo "Welcome to our newest member, $latestuser!\n";

$news_title = "Recent news";

print("

\n");

print (date("l d<\sup>S F Y h:i A"));

$time = round(getmicrotime() - $time_start,4);
$percent = $time * 60;
echo "
Global Server Load (All websites on current host servers): ($percent %)
");
//print("

Recent news");
if (get_user_class() >= UC_ADMINISTRATOR)
$news_title.=" - [News page]";
//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
\n");
end_frame();
}

 if ($CURUSER)
{
  // Get current Last 10 Torrents
  $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);
  }

  //print("

Poll");
 
  $poll_title = "Poll";

  if (get_user_class() >= UC_MODERATOR)
  {
          $poll_title.="";
                $poll_title.=" - [New Poll]\n";
                if($pollok) {
                  $poll_title.=" - [Edit]\n";
                        $poll_title.=" - [Delete]";
                }
                $poll_title.="
";
        }
        //print("

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











\n");
                begin_frame($poll_title,true,5);
          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 = "";
              print("\n");
              ++$i;
            }
            print("
" . $a[1] . "  " .
                "\"\"                 "\" alt=\"\" />\"\" $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");
end_frame();
?>



        } else {
      begin_frame($poll_title,true,5);
      echo "
\n";
          echo "
";
          echo"

No Active Polls

\n";
          echo "
";
      end_frame();
        }
}
?>





Message:

refresh























Users Registered
Users Unverified
Male Users
Female Users
Unconnectable Users










Torrents
Dead Torrents
Total Peers Ratio
Seeders
Leechers
Leechers/Seeders (%)











begin_frame("Server load",true,5);?>
function getmicrotime(){
    list($usec, $sec) = explode(" ",microtime());
    return ((float)$usec + (float)$sec);
    }
$time_start = getmicrotime();
$time = round(getmicrotime() - $time_start,4);
$percent = $time * 60;

$time = round(getmicrotime() - $time_start,4);
$percent = $time * 60;
echo "
Our Tracker Load: ($percent %)
Last Lottery
Last Lottery
Last Amount Won
Date Of Last Lottery
";

//TRACKER LOAD
if ($percent <= 70) $pic_base_url = "pic/loadbargreen.gif";
    elseif ($percent <= 90) $pic_base_url = "pic/loadbaryellow.gif";
      else $pic_base_url = "pic/loadbarred.gif";
          $width = $percent * 4;
echo "$percent%
";
echo "
" . trim(exec('uptime')) . "
";

if (isset($load))
print("
10min load average (%)$load
";

if ($percent <= 70) $pic_base_url = "pic/loadbargreen.gif";
  elseif ($percent <= 90) $pic_base_url = "pic/loadbaryellow.gif";
  else $pic_base_url = "pic/loadbarred.gif";
        $width = $percent * 4;
echo "$percent%
";
?>





// ---- online users
if($CURUSER) {
  $f_sql = 'SELECT friendid FROM friends WHERE userid='.$CURUSER['id'];
  $f_res = mysql_query($f_sql);
  while($farr = mysql_fetch_object($f_res)) {
        $friends[] = $farr->friendid;
  }
}
$dt = gmtime() - 300;
$dt = sqlesc(get_date_time($dt));
$numberactive = number_format(get_row_count("users", "WHERE last_access >=$dt"));
$res = mysql_query("SELECT id, username, class, avatar, warned, donor FROM users WHERE last_access >=$dt ORDER BY class DESC") or print(mysql_error());
while ($arr = mysql_fetch_assoc($res))
{
  if ($activeusers) $activeusers .= ",\n";
  switch ($arr["class"])
  {
  case UC_SYSOP:
      $username = $arr["username"];
      $avatarover = $arr["avatar"];
      $arr["username"] = "', CAPTION, '$username');\" onmouseout=\"return nd();\">" . $arr["username"] . "";
      break;
    case UC_ADMINISTRATOR:
      $username = $arr["username"];
      $avatarover = $arr["avatar"];
      $arr["username"] = "', CAPTION, '$username');\" onmouseout=\"return nd();\">" . $arr["username"] . "";
      break;
    case UC_MODERATOR:
      $username = $arr["username"];
      $avatarover = $arr["avatar"];
      $arr["username"] = "', CAPTION, '$username');\" onmouseout=\"return nd();\">" . $arr["username"] . "";
      break;
    case UC_UPLOADER:
      $username = $arr["username"];
      $avatarover = $arr["avatar"];
      $arr["username"] = "', CAPTION, '$username');\" onmouseout=\"return nd();\">" . $arr["username"] . "";
      break;
    case UC_VIP:
      $username = $arr["username"];
      $avatarover = $arr["avatar"];
      $arr["username"] = "', CAPTION, '$username');\" onmouseout=\"return nd();\">" . $arr["username"] . "";
      break;
    case UC_POWER_USER:
      $username = $arr["username"];
      $avatarover = $arr["avatar"];
      $arr["username"] = "', CAPTION, '$username');\" onmouseout=\"return nd();\">" . $arr["username"] . "";
      break;
    case UC_USER:
      $username = $arr["username"];
      $avatarover = $arr["avatar"];
      $arr["username"] = "', CAPTION, '$username');\" onmouseout=\"return nd();\">" . $arr["username"] . "";
      break;
  }

 
if(@in_array($arr['id'],$friends))
$arr["username"] = "" . $arr["username"] . "Friend" . "";

if ($arr["donor"] == "yes")  $star = "\"Donated\"/";
else $star = "";

if ($arr["warned"] == "yes")  $warn = "\"Warned\"/";
else $warn = "";

$donator = $arr["donated"] > 0;

  if ($donator)
    $activeusers .= "";
    $activeusers .= "" . $arr["username"] . $star . $warn . "";
  if ($donator)
    $activeusers .= "";

}
if (!$activeusers)
  $activeusers = "There have been no active users in the last 15 minutes.";
 

?>
 
 
 
begin_table(true);
echo "
";
echo $activeusers;
echo "


stdfoot();
?>

Last 10 Torrents:
Code:


//Start of Last X torrents with poster and marquee mod
$query="SELECT id, name, poster FROM torrents WHERE poster <> '' ORDER BY added DESC LIMIT 10";
$result=mysql_query($query);$num = mysql_num_rows($result);
print("");
while ($row = mysql_fetch_assoc($result))  {
$id = $row['id'];
$name = $row['name'];
$poster = $row['poster'];
$name = str_replace('_', ' ' , $name);
$name = str_replace('.', ' ' , $name);
$name = substr($name, 0, 50);
print("");
}
print("
");
//End of Last X torrents with poster and marquee mod

?>

Thanks
";
end_table();
?>


Sysop |
Administator |
Moderator |
Uploader |
VIP |
PowerUser | User


echo "
Welcome to our newest member $latestuser!
\n";
end_frame ();
// -------------------------------


?>




Disclaimer: None of the files shown here are actually hosted on this server. The links are provided solely by this site's users.
The administrator of this site (torrentstrike.info) cannot be held responsible for what its users post, or any other actions of its users.
You may not use this site to distribute or download any material when you do not have the legal rights to do so.
It is your own responsibility to adhere to these terms.




wMan 2nd January 2009 21:15

Code:

ob_start("ob_gzhandler");

require "include/bittorrent.php";
loggedinorreturn();

if ($_SERVER["REQUEST_METHOD"] == "POST")
{
  $choice = $_POST["choice"];
  if ($CURUSER && $choice != "" && $choice < 256 && $choice == floor($choice))
  {
    $res = 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"];
    $res = mysql_query("SELECT * FROM pollanswers WHERE pollid=$pollid && userid=$userid") or sqlerr();
    $arr = mysql_fetch_assoc($res);
    if ($arr) die("Dupe vote");
    mysql_query("INSERT INTO pollanswers VALUES(0, $pollid, $userid, $choice)") or sqlerr();
    if (mysql_affected_rows() != 1)
      stderr("Error", "An error occured. Your vote has not been counted.");
    header("Location: $BASEURL/");
    die;
  }
  else
    //////////////////////////FlashGames/////////////////////////////

$user = $CURUSER['id'];
if($_GET["act"]=="Arcade")
{
if($_POST['gname'] == "asteroids")
{
$game = 1;
$level = 1;
$score = $_POST['score'];
}
if($_POST['gname'] == "breakout")
{
$game = 2;
$level = 1;
$score = $_POST['gscore'];
}
if($_POST['gname'] == "hexxagon")
{
$game = 3;
$level = 1;
$score = $_POST['gscore'];
}
if($_POST['gname'] == "invaders")
{
$game = 4;
$level = 1;
$score = $_POST['score'];
}
if($_POST['gname'] == "moonlander")
{
$game = 5;
$level = 1;
$score = $_POST['gscore'];
}
if($_POST['gname'] == "pacman")
{
$game = 6;
$level = 1;
$score = $_POST['gscore'];
}
if($_POST['gname'] == "psol")
{
$game = 7;
$level = 1;
$score = $_POST['gscore'];
}
if($_POST['gname'] == "simon")
{
$game = 8;
$level = 1;
$score = $_POST['gscore'];
}
if($_POST['gname'] == "snake")
{
$game = 9;
if($_POST['levelName'] == "LEVEL: SLUG")
{
$level = 1;
}
if($_POST['levelName'] == "LEVEL: WORM")
{
$level = 2;
}
if($_POST['levelName'] == "LEVEL: PYTHON")
{
$level = 3;
}
$score = $_POST['score'];
}
if($_POST['gname'] == "tetris")
{
$game = 10;
$level = $_POST['level'];
$score = $_POST['gscore'];
}
mysql_query("INSERT INTO `flashscores` ( `ID` , `game` , `user` , `level` , `score` ) VALUES ( '', '".$game."', '".$user."', '".$level."', '".$score."');") OR DIE(MySQL_ERROR());
$url="flashscores.php";
print("\n");

}else{
stderr("Error", "An error occured.");
}
}

///////////////////////////////End//////////////////////////////


if ($CURUSER)
{
$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)
{
$file2 = "$CACHE/index/newestuser.txt";
$expire = 2*60; // 2 minutes
if (file_exists($file2) && filemtime($file2) > (time() - $expire)) {
    $newestuser = unserialize(file_get_contents($file2));
} else {

$res = mysql_query("SELECT id,username FROM users WHERE status='confirmed' ORDER BY id DESC LIMIT 1") or die(mysql_error());
while ($user = mysql_fetch_array($res) ) {
        $newestuser[] = $user;
    }
    $OUTPUT = serialize($newestuser);
    $fp = fopen($file2,"w");
    fputs($fp, $OUTPUT);
    fclose($fp);
} // end else
foreach ($newestuser as $a)
{
  $latestuser = "" . $a["username"] . "";
}
}

$file = "$CACHE/index/stats.txt";
$expire = 10*60; // 10 minutes
if (file_exists($file) &&
    filemtime($file) > (time() - $expire)) {
$a=unserialize(file_get_contents($file));
$male = $a[1];
$female= $a[2];
$registered = $a[3];
$unverified = $a[4];
$torrents = $a[5];
$ratio = $a[6];
$peers = $a[7];
$seeders = $a[8];
$leechers = $a[9];
$dead = $a[10];
$NAT = $a[11];
} else {
$male = number_format(get_row_count("users", "WHERE gender='Male'")); 
$female = number_format(get_row_count("users", "WHERE gender='Female'"));
$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'"));
$NAT    = number_format(get_row_count("peers", "WHERE connectable='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'");
if ($leechers == 0)
  $ratio = 0;
else
  $ratio = round($seeders / $leechers * 100);
$peers = number_format($seeders + $leechers);
$seeders = number_format($seeders);
$leechers = number_format($leechers);
$stats1 = array(1 => "$male", "$female", "$registered", "$unverified", "$torrents", "$ratio", "$peers", "$seeders", "$leechers", "$dead", "$NAT");
$stats2 = serialize($stats1);
$fh = fopen($file, "w");
fwrite($fh,$stats2);
fclose($fh);
}
}

stdhead();
//echo "Welcome to our newest member, $latestuser!\n";

$news_title = "Recent news";

print("

\n");

print (date("l d<\sup>S F Y h:i A"));

$time = round(getmicrotime() - $time_start,4);
$percent = $time * 60;
echo "
Global Server Load (All websites on current host servers): ($percent %)
");
//print("

Recent news");
if (get_user_class() >= UC_ADMINISTRATOR)
$news_title.=" - [News page]";
//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
\n");
end_frame();
}

 if ($CURUSER)
{
  // Get current Last 10 Torrents
  $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);
  }

  //print("

Poll");
 
  $poll_title = "Poll";

  if (get_user_class() >= UC_MODERATOR)
  {
      $poll_title.="";
        $poll_title.=" - [New Poll]\n";
        if($pollok) {
          $poll_title.=" - [Edit]\n";
            $poll_title.=" - [Delete]";
        }
        $poll_title.="
";
    }
    //print("

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



//Start of Last X torrents with poster and marquee mod
$query="SELECT id, name, poster FROM torrents WHERE poster <> '' ORDER BY added DESC LIMIT 10";
$result=mysql_query($query);$num = mysql_num_rows($result);
print("");
while ($row = mysql_fetch_assoc($result))  {
$id = $row['id'];
$name = $row['name'];
$poster = $row['poster'];
$name = str_replace('_', ' ' , $name);
$name = str_replace('.', ' ' , $name);
$name = substr($name, 0, 50);
print("");
}
print("
");
//End of Last X torrents with poster and marquee mod

?>











\n");
        begin_frame($poll_title,true,5);
      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 = "";
          print("\n");
          ++$i;
        }
        print("
" . $a[1] . "  " .
            "\"\"             "\" alt=\"\" />\"\" $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");
end_frame();
?>



    } else {
      begin_frame($poll_title,true,5);
      echo "
\n";
      echo "
";
      echo"

No Active Polls

\n";
      echo "
";
      end_frame();
    }
}
?>





Message:

refresh























Users Registered
Users Unverified
Male Users
Female Users
Unconnectable Users










Torrents
Dead Torrents
Total Peers Ratio
Seeders
Leechers
Leechers/Seeders (%)











begin_frame("Server load",true,5);?>
function getmicrotime(){
    list($usec, $sec) = explode(" ",microtime());
    return ((float)$usec + (float)$sec);
    }
$time_start = getmicrotime();
$time = round(getmicrotime() - $time_start,4);
$percent = $time * 60;

$time = round(getmicrotime() - $time_start,4);
$percent = $time * 60;
echo "
Our Tracker Load: ($percent %)
Last Lottery
Last Lottery
Last Amount Won
Date Of Last Lottery
";

//TRACKER LOAD
if ($percent <= 70) $pic_base_url = "pic/loadbargreen.gif";
    elseif ($percent <= 90) $pic_base_url = "pic/loadbaryellow.gif";
      else $pic_base_url = "pic/loadbarred.gif";
          $width = $percent * 4;
echo "$percent%
";
echo "
" . trim(exec('uptime')) . "
";

if (isset($load))
print("
10min load average (%)$load
";

if ($percent <= 70) $pic_base_url = "pic/loadbargreen.gif";
  elseif ($percent <= 90) $pic_base_url = "pic/loadbaryellow.gif";
  else $pic_base_url = "pic/loadbarred.gif";
        $width = $percent * 4;
echo "$percent%
";
?>





// ---- online users
if($CURUSER) {
  $f_sql = 'SELECT friendid FROM friends WHERE userid='.$CURUSER['id'];
  $f_res = mysql_query($f_sql);
  while($farr = mysql_fetch_object($f_res)) {
        $friends[] = $farr->friendid;
  }
}
$dt = gmtime() - 300;
$dt = sqlesc(get_date_time($dt));
$numberactive = number_format(get_row_count("users", "WHERE last_access >=$dt"));
$res = mysql_query("SELECT id, username, class, avatar, warned, donor FROM users WHERE last_access >=$dt ORDER BY class DESC") or print(mysql_error());
while ($arr = mysql_fetch_assoc($res))
{
  if ($activeusers) $activeusers .= ",\n";
  switch ($arr["class"])
  {
  case UC_SYSOP:
      $username = $arr["username"];
      $avatarover = $arr["avatar"];
      $arr["username"] = "', CAPTION, '$username');\" onmouseout=\"return nd();\">" . $arr["username"] . "";
      break;
    case UC_ADMINISTRATOR:
      $username = $arr["username"];
      $avatarover = $arr["avatar"];
      $arr["username"] = "', CAPTION, '$username');\" onmouseout=\"return nd();\">" . $arr["username"] . "";
      break;
    case UC_MODERATOR:
      $username = $arr["username"];
      $avatarover = $arr["avatar"];
      $arr["username"] = "', CAPTION, '$username');\" onmouseout=\"return nd();\">" . $arr["username"] . "";
      break;
    case UC_UPLOADER:
      $username = $arr["username"];
      $avatarover = $arr["avatar"];
      $arr["username"] = "', CAPTION, '$username');\" onmouseout=\"return nd();\">" . $arr["username"] . "";
      break;
    case UC_VIP:
      $username = $arr["username"];
      $avatarover = $arr["avatar"];
      $arr["username"] = "', CAPTION, '$username');\" onmouseout=\"return nd();\">" . $arr["username"] . "";
      break;
    case UC_POWER_USER:
      $username = $arr["username"];
      $avatarover = $arr["avatar"];
      $arr["username"] = "', CAPTION, '$username');\" onmouseout=\"return nd();\">" . $arr["username"] . "";
      break;
    case UC_USER:
      $username = $arr["username"];
      $avatarover = $arr["avatar"];
      $arr["username"] = "', CAPTION, '$username');\" onmouseout=\"return nd();\">" . $arr["username"] . "";
      break;
  }

 
if(@in_array($arr['id'],$friends))
$arr["username"] = "" . $arr["username"] . "Friend" . "";

if ($arr["donor"] == "yes")  $star = "\"Donated\"/";
else $star = "";

if ($arr["warned"] == "yes")  $warn = "\"Warned\"/";
else $warn = "";

$donator = $arr["donated"] > 0;

  if ($donator)
    $activeusers .= "";
    $activeusers .= "" . $arr["username"] . $star . $warn . "";
  if ($donator)
    $activeusers .= "";

}
if (!$activeusers)
  $activeusers = "There have been no active users in the last 15 minutes.";
 

?>
 
 
 
begin_table(true);
echo "
";
echo $activeusers;
echo "


stdfoot();
?>

marc234 2nd January 2009 21:30

Thank you clocktower for your answering. I just want the poll to take out from index, as in imag out and see, sorry for my bad english !!!!

http://i44.tinypic.com/2s8oay0.jpg

wMan 2nd January 2009 21:31

u want the poll out?

marc234 2nd January 2009 21:32

yes it is :-)



wMan 2nd January 2009 21:33

Code:

ob_start("ob_gzhandler");

require "include/bittorrent.php";
loggedinorreturn();

if ($_SERVER["REQUEST_METHOD"] == "POST")
{
  $choice = $_POST["choice"];
  if ($CURUSER && $choice != "" && $choice < 256 && $choice == floor($choice))
  {
    $res = 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"];
    $res = mysql_query("SELECT * FROM pollanswers WHERE pollid=$pollid && userid=$userid") or sqlerr();
    $arr = mysql_fetch_assoc($res);
    if ($arr) die("Dupe vote");
    mysql_query("INSERT INTO pollanswers VALUES(0, $pollid, $userid, $choice)") or sqlerr();
    if (mysql_affected_rows() != 1)
      stderr("Error", "An error occured. Your vote has not been counted.");
    header("Location: $BASEURL/");
    die;
  }
  else
    //////////////////////////FlashGames/////////////////////////////

$user = $CURUSER['id'];
if($_GET["act"]=="Arcade")
{
if($_POST['gname'] == "asteroids")
{
$game = 1;
$level = 1;
$score = $_POST['score'];
}
if($_POST['gname'] == "breakout")
{
$game = 2;
$level = 1;
$score = $_POST['gscore'];
}
if($_POST['gname'] == "hexxagon")
{
$game = 3;
$level = 1;
$score = $_POST['gscore'];
}
if($_POST['gname'] == "invaders")
{
$game = 4;
$level = 1;
$score = $_POST['score'];
}
if($_POST['gname'] == "moonlander")
{
$game = 5;
$level = 1;
$score = $_POST['gscore'];
}
if($_POST['gname'] == "pacman")
{
$game = 6;
$level = 1;
$score = $_POST['gscore'];
}
if($_POST['gname'] == "psol")
{
$game = 7;
$level = 1;
$score = $_POST['gscore'];
}
if($_POST['gname'] == "simon")
{
$game = 8;
$level = 1;
$score = $_POST['gscore'];
}
if($_POST['gname'] == "snake")
{
$game = 9;
if($_POST['levelName'] == "LEVEL: SLUG")
{
$level = 1;
}
if($_POST['levelName'] == "LEVEL: WORM")
{
$level = 2;
}
if($_POST['levelName'] == "LEVEL: PYTHON")
{
$level = 3;
}
$score = $_POST['score'];
}
if($_POST['gname'] == "tetris")
{
$game = 10;
$level = $_POST['level'];
$score = $_POST['gscore'];
}
mysql_query("INSERT INTO `flashscores` ( `ID` , `game` , `user` , `level` , `score` ) VALUES ( '', '".$game."', '".$user."', '".$level."', '".$score."');") OR DIE(MySQL_ERROR());
$url="flashscores.php";
print("\n");

}else{
stderr("Error", "An error occured.");
}
}

///////////////////////////////End//////////////////////////////


if ($CURUSER)
{
$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)
{
$file2 = "$CACHE/index/newestuser.txt";
$expire = 2*60; // 2 minutes
if (file_exists($file2) && filemtime($file2) > (time() - $expire)) {
    $newestuser = unserialize(file_get_contents($file2));
} else {

$res = mysql_query("SELECT id,username FROM users WHERE status='confirmed' ORDER BY id DESC LIMIT 1") or die(mysql_error());
while ($user = mysql_fetch_array($res) ) {
        $newestuser[] = $user;
    }
    $OUTPUT = serialize($newestuser);
    $fp = fopen($file2,"w");
    fputs($fp, $OUTPUT);
    fclose($fp);
} // end else
foreach ($newestuser as $a)
{
  $latestuser = "" . $a["username"] . "";
}
}

$file = "$CACHE/index/stats.txt";
$expire = 10*60; // 10 minutes
if (file_exists($file) &&
    filemtime($file) > (time() - $expire)) {
$a=unserialize(file_get_contents($file));
$male = $a[1];
$female= $a[2];
$registered = $a[3];
$unverified = $a[4];
$torrents = $a[5];
$ratio = $a[6];
$peers = $a[7];
$seeders = $a[8];
$leechers = $a[9];
$dead = $a[10];
$NAT = $a[11];
} else {
$male = number_format(get_row_count("users", "WHERE gender='Male'")); 
$female = number_format(get_row_count("users", "WHERE gender='Female'"));
$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'"));
$NAT    = number_format(get_row_count("peers", "WHERE connectable='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'");
if ($leechers == 0)
  $ratio = 0;
else
  $ratio = round($seeders / $leechers * 100);
$peers = number_format($seeders + $leechers);
$seeders = number_format($seeders);
$leechers = number_format($leechers);
$stats1 = array(1 => "$male", "$female", "$registered", "$unverified", "$torrents", "$ratio", "$peers", "$seeders", "$leechers", "$dead", "$NAT");
$stats2 = serialize($stats1);
$fh = fopen($file, "w");
fwrite($fh,$stats2);
fclose($fh);
}
}

stdhead();
//echo "Welcome to our newest member, $latestuser!\n";

$news_title = "Recent news";

print("



//Start of Last X torrents with poster and marquee mod
$query="SELECT id, name, poster FROM torrents WHERE poster <> '' ORDER BY added DESC LIMIT 10";
$result=mysql_query($query);$num = mysql_num_rows($result);
print("");
while ($row = mysql_fetch_assoc($result))  {
$id = $row['id'];
$name = $row['name'];
$poster = $row['poster'];
$name = str_replace('_', ' ' , $name);
$name = str_replace('.', ' ' , $name);
$name = substr($name, 0, 50);
print("");
}
print("
");
//End of Last X torrents with poster and marquee mod

?>











");
//print("

Recent news");
if (get_user_class() >= UC_ADMINISTRATOR)
$news_title.=" - [News page]";
//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
\n");
end_frame();
}

?>





Message:

refresh























Users Registered
Users Unverified
Male Users
Female Users
Unconnectable Users










Torrents
Dead Torrents
Total Peers Ratio
Seeders
Leechers
Leechers/Seeders (%)













// ---- online users
if($CURUSER) {
  $f_sql = 'SELECT friendid FROM friends WHERE userid='.$CURUSER['id'];
  $f_res = mysql_query($f_sql);
  while($farr = mysql_fetch_object($f_res)) {
        $friends[] = $farr->friendid;
  }
}
$dt = gmtime() - 300;
$dt = sqlesc(get_date_time($dt));
$numberactive = number_format(get_row_count("users", "WHERE last_access >=$dt"));
$res = mysql_query("SELECT id, username, class, avatar, warned, donor FROM users WHERE last_access >=$dt ORDER BY class DESC") or print(mysql_error());
while ($arr = mysql_fetch_assoc($res))
{
  if ($activeusers) $activeusers .= ",\n";
  switch ($arr["class"])
  {
  case UC_SYSOP:
      $username = $arr["username"];
      $avatarover = $arr["avatar"];
      $arr["username"] = "', CAPTION, '$username');\" onmouseout=\"return nd();\">" . $arr["username"] . "";
      break;
    case UC_ADMINISTRATOR:
      $username = $arr["username"];
      $avatarover = $arr["avatar"];
      $arr["username"] = "', CAPTION, '$username');\" onmouseout=\"return nd();\">" . $arr["username"] . "";
      break;
    case UC_MODERATOR:
      $username = $arr["username"];
      $avatarover = $arr["avatar"];
      $arr["username"] = "', CAPTION, '$username');\" onmouseout=\"return nd();\">" . $arr["username"] . "";
      break;
    case UC_UPLOADER:
      $username = $arr["username"];
      $avatarover = $arr["avatar"];
      $arr["username"] = "', CAPTION, '$username');\" onmouseout=\"return nd();\">" . $arr["username"] . "";
      break;
    case UC_VIP:
      $username = $arr["username"];
      $avatarover = $arr["avatar"];
      $arr["username"] = "', CAPTION, '$username');\" onmouseout=\"return nd();\">" . $arr["username"] . "";
      break;
    case UC_POWER_USER:
      $username = $arr["username"];
      $avatarover = $arr["avatar"];
      $arr["username"] = "', CAPTION, '$username');\" onmouseout=\"return nd();\">" . $arr["username"] . "";
      break;
    case UC_USER:
      $username = $arr["username"];
      $avatarover = $arr["avatar"];
      $arr["username"] = "', CAPTION, '$username');\" onmouseout=\"return nd();\">" . $arr["username"] . "";
      break;
  }

 
if(@in_array($arr['id'],$friends))
$arr["username"] = "" . $arr["username"] . "Friend" . "";

if ($arr["donor"] == "yes")  $star = "\"Donated\"/";
else $star = "";

if ($arr["warned"] == "yes")  $warn = "\"Warned\"/";
else $warn = "";

$donator = $arr["donated"] > 0;

  if ($donator)
    $activeusers .= "";
    $activeusers .= "" . $arr["username"] . $star . $warn . "";
  if ($donator)
    $activeusers .= "";

}
if (!$activeusers)
  $activeusers = "There have been no active users in the last 15 minutes.";
 

?>
 
 
 
begin_table(true);
echo "";
end_table();
?>


Sysop |
Administator |
Moderator |
Uploader |
VIP |
PowerUser | User


echo "
Welcome to our newest member $latestuser!
\n";
end_frame ();
// -------------------------------


?>




Disclaimer: None of the files shown here are actually hosted on this server. The links are provided solely by this site's users.
The administrator of this site (torrentstrike.info) cannot be held responsible for what its users post, or any other actions of its users.
You may not use this site to distribute or download any material when you do not have the legal rights to do so.
It is your own responsibility to adhere to these terms.




Last Lottery
Last Lottery
Last Amount Won
Date Of Last Lottery
";
echo $activeusers;
echo "


stdfoot();
?>

marc234 2nd January 2009 21:36

Thanks thanks :-)


All times are GMT +2. The time now is 07:55.

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