View file forum/tracked.php

File size: 4.01Kb
<?php
ERROR_REPORTING(0);
/*
Project: PBNL Forum v2.3

Coded By: thani sheun

Facebook: http://facebook.com/thani.seun

Email: mail@nairawapers.com

2go: doubletins

Twitter: @supa_surfer

WebSite: http://nairawapers.com
*/
require("../init.php");
if(!isloggedin())
{ header("location: index.php"); }
else { $user=$_SESSION["user"]; }
echo"<title>$config->title &raquo; Tracked Topics</title>";
echo"<div class='body_width'>";
include "../topnav.php";
echo"<div class='breadcrumb'></div>
<center>";
include "../ads.php";
fblike();
echo"</center>
<div style='margin-top: 5px;' class='grid3'>
</div>";
echo"<div class='grid3 middle'><div class='b_head'>My Tracked Topics</div>";
$username=user_info($user, username);
$self=$_SERVER["PHP_SELF"];
$rowsperpage=10;
$range=7;
if(isset($_GET["currentpage"]) && is_numeric($_GET["currentpage"]))
{
$currentpage=(int)$_GET["currentpage"];
}
else
{
$currentpage=1;
}
$offset=($currentpage-1)*$rowsperpage;
$numrows=mysql_num_rows(mysql_query("SELECT * FROM b_replies WHERE poster='$user' AND tracking>0"));
$totalpages=ceil($numrows/$rowsperpage);
if($currentpage>$totalpages)
{
$currentpage=$totalpages;
}
if($currentpage<1)
{
$currentpage=1;
}
{
$query2=mysql_query("SELECT * FROM b_replies WHERE poster='$user' AND tracking>0 ORDER BY hasread='$hasread' LIMIT
$offset, $rowsperpage");
$num=mysql_num_rows($query2);
if($num==0)
{ echo"<div class='msg'><li>You havnt tracked any topic !</li></div>"; }
else {
echo"<div align='left'><br>";
while($info=mysql_fetch_array($query2))
{
$hasread=cleanvalues2($info["hasread"]);
$topicid=cleanvalues2($info["topicid"]);
$author=cleanvalues2($info["poster"]);
$aid=user_info($author, userID);
$date=cleanvalues2($info["date"]);
$lastposter=cleanvalues2($info["lastposter"]);
$forumid=cleanvalues2($info["forumid"]);
$bid=user_info($lastposter, userID);
$lastpostdate=cleanvalues2($info["lastpostdate"]);
$date=date('D, d M Y', $date);
{
$lastpostdate=@date('D, d M Y', $lastpostdate);
}
$tinfo=mysql_fetch_assoc(mysql_query("SELECT * FROM b_topics WHERE id='$topicid'"));
$facebreak=invalidchars(cleanvalues2($tinfo["subject"]));
$title=cleanvalues2($tinfo["subject"]);
$id2=cleanvalues2($tinfo["id"]);
$bid=user_info($lastposter, userID);
$lastposter=cleanvalues2($tinfo["lastposter"]);
$lastpostdate=cleanvalues2($tinfo["lastpostdate"]);
if(empty($lastposter))
{
$lastposter="---";
}
else
{
$lastposter="<a href='../profile.php?uid=$bid'><font color='grey'>$lastposter</font></a>";
}
if($lv==0) { $rnk=''; }
elseif($lv==1) {
$rnk= '<img style="vertical-align:middle" src="/images/veteran.png" />'; }
elseif($lv==2) {
$rnk= '<img style="vertical-align:middle" src="/images/ultimate.png" />'; }if(empty($img))
{ $img="<img src='http://wfs01.wapka.mobi/3363/3363626_ec10bb7ff9.gif'>";
} else { $img="<img src='http://wfs01.wapka.mobi/3363/3363626_ec10bb7ff9.gif'>";}
echo"<ul><li><div class='beauty1'><div align='left' class='name'><a href=../forum/$facebreak._$id2.html>$title</a></div><div align='left'><font color='red'>Started By:</font> <a href='../profile.php?uid=$aid'>$author</a><br>
<font color='red'>Last Post By:</font> $lastposter<br><font color='red'>Unread:</font> $hasread</div></div>";
if($lv==2) { echo ""; }
echo "</li></ul>";
}
echo"</div>";
}
}

if($currentpage>1)
{
echo"<a href='$self?id=$id&currentpage=1'>[<b>First</b>]</a>";
$prevpage=$currentpage-1;
echo"<a href='$self?id=$id&currentpage=$prevpage'>[<b>Prev</b>]</a>";
}
for($x=($currentpage-$range); $x<(($currentpage+$range)+1); $x++)
{
if(($x>0) &&($x<=$totalpages))
{
if($x==$currentpage)
{
echo"[<font color='red'>$x</font>]";
}
else
{

echo"<a href='$self?id=$id&currentpage=$x'>[<b>$x</b>]</a>";
}
}
}
if($currentpage!=$totalpages)
{
$nextpage=$currentpage+1;
echo"<a href='$self?id=$id&currentpage=$nextpage'>[<b>Next</b>]</a>";
echo"<a href='$self?id=$id&currentpage=$totalpages'>[<b>Last</b>]</a>";
}
echo"<br><div class='link_button'><a href='index.php'>Go Back</div></a>";
include "../footer.php";
?>