\n\nPosts\n\n\n

\n"; $barefooter="

\n\n\n"; function einde($eindStr) { global $bareheader, $barefooter; echo $bareheader; eScript($eindStr); echo $barefooter; die(); } $forumid=intval($_GET["forumid"]); $topicid=intval($_GET["topicid"]); $page=intval($_GET["page"]); $page=max(0,$page); $tpage=intval($_GET["tpage"]); $admin=$_GET["admin"]; $refer=$_GET["refer"]; $postid=intval($_GET["postid"]); $x=0; // voor kleuren zie onder if ($forumid<=0 && $postid<=0 && $topicid<=0) { einde($LANG_error.$LANG_unknowntopic); } error_reporting(1); include_once("../database/connectdb.php"); include_once("functions.php"); $instel=explode(";",$_COOKIE["cinstel"]); $ranks=explode(";",$forum_vars_ranks); if ($instel[10]=="N") { $doavatar="N"; } else { $doavatar="Y"; } switch ($instel[11]) { case "A":$maxposts=25;break; case "C":$maxposts=75;break; case "D":$maxposts=100;break; default:$maxposts=50;break; } $tzh = intval(floatval($instel[15]))." ".$LANG_hour; $tzm = ((round(floatval($instel[15]))-floatval($instel[15]))*60)." ".$LANG_minutes; $tz = $tzh." ".$tzm; getforumtable(); if ($topicid>0) { $onderwerp=""; $qry="SELECT forums.id,forums.titel, forums.readonly, forums.membersonly, ".$forumtable.".onderwerp, ".$forumtable.".deleted, ".$forumtable.".replies, ".$forumtable.".bericht, ".$forumtable.".htmlbericht, ".$forumtable.".editmsg, ".$forumtable.".pollvraag, ".$forumtable.".userid, ".$forumtable.".username, ".$forumtable.".forumid, ".$forumtable.".topic, ".$forumtable.".locked, ".$forumtable.".datum, ".$forumtable.".attachment, users.tagline as tagmsg, users.avatar, users.instellingen, users.posts, users.blocked, users.created AS ucreated, users.geslacht, users.stad, users.land, users.customtitle, forumcats.id as catid, forumcats.catnaam FROM ".$forumtable." LEFT JOIN forums ON ".$forumtable.".forumid=forums.id LEFT JOIN forumcats ON forums.categorie=forumcats.id LEFT JOIN users ON ".$forumtable.".userid=users.id LEFT JOIN forumaccess ON forums.id = forumaccess.forumid WHERE (forumaccess.userid='".$_COOKIE["cuserid"]."' or isnull(forumaccess.userid)) AND ".$forumtable.".id='$topicid' LIMIT 1"; $tresult = mysql_query($qry); $trow=mysql_fetch_array($tresult); if ($trow["deleted"]=="ja") { einde($LANG_error.$LANG_unknowntopic); } else { $forumname=$trow["titel"]; $forumonderwerp=$trow["onderwerp"]; $forumid=$trow["id"]; $maxreplies=$trow["replies"]; $membersonly = $trow["membersonly"]; $thisislocked=$trow["locked"]; $onderwerp=$trow["onderwerp"]; $catnaam = $trow["catnaam"]; $catid = $trow["catid"]; $attachment = $trow["attachment"]; $readonly = $trow["readonly"]; } mysql_free_result($tresult); } else if ($postid>0) { $qry="SELECT ".$forumtable.".topic FROM ".$forumtable." LEFT JOIN forumaccess ON ".$forumtable.".forumid = forumaccess.forumid WHERE (forumaccess.userid='".$_COOKIE["cuserid"]."' or isnull(forumaccess.userid)) AND ".$forumtable.".id='$postid' LIMIT 1"; $presult = mysql_query($qry); if (!$presult) die($LANG_error.$LANG_unknownpost); $prow=mysql_fetch_array($presult); if (!$prow) die($LANG_error.$LANG_unknowntopic); $topicid=$prow["topic"]!=0 ? $prow["topic"] : $postid; mysql_free_result($presult); $onderwerp=""; $qry="SELECT forums.id,forums.titel, forums.readonly, forums.membersonly, ".$forumtable.".onderwerp, ".$forumtable.".deleted, ".$forumtable.".replies, ".$forumtable.".bericht, ".$forumtable.".htmlbericht, ".$forumtable.".editmsg, ".$forumtable.".pollvraag, ".$forumtable.".userid, ".$forumtable.".username, ".$forumtable.".forumid, ".$forumtable.".topic, ".$forumtable.".locked, ".$forumtable.".datum, ".$forumtable.".attachment, users.tagline as tagmsg, users.avatar, users.instellingen, users.posts, users.blocked, users.created AS ucreated, users.geslacht, users.stad, users.land, users.customtitle, forumcats.id as catid, forumcats.catnaam FROM ".$forumtable." LEFT JOIN forums ON ".$forumtable.".forumid=forums.id LEFT JOIN forumcats ON forums.categorie=forumcats.id LEFT JOIN users ON ".$forumtable.".userid=users.id WHERE ".$forumtable.".id='$topicid' LIMIT 1"; $tresult = mysql_query($qry); $trow=mysql_fetch_array($tresult); if ($trow["deleted"]=="ja") { einde($LANG_error.$LANG_deletedtopic); } else { $forumname=$trow["titel"]; $forumonderwerp=$trow["onderwerp"]; $forumid=$trow["id"]; $maxreplies=$trow["replies"]; $membersonly = $trow["membersonly"]; $thisislocked=$trow["locked"]; $onderwerp=$trow["onderwerp"]; $catnaam = $trow["catnaam"]; $catid = $trow["catid"]; $attachment = $trow["attachment"]; $readonly = $trow["readonly"]; if ($maxreplies>$maxposts && !$_GET["page"]) { // get aanspreken want page var = 0 door intval $page = (ceil($maxreplies / $maxposts)-1)*$maxposts; } } } if ($membersonly=="ja") { $doenstr=$LANG_memberforum; $returnpage=$_SERVER["SCRIPT_NAME"]."?".$_SERVER["QUERY_STRING"]; if ($returnpage=="" || $returnpage=="null") { $returnpage=$_SERVER["HTTP_REFERER"]; } include_once("frm_checklogin.php"); } // toon headers $tmp_s="\n"; $tmp_s.="\n\n".$forum_vars_title." :: ".$forumname." : ".$forumonderwerp." ".htmlentities($page,ENT_QUOTES)."\n"; $tmp_s.="\n"; $tmp_s.="\n"; $tmp_s.="\n"; $tmp_s.="\n"; $tmp_s.="\n"; $tmp_s.="\n"; $tmp_s.="\n"; $tmp_s.="\n"; $tmp_s.="\n"; $tmp_s.="\n"; $tmp_s.="\n"; if ($_COOKIE["cuserid"] && $_COOKIE["cvaliduser"]) { $result = mysql_query("SELECT count(*) as aantal FROM msgs WHERE map=0 AND aan_userid=".$_COOKIE["cuserid"]." AND gelezen='nee'"); if ($result) { $row=mysql_fetch_array($result); if ($row) { if ($row["aantal"]>0) { $tmp_s.="\n"; $showpms = "ShowPopUp('".$LANG_youhave." ".$row["aantal"]." ".$LANG_newmsgs."','".$forum_url."berichten.php');\n"; } else { $showpms = ""; } mysql_free_result($result); } } } $tmp_s.="\n\n"; echo $tmp_s; if ($forumonderwerp=="") { einde($LANG_error.$LANG_unknowntopic); } $showonlineusers=3;include_once("online.php"); $pagestr=""; if ($maxreplies>$maxposts) { $pagestr="Page "; $zb=0; for ($z=1;$z<=$maxreplies;$z+=$maxposts) { $zb++; $pstarter=($zb-1)*$maxposts; if ($page==$pstarter) { $pagestr.="[".$zb."] "; } else { $pagestr.="".$zb." "; } } // einde for } wScript("maakPostsTabel(\"".date("d-m-Y H:i:s")."\",\"".$pagestr."\", \"".$readonly."\");"); wScript("maakPostsHeader('".$_COOKIE["cuserid"]."','".$_COOKIE["cusername"]."','".cSlash($onlineuserStr)."','".cSlash($announcement)."', $forumid, '".cSlash($forumname)."', $catid, '".$catnaam."', $topicid, '".cSlash($onderwerp)."', $tpage, $page, '".$admin."');"); echo "\n\n\n"; $result = mysql_query("update ".$forumtable." set bekeken=bekeken+1 where id=$topicid"); ?>