Helpful Information
 
 
Category: vBulletin.org Forum
Creating AutoList of SuperMods

Can someone help me with this? I'd really like to be able to have a link where someone would click and it would list all of those in the supermoderator admin group with the following info in a table:

Username Location PM (link to send pm)

How can this be done?

Give me a little while to finish the documentation for the new version of my vBcode buttons and I'll write this for you in a jiffy :)

Originally posted by Kier
Give me a little while to finish the documentation for the new version of my vBcode buttons and I'll write this for you in a jiffy :) Thanks :)

I hope this is what you wanted...

http://kier.3dfrontier.com/vbhacks/supermods.gif

If you link to the attached PHP file, the page will display a list of all your super-moderators, together with a link to their profile and PM, and a display of their location.

I included the forum-jump just because...

To install, just copy the getsmods.php file to your forums directory, and create three custom templates using the .htm files in the attached zip.

Thank you! Works perfectly :)

Kier strikes again :D

Another great hack! Thanks :)

I also added the user's online status to this as well... for those interested:

edit file getsmods.php

Change the main query to read:

$users = $DB_site->query("
SELECT DISTINCT
session.userid AS sessionuserid,
user.*, userfield.* FROM user
LEFT JOIN userfield ON (userfield.userid = user.userid)
LEFT JOIN session ON (session.userid = user.userid
AND session.userid <> 0
AND user.invisible = 0
AND session.lastactivity>0)
WHERE ( user.usergroupid=$super_moderators_group_id )
ORDER BY user.username");

Find:

if ($user[field2] == "") $user[location] = "&nbsp;";
else $user[location] = $user[field2];

And add AFTER:

if ($showonline) {
unset($onlinestatus);
if ($user[sessionuserid]>0) {
eval("\$onlinestatus = \"".gettemplate("postbit_online")."\";");
} else {
eval("\$onlinestatus = \"".gettemplate("postbit_offline")."\";");
}
}


Template Change supermodsbit
Add

$onlinestatus

Thanks Kier & Chris - this is just perfect!!!

Yep.. Works great.

don't forget to add postbit_offline and postbit_online to the list of $templatesused, or the page will use an extra two queries...

Ahh thanks for the tip, I completely forgot about that....

Great AddOn!!! Thx a lot.

I am working on this to fit it my needs and got some ideas, but want to ask anyway, howto list the forums the moderators a moderators of? Any help for this one?

Thanks

I tried this, just to bring the forumids up, but it adds the forumids from the frist to the second mod, and so on....didn't work....anyhelp??

This is what I put into the while () {}
$moderators = $DB_site->query("
SELECT * FROM moderator WHERE userid=$user[userid]");
while ($moderator = $DB_site->fetch_array($moderators))
{
eval("\$supermodsforums .= \"".gettemplate("supermodsforums")."\";");
}
The template only contains:
$moderator[forumid]<br>

The problem with this is "Super Moderators" are not normally assigned to a forum but have free-reign over the entire forum setting.

As I said, I change a lot to fit it my needs. I got this for the getsmods.php and some more templates: It show Admingroup and Moderatorgroup. Now I want to check if the userid is in the moderator table and get the forumids from it to show the forum name.
<?php

$super_moderators_group_id = 35;
$admin_group_id = 6;

$templatesused="supermods,supermodsbits,$supermodspm,supermodsicq,supermodsaim,supermodsemail,su permodshp,postbit_offline,postbit_online";
require('./global.php4');

$users = $DB_site->query("
SELECT DISTINCT
session.userid AS sessionuserid,
user.*, userfield.* FROM user
LEFT JOIN userfield ON (userfield.userid = user.userid)
LEFT JOIN session ON (session.userid = user.userid
AND session.userid <> 0
AND user.invisible = 0
AND session.lastactivity>0)
WHERE ( user.usergroupid=$super_moderators_group_id ) or ( user.usergroupid=$admin_group_id )
ORDER BY user.usergroupid,user.username");


while ($user = $DB_site->fetch_array($users))
{
if (($count++ % 2) == 0) $backcolor = "{secondaltcolor}";
else $backcolor = "{firstaltcolor}";

if ($user[field2] == "") $user[location] = "&nbsp;";
else $user[location] = $user[field2];

if ($showonline) {
unset($onlinestatus);
if ($user[sessionuserid]>0) {
eval("\$onlinestatus = \"".gettemplate("postbit_online")."\";");
} else {
eval("\$onlinestatus = \"".gettemplate("postbit_offline")."\";");
}
}

if ($user[receivepm] == 0) $sendpmlink = "&nbsp;";
else eval("\$sendpmlink = \"".gettemplate("supermodspm")."\";");

if ($user[icq] == "") $sendicqlink = "&nbsp;";
else eval("\$sendicqlink = \"".gettemplate("supermodsicq")."\";");

if ($user[aim] == "") $sendaimlink = "&nbsp;";
else eval("\$sendaimlink = \"".gettemplate("supermodsaim")."\";");

if ($user[homepage] == "") $sendhplink = "&nbsp;";
else eval("\$sendhplink = \"".gettemplate("supermodshp")."\";");

eval("\$supermodsbits .= \"".gettemplate("supermodsbits")."\";");





}

makeforumjump();

eval("dooutput(\"".gettemplate("supermods")."\");");

?>

Anyone who can help or working on it? I need it.....hm.....going to sleep and see whats going to be in a few hours (sometimes I wish I live in a US time zone......)

How can I change this to just list moderators?
Instead of supermods?

Originally posted by Sarge
How can I change this to just list moderators?
Instead of supermods? I don't know -- this goes by usergroup ids and all of my moderators are super moderators.

Theres a groupid part, you just change the number.

what is the group id for mods?

ahhhh, did anyone looked at my code, you find it in there!

Your code didn't work

All I want to do is list the mods instead of the supermods

Any Help??

Inorder to get the group id

User Groups and Permissions
Add | Modify
Modify forums

Do Modify and it will show a chart, moving the mouse over the edit part of each will show you what groupid it is.

Then in getsmods.php just find
$super_moderators_group_id = 23;

and change the 23 to whatever group you want.

I hope this helps.

Originally posted by GameGalaxy
Inorder to get the group id

User Groups and Permissions
Add | Modify
Modify forums

Do Modify and it will show a chart, moving the mouse over the edit part of each will show you what groupid it is.

Then in getsmods.php just find
$super_moderators_group_id = 23;

and change the 23 to whatever group you want.

I hope this helps.

That would help but by default, the moderators are in the Registered usersgroup.

Sure it worked, when you have the right templates. But I opnly wanna show the code to show my error! And in the code also ypu find how to define the mod group, but anyway, as wluke said. You must put the mods in a own group, before it work!


Any help so far for listing the forums the moderator a working on?

Wow, this is great Kier! Just one question. I want to list all my clan members, but some of my clan members are super mods, mods, and then me (the admin)... different user groups obviously. How would I list all of these people using your hack? All my clan members are already in their own custom group. Would I group all people in the clan member user group and then manually assign super mod and admin rights to users that need it? Hmmm, would that work? Or can your code be adapted to include multiple groups and display the output accordingly. What about alphabetical listings of people in a group? Or does your code already do that?

Thanks for this great hack!

I don't know the syntax, but you just need to have it do 2 groups

Like This and That

If nobody posts it I will look it up later tonight and post how you can do it one way.

I have just posted a complete rewrite of this hack here (http://vbulletin.com/forum/showthread.php?s=&threadid=11425).

The new version is easily modified to display any usergroups you want.

It also displays... oh just click the link and read the stuff there. ;)










privacy (GDPR)