Quote:
Originally Posted by juzz86
Hello Folks,
I am attempting to introduce a hook in functions_newpost.php on a vB 4.2.1 forum to allow us to moderate a particular usergroup's threads, not posts, for a subset of forums.
|
I know the section of code you are talking about in 'newpost.php', but I am wondering if this is necessary. Your allowed to select moderators to a forum, you are also allowed to set if a usergroup will follow moderation. You might be able to do this without the hack -- depending how strict your permission system is.
To answer your question:
Code:
is_member_of($vbulletin->userinfo, Y)
Where Y is equl to a valid usergroup id -- is valid vb code as long as '/includes/functions.php' is loaded and in most cases it already is.
Then you just need to alter the permission in 'newpost.php' listed below.
Code:
// see if post has to be moderated or if poster in a mod
if (
((
(
($foruminfo['moderatenewthread'] AND $type == 'thread') OR ($foruminfo['moderatenewpost'] AND $type == 'reply')
)
OR !($forumperms & $vbulletin->bf_ugp_forumpermissions['followforummoderation'])
)
AND !can_moderate($foruminfo['forumid']))
OR
($type == 'reply' AND (($postinfo['postid'] AND !$postinfo['visible'] AND !empty($postinfo['specifiedpost'])) OR !$threadinfo['visible']))
)
You might be able to use the hook: 'newpost_process' with some clever programming or just add your own custom hook, if you do not want to alter the code directly.
I could have been more helpfull, but you did not explain how you were going to manipulate the usergroup data into the function 'build_new_post'. Hopefully, I helped with something...