|
|
|
|
|
|
Re: Private Forums? [message #1019 is a reply to message #1015] |
Wed, 20 March 2002 02:40 |
Luterin
Messages: 17 Registered: March 2002 Location: Malmö/Sweden
Karma: 0
|
Junior Member |
|
|
First of all, gotta say thanks for the excellent code. Easy to follow and play around with.
I did fix the private forums with a nice little hack.
I modified 2 tables: alter table fud_forum add private enum('Y','N') NOT NULL DEFAULT 'N'; alter table fud_users add private_access enum('Y','N') NOT NULL DEFAULT 'N';
Then I just added the following line to "thread.php" just in the beginning before the code checks if the thread needs a registerd user to be able to view it.
(right after this line: cache_buster(); )
if ($frm->private=='Y' && !($usr->private_access=='Y')) error_dialog('This is a Private Forum', 'This is a Private Forum, only invited users may view these forums.' , '');
All that needs to be done is to modify the admin interface to include the private flags for users and threads, so I dont have to go into MySQL everytime I wanna change it.
This does ofcourse only work pretty easy so either a user can see all private forums, or not. It don't have any usergroup handling, but it works fine and shouldn't take any resources to mention since the $frm and $usr is already read anyway.
If it's interesting I can do the changes to the admin interface and post the changes aswell, otherwise I just leave it as it is for now untill I'm bored enough to dig around in the admin code.
Edit: Just corrected a minor typo in the code.
[Updated on: Wed, 20 March 2002 03:01] Report message to a moderator
|
|
|
|
|
Re: Private Forums? [message #1024 is a reply to message #1023] |
Wed, 20 March 2002 03:08 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
It is a good idea to add the variable, it is "the proper way".
FUDforum Core Developer
|
|
|
Re: Private Forums? [message #1026 is a reply to message #1024] |
Wed, 20 March 2002 03:46 |
Luterin
Messages: 17 Registered: March 2002 Location: Malmö/Sweden
Karma: 0
|
Junior Member |
|
|
Ok, added some to make it "the proper way":
users.inc: var $private_access=NULL; forum.inc: var $private=NULL;
And ofcourse I couldn't quit a half finished job, so here is the modifications to the admin interface.
admforum.php: (Added this at the end of the form, before the submit button) <tr bgcolor="#bff8ff"> <td>Private</td> <td><?php draw_select('frm_private', "No\nYes", "N\nY", empty($frm_private)?'':$frm_private); ?></td> </tr>
forum_adm.inc: (Added at the end of the SQL statements in the following fuctions) function add(): ,'".$this->private."' function sync(): ,private='".YN($this->private)."'
So, now it's all there, to get a simple but effective way to make forums private.
Feel free to use this code, or ask/mail me if you got any questions.
Hope I didn't mess any of the code up while pasting it here, it's 5AM here now, so a bit tired, hehe.
|
|
|
|
|
|
|
|
Re: Private Forums? [message #1373 is a reply to message #1370] |
Wed, 10 April 2002 14:51 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
Yeah, the group managment allowed VERY fine grained control.
You can control of people can:
Read, Create Threads, Post Replies, Create Polls, Vote on Polls, Attach Files, Use Smilies, Rate Threads, Use image tags in their messages, edit messages, delete messages, move threads, split threads, make sticky and.or announcment messages.
So, once this system is in place you'll can control exactly what people can & cannot do.
FUDforum Core Developer
|
|
|