[ABD] Super Moderators

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Locked
stu15
Registered User
Posts: 1283
Joined: Sat Mar 15, 2003 1:46 am
Location: New Zealand
Contact:

Post by stu15 »

Does any one have any ideas why the Super Mod panel is showing up like this?

ImageClick for larger image

Also I am getting this error messege on viewonline.php
Parse error: parse error in /home/theend/public_html/viewonline.php on line 116


& Line 166 is:

Code: Select all

else if ( $row['user_level'] == LESS_ADMIN )
			{
				$username = '<b style="color:#' . $theme['fontcolor4'] . '">' . $username . '</b>';
			}
any ideas????

Below is the entire viewonline.php page

Code: Select all

<?php
/***************************************************************************
 *                              viewonline.php
 *                            -------------------
 *   begin                : Saturday, Feb 13, 2001
 *   copyright            : (C) 2001 The phpBB Group
 *   email                : support@phpbb.com
 *
 *   $Id: viewonline.php,v 1.54.2.2 2002/12/02 10:53:42 bartvb Exp $
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_VIEWONLINE);
init_userprefs($userdata);
//
// End session management
//

//
// Output page header and load viewonline template
//
$page_title = $lang['Who_is_Online'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

$template->set_filenames(array(
	'body' => 'viewonline_body.tpl')
);
make_jumpbox('viewforum.'.$phpEx);

$template->assign_vars(array(
	'L_WHOSONLINE' => $lang['Who_is_online'],
	'L_ONLINE_EXPLAIN' => $lang['Online_explain'],
	'L_USERNAME' => $lang['Username'],
	'L_FORUM_LOCATION' => $lang['Forum_Location'],
	'L_LAST_UPDATE' => $lang['Last_updated'])
);

//
// Forum info
//
$sql = "SELECT forum_name, forum_id
	FROM " . FORUMS_TABLE;
if ( $result = $db->sql_query($sql) )
{
	while( $row = $db->sql_fetchrow($result) )
	{
		$forum_data[$row['forum_id']] = $row['forum_name'];
	}
}
else
{
	message_die(GENERAL_ERROR, 'Could not obtain user/online forums information', '', __LINE__, __FILE__, $sql);
}

//
// Get auth data
//
$is_auth_ary = array();
$is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata);

//
// Get user list
//
$sql = "SELECT u.user_id, u.username, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_time, s.session_page, s.session_ip
	FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
	WHERE u.user_id = s.session_user_id
		AND s.session_time >= ".( time() - 300 ) . "
	ORDER BY u.username ASC, s.session_ip ASC";
if ( !($result = $db->sql_query($sql)) )
{
	message_die(GENERAL_ERROR, 'Could not obtain regd user/online information', '', __LINE__, __FILE__, $sql);
}

$guest_users = 0;
$registered_users = 0;
$hidden_users = 0;

$reg_counter = 0;
$guest_counter = 0;
$prev_user = 0;
$prev_ip = '';

while ( $row = $db->sql_fetchrow($result) )
{
	$view_online = false;

	if ( $row['session_logged_in'] ) 
	{
		$user_id = $row['user_id'];

		if ( $user_id != $prev_user )
		{
			$username = $row['username'];

			$style_color = '';
			if ( $row['user_level'] == ADMIN )
			{
else if ( $row['user_level'] == LESS_ADMIN )
			{
				$row['username'] = '<b>' . $row['username'] . '</b>';
				$style_color = 'style="color:#' . $theme['fontcolor4'] . '"';
			}
				$username = '<b style="color:#' . $theme['fontcolor3'] . '">' . $username . '</b>';
			}
else if ( $row['user_level'] == LESS_ADMIN )
			{
				$username = '<b style="color:#' . $theme['fontcolor4'] . '">' . $username . '</b>';
			}
			else if ( $row['user_level'] == MOD )
			{
				$username = '<b style="color:#' . $theme['fontcolor2'] . '">' . $username . '</b>';
			}

			if ( !$row['user_allow_viewonline'] )
			{
				$view_online = ( $userdata['user_level'] == ADMIN ) ? true : false;
				$hidden_users++;

				$username = '<i>' . $username . '</i>';
			}
//ONLY IF YOU WANT SUPER MODERATORS TO VIEW USERONLINE DATA WHEN USERS AREN'T ALLOWED!

			else if ( !$row['user_allow_viewonline'] )
			{
				$view_online = ( $userdata['user_level'] == LESS_ADMIN ) ? true : false;
				$hidden_users++;

				$username = '<i>' . $username . '</i>';
			}


//END ONLY IF YOU WANT SUPER MODERATORS TO VIEW USERONLINE DATA WHEN USERS AREN'T ALLOWED!
			else
			{
				$view_online = true;
				$registered_users++;
			}

			$which_counter = 'reg_counter';
			$which_row = 'reg_user_row';
			$prev_user = $user_id;
		}
	}
	else
	{
		if ( $row['session_ip'] != $prev_ip )
		{
			$username = $lang['Guest'];
			$view_online = true;
			$guest_users++;
	
			$which_counter = 'guest_counter';
			$which_row = 'guest_user_row';
		}
	}

	$prev_ip = $row['session_ip'];

	if ( $view_online )
	{
		if ( $row['session_page'] < 1 || !$is_auth_ary[$row['session_page']]['auth_view'] )
		{
			switch( $row['session_page'] )
			{
				case PAGE_INDEX:
					$location = $lang['Forum_index'];
					$location_url = "index.$phpEx";
					break;
				case PAGE_POSTING:
					$location = $lang['Posting_message'];
					$location_url = "index.$phpEx";
					break;
				case PAGE_LOGIN:
					$location = $lang['Logging_on'];
					$location_url = "index.$phpEx";
					break;
				case PAGE_SEARCH:
					$location = $lang['Searching_forums'];
					$location_url = "search.$phpEx";
					break;
				case PAGE_PROFILE:
					$location = $lang['Viewing_profile'];
					$location_url = "index.$phpEx";
					break;
				case PAGE_VIEWONLINE:
					$location = $lang['Viewing_online'];
					$location_url = "viewonline.$phpEx";
					break;
				case PAGE_VIEWMEMBERS:
					$location = $lang['Viewing_member_list'];
					$location_url = "memberlist.$phpEx";
					break;
				case PAGE_PRIVMSGS:
					$location = $lang['Viewing_priv_msgs'];
					$location_url = "privmsg.$phpEx";
					break;
				case PAGE_FAQ:
					$location = $lang['Viewing_FAQ'];
					$location_url = "faq.$phpEx";
					break;
				default:
					$location = $lang['Forum_index'];
					$location_url = "index.$phpEx";
			}
		}
		else
		{
			$location_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $row['session_page']);
			$location = $forum_data[$row['session_page']];
		}

		$row_color = ( $$which_counter % 2 ) ? $theme['td_color1'] : $theme['td_color2'];
		$row_class = ( $$which_counter % 2 ) ? $theme['td_class1'] : $theme['td_class2'];

		$template->assign_block_vars("$which_row", array(
			'ROW_COLOR' => '#' . $row_color,
			'ROW_CLASS' => $row_class,
			'USERNAME' => $username,
			'LASTUPDATE' => create_date($board_config['default_dateformat'], $row['session_time'], $board_config['board_timezone']),
			'FORUM_LOCATION' => $location,

			'U_USER_PROFILE' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $user_id),
			'U_FORUM_LOCATION' => append_sid($location_url))
		);

		$$which_counter++;
	}
}

if( $registered_users == 0 )
{
	$l_r_user_s = $lang['Reg_users_zero_online'];
}
else if( $registered_users == 1 )
{
	$l_r_user_s = $lang['Reg_user_online'];
}
else
{
	$l_r_user_s = $lang['Reg_users_online'];
}

if( $hidden_users == 0 )
{
	$l_h_user_s = $lang['Hidden_users_zero_online'];
}
else if( $hidden_users == 1 )
{
	$l_h_user_s = $lang['Hidden_user_online'];
}
else
{
	$l_h_user_s = $lang['Hidden_users_online'];
}

if( $guest_users == 0 )
{
	$l_g_user_s = $lang['Guest_users_zero_online'];
}
else if( $guest_users == 1 )
{
	$l_g_user_s = $lang['Guest_user_online'];
}
else
{
	$l_g_user_s = $lang['Guest_users_online'];
}

$template->assign_vars(array(
	'TOTAL_REGISTERED_USERS_ONLINE' => sprintf($l_r_user_s, $registered_users) . sprintf($l_h_user_s, $hidden_users), 
	'TOTAL_GUEST_USERS_ONLINE' => sprintf($l_g_user_s, $guest_users))
);

if ( $registered_users + $hidden_users == 0 )
{
	$template->assign_vars(array(
		'L_NO_REGISTERED_USERS_BROWSING' => $lang['No_users_browsing'])
	);
}

if ( $guest_users == 0 )
{
	$template->assign_vars(array(
		'L_NO_GUESTS_BROWSING' => $lang['No_users_browsing'])
	);
}

$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>
I hope some one can help me fix these errors ASAP!

Thanks!

PS: this is running on phpbb 2.0.7
stu15
Registered User
Posts: 1283
Joined: Sat Mar 15, 2003 1:46 am
Location: New Zealand
Contact:

Post by stu15 »

:? :(
stu15
Registered User
Posts: 1283
Joined: Sat Mar 15, 2003 1:46 am
Location: New Zealand
Contact:

Post by stu15 »

**bump**

Can any one Please help me here?
stu15
Registered User
Posts: 1283
Joined: Sat Mar 15, 2003 1:46 am
Location: New Zealand
Contact:

Post by stu15 »

:?
User avatar
Goronlink
Registered User
Posts: 205
Joined: Sat Apr 26, 2003 11:26 pm
Location: phpbb.com
Contact:

Post by Goronlink »

When I try to go to the Super Moderator Panel, I get this message:
Warning: Cannot modify header information - headers already sent by (output started at /home/blademan/public_html/phpBB2/language/lang_english/lang_admin.php:2) in /home/blademan/public_html/phpBB2/super_mod/index.php on line 581

Warning: Cannot modify header information - headers already sent by (output started at /home/blademan/public_html/phpBB2/language/lang_english/lang_admin.php:2) in /home/blademan/public_html/phpBB2/super_mod/index.php on line 582


What have I missed to make it do this?
RAG
Registered User
Posts: 7
Joined: Sun Dec 28, 2003 4:58 pm

Post by RAG »

OK. But how to install this mod on phpBB 2.0.8 :?:
RAG
Registered User
Posts: 7
Joined: Sun Dec 28, 2003 4:58 pm

Post by RAG »

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
/phpBB2/includes/page_tail.php

#
#-----[ FIND ]------------------------------------------
#
$admin_link = ( $userdata['user_level'] == ADMIN ) ? '<a href="' . append_sid("admin/index.$phpEx") . '">' . $lang['Admin_panel'] . '</a><br /><br />' : '';

#
#-----[ REPLACE WITH ]------------------------------------------
#
if ( $userdata['user_level'] == ADMIN ) 
{ 
        $admin_link = '<a href="' . append_sid("admin/index.$phpEx") . '">' . $lang['Admin_panel'] . '</a><br /><a href="' . append_sid("super_mod/index.$phpEx") . '">' . $lang['Super_Mod_panel'] . '</a><br /><br />';
} 
else if ( $userdata['user_level'] == LESS_ADMIN ) 
{ 
        $admin_link = '<a href="' . append_sid("super_mod/index.$phpEx") . '">' . $lang['Super_Mod_panel'] . '</a><br /><br />';
}
But in phpbb 2.0.8 is

Code: Select all

$admin_link = ( $userdata['user_level'] == ADMIN ) ? '<a href="admin/index.' . $phpEx . '?sid=' . $userdata['session_id'] . '">' . $lang['Admin_panel'] . '</a><br /><br />' : '';
User avatar
playerfr
Registered User
Posts: 851
Joined: Fri Jul 18, 2003 9:50 am
Location: France - Paris

Post by playerfr »

Can I just ask one question which may be seem stupid

what is super mod for ? as I installed it on my forum but it is useless apart adding Banned Key word super moderator cant do anything else :oops:
da_badtz_one
Registered User
Posts: 376
Joined: Thu Jan 29, 2004 8:25 pm

Post by da_badtz_one »

playerfr wrote: Can I just ask one question which may be seem stupid

what is super mod for ? as I installed it on my forum but it is useless apart adding Banned Key word super moderator cant do anything else :oops:


It's kinda of like the junior admin mod.

I've tried installing this mod over and over like a billion times and never wroked :roll:
User avatar
DianaRae
Registered User
Posts: 163
Joined: Fri Mar 22, 2002 9:45 pm
Contact:

banned?

Post by DianaRae »

I installed this mod & I was shocked that I got it to install with no errors..

-except-

when the Super Moderater goes into the Super Mod panel & does an action = then logs out & tries to log in again they are automatically banned.

Any ideas? I am at a loss. :(
Diana Rae
~I was blonde in another life..that explains a LOT of things~
Odin-NMA
Registered User
Posts: 63
Joined: Wed Aug 28, 2002 11:18 am
Location: Valhalla
Contact:

Post by Odin-NMA »

Right, before I post this I need to make this perfectly clear, I DO NOT give support on this mod but since I managed to install it on my site I thought I'd help you guys out...

Well here's the mod for phpBB v2.0.8:

Code: Select all

##############################################################
## MOD Title: Super Moderators 
## MOD Author: Rawly <rawly@jrawly.co.uk> http://www.jrawly.co.uk
## MOD Description: Allows the Administrator to add a 'Super Moderator' with
## restricted administrative controls.
##	
##	Updated by Odin, to work with phpBB 2.0.8. I give no support on this..
##	
##	
##	
## MOD Version: 2.1.0a 
## Installation Level: Easy
## Installation Time: 20 Minutes 
## Files to Edit: /phpBB2/includes/constants.php,
##                /phpBB2/language/lang_english/lang_main.php,
##                /phpBB2/includes/page_tail.php,
##                /phpBB2/viewonline.php,
##                /phpBB2/includes/page_header.php,
##                /phpBB2/admin/admin_styles.php,
##                /phpBB2/language/lang_english/lang_admin.php,
##                /phpBB2/{TEMPLATES DIR}/index_body.tpl,
##                /phpBB2/{TEMPLATES DIR}/admin/styles_edit_body.tpl
##                /phpBB2/admin/admin_ug_auth.php
## Included Files: [30]
##                 /phpBB2/templates/SubSilver/less_admin/category_edit_body.tpl 
##                 /phpBB2/templates/SubSilver/less_admin/disallow_body.tpl
##                 /phpBB2/templates/SubSilver/less_admin/forum_admin_body.tpl
##                 /phpBB2/templates/SubSilver/less_admin/forum_delete_body.tpl 
##                 /phpBB2/templates/SubSilver/less_admin/forum_edit_body.tpl
##                 /phpBB2/templates/SubSilver/less_admin/forum_prune_body.tpl
##                 /phpBB2/templates/SubSilver/less_admin/forum_prune_result_body.tpl
##                 /phpBB2/templates/SubSilver/less_admin/forum_prune_select_body.tpl
##                 /phpBB2/templates/SubSilver/less_admin/index_body.tpl
##                 /phpBB2/templates/SubSilver/less_admin/index_frameset.tpl
##                 /phpBB2/templates/SubSilver/less_admin/index_navigate.tpl
##                 /phpBB2/templates/SubSilver/less_admin/page_footer.tpl
##                 /phpBB2/templates/SubSilver/less_admin/page_header.tpl
##                 /phpBB2/templates/SubSilver/less_admin/user_avatar_gallery.tpl
##                 /phpBB2/templates/SubSilver/less_admin/user_edit_body.tpl
##                 /phpBB2/templates/SubSilver/less_admin/user_email_body.tpl
##                 /phpBB2/templates/SubSilver/less_admin/user_select_body.tpl
##                 /phpBB2/templates/SubSilver/less_admin/words_edit_body.tpl
##                 /phpBB2/templates/SubSilver/less_admin/words_list_body.tpl
##                 /phpBB2/templates/SubSilver/less_admin/index.htm (blank security)
##                 /phpBB2/super_mod/admin_disallow.php
##                 /phpBB2/super_mod/admin_forum_prune.php
##                 /phpBB2/super_mod/admin_forums.php
##                 /phpBB2/super_mod/admin_mass_email.php
##                 /phpBB2/super_mod/admin_users.php
##                 /phpBB2/super_mod/admin_words.php
##                 /phpBB2/super_mod/index.php
##                 /phpBB2/super_mod/page_footer_admin.php
##                 /phpBB2/super_mod/page_header_admin.php
##                 /phpBB2/super_mod/pagestart.php
##                 
########################################################
## This MOD is released under the GPL License.
## Intellectual Property is retained by the MOD Author(s) listed above
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
##############################################################
## Author Notes:
## Upload the files provided using the directory structure (phpBB2 is the default installation directory, replace this with your own)
## Make sure you upload the templates into all template directories used by your forum
## This is NOT a Junior Admin mod and as such you need to grant the permissions for you 'Super Moderator' like you would a normal moderator.
## 
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ DATABASE CHANGES ]------------------------------------------
#
ALTER TABLE phpbb_themes ADD fontcolor4 VARCHAR (6) ;
ALTER TABLE phpbb_themes_name ADD fontcolor4_name CHAR (50) ;
#
#-----[ OPEN ]------------------------------------------
#
/phpBB2/includes/constants.php

#
#-----[ FIND ]------------------------------------------
#
define('USER', 0);
define('ADMIN', 1);
define('MOD', 2);
#
#-----[ AFTER, ADD ]------------------------------------------
#
define('LESS_ADMIN', 3);
#
#-----[ OPEN ]------------------------------------------
#
/phpBB2/language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Admin_panel'] = 'Go to Administration Panel'; 
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['Super_Mod_panel'] = "Go to Super Moderators Panel";
#
#-----[ FIND ]------------------------------------------
#
$lang['Mod_online_color'] = '%sModerator%s';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['Super_Mod_online_color'] = "%sSuper Moderator%s";
#
#-----[ OPEN ]------------------------------------------
#
/phpBB2/includes/page_tail.php

#
#-----[ FIND ]------------------------------------------
#
$admin_link = ( $userdata['user_level'] == ADMIN ) ? '<a href="admin/index.' . $phpEx . '?sid=' . $userdata['session_id'] . '">' . $lang['Admin_panel'] . '</a><br /><br />' : '';

#
#-----[ REPLACE WITH ]------------------------------------------
#
if ( $userdata['user_level'] == ADMIN ) 
{ 
        $admin_link = '<a href="admin/index.' . $phpEx . '?sid=' . $userdata['session_id'] . '">' . $lang['Admin_panel'] . '</a><br /><a href="' . append_sid("super_mod/index.$phpEx") . '">' . $lang['Super_Mod_panel'] . '</a><br /><br />';
} 
else if ( $userdata['user_level'] == LESS_ADMIN ) 
{ 
        $admin_link = '<a href="super_mod/index.' . $phpEx . '?sid=' . $userdata['session_id'] . '">' . $lang['Super_Mod_panel'] . '</a><br /><br />';
}

#
#-----[ OPEN ]------------------------------------------
#
/phpBB2/viewonline.php


#
#-----[ FIND ]------------------------------------------
#
			if ( $row['user_level'] == ADMIN )
			{
				$username = '<b style="color:#' . $theme['fontcolor3'] . '">' . $username . '</b>';
			}
#
#-----[ AFTER, ADD ]------------------------------------------
#
			else if ( $row['user_level'] == LESS_ADMIN )
			{
				$username = '<b style="color:#' . $theme['fontcolor4'] . '">' . $username . '</b>';
			}


#
#-----[ FIND ]------------------------------------------
#
			if ( !$row['user_allow_viewonline'] )
			{
				$view_online = ( $userdata['user_level'] == ADMIN ) ? true : false;
				$hidden_users++;

				$username = '<i>' . $username . '</i>';
			}

#
#-----[ AFTER, ADD ]------------------------------------------
#
//ONLY IF YOU WANT SUPER MODERATORS TO VIEW USERONLINE DATA WHEN USERS AREN'T ALLOWED!

			else if ( !$row['user_allow_viewonline'] )
			{
				$view_online = ( $userdata['user_level'] == LESS_ADMIN ) ? true : false;
				$hidden_users++;

				$username = '<i>' . $username . '</i>';
			}


//END ONLY IF YOU WANT SUPER MODERATORS TO VIEW USERONLINE DATA WHEN USERS AREN'T ALLOWED!

#
#-----[ OPEN ]------------------------------------------
#
/phpBB2/includes/page_header.php
#
#-----[ FIND ]------------------------------------------
#
			if ( $row['user_level'] == ADMIN )
			{
				$row['username'] = '<b>' . $row['username'] . '</b>';
				$style_color = 'style="color:#' . $theme['fontcolor3'] . '"';
			}
#
#-----[ AFTER, ADD ]------------------------------------------
#
			else if ( $row['user_level'] == LESS_ADMIN )
			{
				$row['username'] = '<b>' . $row['username'] . '</b>';
				$style_color = 'style="color:#' . $theme['fontcolor4'] . '"';
			}
#
#-----[ FIND ]------------------------------------------
#
//THIS IS FOR WHO VISITED BOARD TODAY MOD.. MAY BE ON YOUR INDEX.PHP FILE
   if( $todayrow['user_level'] == ADMIN ) 
   { 
      $todayrow['username'] = '<b>' . $todayrow['username'] . '</b>'; 
      $style_color = 'style="color:#' . $theme['fontcolor3'] . '"'; 
   } 
#
#-----[ AFTER, ADD ]------------------------------------------
#
//THIS IS FOR WHO VISITED BOARD TODAY MOD.. MAY BE ON YOUR INDEX.PHP FILE
   else if( $todayrow['user_level'] == LESS_ADMIN ) 
   { 
      $todayrow['username'] = '<b>' . $todayrow['username'] . '</b>'; 
      $style_color = 'style="color:#' . $theme['fontcolor4'] . '"'; 
   }
#
#-----[ FIND ]------------------------------------------
#
	'L_WHOSONLINE_ADMIN' => sprintf($lang['Admin_online_color'], '<span style="color:#' . $theme['fontcolor3'] . '">', '</span>'),
#
#-----[ AFTER, ADD ]------------------------------------------
#
	'L_WHOSONLINE_SUPER_MOD' => sprintf($lang['Super_Mod_online_color'], '<span style="color:#' . $theme['fontcolor4'] . '">', '</span>'),
#
#-----[ FIND ]------------------------------------------
#
	'T_FONTCOLOR3' => '#'.$theme['fontcolor3'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
	'T_FONTCOLOR4' => '#'.$theme['fontcolor4'],


#
#-----[ OPEN ]------------------------------------------
#
/phpBB2/admin/admin_styles.php
#
#-----[ FIND ]------------------------------------------
#
			$updated['fontcolor3'] = $HTTP_POST_VARS['fontcolor3'];
			$updated_name['fontcolor3_name'] = $HTTP_POST_VARS['fontcolor3_name'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
			$updated['fontcolor4'] = $HTTP_POST_VARS['fontcolor4'];
			$updated_name['fontcolor4_name'] = $HTTP_POST_VARS['fontcolor4_name'];

#
#-----[ FIND ]------------------------------------------
#
				"L_FONTCOLOR_3" => $lang['fontcolor3'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
				"L_FONTCOLOR_4" => $lang['fontcolor4'],
#
#-----[ FIND ]------------------------------------------
#
				"FONTCOLOR3" => $selected['fontcolor3'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
				"FONTCOLOR4" => $selected['fontcolor4'],
#
#-----[ FIND ]------------------------------------------
#
				"FONTCOLOR3_NAME" => $selected['fontcolor3_name'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
				"FONTCOLOR4_NAME" => $selected['fontcolor4_name'],

#
#-----[ OPEN ]------------------------------------------
#
/phpBB2/language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
$lang['fontcolor3'] = 'Font Colour 3';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['fontcolor4'] = "Font Colour 4";


#
#-----[ OPEN ]------------------------------------------
#
/phpBB2/{TEMPLATES DIR}/index_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr> 
	<td class="row1" align="left"><span class="gensmall">{TOTAL_USERS_ONLINE} &nbsp; [ {L_WHOSONLINE_ADMIN} ] &nbsp; [ {L_WHOSONLINE_MOD} ]<br />{RECORD_USERS}<br />{LOGGED_IN_USER_LIST}</span></td>
  </tr>
#
#-----[ REPLACE WITH ]------------------------------------------
#
<tr> 
	<td class="row1" align="left"><span class="gensmall">{TOTAL_USERS_ONLINE} &nbsp; [ {L_WHOSONLINE_ADMIN} ] &nbsp; [ {L_WHOSONLINE_SUPER_MOD} ] &nbsp; [ {L_WHOSONLINE_MOD} ]<br />{RECORD_USERS}<br />{LOGGED_IN_USER_LIST}</span></td>
  </tr>

#
#-----[ OPEN ]------------------------------------------
#
/phpBB2/{TEMPLATES DIR}/admin/styles_edit_body.tpl
#
#-----[ FIND ]------------------------------------------
#
	<tr>
		<td class="row1">{L_FONTCOLOR_3}:</td>
		<td class="row2"><input class="post" type="text" size="6" maxlength="6" name="fontcolor3" value="{FONTCOLOR3}"></td>
		<td class="row2"><input class="post" type="text" size="25" maxlength="100" name="fontcolor3_name" value="{FONTCOLOR3_NAME}">
	</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
	<tr>
		<td class="row1">{L_FONTCOLOR_4}:</td>
		<td class="row2"><input type="text" size="6" maxlength="6" name="fontcolor4" value="{FONTCOLOR4}"></td>
		<td class="row2"><input type="text" size="25" maxlength="100" name="fontcolor4_name" value="{FONTCOLOR4_NAME}">
	</tr>

# 
#-----[ OPEN ]------------------------------------------ 
# 

/phpBB2/admin/admin_ug_auth.php 


# 
#-----[ FIND ]------------------------------------------ 
# 

	else
	{
		if ( $mode == 'user' && $HTTP_POST_VARS['userlevel'] == 'user' && $user_level == ADMIN )
		{

# 
#-----[ BEFORE, ADD ]------------------------------------ 
# 

	else if ( $mode == 'user' && $HTTP_POST_VARS['userlevel'] == 'supermod' && $user_level != LESS_ADMIN ) 
	{ 
	   // 
	   // Make user an admin (if already user) 
	   // 
	   if ( $userdata['user_id'] != $user_id ) 
	   { 
	      // 
	      // Update users level, reset 
	      // 
	      $sql = "UPDATE " . USERS_TABLE . " 
	         SET user_level = " . LESS_ADMIN . " 
	         WHERE user_id = $user_id"; 
	      if(!$result = $db->sql_query($sql)) 
	      { 
	            message_die(GENERAL_ERROR, "Couldn't update user level", "", __LINE__, __FILE__, $sql); 
	      } 

	      $sql = "DELETE FROM " . AUTH_ACCESS_TABLE . " 
	         WHERE group_id = $group_id 
	            AND auth_mod = 0"; 
	      if ( !($result = $db->sql_query($sql)) ) 
	      { 
	         message_die(GENERAL_ERROR, "Couldn't delete auth access info", "", __LINE__, __FILE__, $sql); 
	      } 
	
	      // 
	      // Delete any entries in auth_access, they are not required if user is becoming an 
	      // admin 
	      // 
	      $sql = "UPDATE " . AUTH_ACCESS_TABLE . " 
	         SET auth_view = 0, auth_read = 0, auth_post = 0, auth_reply = 0, auth_edit = 0, auth_delete = 0, auth_sticky = 0, auth_announce = 0 
	         WHERE group_id = $group_id"; 
	      if ( !($result = $db->sql_query($sql)) ) 
	      { 
	         message_die(GENERAL_ERROR, "Couldn't update auth access", "", __LINE__, __FILE__, $sql); 
	      } 
	   } 

	   $message = $lang['Auth_updated'] . '<br /><br />' . sprintf($lang['Click_return_userauth'], '<a href="' . append_sid("admin_ug_auth.$phpEx?mode=$mode") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid("index.$phpEx?pane=right") . '">', '</a>'); 
	   message_die(GENERAL_MESSAGE, $message); 
	} 

# 
#-----[ FIND ]------------------------------------------ 
# 
		if ( $mode == 'user' && $HTTP_POST_VARS['userlevel'] == 'user' && $user_level == ADMIN )
		{
			//
			// Make admin a user (if already admin) ... ignore if you're trying
			// to change yourself from an admin to user!
			//
			if ( $userdata['user_id'] != $user_id )
			{
				$sql = "UPDATE " . AUTH_ACCESS_TABLE . "
					SET auth_view = 0, auth_read = 0, auth_post = 0, auth_reply = 0, auth_edit = 0, auth_delete = 0, auth_sticky = 0, auth_announce = 0
					WHERE group_id = $group_id";
				if ( !($result = $db->sql_query($sql)) )
				{
					message_die(GENERAL_ERROR, 'Could not update auth access', '', __LINE__, __FILE__, $sql);
				}

				//
				// Update users level, reset to USER
				//
				$sql = "UPDATE " . USERS_TABLE . "
					SET user_level = " . USER . "
					WHERE user_id = $user_id";
				if ( !($result = $db->sql_query($sql)) )
				{
					message_die(GENERAL_ERROR, 'Could not update user level', '', __LINE__, __FILE__, $sql);
				}
			}

			$message = $lang['Auth_updated'] . '<br /><br />' . sprintf($lang['Click_return_userauth'], '<a href="' . append_sid("admin_ug_auth.$phpEx?mode=$mode") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid("index.$phpEx?pane=right") . '">', '</a>');
		}

# 
#-----[ AFTER, ADD ]-------------------------------- 
# 
		else if ( $mode == 'user' && $HTTP_POST_VARS['userlevel'] == 'user' && $user_level == LESS_ADMIN ) 
		{ 
		   // 
		   // Make super mod a user (if already super mod) ... ignore if you're trying 
		   // to change yourself from an super mod to user! 
		   // 
		   if ( $userdata['user_id'] != $user_id ) 
		   { 
		      $sql = "UPDATE " . AUTH_ACCESS_TABLE . " 
		         SET auth_view = 0, auth_read = 0, auth_post = 0, auth_reply = 0, auth_edit = 0, auth_delete = 0, auth_sticky = 0, auth_announce = 0 
		         WHERE group_id = $group_id"; 
		      if ( !($result = $db->sql_query($sql)) ) 
		      { 
		         message_die(GENERAL_ERROR, 'Could not update auth access', '', __LINE__, __FILE__, $sql); 
		      } 
             
		      // 
		      // Update users level, reset to USER 
		      // 
		      $sql = "UPDATE " . USERS_TABLE . " 
		         SET user_level = " . USER . " 
		         WHERE user_id = $user_id"; 
		      if ( !($result = $db->sql_query($sql)) ) 
		      { 
		         message_die(GENERAL_ERROR, 'Could not update user level', '', __LINE__, __FILE__, $sql); 
		      } 
		   } 

		   $message = $lang['Auth_updated'] . '<br /><br />' . sprintf($lang['Click_return_userauth'], '<a href="' . append_sid("admin_ug_auth.$phpEx?mode=$mode") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid("index.$phpEx?pane=right") . '">', '</a>'); 
		} 

# 
#-----[ FIND ]------------------------------------------- 
#

		//
		// Update user level to mod for appropriate users
		// 
		$sql = "SELECT u.user_id 
			FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . USERS_TABLE . " u  
			WHERE ug.group_id = aa.group_id 
				AND u.user_id = ug.user_id 
				AND u.user_level NOT IN (" . MOD . ", " . ADMIN . ") 
			GROUP BY u.user_id 
			HAVING SUM(aa.auth_mod) > 0";

# 
#-----[ REPLACE WITH ]------------------------------------------- 
#

		// 
		// Update user level to mod for appropriate users 
		// 
		$sql = "SELECT u.user_id 
		         FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . USERS_TABLE . " u  
		         WHERE ug.group_id = aa.group_id 
		            AND u.user_id = ug.user_id 
		            AND u.user_level NOT IN (" . MOD . ", " . ADMIN . ", ". LESS_ADMIN .") 
		         GROUP BY u.user_id 
		         HAVING SUM(aa.auth_mod) > 0";



# 
#-----[ FIND ]------------------------------------------ 
# 
		//
		// Update user level to user for appropriate users
		// 
		switch ( SQL_LAYER )
		{
			case 'postgresql':
				$sql = "SELECT u.user_id 
					FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug, " . AUTH_ACCESS_TABLE . " aa
					WHERE ug.user_id = u.user_id 
						AND aa.group_id = ug.group_id 
						AND u.user_level NOT IN (" . USER . ", " . ADMIN . ")
					GROUP BY u.user_id 
					HAVING SUM(aa.auth_mod) = 0 
					UNION (
						SELECT u.user_id  
						FROM " . USERS_TABLE . " u 
						WHERE NOT EXISTS ( 
							SELECT aa.auth_mod 
							FROM " . USER_GROUP_TABLE . " ug, " . AUTH_ACCESS_TABLE . " aa 
							WHERE ug.user_id = u.user_id 
								AND aa.group_id = ug.group_id
						)
						AND u.user_level NOT IN (" . USER . ", " . ADMIN . ")  
						GROUP BY u.user_id
					)";
				break;
			case 'oracle':
				$sql = "SELECT u.user_id 
					FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug, " . AUTH_ACCESS_TABLE . " aa 
					WHERE ug.user_id = u.user_id(+)
						AND aa.group_id = ug.group_id(+) 
						AND u.user_level NOT IN (" . USER . ", " . ADMIN . ")
					GROUP BY u.user_id 
					HAVING SUM(aa.auth_mod) = 0";
				break;
			default:
				$sql = "SELECT u.user_id 
					FROM ( ( " . USERS_TABLE . " u  
					LEFT JOIN " . USER_GROUP_TABLE . " ug ON ug.user_id = u.user_id ) 
					LEFT JOIN " . AUTH_ACCESS_TABLE . " aa ON aa.group_id = ug.group_id ) 
					WHERE u.user_level NOT IN (" . USER . ", " . ADMIN . ")
					GROUP BY u.user_id 
					HAVING SUM(aa.auth_mod) = 0";
				break;
		}

# 
#-----[ REPLACE WITH ]------------------------------------------
# 

		//
		// Update user level to user for appropriate users
		// 		switch ( SQL_LAYER ) 
		{ 
		   case 'postgresql': 
		      $sql = "SELECT u.user_id 
		         FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug, " . AUTH_ACCESS_TABLE . " aa 
		         WHERE ug.user_id = u.user_id 
		            AND aa.group_id = ug.group_id 
		            AND u.user_level NOT IN (" . USER . ", " . ADMIN . ", " . LESS_ADMIN . ") 
		         GROUP BY u.user_id 
		         HAVING SUM(aa.auth_mod) = 0 
		         UNION ( 
		            SELECT u.user_id  
		            FROM " . USERS_TABLE . " u 
		            WHERE NOT EXISTS ( 
		               SELECT aa.auth_mod 
		               FROM " . USER_GROUP_TABLE . " ug, " . AUTH_ACCESS_TABLE . " aa 
		               WHERE ug.user_id = u.user_id 
		                  AND aa.group_id = ug.group_id 
		            ) 
		            AND u.user_level NOT IN (" . USER . ", " . ADMIN . ", " . LESS_ADMIN . ")  
		            GROUP BY u.user_id 
		         )"; 
		      break; 
		   case 'oracle': 
		      $sql = "SELECT u.user_id 
		         FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug, " . AUTH_ACCESS_TABLE . " aa 
		         WHERE ug.user_id = u.user_id(+) 
		            AND aa.group_id = ug.group_id(+) 
		            AND u.user_level NOT IN (" . USER . ", " . ADMIN . ", " . LESS_ADMIN . ") 
		         GROUP BY u.user_id 
		         HAVING SUM(aa.auth_mod) = 0"; 
		      break; 
		   default: 
		      $sql = "SELECT u.user_id 
		         FROM ( ( " . USERS_TABLE . " u  
		         LEFT JOIN " . USER_GROUP_TABLE . " ug ON ug.user_id = u.user_id ) 
		         LEFT JOIN " . AUTH_ACCESS_TABLE . " aa ON aa.group_id = ug.group_id ) 
		         WHERE u.user_level NOT IN (" . USER . ", " . ADMIN . ", " . LESS_ADMIN . ") 
		         GROUP BY u.user_id 
		         HAVING SUM(aa.auth_mod) = 0"; 
		      break; 
		} 


# 
#-----[ FIND ]------------------------------------------ 
# 

	$is_admin = ( $mode == 'user' ) ? ( ( $ug_info[0]['user_level'] == ADMIN && $ug_info[0]['user_id'] != ANONYMOUS ) ? 1 : 0 ) : 0;


# 
#-----[ AFTER, ADD ]------------------------------------ 
# 

	$is_super = ( $mode == 'user' ) ? ( ( $ug_info[0]['user_level'] == LESS_ADMIN && $ug_info[0]['user_id'] != ANONYMOUS ) ? 1 : 0 ) : 0; 
	$is_user = ( $mode == 'user' ) ? ( ( $ug_info[0]['user_level'] == USER || $ug_info[0]['user_level'] == MOD && $ug_info[0]['user_id'] != ANONYMOUS ) ? 1 : 0 ) : 0; 

# 
#-----[ FIND ]------------------------------------------- 
# 

		$s_user_type = ( $is_admin ) ? '<select name="userlevel"><option value="admin" selected="selected">' . $lang['Auth_Admin'] . '</option><option value="user">' . $lang['Auth_User'] . '</option></select>' : '<select name="userlevel"><option value="admin">' . $lang['Auth_Admin'] . '</option><option value="user" selected="selected">' . $lang['Auth_User'] . '</option></select>';

# 
#-----[ REPLACE WITH ]------------------------------------------- 
# 

		$s_user_type = '<select name="userlevel">'; 
		$s_user_type .= ($is_admin) ? '<option value="admin" selected=\"selected\">' . $lang['Auth_Admin'] . '</option>' : '<option value="admin">' . $lang['Auth_Admin'] . '</option>'; 
		$s_user_type .= ($is_super) ? '<option value="supermod" selected=\"selected\">Super Moderator</option>' : '<option value="supermod">Super Moderator</option>'; 
		$s_user_type .= ($is_user) ? '<option value="user" selected=\"selected\">' . $lang['Auth_User'] . '</option>' : '<option value="user">' . $lang['Auth_User'] . '</option>'; 
		$s_user_type .= '</select>'; 

#
#-----[ SAVE/CLOSE ALL FILES ]----------------------------------------
#
# EoM
This includes the admin control panel, so that you can add those super moderators...

Have fun...

Btw.. If you want to add other admin features to the Super Moderators, just copy the file from the phpBB/admin/ folder to the phpBB/super_mod/ folder and remember to add the tpl files also, which is in the /phpBB/templates/SubSilver/admin/ to the /phpBB/templates/SubSilver/less_admin/
tbartold
Registered User
Posts: 138
Joined: Sat Mar 15, 2003 3:51 am
Contact:

Post by tbartold »

I've also heavily modified this MOD to get it to work nicely on our site, running phpBB2.0.8a. I actually stripped out a lot of stuff and made it simpler.

The main thing is that there is no reason to create the template files, since they are pretty much the same as the standard admin template files, so why not just use them? Also all the files in the super_mod directory should be updated to match the files with the same names in the admin directory, so I off this as an alternative...

Code: Select all

##############################################################
## MOD Title: Super Moderators
## MOD Author: Rawly <rawly@jrawly.co.uk> http://www.jrawly.co.uk
##             GateKeeper <gatekeep@optonline.net> http://www.circlesoftus.org:83/
## MOD Description: Allows the Administrator to add a 'Super Moderator' with
## restricted administrative controls.
## Allows the Administrator use the administration panel to change user to super moderator.
##
## MOD Version: 2.1.1
## Installation Level: Moderate
## Installation Time: 20 Minutes
## Files to Edit: includes/constants.php,
##                language/lang_english/lang_main.php,
##                includes/page_tail.php,
##                viewonline.php,
##                includes/page_header.php,
##                admin/admin_styles.php,
##                language/lang_english/lang_admin.php,
##                templates/SubSilver/index_body.tpl,
##                templates/SubSilver/admin/styles_edit_body.tpl
##                admin/admin_ug_auth.php
## Included Files: [4+]
##                 super_mod/index.php
##                 super_mod/page_footer_admin.php
##                 super_mod/page_header_admin.php
##                 super_mod/pagestart.php
##
########################################################
## This MOD is released under the GPL License.
## Intellectual Property is retained by the MOD Author(s) listed above
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
##############################################################
## Author Notes:
## Upload the files provided using the directory structure (phpBB2 is the default installation directory, replace this with your own)
## This is NOT a Junior Admin mod and as such you need to grant the permissions for your 'Super Moderator' like you would a normal moderator.
## The Super Moderator will have the abilities dictated by whatever files you copy from the admin directory
## to the super_mod directory. The only file changed from the phpBB2 base code is super_mod/pagestart.php
##############################################################
##
##  Revision History:
##
##  v2.1.1
##  - Updated for EZMod and phpBB2.0.8a compatibility
##  - Removed compatibility with who's visited today MOD
##  - Removed all template files (just copies of the admin templates anyway)
##  - Updated included super_mod files to be files from current 2.0.8a distribution
##  - Integerated Administration Panel for Super Moderators v1.1.1
##
##  v2.1.0
##  - Includes the Color Add On (v1.5.0)
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ COPY ]------------------------------------------
#
copy super_mod/index.php to super_mod/index.php
copy super_mod/page_footer_admin.php to super_mod/page_footer_admin.php
copy super_mod/page_header_admin.php to super_mod/page_header_admin.php
copy super_mod/pagestart.php to super_mod/pagestart.php
#
# Note that you should copy additional files from your own admin
# directory to add any desired abilities for the super_mod
#
# copy super_mod/admin_disallow.php to super_mod/admin_disallow.php
# copy super_mod/admin_forum_prune.php to super_mod/admin_forum_prune.php
# copy super_mod/admin_forums.php to super_mod/admin_forums.php
# copy super_mod/admin_mass_email.php to super_mod/admin_mass_email.php
# copy super_mod/admin_users.php to super_mod/admin_users.php
# copy super_mod/admin_words.php to super_mod/admin_words.php
#
#
#-----[ DATABASE CHANGES ]------------------------------------------
#
ALTER TABLE phpbb_themes ADD fontcolor4 VARCHAR (6) ;
ALTER TABLE phpbb_themes_name ADD fontcolor4_name CHAR (50) ;


#
#-----[ OPEN ]------------------------------------------
#
super_mod/pagestart.php
#
#-----[ FIND ]------------------------------------------
#
ADMIN
#
#-----[ IN-LINE FIND ]------------------------------------------
#
ADMIN
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 && $userdata['user_level'] != LESS_ADMIN
#
#-----[ OPEN ]------------------------------------------
#
includes/constants.php
#
#-----[ FIND ]------------------------------------------
#
define('USER', 0);
define('ADMIN', 1);
define('MOD', 2);
#
#-----[ AFTER, ADD ]------------------------------------------
#
define('LESS_ADMIN', 3);
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Admin_panel'] = 'Go to Administration Panel';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['Super_Mod_panel'] = "Go to Super Moderators Panel";
#
#-----[ FIND ]------------------------------------------
#
$lang['Admin_online_color'] = '%sAdministrator%s';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['Super_Mod_online_color'] = "%sSuper Moderator%s";
#
#-----[ OPEN ]------------------------------------------
#
includes/page_tail.php
#
#-----[ FIND ]------------------------------------------
#
$admin_link = ( $userdata['user_level'] == ADMIN ) ? '<a href="admin/index.' . $phpEx . '?sid=' . $userdata['session_id'] . '">' . $lang['Admin_panel'] . '</a><br /><br />' : '';
#
#-----[ REPLACE WITH ]------------------------------------------
#
if ( $userdata['user_level'] == ADMIN )
{
	$admin_link = '<a href="admin/index.' . $phpEx . '?sid=' . $userdata['session_id'] . '">' . $lang['Admin_panel'] . '</a><br /><br />';
}
else if ( $userdata['user_level'] == LESS_ADMIN )
{
	$admin_link = '<a href="super_mod/index.' . $phpEx . '?sid=' . $userdata['session_id'] . '">' . $lang['Super_Mod_panel'] . '</a><br /><br />';
}
#
#-----[ OPEN ]------------------------------------------
#
viewonline.php
#
#-----[ FIND ]------------------------------------------
#
			if ( $row['user_level'] == ADMIN )
			{
				$username = '<b style="color:#' . $theme['fontcolor3'] . '">' . $username . '</b>';
			}
#
#-----[ AFTER, ADD ]------------------------------------------
#
			else if ( $row['user_level'] == LESS_ADMIN )
			{
				$username = '<b style="color:#' . $theme['fontcolor4'] . '">' . $username . '</b>';
			}
#
#-----[ FIND ]------------------------------------------
#
			if ( !$row['user_allow_viewonline'] )
			{
				$view_online = ( $userdata['user_level'] == ADMIN ) ? true : false;
				$hidden_users++;

				$username = '<i>' . $username . '</i>';
			}
#
#-----[ AFTER, ADD ]------------------------------------------
#
			else if ( !$row['user_allow_viewonline'] )
			{
				$view_online = ( $userdata['user_level'] == LESS_ADMIN ) ? true : false;
				$hidden_users++;

				$username = '<i>' . $username . '</i>';
			}
#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]------------------------------------------
#
			if ( $row['user_level'] == ADMIN )
			{
				$row['username'] = '<b>' . $row['username'] . '</b>';
				$style_color = 'style="color:#' . $theme['fontcolor3'] . '"';
			}
#
#-----[ AFTER, ADD ]------------------------------------------
#
			else if ( $row['user_level'] == LESS_ADMIN )
			{
				$row['username'] = '<b>' . $row['username'] . '</b>';
				$style_color = 'style="color:#' . $theme['fontcolor4'] . '"';
			}
#
#-----[ FIND ]------------------------------------------
#
'L_WHOSONLINE_ADMIN' => sprintf($lang['Admin_online_color'], '<span style="color:#' . $theme['fontcolor3'] . '">', '</span>'),
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_WHOSONLINE_SUPER_MOD' => sprintf($lang['Super_Mod_online_color'], '<span style="color:#' . $theme['fontcolor4'] . '">', '</span>'),
#
#-----[ FIND ]------------------------------------------
#
'T_FONTCOLOR3' => '#'.$theme['fontcolor3'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'T_FONTCOLOR4' => '#'.$theme['fontcolor4'],
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_styles.php
#
#-----[ FIND ]------------------------------------------
#
$updated['fontcolor3'] = $HTTP_POST_VARS['fontcolor3'];
			$updated_name['fontcolor3_name'] = $HTTP_POST_VARS['fontcolor3_name'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
$updated['fontcolor4'] = $HTTP_POST_VARS['fontcolor4'];
			$updated_name['fontcolor4_name'] = $HTTP_POST_VARS['fontcolor4_name'];
#
#-----[ FIND ]------------------------------------------
#
"L_FONTCOLOR_3" => $lang['fontcolor3'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
"L_FONTCOLOR_4" => $lang['fontcolor4'],
#
#-----[ FIND ]------------------------------------------
#
"FONTCOLOR3" => $selected['fontcolor3'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
"FONTCOLOR4" => $selected['fontcolor4'],
#
#-----[ FIND ]------------------------------------------
#
"FONTCOLOR3_NAME" => $selected['fontcolor3_name'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
"FONTCOLOR4_NAME" => $selected['fontcolor4_name'],

#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
$lang['fontcolor3'] = 'Font Colour 3';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['fontcolor4'] = 'Font Colour 4';
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/index_body.tpl
#
#-----[ FIND ]------------------------------------------
#
	<td class="row1" align="left"><span class="gensmall">{TOTAL_USERS_ONLINE} &nbsp; [ {L_WHOSONLINE_ADMIN} ] &nbsp; [ {L_WHOSONLINE_MOD} ]<br />{RECORD_USERS}<br />{LOGGED_IN_USER_LIST}</span></td>
#
#-----[ REPLACE WITH ]------------------------------------------
#
	<td class="row1" align="left"><span class="gensmall">{TOTAL_USERS_ONLINE} &nbsp; [ {L_WHOSONLINE_ADMIN} ] &nbsp; [ {L_WHOSONLINE_SUPER_MOD} ] &nbsp; [ {L_WHOSONLINE_MOD} ]<br />{RECORD_USERS}<br />{LOGGED_IN_USER_LIST}</span></td>
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/styles_edit_body.tpl
#
#-----[ FIND ]------------------------------------------
#
		<td class="row1">{L_FONTCOLOR_3}:</td>
#
#-----[ FIND ]------------------------------------------
#
	</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
	<tr>
		<td class="row1">{L_FONTCOLOR_4}:</td>
		<td class="row2"><input class="post" type="text" size="6" maxlength="6" name="fontcolor4" value="{FONTCOLOR4}"></td>
		<td class="row2"><input class="post" type="text" size="25" maxlength="100" name="fontcolor4_name" value="{FONTCOLOR4_NAME}">
	</tr>
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_ug_auth.php
#
#-----[ FIND ]------------------------------------------
#
else
{
	if ( $mode == 'user' && $HTTP_POST_VARS['userlevel'] == 'user' && $user_level == ADMIN )
	{
#
#-----[ BEFORE, ADD ]------------------------------------
#
	else if ( $mode == 'user' && $HTTP_POST_VARS['userlevel'] == 'supermod' && $user_level != LESS_ADMIN )
	{
		//
		// Make user an admin (if already user)
		//
		if ( $userdata['user_id'] != $user_id )
		{
			$sql = "UPDATE " . USERS_TABLE . "
				SET user_level = " . LESS_ADMIN . "
				WHERE user_id = $user_id";
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not update user level', '', __LINE__, __FILE__, $sql);
			}

			$sql = "DELETE FROM " . AUTH_ACCESS_TABLE . "
				WHERE group_id = $group_id
					AND auth_mod = 0";
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, "Couldn't delete auth access info", "", __LINE__, __FILE__, $sql);
			}

			//
			// Delete any entries in auth_access, they are not required if user is becoming an
			// admin
			//
			$sql = "UPDATE " . AUTH_ACCESS_TABLE . "
				SET auth_view = 0, auth_read = 0, auth_post = 0, auth_reply = 0, auth_edit = 0, auth_delete = 0, auth_sticky = 0, auth_announce = 0
				WHERE group_id = $group_id";
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, "Couldn't update auth access", "", __LINE__, __FILE__, $sql);
			}
		}

		$message = $lang['Auth_updated'] . '<br /><br />' . sprintf($lang['Click_return_userauth'], '<a href="' . append_sid("admin_ug_auth.$phpEx?mode=$mode") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid("index.$phpEx?pane=right") . '">', '</a>');
		message_die(GENERAL_MESSAGE, $message);
	}
#
#-----[ FIND ]------------------------------------------
#
			$message = $lang['Auth_updated'] . '<br /><br />' . sprintf($lang['Click_return_userauth'], '<a href="' . append_sid("admin_ug_auth.$phpEx?mode=$mode") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid("index.$phpEx?pane=right") . '">', '</a>');
		}
#
#-----[ AFTER, ADD ]--------------------------------
#
		else if ( $mode == 'user' && $HTTP_POST_VARS['userlevel'] == 'user' && $user_level == LESS_ADMIN )
		{
			//
			// Make admin a user (if already admin) ... ignore if you're trying
			// to change yourself from an admin to user!
			//
			if ( $userdata['user_id'] != $user_id )
			{
				$sql = "UPDATE " . AUTH_ACCESS_TABLE . "
					SET auth_view = 0, auth_read = 0, auth_post = 0, auth_reply = 0, auth_edit = 0, auth_delete = 0, auth_sticky = 0, auth_announce = 0
					WHERE group_id = $group_id";
				if ( !($result = $db->sql_query($sql)) )
				{
					message_die(GENERAL_ERROR, 'Could not update auth access', '', __LINE__, __FILE__, $sql);
				}

				//
				// Update users level, reset to USER
				//
				$sql = "UPDATE " . USERS_TABLE . "
					SET user_level = " . USER . "
					WHERE user_id = $user_id";
				if ( !($result = $db->sql_query($sql)) )
				{
					message_die(GENERAL_ERROR, 'Could not update user level', '', __LINE__, __FILE__, $sql);
				}
			}

			$message = $lang['Auth_updated'] . '<br /><br />' . sprintf($lang['Click_return_userauth'], '<a href="' . append_sid("admin_ug_auth.$phpEx?mode=$mode") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid("index.$phpEx?pane=right") . '">', '</a>');
		}
#
#-----[ FIND ]-------------------------------------------
#
				AND u.user_level NOT IN (" . MOD . ", " . ADMIN . ")
#
#-----[ REPLACE WITH ]-------------------------------------------
#
				AND u.user_level NOT IN (" . MOD . ", " . ADMIN . ", ". LESS_ADMIN .")
#
#-----[ FIND ]------------------------------------------
#
						AND u.user_level NOT IN (" . USER . ", " . ADMIN . ")
#
#-----[ REPLACE WITH ]--------------------------------
#
						AND u.user_level NOT IN (" . USER . ", " . ADMIN . ", " . LESS_ADMIN . ")
#
#-----[ FIND ]------------------------------------------
#
						AND u.user_level NOT IN (" . USER . ", " . ADMIN . ")
#
#-----[ REPLACE WITH ]--------------------------------
#
						AND u.user_level NOT IN (" . USER . ", " . ADMIN . ", " . LESS_ADMIN . ")
#
#-----[ FIND ]------------------------------------------
#
						AND u.user_level NOT IN (" . USER . ", " . ADMIN . ")
#
#-----[ REPLACE WITH ]--------------------------------
#
						AND u.user_level NOT IN (" . USER . ", " . ADMIN . ", " . LESS_ADMIN . ")
#
#-----[ FIND ]------------------------------------------
#
					WHERE u.user_level NOT IN (" . USER . ", " . ADMIN . ")
#
#-----[ REPLACE WITH ]--------------------------------
#
					WHERE u.user_level NOT IN (" . USER . ", " . ADMIN . ", " . LESS_ADMIN . ")
#
#-----[ FIND ]------------------------------------------
#
	$is_admin = ( $mode == 'user' ) ? ( ( $ug_info[0]['user_level'] == ADMIN && $ug_info[0]['user_id'] != ANONYMOUS ) ? 1 : 0 ) : 0;
#
#-----[ AFTER, ADD ]------------------------------------
#
	$is_super = ( $mode == 'user' ) ? ( ( $ug_info[0]['user_level'] == LESS_ADMIN && $ug_info[0]['user_id'] != ANONYMOUS ) ? 1 : 0 ) : 0;
	$is_user = ( $mode == 'user' ) ? ( ( $ug_info[0]['user_level'] == USER || $ug_info[0]['user_level'] == MOD && $ug_info[0]['user_id'] != ANONYMOUS ) ? 1 : 0 ) : 0;
#
#-----[ FIND ]-------------------------------------------
#
		$s_user_type = ( $is_admin ) ? '<select name="userlevel"><option value="admin" selected="selected">' . $lang['Auth_Admin'] . '</option><option value="user">' . $lang['Auth_User'] . '</option></select>' : '<select name="userlevel"><option value="admin">' . $lang['Auth_Admin'] . '</option><option value="user" selected="selected">' . $lang['Auth_User'] . '</option></select>';
#
#-----[ REPLACE WITH ]-------------------------------------------
#
		$s_user_type = '<select name="userlevel">';
		$s_user_type .= ($is_admin) ? '<option value="admin" selected="selected">' . $lang['Auth_Admin'] . '</option>' : '<option value="admin">' . $lang['Auth_Admin'] . '</option>';
		$s_user_type .= ($is_super) ? '<option value="supermod" selected="selected">Super Moderator</option>' : '<option value="supermod">Super Moderator</option>';
		$s_user_type .= ($is_user) ? '<option value="user" selected="selected">' . $lang['Auth_User'] . '</option>' : '<option value="user">' . $lang['Auth_User'] . '</option>';
		$s_user_type .= '</select>';
#
#-----[ SAVE/CLOSE ALL FILES ]----------------------------------------
#
# EoM
Note that the files "copied" from the super_mod directory are identical to the files of the same name in your admin directory. You only need to change the pagestart.php file to allow the super_mod to use it, and you only need to copy whatever files from the admin directory to the super_mod directory to allow the super_mod to use them.

I like this way better since you don't need to bother with al those template files, especially if you use multiple styles on your board.
User avatar
MHobbit
Former Team Member
Posts: 4761
Joined: Thu Mar 18, 2004 5:32 pm
Location: There and Back Again

Post by MHobbit »

I installed this MOD fine, but I noticed if I don't go into the ACP within a certain amount of time, when I click the link at the bottom of the page I'm redirected to the index. I'm an admin of the forums, of course, but this occurs, and I can't seem how to fix it. I need help. Thanks in advance.
Former phpBB MOD Team member
No private support is offered.
"There’s too many things to get done, and I’m running out of days..."
AznBoyye
Registered User
Posts: 133
Joined: Fri Aug 09, 2002 1:48 am

Post by AznBoyye »

hey tbartold i used yer version and i get this error when i try to go to super mod panel

Template->make_filename(): Error - file does not exist
AznBoyye
Registered User
Posts: 133
Joined: Fri Aug 09, 2002 1:48 am

Post by AznBoyye »

nvm i fixed it. thanx alot yer mod works terrific
Locked

Return to “[2.0.x] MODs in Development”