Jump to content


- - - - -

(Adriano) Staff Status on Moderating Team v1.1


  • Please log in to reply
17 replies to this topic

#1 Adriano Faria

Adriano Faria

    ...a curious guy...

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 3,268 posts
  • Location:Brazil
  • Real Name:Adriano
  • IPB Version:v3.3.x
Contributor

Posted 13 December 2008 - 07:00 PM

Posted Image

File Name: (Adriano) Staff Status on Moderating Team v1.1
File Submitter: SOSInvision
File Submitted: 13 Dec 2008
File Updated: 19 Dec 2008
File Category: IP.Board v2.3.x Mods

This MOD allows to show the staff status (online or offline) on Moderating Team page. Admins will see as online the users that are   log in as invisible; other users will see them as offline.

File Affected:
  • sources/action_public/misc/stats.php

Click here to download this file

#2 Oops

Oops

    Novice

  • Banned
  • PipPip
  • 16 posts
  • Location:Egypto..
  • Real Name:Mohamed
  • IPB Version:v2.3.x

Posted 13 December 2008 - 08:01 PM

you need to remove

<a href="{$this->ipsclass->base_url}showuser={$info['id']}">{$info['members_display_name']}</a>

from skin edit , cuz it making duplicate user name :)

Nice Mod  ;)

#3 Adriano Faria

Adriano Faria

    ...a curious guy...

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 3,268 posts
  • Location:Brazil
  • Real Name:Adriano
  • IPB Version:v3.3.x
Contributor

Posted 13 December 2008 - 08:46 PM

View PostOops, on Dec 13 2008, 06:01 PM, said:

cuz it making duplicate user name
My mistake! The right is CHANGE TO and not ADD BELOW! Fresh Install updated! ;)

View PostOops, on Dec 13 2008, 06:01 PM, said:

Nice Mod
Tks! :)

#4 MichaelJohn

MichaelJohn

    Programmer

  • Modders
  • PipPipPipPipPipPip
  • 478 posts
  • Location:Australia
  • Real Name:Michael
  • IPB Version:v3.1.x
Contributor

Posted 13 December 2008 - 09:56 PM

Installed and worked like a charm ;) Nice mod Adriano!

Keep up to date with DevFuse mod development and releases.

Posted Image Posted Image Posted Image Posted Image Posted Image


#5 Adriano Faria

Adriano Faria

    ...a curious guy...

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 3,268 posts
  • Location:Brazil
  • Real Name:Adriano
  • IPB Version:v3.3.x
Contributor

Posted 14 December 2008 - 12:05 PM

View PostMichaelJohn, on Dec 13 2008, 07:56 PM, said:

Installed and worked like a charm  Nice mod Adriano!
Tks for the feedback! ;)

#6 prozhektor

prozhektor

    n00b

  • Members
  • Pip
  • 3 posts
  • IPB Version:v2.3.x

Posted 17 December 2008 - 04:33 AM

Hi
Not show in GET MODERATORS: Normal
Super Moderators & Admins show good.
Can you help me?

Sory my english
Thanks

