vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   forum moderators (https://vborg.vbsupport.ru/showthread.php?t=52934)

Sebastian 05-14-2003 06:59 AM

forum moderators
 
anyone care to help me out..

I'd like to display all the forums title of the forums a user moderates on postbit.

say i am the mod of forum "Hack Requests"

below my name something like "Mod of: Hack Requests" would appear.

thing is, i don't want forum names to appear if a user doesn't have access to that particular forum..

i tried using showgroups.php as a base, but i am really lost.

see here:
https://vborg.vbsupport.ru/showgroups.php

under "Moderated Forums" is what i want to put in postbit.

thanks for any help.

Sebastian 05-14-2003 07:09 AM

1 Attachment(s)
see if this screenshot makes sense.

Boofo 05-14-2003 07:23 AM

Here is the piece of code I think you need to play with:

PHP Code:

        $listexploded=explode(","$forum['parentlist']);
        while ( list(
$mkey1,$mval1)=each($listexploded) ) {
          if ( !isset(
$imodcache["$mval1"]) ) {
            continue;
          }
          
reset($imodcache["$mval1"]);
          while ( list(
$mkey2,$moderator)=each($imodcache["$mval1"]) ) {
            if ( !isset(
$forum['moderators']) ) {
              eval(
"\$forum['moderators'] = \"".gettemplate('forumhome_moderator')."\";");
            } else {
              eval(
"\$forum['moderators'] .= \", ".gettemplate('forumhome_moderator')."\";");
            }
          }
        } 


Sebastian 05-14-2003 09:53 AM

that won't work.. see the screenshot in my second post.
trying to get the list of forum titles that a user is moderator of and display the list on postbit.

Boofo 05-14-2003 10:02 AM

The this is the query you want.

PHP Code:

$users $DB_site->query("
    SELECT
        
$locationfieldselect forum.forumid, forum.title AS forumtitle,
        user.username, user.userid, user.invisible, user.showemail, user.receivepm, user.lastactivity, user.lastvisit
        FROM moderator
        LEFT JOIN user ON (user.userid = moderator.userid)
        LEFT JOIN forum ON (forum.forumid = moderator.forumid)
        LEFT JOIN userfield ON (userfield.userid = user.userid)
    WHERE forum.active = 1
    ORDER BY user.username ASC, forum.displayorder ASC
"
); 


Xenon 05-14-2003 11:40 AM

i can just say:
DONT DO IT.

As you want it in postbit it would produce extraqueries for every moderatorpost.
second to include also the permissions it would also slow down the page and wouldn't make it easier to write the forumlist at all.

sur you can come up with some sort of caching, but it will always slow down the pgae gen


All times are GMT. The time now is 07:17 AM.

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.00994 seconds
  • Memory Usage 1,732KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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