MyBB Community Forums
[How To?] Need a little help in permission - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Community Archive (https://community.mybb.com/forum-106.html)
+--- Forum: Archived Forums (https://community.mybb.com/forum-143.html)
+---- Forum: Archived Development and Support (https://community.mybb.com/forum-155.html)
+----- Forum: MyBB 1.6 (https://community.mybb.com/forum-138.html)
+------ Forum: 1.6 General Support (https://community.mybb.com/forum-127.html)
+------ Thread: [How To?] Need a little help in permission (/thread-151877.html)



Need a little help in permission - VIP3R69 - 2014-03-13

i wanna know how can i setup permission so that if a certain group got the the forum section he can see the thread titles but when he click on the thread then he will be redirected to a link?

Any who help will be appreciated


RE: Need a little help in permission - marcus123 - 2014-03-13

And what link do you want them to get redirected?


RE: Need a little help in permission - VIP3R69 - 2014-03-14

it will be VIP section so when normal users click it they can be redirected to upgrade page


RE: Need a little help in permission - marcus123 - 2014-03-14

Ask someone to create a simple plugin I just don't have time sorry!

Here is a plugin not tested so don't know if it'll work but I hope someone will fix it Smile

<?php

$plugins->add_hook('showthread_start', 'VIP');
function VIP_info()
{
	return array(
		"name"			=> "VIP member",
		"description"	=> "Users that are not in this group will be redirected to VIP page",
		"compatibility"	=> "16*"
	);
}




function VIP()
{
	global $mybb;
	if (!in_array($mybb->user['usergroup'], array(3, 4, 6))) {
		header("Location: http://www.letsforum.com"); /* Redirect browser */
exit();
	}
	
}

?>

Remember to change redirect URL Smile

Or use:

if (!in_array($mybb->user['usergroup'], array(3, 4, 6))) {
		error("error message");
	}