PDA

View Full Version : Admin / Mod CP links for qualified Usergroups


Sc0rp
08-19-2004, 10:00 PM
What this basically do is add an 'admin cp' link to the bottom $logincode bit if the user has admin control panel access (cancontrolpanel) and add a 'mod cp' link if the user is a moderator (ismoderator).

so your $logincode would basically look like this if your an admin:

"Log Out | Mark All Forums Read | Forum Leaders | Admin CP | Mod CP"

(moderators would of course lack the admin link)

of course thats only the way ive done it, you can add your admin/mod links anywhere you want anyway you want.

Now I know this can be done easily by adding a short bit of code to the phpinclude template in which case it wouldnt even be called a hack, but then you'd have to edit the phpinclude template every time you'd want to add another usergroup to the 'allow list'. And since I like doing things the easy way I made a very small code modification so the script would detect the qualified usergroups by itself :p

Now imo this shouldnt even be called a hack cuz its so small but the fact is that it qualifies the hack posting rules so if I'd post it somewhere else but here it would be moved here anyway right? ^_^ Either way, doesnt really matter to me, I just wanted this little feature for myself and im sure some other ppl might appreciate it too..

Polo
08-20-2004, 01:15 PM
Nice, thanks for sharing...

Do you have any screenshots?

Sc0rp
08-20-2004, 01:59 PM
a screenshot wouldnt really add any information :p

just look at the bottom of your forum for this line:

Log Out | Mark All Forums Read | Forum Leaders

and imagen that with the hack installed it would look like this for an admin:

Log Out | Mark All Forums Read | Forum Leaders | Admin CP | Mod Cp

or this for a mod:

Log Out | Mark All Forums Read | Forum Leaders | Mod CP

basically usegroups that have access to the admin control panel (you can define this option when editing a usergroup, I think its the last or second last option) will see the admin cp and mod cp links and usergroups that are defined as moderators will see the mod cp link.

the only difference with this 'hack' compared to the template modification posted on vbulletintemplates.com is that in this hack the script automatically detects a usergroups permissions and with the template modification you have to define the usergroups manually.

Polo
08-20-2004, 02:30 PM
Oh, i see... yeah you are right... thanks ;)

Mr.Z
09-23-2004, 11:59 PM
I can't do this. I can't find


$usercache["$userid"]=$DB_site->query_first("SELECT user.*,userfield.* FROM user LEFT JOIN userfield ON userfield.userid=user.userid WHERE user.userid='$userid'");

In adminfunctions.php, but I did find something close....


// ###################### Start adminlog #######################
function adminlog ($extrainfo="",$userid=-1,$script="",$scriptaction="") {
global $DB_site,$bbuserinfo,$PHP_SELF,$action,$REMOTE_ADD R;

if ($userid==-1) {
$userid=$bbuserinfo[userid];
}
if ($script=="") {
$script=basename($PHP_SELF);
}
if ($scriptaction=="") {
$scriptaction=$action;
}
I'm using a vdeck, webhost is IPW, and the version is vBulletin Version 2.3.5 Help me....

Sc0rp
09-24-2004, 02:04 PM
you have to edit the functions.php file in your admin folder.. not adminfunctions.php :p

Riot-Boards
10-25-2004, 01:01 AM
Could you possibly tell us which sub division the first part of the code is in... since admin/functions.php is one of the larger vBulletin coding files, its a pain to prune through the whole big file... if you could specify what the code is under (I.E. ###################### Start getpagenav #######################) it would really be a huge help!

Thanks!