Welcome, Guest. Please Login or Register.
May 09, 2025, 01:10:42 AM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  No guests on specific category « previous next »
Pages: [1] Reply Ignore Print
Author Topic: No guests on specific category  (Read 265 times)
Armadillo
Noobie
*
Posts: 22


Medieval Warrior

No guests on specific category
« on: November 04, 2002, 05:34:10 AM »
Reply with quote

I would like to allow guests to read, but not post in, a specific category. They would have normal access in other areas. The "Only access for membergroups" thing does not do this. It will only recognize admins and mods.

I am an amature at PHP, but do you believe this code will work in the post.php?
if ($board=="Restricted Area" && $username=="Guest") {fatal_error($text[1]);}
Also, is there a way to remove some of the ubbc buttons, but keep others?

Logged

Everything should be made as simple as possible, but no simpler.
Armadillo
Noobie
*
Posts: 22


Medieval Warrior

Re:No guests on specific category
« Reply #1 on: December 17, 2002, 08:57:20 AM »
Reply with quote

I guess no one cared about my idea, so I developed it my self.
If anyone is interrested, here it is.
In the Post.php file find this line....
$bcinfo = mysql_fetch_array($request);
$curcat = $bcinfo['cid'];
$cat = $bcinfo['cname'];
$currentboard = $bcinfo['bid'];
$boardname = $bcinfo['bname'];
And add this code after it....
if($username == 'Guest' && $cat == 'Members Only' ) { fatal_error($txt[1]); }
Replace the text 'Members Only' with the name of whatever category you want to be restricted.
Now, guests can read topics in the boards contained in the category but they can not reply or start a topic.
Purhaps this will give guests some incentive to join.

The hard-core PHP coders here could easyly turn this into a true mod with an admin option to enable, disable, or add restricted categorys.
 ;D
Logged

Everything should be made as simple as possible, but no simpler.
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  No guests on specific category « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.095 seconds with 21 queries.