PHP Code
<?php
ERROR_REPORTING(0);
/*
* Script By: Christopher Odinaka
* 2go: Donsinister
* Website: http://wapz
*/
require("../init.php");
echo'<script type="text/javascript">varswitchTo5x=true;</script>
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript">stLight.options({publisher:"ur-aef0ff32-44c2-6619-5986-a8d7c240f42c"}); </script>';
$id=(int)$_GET["id"];
if($id<1)
{ header("location: /forum/topics.php");
exit(); }
$spam=array('.tk','.TK','.com','.COM','.NET','.net','.wapka','.org','fool','www','[url','http','.mobi','copy and paste');
if($level<1) {
if(in_array($message)==$spam)
{ echo"<div class='msg'> Your Message contains spam content, your action has  been reported.  You would be  suspended soon</div>";
exit(); } }
$level=user_info($user, level);
$username=user_info($user, username);
$rank=getrank($level);
if (preg_match('%\b(wapka|tk|jersey|nikeandreebok|loadedteam|naijafamily|louis|jerseys|uggwarmwinter|on sale|louisvuittonautumnsale|flawed|talkloaded|.com|boots|invcod|collections.co.uk|.tk|naijasilvers|t,k|dot|jerseyszone|nfl jerseys|nikeandreebok|waploaded|proudlyboiz|Oscar)\b% i', $message) > 0) {
echo"<div class='msg'>Your message contain spam</div>";
mysql_query("INSERT INTO b_pms SET `reciever`='MR CHRIS', `sender`='Reports',
`subject`='Reports', `message`='$poster just spammed forum with ($message) in ($title) Please do not neglect this make sure you ban him', `date`='$date'") or mysql_erro();
}
//TOPIC DETAILS
$tquery=mysql_query("SELECT * FROM b_topics WHERE id=$id");
$tnum=mysql_num_rows($tquery);
if($tnum==0)
{ header("location: topics.php"); }
$tinfo=mysql_fetch_assoc($tquery);
$fid=$tinfo["forumid"];
$title=$tinfo["subject"];
$author=$tinfo["poster"];
$tmessage=$tinfo["message"];
$tmessage=bbcode($tmessage);
$tmessage=at_user($tmessage);
$tmessage=smiley($tmessage);
$locked=$tinfo["locked"];
$tdate=$tinfo["date"];
$tdate=date("h:ia D d M Y", $tdate);
$tid=$tinfo["id"];
//$ctimeout=$ctimenow-$ctimeto;
mysql_query("DELETE FROM b_onlineforum WHERE donsinister='$user'");
$insert=mysql_query("INSERT INTO b_onlineforum SET time='$time', donsinister='$user', id='$id'");
if(!$insert)
{
mysql_query("UPDATE b_onlineforum SET time='$time', donsinister='$user', id='$id'");
}
$topiclike = '<a href="like.php?t=1&id='.$id.'">Like post</a>';
$analike = mysql_query("SELECT `from` FROM `pbnl_like` WHERE `type` = 1 AND `itemid` = $id");
if(mysql_num_rows($analike) > 0)
{
$analiketopics = ':- ';
while($get = mysql_fetch_assoc($analike))
{
$analiketopics .= ''.$get["from"].', ';
}
}
$hints=$tinfo["hints"]+1;
mysql_query("UPDATE b_topics SET hints='$hints' WHERE id='$tid'");
//FORUMS
$finfo=mysql_fetch_assoc(mysql_query("SELECT * FROM b_forums WHERE id=$fid"));
$fname=$finfo["name"];
$fid=$finfo["id"];
echo"<title>$config->title &raquo; Forum | $title</title>";
echo"<style type='text/css'>
<!--
.style2 {
font-family: Arial, Helvetica, sans-serif;
color: #FF0000;
font-size: 12px;
}
.style3 {color: #FF0000}
.style5 {color: #FF0000; font-weight: bold; }
body,td,th {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
}
-->
</style>
<div class='body_width'>";
include "../topnav.php";
echo"<center>";
include"../ads2.php";
echo"</center>";
echo"<div class='item-tag'><font size='5px'><a href='../member/index.php'><img src='/icons/home.png'/></a> &raquo; <a href='index.php'>Forum</a> &raquo; <a href='topics.php?id=$fid'>$fname</a></font></div>";
echo"<center>";
include"spam.php";
echo"</center>";
echo"<center>
<div class='public_message'><div class='success'></div></div> ";
$amsg=$_GET["amsg"];
if(!empty($amsg))
{ echo"<div class='msg'>$amsg</div>";
}
if(isset($_POST["pincode"]))
{
{
if($_POST["code"] !== 'sheriff')
{
echo"<div class='msg'> pin code incorrect try again</div>";
}
if($_POST["code"] == 'sheriff')
{
echo"<div class='msg'> pin code accepted you can now read the post</div>";
}
}
if(isset($_POST["submit"]))
{
$poster=$_POST["poster"];
$topicid=$_POST["topicid"];
$message=$_POST["message"];
$date=time();
//CLEAN
if (preg_match('%\b(wapka.mobi|www.|,tk|.tk|tk|jersey|nikeandreebok|http://|loadedteam|naijafamily|louis|jerseys|uggwarmwinter|on sale|louisvuittonautumnsale|flawed|talkloaded|boots|invcod|collections.co.uk|.co.cc|naijasilvers|t,k|dot|jerseyszone|nfl jerseys|nikeandreebok|waploaded|proudlyboiz|Oscar)\b% i', $message) > 0) {
echo"<div class='msg'>Your message contain spam,you've been reported</div>";
mysql_query("INSERT INTO b_pms SET `reciever`='MR WAPGODZ', `sender`='Reports',
`subject`='Reports', `message`='$poster just spammed forum with ($message) in ($title) Please do not neglect this make sure you ban him', `date`='$date'") or mysql_erro();
}
if(strlen($message)<4 || empty($message))
{
echo"<div class='msg'>Your message is too short</div>";
}
else
{
$topicid=cleanvalues($topicid);
$message=cleanvalues($message);
if($level==0)
$message = spam($message);
if($level==1)
$message = spam($message);
if($level==2)
$message = spam($message);
$insert=mysql_query("INSERT INTO b_replies SET poster='$poster', date='$date', topicid='$id', message='$message'");
mysql_query("UPDATE b_topics SET lastposter='$poster', lastpostdate='$date' WHERE id=$id");
if(!$insert)
{
$msg3="An error occured";
}
else
{$kquery=mysql_fetch_array(mysql_query("SELECT * FROM b_users WHERE username='$poster'"));
$cd=$kquery["rate"]+10;
mysql_query("UPDATE b_users SET rate=$cd Where username='$poster'");
$msg3="Reply Successfully Added";
}
echo"<div class='msg'>$msg3</div>";
}
}
//REPLIES
$self=$_SERVER["PHP_SELF"];
$rowsperpage=5;
$range=10;
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 topicid=$id"));
$totalpages=ceil($numrows/$rowsperpage);
if($currentpage>$totalpages)
{
$currentpage=$totalpages;
}
if($currentpage<1)
{
$currentpage=1;
}
$rquery=mysql_query("SELECT * FROM b_replies WHERE topicid=$id ORDER BY id Asc LIMIT $offset, $rowsperpage");
$rnum=mysql_num_rows($rquery);
echo"
</center>
<div style='margin-top: 5px;' class='grid3'>
</div>";
echo"<div class='grid3 middle'>
<h3 class='comment_header'><font color='#ffffff'><center>Forum &raquo; $fname</center></font></h3><div class='thread'>
<div class='thread-main-post'>
<div id='post-head'><font size='5pix'><b>$title</b></font><br/>
<div align='center'><span class='st_facebook_hcount' displayText='Share'> </span>
<span class='st_twitter_hcount' displayText='Tweet'> </span>
<span class='st_linkedin_hcount' displayText='LinkedIn'> </span>
<span class='st_email_hcount' displayText='Email'> </span></div>
</div>
<div id='post-info'>
<span class='left'>Views: $hints</span>&nbsp; | &nbsp;<span class='right'>Comments: $numrows</span><div class='clearfix'></div>
</div>";
$uid=user_info($author, userID);
if($_POST['code'] != 'sheriff'  && $level < 1 && $author != $username) { $tmessage =preg_replace('#\[lock\](.*?)\[/lock\]#si','Three Comments Is Required to get the Unlock Pin
<form method="post" action="#"><input type="text" size="10" name="code" /><br/><input type="submit" name="pincode" value="Unlock" class="button">',$tmessage); } else { $tmessage = preg_replace('#\[lock\](.*?)\[/lock\]#si', '\1',$tmessage); }
$coins=getworth($author);
$post=user_info($author, rate);
$rating=getrating($post);
$query="SELECT COUNT(poster) AS fcount FROM b_topics WHERE poster='$author'";
$goPage=mysql_query($query);
if(!$goPage)
if(!$goPage)
die("ERROR_PAGE_SQL");
$fcount=mysql_result($goPage,0,`fcount`);
$tquery="SELECT COUNT(poster) AS tcount FROM b_replies WHERE poster='$author'";
$page=mysql_query($tquery);
if(!$page)
die("ERROR_PAGE_SQL");
$tcount=mysql_result($page,0,`tcount`);
$checkid=mysql_num_rows(mysql_query("SELECT * FROM b_users WHERE userID=$uid"));
if(empty($uid)||$author<1)
$recent=date("U")-900;
$onlinecheck=mysql_num_rows(mysql_query("SELECT * FROM b_users WHERE userID='$uid' AND lasttime>'$recent'"));
if($onlinecheck>0) { $st=" <font color=\"green\">&diams;</font> "; } else {
$st=" <font color=\"red\">&diams;</font> "; }
$onlinecheck=user_info($author, online);
$pavt=user_info($author, photo);
if(empty($pavt))
{
$pavt="$config->url/images/nophoto.png";
}
else
{
$pavt="$config->url/avatars/$pavt";
}
$llv=user_info($author, level);
if($llv==0) { $rnk='<img style="vertical-align:middle" src="/images/member.gif"/>'; }
elseif($llv==1) {
$rnk='<img style="vertical-align:middle" src="/images/mod.gif" />'; }
elseif($llv==2) {
$rnk='<img style="vertical-align:middle" src="/images/admin.gif" />'; }
$levul=user_info($author, level);
if($levul==0) { $rnku='<img style="vertical-align:right" src="/images/member.gif" alt="User"/>'; }
elseif($levul==1) {
$rnku='<img style="vertical-align:right" src="/images/mod.gif" alt="admin"/>'; }
elseif($levul==2) {
$rnku='<img style="vertical-align:right" src="/images/admin.gif" alt="owner"/>'; }
If($level==2)
{
if($locked==0)
{
$link2="<a href='action.php?action=movetopic&tid=$tid'>Move</a> - <a href='action.php?action=lock&id=$tid'>Lock</a>- <a href='action.php?action=edittopic&tid=$tid'>Edit</a>- <a href='tim0tgvRE.php?action=update&tid=$tid'>Tag</a>";
}
else
{
$link2="<a href='action.php?action=movetopic&id=$tid'>Move</a> - <a href='action.php?action=unlock&id=$tid'>UnLock</a> - <a href='action.php?action=edittopic&id=$tid'>Edit</a>";
}
}
If($level==1)
{
if($locked==0)
{
$link2="<a href='action.php?action=movetopic&tid=$tid'>Move</a> - <a href='action.php?action=lock&id=$tid'>Lock</a>- <a href='action.php?action=edittopic&tid=$tid'>Edit</a>- <a href='tim0tgvRE.php?action=update&tid=$tid'>Tag</a>";
}
else
{
$link2="<a href='action.php?action=movetopic&id=$tid'>Move</a> - <a href='action.php?action=unlock&id=$tid'>UnLock</a> - <a href='action.php?action=edittopic&id=$tid'>Edit</a>";
}
}
echo"<div class='mainblok'><div
class='phdr' align='right'><table cellpadding='0'
cellspacing='0' width='100%'><tbody><tr><td width='auto' align='left'><img src='http://codedhtml.tk/images/file.png' width='12' height='12'
alt=''>&nbsp; $tdate<td width='auto'
align='right'> #$tid</td><td width='auto' align='right'></td></tr></tbody></table></div><div><div class='newsx'><table
width='100%' cellpadding='0'
cellspacing='0'><tbody><tr><td width='36' align='left' valign='top'><span class='avatar'><img src='$pavt' alt='photo' height='30' width='30' /></span></td><td width='auto' align='left' valign='top'><a
href=\"../profile.php?uid=$uid\"><b>$author</b></a> $st<br/>$rnk<br/><font
color='red'>$rating</font></td><br><td width='auto' align='right'
valign='top'><a href='../mail/compose.php?ruser=$author'><b>PM</b> <img src='http://codedhtml.tk/images/pm.png' width='auto' heght='12' align='middle'></a><br>Post:
$fcount<br><img src='http://codedhtml.tk/forum/thanx.gif' width='14' height='14'> $tcount</td></tr></table></div>";
if($locked==0)
{ if(isloggedin())
{ echo"<div class='forumtxt' align='left'>$tmessage </div><br/><div class='forumb' align='left'>".$topiclike.$analiketopics."</div><div align='left'><b>Posted Via <a href='topics.php?id=$fid'><font color='#ff6600'>$fname</font></a><br>Share this with your friends</b><br>
<span class='st_facebook_hcount' displayText='Share'> </span>
<span class='st_twitter_hcount' displayText='Tweet'> </span></div><br> <div class='forum_adm' align='left'>$link2</div></div>
</div><h3 class=\"comment_header\"><font color=\"#ffffff\">Members Comments</font></h3>";
echo"
<center>"; } else
{echo "<div class='msg'><font color='red'>Hi Guest, To See This Topic Posted in Here Please <a href='/index.php'><u>LOGIN</u></a> or <a href='/register.php'><u>REGISTER</u></a> To View amd Add Your Comments</font></div></center>";}}
else {
echo" "; }
if($rnum==0)
{
echo"<div class='msg'>No replies yet! Be the first to reply and earn #10 Instantly</div>";
}
else
{
while($rinfo=mysql_fetch_assoc($rquery))
{
$poster=$rinfo["poster"];
$topicid=$rinfo["topicid"];
$uid=user_info($poster, userID);
$coins=getworth($poster);
$posts=user_info($poster, rate);
$rate=getrating($posts);
$checkid=mysql_num_rows(mysql_query("SELECT * FROM b_users WHERE userID=$uid"));
if(empty($uid)||$poster<0)
$recent=date("U")-900;
$onlinecheck=mysql_num_rows(mysql_query("SELECT * FROM b_users WHERE userID='$uid' AND lasttime>'$recent'"));
if($onlinecheck>0) { $st=" <font color=\" green\">&diams;</font> "; }
else {
$st=" <font color=\" red\">&diams;</font> "; }
$st=" <font color=\" red\">&diams;</font> "; }
$onlinecheck=user_info($poster, online);
$favt=user_info($poster, photo);
if(empty($favt))
{
$favt="$config->url/images/nophoto.png";
}
else
{
$favt="$config->url/avatars/$favt";
}
$plev=user_info($poster, level);
if($plev==0) { $rnk='<img style="vertical-align:middle" src="/images/member.gif"/>'; }
elseif($plev==1) {
$rnk='<img style="vertical-align:middle" src="/images/mod.gif" />'; }
elseif($plev==2) {
$rnk='<img style="vertical-align:middle" src="/images/admin.gif" />'; }
$abu=user_info($poster, level);
if($abu==0) { $akanbi='<img style="vertical-align:right" src="/images/member.gif" alt="User"/>'; }
elseif($abu==1) {
$akanbi='<img style="vertical-align:right" src="/images/mod.gif" alt="admin"/>'; }
elseif($abu==2) {
$akanbi='<img style="vertical-align:right" src="/images/admin.gif" alt="owner"/>'; }
$query="SELECT COUNT(poster) AS fcount FROM b_topics WHERE poster='$poster'";
$goPage=mysql_query($query);
if(!$goPage)
die("ERROR_PAGE_SQL");
$fcount=mysql_result($goPage,0,`fcount`);
$tquery="SELECT COUNT(poster) AS tcount FROM b_replies WHERE poster='$poster'";
$page=mysql_query($tquery);
if(!$page)
die("ERROR_PAGE_SQL");
$tcount=mysql_result($page,0,`tcount`);
$pid=$rinfo["id"];
$netnaija = '<a href="like.php?t=2&id='.$pid.'">Like post</a>';
$nn = mysql_query("SELECT `from` FROM `pbnl_like` WHERE `type` = 2 AND `itemid` = $pid");
if(mysql_num_rows($nn) > 0)
{
$replikes = ':- ';
while($get = mysql_fetch_assoc($nn))
{
$replikes .= ''.$get["from"].', ';
}
}
$message=$rinfo["message"];
$date=$tinfo["date"];
$date=date("h:ia D d M Y", $date);
//BBCODE
$message=smiley(cleanvalues2($message));
$message=bbcode($message);
$message=at_user($message);
if(isloggedin())
{$quote="<div align='right'><a href='quote.php?action=copy&id=$pid&tid=$tid'>| <img src='../images/quote.png' alt='[Quote]'/> |</a> $rnk</div>";}
$link="<br><a href='action.php?action=delete&id=$pid&tid=$tid'><font color='red'>Delete</font></a> - <a href='action.php?action=edit&id=$pid&tid=$tid'>Edit</a>";
$link0=" ";
$link4=($level>0) ? $link : $link0;
$query=mysql_fetch_array(mysql_query("SELECT * FROM b_topics WHERE id=$topicid"));
$subject=$query["subject"];
echo"<div class='mainblok'><div
class='phdr' align='right'><table cellpadding='0'
cellspacing='0' width='100%'><tbody><tr><td width='auto' align='left'><img src='http://codedhtml.tk/images/file.png' width='12' height='12'
alt=''>&nbsp; $date<td width='auto'
align='right'> #$pid</td><td width='auto' align='right'></td></tr></tbody></table></div><div><div class='newsx'><table
width='100%' cellpadding='0'
cellspacing='0'><tbody><tr><td width='36' align='left' valign='top'><span class='avatar'><img src='$favt' alt='photo' height='25' width='25' /></span></td><td width='auto' align='left' valign='top'><a href='../profile.php?uid=$uid'><b>$poster</b></a> $st<br/><font
color='red'>$rate</font></td><td width='auto' align='right'
valign='top'><a href='../mail/compose.php?ruser=$poster'><b>PM</b> <img src='http://codedhtml.tk/images/pm.png' width='auto' heght='12' align='middle'></a><br>Post:
$fcount<br><img src='http://codedhtml.tk/forum/thanx.gif' width='14' height='14'> $tcount</td></tr></table></div><div class='forumtxt' align='left'>$message</div><div class='forumb'>$quote</div> <div class='forum_adm' align='left'>$link4</div></div></div>";
} echo "<br><div class=\"pager\">"; if($currentpage>1)
{ echo"<a href='$self?currentpage=1&id=$id'>[<b>First</b>]</a>";
$prevpage=$currentpage-1;
echo"<a href='$self?currentpage=$prevpage&id=$id'>[<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?currentpage=$x&id=$id'>[<b>$x</b>]</a>";
}
}
} if($currentpage!=$totalpages)
{ $nextpage=$currentpage+1;
echo"<a href='$self?currentpage=$nextpage&id=$id'>[<b>Next</b>]</a>"; echo"<a href='$self?currentpage=$totalpages&id=$id'>[<b>Last</b>]</a>"; } echo"</div><br>";
$onlinequery=mysql_query("SELECT DISTINCT * FROM b_onlineforum WHERE id=$id");
echo"<ul><li><select><option>PEOPLE THAT ARE IN FORUM</option>";
while($row[email protected]mysql_fetch_array($onlinequery))
{
$donsinister=$row["donsinister"];
echo"<option>$donsinister</option>";
}
echo"</select></li></ul><br>"; }
if($locked==0)
{ if(isloggedin())
{ echo "<span
class=\"style2\"><strong>=></strong>Pls do not Spam, else you <br/>might lose your Account!</span><br>
<br>Post Reply<br><a href='/content/bbcode_ref.php'>BBcodes</a> <b>|</b> <a
<br>Post Reply<br><a href='/content/bbcode_ref.php'>BBcodes</a> <b>|</b> <a
href='/content/smiley_ad.php'>Smileys</a><form action='#' method='POST'><input type='hidden' name='topicid' value='$id'><input type='hidden' name='poster' value='$user'><textarea rows='4' cols='26' name='message'></textarea><br/><input type='submit' name='submit' value='Reply' class='button'></form><br/>";
$rel=mysql_query("SELECT * FROM b_topics WHERE MATCH(subject) AGAINST('$title') LIMIT 6");
if(mysql_num_rows($rel)<0){
echo"";
}else{
echo" <div align='center'><div class='b_head'>Related Topics</div></div>";
while($rel2=mysql_fetch_assoc($rel)){
$reltitle=$rel2["subject"];
$relid=$rel2["id"];
echo" <a href='showtopic.php?id=$relid'><div class='amdot'><div align='left'><font color='#ff6600'>$reltitle</font></div></div></a>";
}
}
echo"
<center><br>"; } else
{echo "<div class='msg'><font color='red'>Hi Guest, If You Want To See This Post Please <a href='/index.php'><u>LOGIN</u></a> or <a href='/register.php'><u>REGISTER</u></a> To View And Also Add Your Comment</font></div>";}}
else {
echo"<div class='msg'><font color='red'><b>This Topic has been locked by the admin</b></font></div>";
}
echo"<br>";
include"../footer.php";
?>