Thread: TBDevRU 3.2
View Single Post
  #52  
Old 5th February 2010, 20:59
underx underx is offline
Senior Member
 
Join Date: Sep 2008
Posts: 84
Default
I got
Code:
Parse error: syntax error, unexpected $end in C:\xampp\htdocs\tbdevru\index.php on line 341
in that line there is only ?>

here is my index.php:
PHP Code:
<?php

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

$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 href=userdetails.php?id=" $a["id"] . ">" $a["username"] . "</a>";
else
  
$latestuser $a['username'];


$registered number_format(get_row_count("users"));
$torrents number_format(get_row_count("torrents"));

$r mysql_query("SELECT value_u FROM avps WHERE arg='seeders'") or sqlerr(__FILE____LINE__);
$a mysql_fetch_row($r);
$seeders $a[0];
$r mysql_query("SELECT value_u FROM avps WHERE arg='leechers'") or sqlerr(__FILE____LINE__);
$a mysql_fetch_row($r);
$leechers $a[0];
if (
$leechers == 0)
  
$ratio 0;
else
$ratio round($seeders $leechers 100);
$peers number_format($seeders $leechers);
$seeders number_format($seeders);
$leechers number_format($leechers);

$dt gmtime() - 180;
$dt sqlesc(get_date_time($dt));
$res mysql_query("SELECT id, username, class FROM users WHERE last_access >= $dt ORDER BY username") or print(mysql_error());

while (
$arr mysql_fetch_assoc($res))
{
  
$donator $arr["donated"] > 0;
  if (
$donator)
    
$activeusers .= "<nobr>";
  if (
$CURUSER)
    
$activeusers .= "<a href=userdetails.php?id=" $arr["id"] . " title=" get_user_class_name($arr["class"]) . "><b>" get_user_class_color($arr["class"], $arr["username"]) . "</b></a>&nbsp;";
  else
    
$activeusers .= "<b>" get_user_class_color($arr["class"], $arr["username"]) . "</b>";
  if (
$donator)
    
$activeusers .= "<img src=\"{$pic_base_url}star.gif\" alt='Donated $$arr[donated]'></nobr>";
}
if (!
$activeusers)
  
$activeusers "There have been no active users in the last 15 minutes :'(";

stdhead();

print(
"<table width=737 class=main border=0 cellspacing=0 cellpadding=0><tr><td class=embedded>");

if (
$CURUSER) {

if (
$CURUSER['donor'] == "yes")
    
$medaldon "<img src=\"pic/star.gif\" alt=\"Donor\" title=\"Donor\">";
if (
$CURUSER['warned'] == "yes")
    
$warn "<img src=\"pic/warned.gif\" alt=\"Warned\" title=\"User warned\">";

?>
<?

$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($ratio3);

$color get_ratio_color($ratio);

if (
$color)

$ratio "<font color=$color>$ratio</font>";

}

else

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

$ratio "Inf.";

else

$ratio "---";



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

$medaldon "<img src=pic/star.gif alt=donor title=donor>";



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

$warn "<img src=pic/warned.gif alt=warned title=warned>";




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

?>
<!-- //////// start the statusbar ///////////// -->

<p>

<table align="center" cellpadding="4" cellspacing="0" border="0" style="width:90%">
<tr>
<td class="tablea"><table align="center" style="width:879" cellspacing="0" cellpadding="0" border="0">
<tr>
<td class="bottom" align="left"><span style="text-decoration: none;" class="smallfont"><b>Greetings:&nbsp; <a href="userdetails.php?id=<?=$CURUSER['id']?>"><?=get_user_class_color($CURUSER['class'], $CURUSER['username'])?></a></b><?=$medaldon?><?=$warn?><? if ($CURUSER["class"] > UC_MODERATOR) { ?>&nbsp;[<a href="staffpanel.php">Staff Panel</a>]<? }?>&nbsp;[<a href="friends.php">Friends</a>]&nbsp;[<a href="my.php">Profile</a>]&nbsp;[<a onClick="return confirm('Are you sure you want to logout?')" href="logout.php">Logout</a>]<br/>