my function show_leaders :
function show_leaders()
 	{
		//-----------------------------------------
		// Work out where our super mods / admins/ mods
		// are.....
		//-----------------------------------------
		
		$group_ids  = array();
		$member_ids = array();
		$used_ids   = array();
		$members	= array();
		$moderators = array();
		
		foreach( $this->ipsclass->cache['group_cache'] as $i )
		{
			if ( $i['g_is_supmod'] )
			{
				$group_ids[ $i['g_id'] ] = $i['g_id'];
			}
			
			if ( $i['g_access_cp'] )
			{
				$group_ids[ $i['g_id'] ] = $i['g_id'];
			}
		}
		
		foreach( $this->ipsclass->cache['moderators'] as $i )
		{
			if ( $i['is_group'] )
			{
				$group_ids[ $i['group_id'] ] = $i['group_id'];
			}
			else
			{
				$member_ids[ $i['member_id'] ] = $i['member_id'];
			}
		}
		
		//-----------------------------------------
		// Get all members.. (two is more eff. than 1)
		//-----------------------------------------
		
		if ( count( $member_ids ) )
		{
			$this->ipsclass->DB->cache_add_query( 'stats_get_all_members', array( 'member_ids' => $member_ids ) );
			$this->ipsclass->DB->cache_exec_query();
			
			while( $r = $this->ipsclass->DB->fetch_row() )
			{
				$members[ strtolower($r['members_display_name']) ] = $r;
			}
		}
		
		//-----------------------------------------
		// Get all groups.. (two is more eff. than 1)
		//-----------------------------------------
		
		$this->ipsclass->DB->cache_add_query( 'stats_get_all_members_groups', array( 'group_ids' => $group_ids ) );
		$this->ipsclass->DB->cache_exec_query();
		
		while( $r = $this->ipsclass->DB->fetch_row() )
		{
			$members[ strtolower($r['members_display_name']) ] = $r;
		}
		
		ksort($members);
		
		//-----------------------------------------
		// PRINT: Admins
		//-----------------------------------------
		
		$this->output .= $this->ipsclass->compiled_templates['skin_stats']->group_strip( $this->ipsclass->lang['leader_admins'] );
		
		foreach( $members as $member )
		{

			//--------------------------------------------------
			// (Adriano) Status da Staff na Equipe de Moderacao
			//--------------------------------------------------
		
			$cut_off = ($this->ipsclass->vars['au_cutoff'] != "") ? $this->ipsclass->vars['au_cutoff'] * 60 : 900;
			$time_limit	= time() - $cut_off;
			
			$member['online_status_indicator'] = '<{PB_USER_OFFLINE}>';
			$member['online_extra']			= '('.$this->ipsclass->lang['online_offline'].')';
			
			list( $be_anon, $loggedin ) = explode( '&', $member['login_anonymous'] );
			
			$bypass_anon = 0;
			
			$our_mgroups = array();
			
			if( $this->ipsclass->member['mgroup_others'] )
			{
				$our_mgroups = explode( ",", $this->ipsclass->clean_perm_string( $this->ipsclass->member['mgroup_others'] ) );
			}
			
			$our_mgroups[] = $this->ipsclass->member['mgroup'];
						
			if ( (in_array( $this->ipsclass->vars['admin_group'], $our_mgroups )) and ($this->ipsclass->vars['disable_admin_anon'] != 1) )
			{
				$bypass_anon = 1;
			}
			
			//-----------------------------------------
			// DO it
			//-----------------------------------------
			
			if ( ( $member['last_visit'] > $time_limit or $member['last_activity'] > $time_limit ) AND $loggedin == 1 AND ( $be_anon != 1 OR $bypass_anon == 1 ) )
			{
				$member['online_status_indicator'] = '<{PB_USER_ONLINE}>';
			}
			

			if ( $this->ipsclass->cache['group_cache'][ $member['mgroup'] ]['g_access_cp'] )
			{
				$this->output .= $this->ipsclass->compiled_templates['skin_stats']->leader_row( $this->parse_member( $member ), $this->ipsclass->lang['leader_all_forums'] );
				
				//-----------------------------------------
				// Used...
				//-----------------------------------------
				
				$used_ids[] = $member['id'];
			}
		}
		
		$this->output .= $this->ipsclass->compiled_templates['skin_stats']->close_strip();
		
		//-----------------------------------------
		// PRINT: Super Moderators
		//-----------------------------------------
		
		$tmp_html = "";
		
		foreach( $members as $member )
		{

			//--------------------------------------------------
			// (Adriano) Status da Staff na Equipe de Moderacao
			//--------------------------------------------------
		
			$cut_off = ($this->ipsclass->vars['au_cutoff'] != "") ? $this->ipsclass->vars['au_cutoff'] * 60 : 900;
			$time_limit	= time() - $cut_off;
			
			$member['online_status_indicator'] = '<{PB_USER_OFFLINE}>';
			$member['online_extra']			= '('.$this->ipsclass->lang['online_offline'].')';
			
			list( $be_anon, $loggedin ) = explode( '&', $member['login_anonymous'] );
			
			$bypass_anon = 0;
			
			$our_mgroups = array();
			
			if( $this->ipsclass->member['mgroup_others'] )
			{
				$our_mgroups = explode( ",", $this->ipsclass->clean_perm_string( $this->ipsclass->member['mgroup_others'] ) );
			}
			
			$our_mgroups[] = $this->ipsclass->member['mgroup'];
						
			if ( (in_array( $this->ipsclass->vars['admin_group'], $our_mgroups )) and ($this->ipsclass->vars['disable_admin_anon'] != 1) )
			{
				$bypass_anon = 1;
			}
			
			//-----------------------------------------
			// DO it
			//-----------------------------------------
			
			if ( ( $member['last_visit'] > $time_limit or $member['last_activity'] > $time_limit ) AND $loggedin == 1 AND ( $be_anon != 1 OR $bypass_anon == 1 ) )
			{
				$member['online_status_indicator'] = '<{PB_USER_ONLINE}>';
			}
			

			if ( $this->ipsclass->cache['group_cache'][ $member['mgroup'] ]['g_is_supmod'] and ( ! in_array( $member['id'], $used_ids) ) )
			{
				$tmp_html .= $this->ipsclass->compiled_templates['skin_stats']->leader_row( $this->parse_member( $member ), $this->ipsclass->lang['leader_all_forums'] );
				
				//-----------------------------------------
				// Used...
				//-----------------------------------------
				
				$used_ids[] = $member['id'];
			}
		}
		
		if ( $tmp_html )
		{
			$this->output .= $this->ipsclass->compiled_templates['skin_stats']->group_strip( $this->ipsclass->lang['leader_global'] );
			$this->output .= $tmp_html;
			$this->output .= $this->ipsclass->compiled_templates['skin_stats']->close_strip();
		}
		
		//-----------------------------------------
		// GET MODERATORS: Normal
		//-----------------------------------------
		
		$tmp_html = "";
		
		foreach( $members as $member )
		{

						//--------------------------------------------------
			// (Adriano) Status da Staff na Equipe de Moderacao
			//--------------------------------------------------
		
			$cut_off = ($this->ipsclass->vars['au_cutoff'] != "") ? $this->ipsclass->vars['au_cutoff'] * 60 : 900;
			$time_limit	= time() - $cut_off;
			
			$member['online_status_indicator'] = '<{PB_USER_OFFLINE}>';
			$member['online_extra']			= '('.$this->ipsclass->lang['online_offline'].')';
			
			list( $be_anon, $loggedin ) = explode( '&', $member['login_anonymous'] );
			
			$bypass_anon = 0;
			
			$our_mgroups = array();
			
			if( $this->ipsclass->member['mgroup_others'] )
			{
				$our_mgroups = explode( ",", $this->ipsclass->clean_perm_string( $this->ipsclass->member['mgroup_others'] ) );
			}
			
			$our_mgroups[] = $this->ipsclass->member['mgroup'];
						
			if ( (in_array( $this->ipsclass->vars['admin_group'], $our_mgroups )) and ($this->ipsclass->vars['disable_admin_anon'] != 1) )
			{
				$bypass_anon = 1;
			}
			
			//-----------------------------------------
			// DO it
			//-----------------------------------------
			
			if ( ( $member['last_visit'] > $time_limit or $member['last_activity'] > $time_limit ) AND $loggedin == 1 AND ( $be_anon != 1 OR $bypass_anon == 1 ) )
			{
				$member['online_status_indicator'] = '<{PB_USER_ONLINE}>';
			}
			


			if ( ! in_array( $member['id'], $used_ids) ) 
			{
				foreach( $this->ipsclass->cache['moderators'] as $data )
				{


					if ( $data['is_group'] and $data['group_id'] == $member['mgroup'] )
					{
						if ( $this->ipsclass->check_perms( $this->ipsclass->forums->forum_by_id[ $data['forum_id'] ]['read_perms'] ) == TRUE )
						{
							$moderators[] = array_merge( $member, array( 'forum_id' => $data['forum_id'] ) );
						}
						
						$used_ids[] = $member['id'];
					}
					else if ( $data['member_id'] == $member['id'] )
					{
						if ( $this->ipsclass->check_perms( $this->ipsclass->forums->forum_by_id[ $data['forum_id'] ]['read_perms'] ) == TRUE )
						{
							$moderators[] = array_merge( $member, array( 'forum_id' => $data['forum_id'] ) );
						}
						
						$used_ids[] = $member['id'];
					}
				}
			}
		}
		
		//-----------------------------------------
		// Parse moderators
		//-----------------------------------------
		
		if ( count($moderators) > 0 )
		{
			$mod_array = array();
			
			$this->output .= $this->ipsclass->compiled_templates['skin_stats']->group_strip( $this->ipsclass->lang['leader_mods'] );
			
			foreach ( $moderators as $i )
			{

				if ( ! isset( $mod_array['member'][ $i['id'] ][ 'name' ] ) )
				{
					//-----------------------------------------
					// Member is not already set, lets add the member...
					//-----------------------------------------
					
					$mod_array['member'][ $i['id'] ] = array(  'members_display_name' => $i['members_display_name'],
															  'email'	  => $i['email'],
															  'hide_email' => $i['hide_email'],
															  'location'   => $i['location'],
															  'aim_name'   => $i['aim_name'],
															  'icq_number' => $i['icq_number'],
															  'id'		 => $i['id'],
															  'mgroup'		 => $i['mgroup']
															);
															
		$i['members_display_name'] = $this->ipsclass->make_name_formatted($i['members_display_name'], $i['mgroup']);

				}
				
				//-----------------------------------------
				// Add forum..	
				//-----------------------------------------
				
				$mod_array['forums'][ $i['id'] ][] = array( $i['forum_id'] , $this->ipsclass->forums->forum_by_id[ $i['forum_id'] ]['name'] );
			}
			
			foreach( $mod_array['member'] as $id => $data )
			{
				$fhtml = "";
				
				if ( count( $mod_array['forums'][ $id ] ) > 1 )
				{
					$cnt   = count( $mod_array['forums'][ $id ] );
					$fhtml = $this->ipsclass->compiled_templates['skin_stats']->leader_row_forum_start($id, sprintf( $this->ipsclass->lang['no_forums'],  $cnt ) );
					
					foreach( $mod_array['forums'][ $id ] as $data )
					{
						$fhtml .= $this->ipsclass->compiled_templates['skin_stats']->leader_row_forum_entry($data[0],$data[1]);
					}
					
					$fhtml .= $this->ipsclass->compiled_templates['skin_stats']->leader_row_forum_end();
				}
				else
				{
					$fhtml = "<a href='{$this->ipsclass->base_url}showforum=".$mod_array['forums'][ $id ][0][0]."'>".$mod_array['forums'][ $id ][0][1]."</a>";
				}
						
						
				$this->output .= $this->ipsclass->compiled_templates['skin_stats']->leader_row( 
														   $this->parse_member( $mod_array['member'][ $id ] ),
														   $fhtml
														);
			}
			
			$this->output .= $this->ipsclass->compiled_templates['skin_stats']->close_strip();
			
		}
		
		$this->page_title = $this->ipsclass->lang['forum_leaders'];
		$this->nav		= array( $this->ipsclass->lang['forum_leaders'] );
 	}


