Help - Search - Members - Calendar
Full Version: question
Invision Power Services > Community Forums > Community General Chat
Luke
I run a query on my module to get the forum id's that the current member has mod powers over (not super mods). Is there something preset I can use because im very hesitant about using a query, especially if there's something preset. Like something besides the moderator's cache (something with the member info).

And another question I have is: Can a moderator of one forum see invisible posts of a forum they dont have mod powers over? (cuz i hope not)
kacy
By inivisible do you mean not approved topic or a new forum?(If you've set the permissions correctly for that forum then no they won't be able to unless you specify them to do so).

Regards
Luke
I mean an unapproved topic/post. Can a mod (or mini-mod rather) see unapproved topics/posts in a forum they arnt a moderator in?
Zoruglu
No original.gif
Luke
Ok good. Now how about my query question original.gif?
Zoruglu
Sorry, I didn't really understand what you mean with this:

QUOTE
I run a query on my module to get the forum id's that the current member has mod powers over (not super mods). Is there something preset I can use because im very hesitant about using a query, especially if there's something preset. Like something besides the moderator's cache (something with the member info).


I can't read inside your brain so I don't know what you want to do, what query you are using and what it's for and why you fear you would break something up and I also don't know what you fear to break up and what you mean with "preset" original.gif
Luke
CODE
   $sql = "SELECT forum_id FROM ".SQL_PREFIX."moderators WHERE member_id='".$ibforums->member['id']."'";
   $DB->query( $sql );
   
   if($DB->get_num_rows() > 0)
   {
       while( $r = $DB->fetch_row() )
       {
     $m_mod[] = $r['forum_id'];
       }
       $mini_mod = implode(",", $m_mod);
   }


That's what im running to get the forum id's of the forums the current user is mod over. I was wondering if IPB already does something like this.
jp0692
Wouldn't it have too?
Zoruglu
I suppose it does, how can it display the moderators for each forum in the forum description? original.gif
Matt
You can use the moderator's cache which is loaded each page view.

CODE
foreach( $this->ipsclass->cache['moderators'] as $i => $r )
   {
       if ( $r['member_id'] == $this->member['id'] or $r['group_id'] == $this->member['mgroup'] )
       {
     $m_mod[] = $r['forum_id'];
       }
   }
marcele
QUOTE(Matt @ Apr 4 2005, 04:58 AM)
You can use the moderator's cache which is loaded each page view.


He's probably not using the IPB 2.1 kernel yet so its original.gif

CODE
foreach( $ibforums->cache['moderators'] as $i => $r )
   {
       if ( $r['member_id'] == $this->member['id'] or $r['group_id'] == $this->member['mgroup'] )
       {
     $m_mod[] = $r['forum_id'];
       }
   }
Luke
QUOTE(marcele @ Apr 4 2005, 05:12 AM)
He's probably not using the IPB 2.1 kernel yet so its original.gif


I dont think anyone has it yet blink.gif
QUOTE(marcele @ Apr 4 2005, 05:12 AM)
He's probably not using the IPB 2.1 kernel yet so its original.gif

CODE
foreach( $ibforums->cache['moderators'] as $i => $r )
   {
       if ( $r['member_id'] == $this->member['id'] or $r['group_id'] == $this->member['mgroup'] )
       {
     $m_mod[] = $r['forum_id'];
       }
   }

*


Thanks that's exactly what I was looking for original.gif. Wasnt totally sure where or how to do it with the cache (just yet).

Thanks!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.