- Liittynyt
- 17.4.2002
- Viestejä
- 1 963
Välillä kun yrittää klikata esim. "yleinen keskustelu aukee sivu jossa lukee seuraavaaa:
200) { //max of 200, per several users requests $perpage=$maxthreads; } $pagenumber = intval($pagenumber); if (!isset($pagenumber) or $pagenumber==0) { $pagenumber=1; } $forumid = intval($forumid); $foruminfo = verifyid('forum',$forumid,1,1); $getperms=getpermissions($forumid,-1,-1,$foruminfo['parentlist']); if (!$getperms[canview]) { show_nopermission(); } updateuserforum($forumid); $forumdisplay['threadslist'] = ""; $bbcodeon=iif($foruminfo['allowbbcode'],$ontext,$offtext); $imgcodeon=iif($foruminfo['allowimages'],$ontext,$offtext); $htmlcodeon=iif($foruminfo['allowhtml'],$ontext,$offtext); $smilieson=iif($foruminfo['allowsmilies'],$ontext,$offtext); if (!isset($daysprune) or $daysprune==0 or $daysprune==-1) { if ($bbuserinfo['daysprune']>0) { $daysprune = $bbuserinfo['daysprune']; } else { $daysprune = iif($foruminfo['daysprune'], $foruminfo['daysprune'], 30); } } // draw nav bar $navbar=makenavbar($forumid,"forum",0); // get moderators $forummoderators=$DB_site->query('SELECT user.userid,user.username,moderator.forumid FROM moderator LEFT JOIN user ON (moderator.userid=user.userid) ORDER BY user.username'); unset($imodcache); while ($moderator=$DB_site->fetch_array($forummoderators)) { $imodcache["$moderator[forumid]"][] = $moderator; } $DB_site->free_result($forummoderators); unset($moderatorslist); $listexploded=explode(',', $foruminfo['parentlist']); while ( list($mkey1,$mval1)=each($listexploded) ) { if ( !isset($imodcache["$mval1"]) ) { continue; } reset($imodcache["$mval1"]); while ( list($mkey2,$moderator)=each($imodcache["$mval1"]) ) { if ( !isset($moderatorslist) ) { eval("\$moderatorslist = \"".gettemplate('forumdisplay_moderator')."\";"); } else { eval("\$moderatorslist .= \", ".gettemplate('forumdisplay_moderator')."\";"); } } } if ( isset($moderatorslist) ) { eval("\$moderatedby = \"".gettemplate('forumdisplay_moderatedby')."\";"); } else { $moderatedby=''; } // display sub forums $permissions = $getperms; //Forum info $forums=$DB_site->query('SELECT * FROM forum WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder,forumid'); unset($iforumcache); while ($forum=$DB_site->fetch_array($forums)) { $iforumcache["$forum[parentid]"]["$forum[displayorder]"]["$forum[forumid]"] = $forum; } $DB_site->free_result($forums); unset($forum); unset($ipermcache); //Forum perms $forumperms=$DB_site->query("SELECT forumid,canview,canpostnew FROM forumpermission WHERE usergroupid='$bbuserinfo[usergroupid]'"); while ($forumperm=$DB_site->fetch_array($forumperms)) { $ipermcache["$forumperm[forumid]"] = $forumperm; } $DB_site->free_result($forumperms); unset($forumperm); $accesscache = array(); if ($bbuserinfo['userid']!=0 AND $enableaccess) { //Access table perms $accessperms=$DB_site->query("SELECT forumid,accessmask FROM access WHERE userid='$bbuserinfo[userid]'"); while ($accessperm=$DB_site->fetch_array($accessperms)) { $accesscache["$accessperm[forumid]"] = $accessperm; } $DB_site->free_result($accessperms); unset($accessperm); // usergroup defaults $usergroupdef['canview'] = $permissions['canview']; $usergroupdef['canpostnew'] = $permissions['canpostnew']; // array for accessmask=0 $noperms['canview'] = 0; $noperms['canpostnew'] = 0; } //GENERATE forumjump: $curforumid = $forumid; makeforumjump(); // Start makeforumbit $forumshown = 0; function makeforumbit($forumid,$depth=1,$permissions='') { global $DB_site,$bbuserinfo,$iforumcache,$ipermcache,$imodcache,$session,$accesscache,$usergroupdef,$noperms; global $showlocks,$hideprivateforums,$showforumdescription,$forumdisplaydepth,$dateformat,$timeformat,$forumshown,$enableaccess; if ( empty($iforumcache["$forumid"]) or !is_array($iforumcache["$forumid"]) ) { return; } $forumbits = ''; reset($iforumcache["$forumid"]); while ( list($key1,$val1)=each($iforumcache["$forumid"]) ) { while ( list($key2,$forum)=each($val1) ) { // Permissions if ( $enableaccess and is_array($accesscache["$forum[forumid]"]) ) { if ($accesscache["$forum[forumid]"]['accessmask']==1) { $forumperms = $usergroupdef; } else { $forumperms = $noperms; } } else if ( is_array($ipermcache["$forum[forumid]"]) ) { $forumperms = $ipermcache["$forum[forumid]"]; } else { $forumperms = $permissions; } if (!$hideprivateforums) { $forumperms['canview']=1; } if (!$forumperms['canview']) { continue; } else { $forumshown=1; // do light bulb if ($bbuserinfo['lastvisitdate']=='Never') { $forum['onoff']='on'; } else { if (($fview = get_bbarraycookie('forumview', $forum['forumid'])) > $bbuserinfo['lastvisit']) { $userlastvisit=$fview; } else { $userlastvisit=$bbuserinfo['lastvisit']; } if ($userlastvisit<$forum['lastpost']) { $forum['onoff']='on'; } else { $forum['onoff']='off'; } } if ((!$forumperms['canpostnew'] and $showlocks) or $forum['allowposting']==0) { $forum['onoff'].='lock'; } // prepare template vars if (!$showforumdescription) { $forum['description']=''; } // dates if ($forum['lastpost']>0) { $forum['lastpostdate']=vbdate($dateformat,$forum['lastpost']); $forum['lastposttime']=vbdate($timeformat,$forum['lastpost']); eval("\$forum['lastpostinfo'] = \"".gettemplate('forumhome_lastpostby')."\";"); } else { $forum['lastpostinfo']='Never'; } unset($forum['moderators']); $listexploded=explode(",", $forum['parentlist']); while ( list($mkey1,$mval1)=each($listexploded) ) { if ( !isset($imodcache["$mval1"]) ) { continue; } reset($imodcache["$mval1"]); while ( list($mkey2,$moderator)=each($imodcache["$mval1"]) ) { if ( !isset($forum['moderators']) ) { eval("\$forum['moderators'] = \"".gettemplate('forumhome_moderator')."\";"); } else { eval("\$forum['moderators'] .= \", ".gettemplate('forumhome_moderator')."\";"); } } } if ( !isset($forum['moderators'
Mistä johtuu? :lol2:
200) { //max of 200, per several users requests $perpage=$maxthreads; } $pagenumber = intval($pagenumber); if (!isset($pagenumber) or $pagenumber==0) { $pagenumber=1; } $forumid = intval($forumid); $foruminfo = verifyid('forum',$forumid,1,1); $getperms=getpermissions($forumid,-1,-1,$foruminfo['parentlist']); if (!$getperms[canview]) { show_nopermission(); } updateuserforum($forumid); $forumdisplay['threadslist'] = ""; $bbcodeon=iif($foruminfo['allowbbcode'],$ontext,$offtext); $imgcodeon=iif($foruminfo['allowimages'],$ontext,$offtext); $htmlcodeon=iif($foruminfo['allowhtml'],$ontext,$offtext); $smilieson=iif($foruminfo['allowsmilies'],$ontext,$offtext); if (!isset($daysprune) or $daysprune==0 or $daysprune==-1) { if ($bbuserinfo['daysprune']>0) { $daysprune = $bbuserinfo['daysprune']; } else { $daysprune = iif($foruminfo['daysprune'], $foruminfo['daysprune'], 30); } } // draw nav bar $navbar=makenavbar($forumid,"forum",0); // get moderators $forummoderators=$DB_site->query('SELECT user.userid,user.username,moderator.forumid FROM moderator LEFT JOIN user ON (moderator.userid=user.userid) ORDER BY user.username'); unset($imodcache); while ($moderator=$DB_site->fetch_array($forummoderators)) { $imodcache["$moderator[forumid]"][] = $moderator; } $DB_site->free_result($forummoderators); unset($moderatorslist); $listexploded=explode(',', $foruminfo['parentlist']); while ( list($mkey1,$mval1)=each($listexploded) ) { if ( !isset($imodcache["$mval1"]) ) { continue; } reset($imodcache["$mval1"]); while ( list($mkey2,$moderator)=each($imodcache["$mval1"]) ) { if ( !isset($moderatorslist) ) { eval("\$moderatorslist = \"".gettemplate('forumdisplay_moderator')."\";"); } else { eval("\$moderatorslist .= \", ".gettemplate('forumdisplay_moderator')."\";"); } } } if ( isset($moderatorslist) ) { eval("\$moderatedby = \"".gettemplate('forumdisplay_moderatedby')."\";"); } else { $moderatedby=''; } // display sub forums $permissions = $getperms; //Forum info $forums=$DB_site->query('SELECT * FROM forum WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder,forumid'); unset($iforumcache); while ($forum=$DB_site->fetch_array($forums)) { $iforumcache["$forum[parentid]"]["$forum[displayorder]"]["$forum[forumid]"] = $forum; } $DB_site->free_result($forums); unset($forum); unset($ipermcache); //Forum perms $forumperms=$DB_site->query("SELECT forumid,canview,canpostnew FROM forumpermission WHERE usergroupid='$bbuserinfo[usergroupid]'"); while ($forumperm=$DB_site->fetch_array($forumperms)) { $ipermcache["$forumperm[forumid]"] = $forumperm; } $DB_site->free_result($forumperms); unset($forumperm); $accesscache = array(); if ($bbuserinfo['userid']!=0 AND $enableaccess) { //Access table perms $accessperms=$DB_site->query("SELECT forumid,accessmask FROM access WHERE userid='$bbuserinfo[userid]'"); while ($accessperm=$DB_site->fetch_array($accessperms)) { $accesscache["$accessperm[forumid]"] = $accessperm; } $DB_site->free_result($accessperms); unset($accessperm); // usergroup defaults $usergroupdef['canview'] = $permissions['canview']; $usergroupdef['canpostnew'] = $permissions['canpostnew']; // array for accessmask=0 $noperms['canview'] = 0; $noperms['canpostnew'] = 0; } //GENERATE forumjump: $curforumid = $forumid; makeforumjump(); // Start makeforumbit $forumshown = 0; function makeforumbit($forumid,$depth=1,$permissions='') { global $DB_site,$bbuserinfo,$iforumcache,$ipermcache,$imodcache,$session,$accesscache,$usergroupdef,$noperms; global $showlocks,$hideprivateforums,$showforumdescription,$forumdisplaydepth,$dateformat,$timeformat,$forumshown,$enableaccess; if ( empty($iforumcache["$forumid"]) or !is_array($iforumcache["$forumid"]) ) { return; } $forumbits = ''; reset($iforumcache["$forumid"]); while ( list($key1,$val1)=each($iforumcache["$forumid"]) ) { while ( list($key2,$forum)=each($val1) ) { // Permissions if ( $enableaccess and is_array($accesscache["$forum[forumid]"]) ) { if ($accesscache["$forum[forumid]"]['accessmask']==1) { $forumperms = $usergroupdef; } else { $forumperms = $noperms; } } else if ( is_array($ipermcache["$forum[forumid]"]) ) { $forumperms = $ipermcache["$forum[forumid]"]; } else { $forumperms = $permissions; } if (!$hideprivateforums) { $forumperms['canview']=1; } if (!$forumperms['canview']) { continue; } else { $forumshown=1; // do light bulb if ($bbuserinfo['lastvisitdate']=='Never') { $forum['onoff']='on'; } else { if (($fview = get_bbarraycookie('forumview', $forum['forumid'])) > $bbuserinfo['lastvisit']) { $userlastvisit=$fview; } else { $userlastvisit=$bbuserinfo['lastvisit']; } if ($userlastvisit<$forum['lastpost']) { $forum['onoff']='on'; } else { $forum['onoff']='off'; } } if ((!$forumperms['canpostnew'] and $showlocks) or $forum['allowposting']==0) { $forum['onoff'].='lock'; } // prepare template vars if (!$showforumdescription) { $forum['description']=''; } // dates if ($forum['lastpost']>0) { $forum['lastpostdate']=vbdate($dateformat,$forum['lastpost']); $forum['lastposttime']=vbdate($timeformat,$forum['lastpost']); eval("\$forum['lastpostinfo'] = \"".gettemplate('forumhome_lastpostby')."\";"); } else { $forum['lastpostinfo']='Never'; } unset($forum['moderators']); $listexploded=explode(",", $forum['parentlist']); while ( list($mkey1,$mval1)=each($listexploded) ) { if ( !isset($imodcache["$mval1"]) ) { continue; } reset($imodcache["$mval1"]); while ( list($mkey2,$moderator)=each($imodcache["$mval1"]) ) { if ( !isset($forum['moderators']) ) { eval("\$forum['moderators'] = \"".gettemplate('forumhome_moderator')."\";"); } else { eval("\$forum['moderators'] .= \", ".gettemplate('forumhome_moderator')."\";"); } } } if ( !isset($forum['moderators'
Mistä johtuu? :lol2: