query("SELECT t.*,p.userid,p.posttime,p.posttopic,p.message,p.postid,p.allowsmilies,b.allowsmilies AS allowsmilies_b,b.allowhtml,b.allowbbcode,b.allowimages,u.homepage,u.username FROM bb".$n."_threads AS t LEFT JOIN bb".$n."_posts AS p ON (t.threadid=p.threadid) LEFT JOIN bb".$n."_boards AS b ON (t.boardid=b.boardid) LEFT JOIN bb".$n."_users AS u ON (p.userid=u.userid) WHERE t.boardid IN ($portal_news_board) AND t.visible=1 GROUP BY t.threadid ORDER BY t.threadid DESC LIMIT ".$portal_count_news); if($portal_news_images == 2) $portal_news_images = $wbbuserdata['showimages']; while($news = $db->fetch_array($res3)) { $board = $db->query_first("SELECT * FROM bb".$n."_boards WHERE boardid=".$news['boardid'].";"); $parse = new parse($docensor,75,$board['allowsmilies'],$board['allowbbcode'],$portal_news_images,$usecode); $news_postdate=formatdate($dateformat.",",$news['posttime'],1); $news_posttime=formatdate($timeformat,$news['posttime']); if ($news['posttopic'] == "") $news['posttopic'] = "no Topic"; $news['message']=$parse->doparse($news['message'],$news['allowsmilies']*$news['allowsmilies_b'],$news['allowhtml'],$news['allowbbcode'],$news['allowimages']); if($portal_news_cut && strlen($news['message']) > $portal_news_cut) { $news['message']=substr($news['message'],0,$portal_news_cut); eval ("\$news[message] .= \"".$tpl->get("portal_newscut")."\";"); } $news['posttopic']=$parse->textwrap($news['posttopic'],30); if ($news['replies'] >15) $hotreplies = makeimgtag("{imagefolder}/portal_news_hot.gif"); else $hotreplies = ""; if ($news['views'] >150) $topviews = makeimgtag("{imagefolder}/portal_news_top.gif"); else $topviews = ""; eval ("\$portal_newsbit .= \"".$tpl->get("portal_newsbit")."\";"); } eval ("\$newsforen = \"".$tpl->get("portal_news")."\";"); $box3 = str_replace("{newsforen}","$newsforen",$box3); } /* ########### Ende News Beiträge ########## */ /* ########### Anfang Anzeige der letzten Themen ########## */ if(ereg("{themen}",$box3)) { if($_POST['ltcount'] == "*") bbcookie("ltcount","",1); else { if($_POST['ltcount']) { $portal_count_lastthread = $_POST['ltcount']; $_SESSION['ltcount'] = $_POST['ltcount']; $_COOKIE['ltcount'] = $_POST['ltcount']; bbcookie("ltcount",$_POST['ltcount'],time()+3600*24*365); } else if($_SESSION['ltcount']) $portal_count_lastthread = $_SESSION['ltcount']; else if($_COOKIE['ltcount']) $portal_count_lastthread = $_COOKIE['ltcount']; $tmp = "selected".$portal_count_lastthread; $$tmp = " selected"; } if(!$portal_lt_boards) $portal_lt_boards=0; if(isset($_COOKIE['boardvisit'])) $boardvisit=decode_cookie($_COOKIE['boardvisit']); else $boardvisit=array(); if(isset($_COOKIE['threadvisit'])) $threadvisit=decode_cookie($_COOKIE['threadvisit']); else $threadvisit=array(); $result = $db->query("SELECT t.*, b.title,b.postsperpage, b.hotthread_reply,b.hotthread_view, IF(voted>0,votepoints/voted,0) AS vote, i.* FROM bb".$n."_threads t LEFT JOIN bb".$n."_icons i USING (iconid) LEFT JOIN bb".$n."_boards b ON (t.boardid=b.boardid) LEFT JOIN bb".$n."_permissions p ON (p.boardid=b.boardid) WHERE t.boardid NOT IN ($portal_lt_boards) AND p.groupid='".$wbbuserdata['groupid']."' AND p.boardpermission=1 AND t.visible=1 ORDER BY lastposttime DESC LIMIT ".$portal_count_lastthread); while($threads=$db->fetch_array($result)) { $firstnew=""; $multipages=""; $prefix=""; if($wbbuserdata['umaxposts']) $postsperpage=$wbbuserdata['umaxposts']; elseif($threads['postsperpage']) $postsperpage=$threads['postsperpage']; else $postsperpage=$default_postsperpage; if(isset($boardvisit[$threads['boardid']]) && $boardvisit[$threads['boardid']]>$wbbuserdata['lastvisit']) $wbbuserdata['lastvisit']=$boardvisit[$threads['boardid']]; if($threads['hotthread_reply']==0) $threads['hotthread_reply']=$default_hotthread_reply; if($threads['hotthread_view']==0) $threads['hotthread_view']=$default_hotthread_view; if(strlen($threads['topic'])>60) $threads['topic']=parse::textwrap($threads['topic'],60); if($threads['starterid']!=0) eval ("\$threads['starter'] = \"".$tpl->get("board_threadbit_starter")."\";"); if($threads['lastposterid']!=0) eval ("\$threads['lastposter'] = \"".$tpl->get("board_threadbit_lastposter")."\";"); $lastpostdate=formatdate($dateformat,$threads['lastposttime'],1); $lastposttime=formatdate($timeformat,$threads['lastposttime']); if($threads['closed']==3) { $threads['threadid']=$threads['pollid']; $threadrating=" "; eval ("\$prefix .= \"".$tpl->get("board_thread_moved")."\";"); $foldericon="moved"; if($wbbuserdata['lastvisit']<$threads['lastposttime'] && $threadvisit[$threads['threadid']]<$threads['lastposttime']) eval ("\$firstnew = \"".$tpl->get("board_threadbit_firstnew")."\";"); if($threads['iconid']) $threadicon=makeimgtag($threads['iconpath'],$threads['icontitle']); else $threadicon=" "; $threads['replycount']="-"; $threads['views']="-"; } else { if($threads['voted']) { $avarage=number_format($threads['votepoints']/$threads['voted'],2); eval ("\$threadrating = \"".$tpl->get("board_threadbit_rating")."\";"); $threadrating=str_repeat($threadrating, round($avarage)); } else $threadrating=" "; if($threads['important']==2) eval ("\$prefix .= \"".$tpl->get("board_thread_announce")."\";"); if($threads['important']==1) eval ("\$prefix .= \"".$tpl->get("board_thread_important")."\";"); if($threads['pollid']!=0) eval ("\$prefix .= \"".$tpl->get("board_thread_poll")."\";"); if($threads['important']==2) $foldericon="announce"; else $foldericon=ifelse($wbbuserdata['lastvisit']<$threads['lastposttime'] && $threadvisit[$threads['threadid']]<$threads['lastposttime'],"new").ifelse($threads['replycount']>=$threads['hotthread_reply'] || $threads['views']>=$threads['hotthread_view'],"hot").ifelse($threads['closed']!=0,"lock")."folder"; if($wbbuserdata['lastvisit']<$threads['lastposttime'] && $threadvisit[$threads['threadid']]<$threads['lastposttime']) eval ("\$firstnew = \"".$tpl->get("board_threadbit_firstnew")."\";"); if($threads['pollid']!=0) $threadicon=makeimgtag("{imagefolder}/poll.gif",""); elseif($threads['iconid']) $threadicon=makeimgtag($threads['iconpath'],$threads['icontitle']); else $threadicon=" "; if($threads['replycount']+1>$postsperpage && $showmultipages!=0) { unset($multipage); unset($multipages_lastpage); $xpages=ceil(($threads['replycount']+1)/$postsperpage); if($xpages>$showmultipages) { eval ("\$multipages_lastpage = \"".$tpl->get("board_threadbit_multipages_lastpage")."\";"); $xpages=$showmultipages; } for($i=1;$i<=$xpages;$i++) { $multipage.=" ".makehreftag("thread.php?threadid=$threads[threadid]&page=$i&sid=$session[hash]",$i); } eval ("\$multipages = \"".$tpl->get("board_threadbit_multipages")."\";"); } } eval ("\$ltportal .= \"".$tpl->get("portal_board_threadbit")."\";"); } eval ("\$ltportal = \"".$tpl->get("portal_lastthread")."\";"); $box3 = str_replace("{themen}","$ltportal",$box3); } /* ########### Ende Anzeige der letzten Themen ########## */ /* ########### Anfang Statistik ########## */ if(ereg("{statistik}",$box3)) { $portal_posts = $db->query_first("SELECT COUNT(postid) FROM bb".$n."_posts WHERE visible=1"); $portal_posts[0] = number_format($portal_posts[0],0,",","."); $portal_threads = $db->query_first("SELECT COUNT(threadid) FROM bb".$n."_threads WHERE visible=1"); $portal_threads[0] = number_format($portal_threads[0],0,",","."); $portal_avatars = $db -> query_first("SELECT COUNT(*) FROM bb".$n."_avatars"); $portal_smilies = $db -> query_first("SELECT COUNT(*) FROM bb".$n."_smilies"); $portal_styles = $db -> query_first("SELECT COUNT(*) FROM bb".$n."_styles"); $portal_users = $db -> query_first("SELECT COUNT(*) FROM bb".$n."_users WHERE activation='1'"); $portal_users[0] = number_format($portal_users[0],0,",","."); $portal_inactive = $db->query_first("SELECT COUNT(userid) FROM bb".$n."_users WHERE activation <> 1"); $portal_blocked = $db->query_first("SELECT COUNT(userid) FROM bb".$n."_users WHERE blocked <> 0"); $portal_votings = $db -> query_first("SELECT COUNT(*) FROM bb".$n."_polls"); $portal_boards = $db -> query_first("SELECT COUNT(*) FROM bb".$n."_boards WHERE isboard = 1"); $portal_cats = $db -> query_first("SELECT COUNT(*) FROM bb".$n."_boards WHERE isboard = 0"); $portal_pms = $db -> query_first("SELECT COUNT(*) FROM bb".$n."_privatemessage"); $portal_pms[0] = number_format($portal_pms[0],0,",","."); $portal_announcements = $db->query_first("SELECT count(*) FROM bb".$n."_announcements");; $portal_groups = $db -> query_first("SELECT COUNT(*) FROM bb".$n."_groups"); $result = $db->query("SELECT count(*) AS count, g.title,canuseacp,ismod,issupermod FROM bb".$n."_users u,bb".$n."_groups g WHERE g.groupid=u.groupid AND (canuseacp=1 OR ismod=1 OR issupermod=1) GROUP BY g.groupid;"); while($teammembers = $db->fetch_array($result)) $portal_teamcache[] = $teammembers; for($i=0; $i"; else if($portal_teamcache[$i]['issupermod']) $portal_teamstatsbit1img = ""; else if($portal_teamcache[$i]['ismod']) $portal_teamstatsbit1img = ""; else $portal_teamstatsbit1img = ""; if($portal_teamcache[$i+1]['canuseacp']) $portal_teamstatsbit2img = ""; else if($portal_teamcache[$i+1]['issupermod']) $portal_teamstatsbit2img = ""; else if($portal_teamcache[$i+1]['ismod']) $portal_teamstatsbit2img = ""; else $portal_teamstatsbit2img = ""; eval ("\$portal_teamstats .= \"".$tpl->get("portal_teamstats")."\";"); } eval ("\$boardstats .= \"".$tpl->get("portal_boardstats")."\";"); $box3 = str_replace("{statistik}","$boardstats",$box3); } /* ########### Ende Statistik ########## */ /* ############## Anfang Portal-Forum ############## */ if(ereg("{forum}",$box3)) { $boardcache=array(); $permissioncache=array(); $modcache=array(); $activtime=time()-60*$useronlinetimeout; $result = $db->query(" SELECT b.*".ifelse($showlastposttitle==1,", t.topic, i.*")." FROM bb".$n."_boards b ".ifelse($showlastposttitle==1,"LEFT JOIN bb".$n."_threads t ON (t.threadid=b.lastthreadid) LEFT JOIN bb".$n."_icons i USING (iconid)")." ORDER by b.parentid ASC, b.boardorder ASC"); while ($row = $db->fetch_array($result)) $boardcache[$row['parentid']][$row['boardorder']][$row['boardid']] = $row; $result = $db->query("SELECT boardid, threadid, lastposttime FROM bb".$n."_threads WHERE visible = 1 AND lastposttime > '$wbbuserdata[lastvisit]' AND closed <> 3"); while($row=$db->fetch_array($result)) $visitcache[$row['boardid']][$row['threadid']]=$row['lastposttime']; $result = $db->query("SELECT * FROM bb".$n."_permissions WHERE groupid = '$wbbuserdata[groupid]'"); while ($row = $db->fetch_array($result)) $permissioncache[$row['boardid']] = $row; $result = $db->query("SELECT bb".$n."_moderators.*, username FROM bb".$n."_moderators LEFT JOIN bb".$n."_users USING (userid) ORDER BY username ASC"); while ($row = $db->fetch_array($result)) $modcache[$row['boardid']][] = $row; $portal_boardbit = makeboardbit(0); eval ("\$portal_forum .= \"".$tpl->get("portal_box_forum")."\";"); $box3 = str_replace("{forum}","$portal_forum",$box3); } /* ############## Ende Portal-Forum ############## */ if(!$wbbuserdata['userid']) { eval ("\$welcome = \"".$tpl->get("index_welcome")."\";"); eval ("\$quicklogin = \"".$tpl->get("index_quicklogin")."\";"); } else { $currenttime=formatdate($timeformat,time()); $toffset=ifelse($default_timezoneoffset>=0,"+").$default_timezoneoffset; $lastvisitdate = formatdate($dateformat,$wbbuserdata['lastvisit']); $lastvisittime = formatdate($timeformat,$wbbuserdata['lastvisit']); eval ("\$welcome = \"".$tpl->get("index_hello")."\";"); if($wbbuserdata['canusepms']==1 && $showpmonindex==1) { $counttotal=0; $countunread=0; $countnew=0; $result = $db->query("SELECT view, sendtime FROM bb".$n."_privatemessage WHERE deletepm <> 1 AND recipientid = '$wbbuserdata[userid]'"); while($row=$db->fetch_array($result)) { $counttotal++; if($row['view']==0) { $countunread++; if($row['sendtime']>$wbbuserdata['lastvisit']) $countnew++; } } if($countnew>0) eval ("\$new_notnew = \"".$tpl->get("index_newpm")."\";"); else eval ("\$new_notnew = \"".$tpl->get("index_nonewpm")."\";"); eval ("\$index_pms = \"".$tpl->get("index_pms")."\";"); } } if($_REQUEST['hidesideboxes']) eval("\$tpl->output(\"".$tpl->get("portal2")."\");"); else eval("\$tpl->output(\"".$tpl->get("portal")."\");"); ?>