#7 Adriano Faria

Adriano Faria

    ...a curious guy...

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 3,268 posts
  • Location:Brazil
  • Real Name:Adriano
  • IPB Version:v3.3.x
Contributor

Posted 17 December 2008 - 09:49 AM

I got it workin on my board:

Find:

//-----------------------------------------
		// GET MODERATORS: Normal
		//-----------------------------------------
		
		$tmp_html = "";
		
		foreach( $members as $member )
		 {
Add below:

				//-----------------------------------------
			 // Online, offline?
			 //-----------------------------------------
		 
			 $cut_off = ($this->ipsclass->vars['au_cutoff'] != "") ? $this->ipsclass->vars['au_cutoff'] * 60 : 900;
			 $time_limit	= time() - $cut_off;
			 
			 $member['online_status_indicator'] = '<{PB_USER_OFFLINE}>';
			 $member['online_extra']			= '('.$this->ipsclass->lang['online_offline'].')';
			 
			 list( $be_anon, $loggedin ) = explode( '&', $member['login_anonymous'] );
			 
			 $bypass_anon = 0;
			 
			 $our_mgroups = array();
			 
			 if( $this->ipsclass->member['mgroup_others'] )
			 {
				 $our_mgroups = explode( ",", $this->ipsclass->clean_perm_string( $this->ipsclass->member['mgroup_others'] ) );
			 }
			 
			 $our_mgroups[] = $this->ipsclass->member['mgroup'];
						 
			 if ( (in_array( $this->ipsclass->vars['admin_group'], $our_mgroups )) and ($this->ipsclass->vars['disable_admin_anon'] != 1) )
			 {
				 $bypass_anon = 1;
			 }
http://forum.sosinvi...mp;CODE=leaders

#8 RichardC

RichardC

    ^^ They think you are odd

  • IM Supporters
  • PipPipPipPipPipPipPipPip
  • 1,028 posts
  • Location:United Kingdom
  • Real Name:Richard
  • IPB Version:v2.3.x
Contributor

Posted 17 December 2008 - 01:24 PM

*off topic*

Hi Adriano
was checking out http://forum.sosinvi...mp;CODE=leaders  NICE ;) when I had a look at your link block under your left menu.

clicked on 'forum manager' link and scrolled down to see if I could change the language to English and noticed the IPS/IPB link backs are not clickable, this usually indicates a nulled board, you may wish to not be associated with them.

regards

Richard

#9 Adriano Faria

Adriano Faria

    ...a curious guy...

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 3,268 posts
  • Location:Brazil
  • Real Name:Adriano
  • IPB Version:v3.3.x
Contributor

Posted 17 December 2008 - 04:06 PM

View PostRichardC, on Dec 17 2008, 11:24 AM, said:

clicked on 'forum manager' link and scrolled down to see if I could change the language to English and noticed the IPS/IPB link backs are not clickable, this usually indicates a nulled board, you may wish to not be associated with them.
You're right! :)

I didn't notice it... I will look for the admin of that affiliate board! Tks! ;)

#10 neito

neito

    Novice

  • Members
  • PipPip
  • 11 posts
  • Real Name:Cris
  • IPB Version:v2.3.x

Posted 19 December 2008 - 02:26 AM

View Postprozhektor, on Dec 17 2008, 01:33 AM, said:

Hi
Not show in GET MODERATORS: Normal
Super Moderators & Admins show good.
Can you help me?

Me too.... ;)