<font color=1900D1>Ratio:</font> <?=$ratio?>&nbsp;&nbsp;<font color=green>Uploaded:</font> <font color=black><?=$uped?></font>&nbsp;&nbsp;<font color=darkred>Downloaded:</font> <font color=black><?=$downed?></font>&nbsp;&nbsp;<font color=1900D1>Active Torrents:&nbsp;</font></span> <img alt="Torrents seeding" title="Torrents seeding" src="pic/arrowup.gif">&nbsp;<font color=black><span class="smallfont"><?=$activeseed?></span></font>&nbsp;&nbsp;<img alt="Torrents leeching" title="Torrents leeching" src="pic/arrowdown.gif">&nbsp;<font color=black><span class="smallfont"><?=$activeleech?></span></font></td>
<?
loggedinorreturn
();
$res mysql_query("SELECT COUNT(*) FROM messages WHERE receiver=" $CURUSER["id"] . " AND location IN ('in', 'both')") or print(mysql_error());
$arr mysql_fetch_row($res);
$messages $arr[0];
$res mysql_query("SELECT COUNT(*) FROM messages WHERE receiver=" $CURUSER["id"] . " AND location IN ('in', 'both') AND unread='yes'") or print(mysql_error());
$arr mysql_fetch_row($res);
$unread $arr[0];
$res mysql_query("SELECT COUNT(*) FROM messages WHERE sender=" $CURUSER["id"] . " AND location IN ('out', 'both')") or print(mysql_error());
$arr mysql_fetch_row($res);
$outmessages $arr[0];

if (
$messages){
print(
"<td class='bottom' align='right'>");
print(
"<span style=\"text-decoration: none;\"  class=smallfont><a href=inbox.php><a href=inbox.php><img height=16px style=border:none alt=sentbox title=sentbox src=pic/pn_inboxnew.gif>$inboxpic</a> $messages ($unread New)</span>");
if (
$outmessages)
print(
"<span style=\"text-decoration: none;\" class=smallfont>&nbsp;&nbsp;<a href=inbox.php?out=1><img height=16px style=border:none alt=sentbox title=sentbox src=pic/pn_sentbox.gif></a> $outmessages</span>");
else
print(
"<span style=\"text-decoration: none;\" class=smallfont>&nbsp;&nbsp;<a href=inbox.php?out=1><img height=16px style=border:none alt=sentbox title=sentbox src=pic/pn_sentbox.gif></a> 0</span>");
}
else
{
print(
"<td class='bottom' align='right'>");
print(
"<span style=\"text-decoration: none;\" class=smallfont><a href=inbox.php><img height=16px style=border:none alt=inbox title=inbox src=pic/pn_inbox.gif></a> 0</span>");
if (
$outmessages)
print(
"<span style=\"text-decoration: none;\" class=smallfont>&nbsp;&nbsp;<a href=inbox.php?out=1><img height=16px style=border:none alt=sentbox title=sentbox src=pic/pn_sentbox.gif></a> $outmessages</span>");
else
print(
"<span style=\"text-decoration: none;\" class=smallfont>&nbsp;&nbsp;<a href=inbox.php?out=1><img height=16px style=border:none alt=sentbox title=sentbox src=pic/pn_sentbox.gif></a> 0</span>");
}
print(
"&nbsp;<a href=friends.php><img style=border:none alt=Buddylist title=Buddylist src=pic/buddylist.gif></a>");
print(
"&nbsp;<a href=getrss.php><img style=border:none alt=RSS title=RSS src=pic/rss.gif></a>");
print(
"</form>");
?>
</span></td>

</tr>
</table></table></table>

<br>

