vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Creating AutoList of SuperMods (https://vborg.vbsupport.ru/showthread.php?t=10820)

Me2Be 03-08-2001 05:29 PM

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?

03-08-2001 05:42 PM

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 :)

03-08-2001 05:51 PM

Quote:

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 :)

03-08-2001 08:27 PM

1 Attachment(s)
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.

03-08-2001 08:50 PM

Thank you! Works perfectly :)

03-09-2001 11:09 AM

Kier strikes again :D

03-09-2001 09:35 PM

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:
Code:

$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:
Code:

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

And add AFTER:
Code:

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

Template Change supermodsbit
Add
Code:

$onlinestatus

03-09-2001 09:45 PM

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

03-09-2001 09:50 PM

Yep.. Works great.

03-10-2001 08:46 PM

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

03-11-2001 02:44 AM

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

03-11-2001 01:39 PM

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

03-11-2001 02:47 PM

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 () {}
PHP Code:

$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:
PHP Code:

$moderator[forumid]<br


03-11-2001 03:16 PM

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

03-11-2001 03:49 PM

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 Code:

<?php

$super_moderators_group_id 
35;
$admin_group_id 6;

$templatesused="supermods,supermodsbits,$supermodspm,supermodsicq,supermodsaim,supermodsemail,supermodshp,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")."\");");

?>


03-11-2001 09:01 PM

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......)

03-13-2001 01:50 PM

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

03-13-2001 05:32 PM

Quote:

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.

03-13-2001 05:37 PM

Theres a groupid part, you just change the number.

03-13-2001 05:45 PM

what is the group id for mods?

03-13-2001 09:10 PM

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

03-14-2001 03:57 AM

Your code didn't work

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

Any Help??

03-14-2001 05:05 AM

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.

03-14-2001 09:26 AM

Quote:

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.

03-14-2001 10:27 AM

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?

03-15-2001 02:41 AM

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!

03-15-2001 02:44 AM

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.

03-15-2001 03:11 AM

I have just posted a complete rewrite of this hack here.

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. ;)


All times are GMT. The time now is 11:09 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01191 seconds
  • Memory Usage 1,817KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (3)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (28)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete