PDA

View Full Version : This mod available? [Post restrictions user/forum ID]


dutchbb
07-26-2012, 05:19 PM
I've used the search but could not find anything. Is this mod available: setting post restriction for a specific user ID and specific forum IDs so he can only post in one specific forum for example.

Ty

Simon Lloyd
07-26-2012, 05:32 PM
Just use if conditions in the header template<if condition="$vbulletin->userinfo['userid'] == x AND !in_array($forum['forumid'], array(1,2,3,4))">
IF I AM USER X AND I AM VIEWING A FORUM NOT SHOWN IN THE ARRAY I CAN SEE THIS
</if>

dutchbb
07-26-2012, 05:45 PM
Thanks, I want them to still be able to read but not post.

I know this can probably be done with usergroups and forum permissions but that would be too much of a hassle in our case, so I was wondering if a simple mod for this exists.

Simon Lloyd
07-26-2012, 05:57 PM
You started out by saying "A user" but now you are talking about usergroups, search for CYB forum permissions, but to be honest you'd be better off going the permissions route with vb :)

vijayninel
07-26-2012, 05:59 PM
You could try writing in a plugin for that:

Product : vbulletin
Hook Location: newreply_post_start
Title : vijay's great plugin
Execution Order: 5 should be ok
Plugin PHP Code:


if (in_array($vbulletin->userinfo['userid'], array(1,2,3,4)) AND $threadinfo[forumid] != XX)
{
print_no_permission();
}


replace 1,2,3,4 with the members id and xx with the forum id.

dutchbb
07-26-2012, 06:06 PM
You started out by saying "A user" but now you are talking about usergroups, search for CYB forum permissions, but to be honest you'd be better off going the permissions route with vb :)

I'm still talking about user ID, I just pointed out this is the only way I know of how it can be done in default vb. However it requires a lot of changes, and it only applies to one single user so I don't want to do that.

So there is no mod like this made?

I'' try the above. Thanks vijayninel

Hm tried it but does not work unfortunately.

Simon Lloyd
07-26-2012, 06:28 PM
@Vijay - Nice Title :D

--------------- Added 1343330965 at 1343330965 ---------------


I'' try the above. Thanks vijayninel

Hm tried it but does not work unfortunately.In which way doesn't it work? post the code exactly as you have used it.