<? } else {?>
<? 
?>

<table width=889 border=1 cellspacing=0 cellpadding=0><tr><td align=center>
<table align=left width=46% cellspacing=0 cellpadding=5><tr><td style="border:none" align=left>
<table class=main border=1 cellspacing=0 cellpadding=5>

<? 
print("<h2>Recent news");

if (
get_user_class() >= UC_ADMINISTRATOR)
    print(
" - <font class=small><a  class=altlink href=news.php><b>[News page]</b></a></font>");
$res mysql_query("SELECT * FROM news WHERE ADDDATE(added, INTERVAL 45 DAY) > NOW() ORDER BY added DESC LIMIT 3") or sqlerr(__FILE____LINE__);

if (
mysql_num_rows($res) > 0)
{    print(
"<table width=100% border=1 cellspacing=0 cellpadding=2><tr>\n");
    while(
$array mysql_fetch_assoc($res))
    {
      print(
"<div class=\"accordion\"><h3>" gmdate("Y-m-d",strtotime($array['added'])) . "</h3>" "<p>" format_comment($array['body']));
    if (
get_user_class() >= UC_ADMINISTRATOR)
    {
        print(
" <font size=\"-2\"><a class=altlink href=news.php?action=edit&newsid=" $array['id'] . "&returnto=" urlencode($_SERVER['PHP_SELF']) . "><img style='border: none' alt='Edit' title='Edit news' src='pic/pen.gif'/></a></font>");
        print(
" <font size=\"-2\"><a class=altlink href=news.php?action=delete&newsid=" $array['id'] . "&returnto=" urlencode($_SERVER['PHP_SELF']) . "><img style='border: none' alt='Delete' title='Delete' src='pic/delete.gif'/></a></font>");
    }
    print(
"</p>");
  }
  print(
"</ul></td></tr>\n"); 

  
?></table></table>

<table align=right width=40% cellspacing=0 cellpadding=0><tr><td align=right>
<div id=stats><font class=small><div style="text-align: justify;"><table width=100% cellspacing=0 cellpadding=7><tr><td style="border:none" align=center>
<table class=main style="border:none" cellspacing=0 cellpadding=5>
<?if (isset($peers)) {?>
<?
$seeders 
get_row_count("peers""WHERE seeder='yes'");
$warned_users number_format(get_row_count("users""WHERE warned = 'yes'"));
$leechers get_row_count("peers""WHERE seeder='no'");
$unverified number_format(get_row_count("users""WHERE status='pending'"));
$uploaders number_format(get_row_count("users""WHERE class=".UC_UPLOADER));
$golds number_format(get_row_count("users""WHERE class=".UC_GOLD));
?>
<tr><td class=rowhead>Registered Users</td><td align=right><?=$registered?></td></tr>
<tr><td class=rowhead>Warned Users</td><td align=right><?=$warned_users?></td></tr>
<tr><td class=rowhead>Unconfirmed users</td></td><td align=right><?=$unverified?></td></tr>
<tr><td class=rowhead><font color=gold>Gold</font></td><td align=right><?=$golds?></td></tr>
<tr><td class=rowhead>Upploaders</td><td align=right><?=$uploaders?></td></tr>
<? ?>
</table></td>
<td width=\"52%\" align=center style="border:none">
<table class=main border=10 cellspacing=0 cellpadding=5><tr><td class=rowhead>Torrents</td><td align=right><?=$torrents?></td></tr>
<tr><td class=rowhead><font color=green>Seeders</font></td><td align=right><?=$seeders?></td></tr>
<tr><td class=rowhead><font color=red>Leechers</font></td><td align=right><?=$leechers?></td></tr>
<tr><td class=rowhead>Total downloaded</td><td align=right><?=mksize($totaldownloaded)?></td></tr>
<tr><td class=rowhead>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Total uploaded</td><td align=right><?=mksize($totaluploaded)?></td></tr>
</table></td>
</td></tr></table><form method='get' action=browse.php>
&nbsp;&nbsp; <input type='ext' name='search' size='51' onfocus="if(this.value=='Click here if you want to search...') this.value='';" onblur="if(this.value=='') this.value='Click here if you want to search...';" value="Click here if you want to search..." style="color:#888888; font-style: italic;"/>
<input type='submit' value='Search'/></form>
</div><br></table></table><br>

<table width=889 border=1 cellspacing=0 cellpadding=10><tr><td align=Left>
<b>Newest torrents</b><br>
<p>
<?
$tag_list 
mysql_query("SELECT categories.id, categories.name, categories.point_class, tags_settings.word_color AS color, tags_settings.word_size AS size FROM categories LEFT JOIN tags_settings ON categories.point_class = tags_settings.id ORDER BY id");

while(
$tags mysql_fetch_assoc($tag_list))
{

    
$tag .= "<span onclick=\"getTagDetails('" .$tags["id"]. "', '" .$tags["name"]. "');\"
                style='cursor: pointer;" 
.($tags["color"] ? "color: " .$tags["color"]. ";" "") . 
                (
$tags["size"] ? "font-size: " .$tags["size"]. "0%;" ""). "
                '>
                " 
.$tags["name"]. "
            </span>&nbsp;|&nbsp;"
;
            
}
?>

<script language="javascript" type="text/javascript" src="js/ajax.js"></script>
<script type="text/javascript">

    function getTagDetails(tId, tName)
    {
        
         var ajax = new tbdev_ajax();
        ajax.onShow ('');
         var varsString = "";
         ajax.requestFile = "getTagDetails.php";
         ajax.setVar("tagId", tId);
         ajax.setVar("tagName", tName);
         ajax.method = 'POST';
         ajax.element = 'tagDetails';
         ajax.sendAJAX(varsString);
         
    }
    
</script>
<div id="loading-layer"></div>

<?
$content 
.= "<div id='tagDetails'>Choose a category.</div><hr size=\"1\" noshade color=\"#D4D4D4\">";
$content .= $tag;

if(
get_user_class() >= UC_ADMINISTRATOR)
    
$content .= "<hr size=\"1\" noshade color=\"#D4D4D4\"><center><a href='tags_admin.php'><font size=1.5>Adjust parameters</font></a></center>"
    print (
$content);
?>
</td></tr></table><br>

<?if ($online_on == "1") { ?>
<table width=889 border=1 cellspacing=0 cellpadding=10><tr><td align=Left>
<div class="news-head folded clickable"><b>Users online</b></font></div><div class="news-body">
<font class=small>
<center><font class=small>Welcome to our newest member, <b><?=$latestuser?></b>!</font><br></center>
<?=$activeusers?></p>
<font class=small><font color=#0F6CEE>SysOP</font> | <font color=#009900>Admin</font> | <font color=#cc0000>Moderator</font> | <font color=gold>Gold</font> | <font color=orange>Uploaders</font> | <font color=#ff99ff>VIP</font> | Users</font></font>
</div></td></tr></table>
<?}?>

<h2>Disclaimer</h2>
<table width=889 border=1 cellspacing=0 cellpadding=10><tr><td align=Left>



<?
echo "<marquee onmouseover=this.stop() onmouseout=this.start() scrollAmount=1.8 direction=up width='100%' height='100'>";
?>


<p><font class=small>None of the files shown here are actually hosted on this server. The links are provided solely by this site's users. These BitTorrent files are meant for the distribution of backup files. By downloading the BitTorrent file, you are claiming that you own the original file. The administrator of this site ( <font color=#cc0000>Yourname here</font> ) holds NO RESPONSIBILITY if these files are misused in any way and cannot be held responsible for what its users post, or any other actions of its users. For controversial reasons, if you are affiliated with any government, ANTI-Piracy group or any other related group, or were formally a worker of one you CANNOT download any of these BitTorrent files. 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.</font></p>


</marquee>



</td></tr></table>

<?php
// Variables for Start Time
$mtime microtime(); // Get Current Time
$mtime explode (" "$mtime); // Split Seconds and Microseconds  
$mtime $mtime[1] + $mtime[0];  // Create a single value for start time
$tstart $mtime// Start time

// Variables for Start Time
$mtime microtime();
$mtime explode (" "$mtime);
$mtime $mtime[1] + $mtime[0];
$tend $mtime// End time
$totaltime = ($tend $tstart);
printf ("Executed in %f seconds!"$totaltime);
?>
<?
stdfoot
();
?>

Last edited by underx; 5th February 2010 at 21:17.
Reply With Quote