miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /  
 

Private forum, but visible to everyone

 
 
Page  Page 1 of 2:  1  2  Next »

Author rvpelt
Partaker
#1 | Posted: 6 Jun 2005 20:28 
Is it possible to create a forum to which I can assign specific members that are allowed to post on that forum, while the forum is readable to everyone?

Author Team
8-)
#2 | Posted: 6 Jun 2005 22:08 
Currently no :-( only administration can make posts in post-only forums.

Bud this is good idea to think in the next release!
Thanks!

Author Paul
Lead Developer 
#3 | Posted: 6 Jun 2005 23:06 
I've came up with idea... a very nice idea how to do it in current miniBB version :-)

So, specify $clForums and $clForumsUsers in bb_specials.php like it is described in manual. For example:

$clForums=array(7,5);
$clForumsUsers[7]=array(9,10);
$clForumsUsers[5]=array(11);
this will specify closed forum with IDs 7 and 5, and specify users with IDs 9 and 10 with allowed access to forum 7, and with ID 11 - to forum 5.

Then, paste the code you your language pack (lang/eng.php or whatever):

/* Protected forums hack - create closed forums for public viewing */

if(!defined('ADMIN_PANEL')){

if($action!='pthread' and $action!='ptopic'){
if(isset($clForumsUsers[$forum]) and !in_array($user_id,$clForumsUsers[$forum])) $roForums[]=$forum;

/* If you want anonymous has access, append 0 and $user_id */
$clForumsUsers[7]=array_merge($clForumsUsers[7], array(0,$user_id));

/* If you want only registered has access, append only $user_id */
$clForumsUsers[5][]=$user_id;
}

}
That's all! Users specified in $clForumsUsers will have usual access to these forums. On your choise, any other signed in user or anonymous will be able to read these forums.

miniBB rocks and I am the Walrus :-)

Author Team
8-)
#4 | Posted: 6 Jun 2005 23:10 
...and the solution tested for the latest release, of course.

Author peter
Guest
#5 | Posted: 15 Jun 2005 19:50 
Hi. In a similar way, I wish to disable anonymous posting from my entire bb, but allow anonymous viewing.

Is this possible already? Sorry I'm a n00b.

Author peter
Guest
#6 | Posted: 15 Jun 2005 19:55 
oops. It already does that if I make the forums registered only, it seems.

Sorry about that, and thanks for a great little piece of software.

Author rvpelt
Partaker
#7 | Posted: 16 Jun 2005 23:43 
Thank you so much for the replies.
Hack works like a charm! :)

Author RAM
Guest
#8 | Posted: 24 Nov 2009 11:14 
Paul:
Then, paste the code you your language pack (lang/eng.php or whatever):

/* Protected forums hack - create closed forums for public viewing */

if($action!='pthread' and $action!='ptopic'){
if(isset($clForumsUsers[$forum]) and !in_array($user_id,$clForumsUsers[$forum])) $roForums[]=$forum;

/* If you want anonymous has access, append 0 and $user_id */
$clForumsUsers[7]=array_merge($clForumsUsers[7], array(0,$user_id));

/* If you want only registered has access, append only $user_id */
$clForumsUsers[5][]=$user_id;
}
Thank you very much for the solution. It works splendid. The only issue remaining with it, I've got two error messages in the administrative panel page. They look uniformly, like the following:
"Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /data/www/.../lang/eng.php on line 421

Could you suggest, how get rid of it?
Thank you in advance.

Author Paul
Lead Developer 
#9 | Posted: 25 Nov 2009 03:39 
if(!defined('ADMIN_PANEL')){

if($action!='pthread' and $action!='ptopic'){
...
}

}
You may try the code above - it's a condition excluding execution of this code from admin panel.

Author RAM
Guest
#10 | Posted: 25 Nov 2009 11:14 
After applying this trick, one notification has gone, the other one is still there. :(

Author Paul
Lead Developer 
#11 | Posted: 25 Nov 2009 13:29 
Strange. Both notifications and they lead to the same error line? Or is there another error line mentioned?

Author RAM
Guest
#12 | Posted: 26 Nov 2009 02:59 
The same error line, # 421 in my case, or, to be certain, this one:

$clForumsUsers[#]=array_merge($clForumsUsers[#], array(0,$user_id));

(a particular forum ID was changed to a # symbol in this example).
Is it possible, some other template calls this code as well, when displaying the admin panel? My admin panel has the anti-troll (IP<>ID) extention.

Author Paul
Lead Developer 
#13 | Posted: 26 Nov 2009 04:08 
The condition I provided really should cover all cases related to admin panel. So I don't know where the reason is. It works on my side.

Make sure you have put this condition properly. I've fixed the initial solution above to provide the exact piece of code.

Author Georg
Guest
#14 | Posted: 10 Nov 2012 12:19 
And an private forum, not visible to everyone - but all reg useres can read and write ?

Author Georg
Guest
#15 | Posted: 10 Nov 2012 15:26 
in bb_specials:

// forum 10 for all reg users, but not visible for guests
$clForumsUsers[10]=array();

and at the end of language-file

if($user_id!=0) {
$clForumsUsers[10][]=$user_id;
}

right ?

Page  Page 1 of 2:  1  2  Next » 
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /
 Private forum, but visible to everyone
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Get the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