#11 Adriano Faria

Adriano Faria

    ...a curious guy...

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 3,268 posts
  • Location:Brazil
  • Real Name:Adriano
  • IPB Version:v3.3.x
Contributor

Posted 19 December 2008 - 09:51 AM

Which version is you IP.Board ?

#12 gtman55

gtman55

    Member

  • IM Supporters
  • PipPipPip
  • 25 posts
  • IPB Version:N/A

Posted 19 December 2008 - 11:50 PM

View Postprozhektor, on Dec 16 2008, 11:33 PM, said:

Hi
Not show in GET MODERATORS: Normal
Super Moderators & Admins show good.
Can you help me?

Sory my english
Thanks
This only shows for admins and supermods but not forum moderators. Too bad.  ;)

#13 Adriano Faria

Adriano Faria

    ...a curious guy...

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 3,268 posts
  • Location:Brazil
  • Real Name:Adriano
  • IPB Version:v3.3.x
Contributor

Posted 19 December 2008 - 11:54 PM

View Postgtman55, on Dec 19 2008, 09:50 PM, said:

This only shows for admins and supermods but not forum moderators. Too bad.
I'm testing again... BRB.

#14 Adriano Faria

Adriano Faria

    ...a curious guy...

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 3,268 posts
  • Location:Brazil
  • Real Name:Adriano
  • IPB Version:v3.3.x
