PHP Web Host - Quality Web Hosting For All PHP Applications Graphic Tees & Gifts For Everyone. Free Personalization!
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
minx
Client


Joined: Dec 25, 2003
Posts: 16

PostPosted: Sun Feb 08, 2004 12:05 am Reply with quote Back to top

I'm running a messageboard and have had occasion to suspend a user.

If I put the user as inactive in forums admin they cant see the site or access PMs.

To get round this I created usegroups and add all members to the 'normal' group to allow them to post.
If I have to suspend anyone I remove from from the group, this way they can still read forums and PMs.

The problem with this is that if any new user joins they have to wait till I am on site to add them to user group before they can post.

Is there any other means by which I can suspend a user from posting, but allow him to view site/PMs?

Cheers:)
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 15311
Location: Kansas

PostPosted: Sun Feb 08, 2004 2:39 am Reply with quote Back to top

Minx,

I just threw together some code but it seems to work. Try this.

In modules/Forums/posting.php, on or about line 372 you should see these comment lines
Code:
//
// The user is not authed, if they're not logged in then redirect
// them, else show them an error message
//
Place this code right ahead of those comments
Code:
/*****************************************************/
$groupToSuspend = 33;
$sqlSuspended = 'SELECT * FROM '.$prefix.'_bbuser_group WHERE user_id='.$userdata['user_id'].' AND group_id=$groupToSuspend';
$resultSuspended = $db->sql_query($sqlSuspended);
if (@sql_num_rows($resultSuspended)) {
   message_die(GENERAL_MESSAGE, '<b>'.$userdata['username'].', you have been temporarily restricted from posting in this forum.<br /><br />If you feel this is a mistake, please contact the Forum Admin.</b>');
}
/*****************************************************/
Here is what you need to do now.
- Create a group to hold these 'banned' user(s).
- Add the banned users to this group.
- Use phpMyAdmin to get the Group_id of the newly created group.
- Modify the $groupToSupend = 33; to be whatever the New Group Id is.

I think I will spruce this up a bit and make it controlled in the Admin panel. I will work on that, but for now, this manual intervention should work just fine Smile
Raven


Last edited by Raven on Sun Feb 08, 2004 10:29 pm; edited 5 times in total
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
minx
Client


Joined: Dec 25, 2003
Posts: 16

PostPosted: Sun Feb 08, 2004 9:09 pm Reply with quote Back to top

Lol!! As per I've got it wrong. I tried to do what you said, added a user to the banned group as a test and she could still post!

I added the code, stars and all, just above where you said.

Then I went to admin forums and created a 'banned' group.

In phpmy admin I clicked on groups, then ticked group id and clicked browse.
On the new page it said group id for banned was 17
I then modified Modify the $groupToSupend = 33; using 17 instead of 33.

And it didnt work for me, where did I go wrong? Embarassed Crying or Very sad
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 15311
Location: Kansas

PostPosted: Sun Feb 08, 2004 9:26 pm Reply with quote Back to top

I'll check on it because it worked for me so you probably have a little different setup. I'll get back to you soon ....
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 15311
Location: Kansas

PostPosted: Sun Feb 08, 2004 10:16 pm Reply with quote Back to top

OK, I modified the code in my above posts and you have confirmed it now works Smile Thanks!
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
minx
Client


Joined: Dec 25, 2003
Posts: 16

PostPosted: Tue Feb 10, 2004 1:04 am Reply with quote Back to top

Works brilliantly and means a lot less work for me-cheers Raven!! Very Happy
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 15311
Location: Kansas

PostPosted: Tue Feb 10, 2004 6:52 am Reply with quote Back to top

I'm going to make this into an Admin mod with some extras.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2008 by Raven
Proud to be listed at Lobo Links Web Directory

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::

:: fisubice Theme Recoded To 100% W3C CSS & HTML 4.01 Transitional Compliance by Raven and 64bitguy ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum