realitybytes Arrays are anyway faster than selecting from database. So I would suppose this is still good solution for what ezkim0x requests.
The final code for giving warning to anonymous users, if they enter restricted forum, would be quite simple (paste the code below in bb_plugins.php):
/* Warning message for anonymous users to register */
$warningForums=array(1,8); //specify array of forum IDs above - similarly to other miniBB arrays
if($user_id==0 and $forum!=0 and in_array($forum, $warningForums)){
$title.=$l_accessDenied; $errorMSG='Sorry! You are not allowed to visit this forum, because you are not registered user. Please, <a href="'.$main_url.'/'.$indexphp.'action=registernew">sign up</a> before you can read and post in this forum.'; $correctErr=''; echo load_header(); echo ParseTpl(makeUp('main_warning')); $endtime=get_microtime(); $totaltime=sprintf ("%01.3f", ($endtime-$starttime)); if(isset($includeFooter)) include($includeFooter); else echo ParseTpl(makeUp('main_footer')); exit;
} /* --Warning message for anonymous users to register */
shedrock Report me will it work or not, please. |