Contributor

Posted 20 December 2008 - 12:47 AM

Sorry, my bad! ;)

I got it working on my board but I forgot a modification on Fresh Install.

Manual update.

-> install the MOD as asked on Fresh Install and find:

					$mod_array['member'][ $i['id'] ] = array( 'members_display_name' => $i['members_display_name'],
															  'email'	  => $i['email'],
															  'hide_email' => $i['hide_email'],
															  'location'   => $i['location'],
															  'aim_name'   => $i['aim_name'],
															  'icq_number' => $i['icq_number'],
															  'id'		 => $i['id']
															);
Change to:

					$mod_array['member'][ $i['id'] ] = array( 'members_display_name' => $i['members_display_name'],
															  'email'	  => $i['email'],
															  'hide_email' => $i['hide_email'],
															  'location'   => $i['location'],
															  'aim_name'   => $i['aim_name'],
															  'icq_number' => $i['icq_number'],
															  'online_status_indicator' => $i['online_status_indicator'],
															  'id'		 => $i['id']
															);
Now it's ok! :)

#15 gtman55

gtman55

    Member

  • IM Supporters
  • PipPipPip
  • 25 posts
  • IPB Version:N/A

Posted 20 December 2008 - 07:37 AM

All fixed! Thank you.  ;)

#16 neito

neito

    Novice

  • Members
  • PipPip
  • 11 posts
  • Real Name:Cris
  • IPB Version:v2.3.x

Posted 25 December 2008 - 12:25 AM

Now Yeah!!

Thank you ;)

#17 RichardC

RichardC

    ^^ They think you are odd

  • IM Supporters
  • PipPipPipPipPipPipPipPip
  • 1,028 posts
  • Location:United Kingdom
  • Real Name:Richard
  • IPB Version:v2.3.x
Contributor

Posted 18 March 2009 - 09:47 AM

will this work if the staff member is a moderator as a secondary group? or only as a primary group?

regards

Richard

#18 Adriano Faria

Adriano Faria

    ...a curious guy...

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 3,268 posts
  • Location:Brazil
  • Real Name:Adriano
  • IPB Version:v3.3.x
Contributor

Posted 18 March 2009 - 12:01 PM

I just used the online indicator... the way this page works, remains the same. ;)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users