Page 1 of 11

[2.0.10] DHTML Slide Menu for ACP

Posted: Wed Aug 11, 2004 12:07 pm
by Extensions Robot
MOD Name: DHTML Slide Menu for ACP
Author: markus_petrux
MOD Description: This MOD turns your ACP left pane into a Dynamic HTML Slide Menu (roll-in/roll-out effects), making it easier to navigate. It should work on latests versions of all major browsers, and is supposed to degrade correctly on non-supported browsers (ie: all categories remain open). It also uses cookies to remind previous menu state. Really useful if you have many MODs installed. :-)

MOD Version: 1.0.0

Download File: dhtml_menu_for_acp_mod_v1_0_0.zip
mods overview page: View
File Size: 4113 Bytes

Security Score:

Posted: Tue Sep 07, 2004 6:03 pm
by Darkmonkey
MOD Validated/Released

Notes:
A very useful MOD, if you have a cluttered Administrator Panel. MOD uses cookies, javascript and DHTML to create a slide in/out effect to "minimize" the different panel groups. Cookies are used to remember panel posistions. Works in the latest versions of all Major browsers, and degrades well with others.

Posted: Tue Sep 07, 2004 8:20 pm
by markus_petrux
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Notes related to Junior Admin MOD by Nivisec:
A MOD Script is being tested here:
http://www.phpbb.com/phpBB/viewtopic.ph ... 05#1284305
If that works, I'll include it in a contrib folder for this MOD as well and try to re-submit the MOD to the Database.

Notes related to Global Admin Template MOD by Thoul:
If you're using G.A.T., then read this before installing my MOD:
http://www.phpbb.com/phpBB/viewtopic.ph ... 80#1306580

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Original post follows:

Ah, great ...my first approved MOD!

Thank you very much, MOD Team. :) ...also the "Validator's Review" comments... much appreciated. :) :) :)

Screenshot:
Image
Click to enlarge

Demo:
http://forums.phpmix.org/viewtopic.php?t=324#1160


Tips for installing MODs:
Use EasyMOD, it works. :roll: :wink:

Posted: Tue Sep 07, 2004 8:39 pm
by markus_petrux
BTW, feel free to rate this MOD. I already did it, and it was really funny. :lol: ;)


.

Posted: Tue Sep 07, 2004 10:02 pm
by Peter VDD
Now who's the bastard voting "Poor" there? :?

Great mod markus_petrux! You see I told you it had potential ;)

Posted: Tue Sep 07, 2004 10:16 pm
by Shof515
its a shame that someone voted for poor on this great wonderfull mod

Posted: Tue Sep 07, 2004 10:28 pm
by markus_petrux
Thanks you guys.


Keep up voting, it's free. :)

Posted: Wed Sep 08, 2004 7:19 pm
by munkyxtc
Great Mod, extremely easy to implement, and works excellently -- will definately keep my scrolling to a minimum.

Thanks.

Posted: Thu Sep 09, 2004 12:15 am
by onigumo
*slaps marcus on the back* Hey, man! This is an awesome modification, you created. ^__^

I've got a problem, though, man. I implemented it but nothing changed in the ACP. Here's the files required for editing, after I edited them:
templates/subSilver/admin/index_navigate.tpl wrote: <script language="javascript" type="text/javascript">
<!--

var menuVersion = "Slide Menu v1.0.0";

/*************************************************************
* DHTML Slide Menu for ACP MOD
*
* Copyright (C) 2004, Markus (phpMiX)
* This script is released under GPL License.
* Feel free to use this script (or part of it) wherever you need
* it ...but please, give credit to original author. Thank you. :-)
* We will also appreciate any links you could give us.
*
* Enjoy! ;-)
*************************************************************/

menuVersion += ' &copy; 2004<br />by <a href="http://www.phpmix.com/" target="_blank" class="copyright">phpMiX</a>';

function getCookie(name)
{
var cookies = document.cookie;
var start = cookies.indexOf(name + '=');
if( start < 0 ) return null;
var len = start + name.length + 1;
var end = cookies.indexOf(';', len);
if( end < 0 ) end = cookies.length;
return unescape(cookies.substring(len, end));
}
function setCookie(name, value, expires, path, domain, secure)
{
document.cookie = name + '=' + escape (value) +
((expires) ? '; expires=' + ( (expires == 'never') ? 'Thu, 31-Dec-2099 23:59:59 GMT' : expires.toGMTString() ) : '') +
((path) ? '; path=' + path : '') +
((domain) ? '; domain=' + domain : '') +
((secure) ? '; secure' : '');
}
function delCookie(name, path, domain)
{
if( getCookie(name) )
{
document.cookie = name + '=;expires=Thu, 01-Jan-1970 00:00:01 GMT' +
((path) ? '; path=' + path : '') +
((domain) ? '; domain=' + domain : '');
}
}

function menuCat(id, rows)
{
this.cat_id = id;
this.cat_rows = rows;
this.status = 'block';
}
var menuCats = new Array();
<!-- BEGIN catrow -->
menuCats['menuCat_{catrow.MENU_CAT_ID}'] = new menuCat('{catrow.MENU_CAT_ID}', {catrow.MENU_CAT_ROWS});
<!-- END catrow -->

function getObj(obj)
{
return ( document.getElementById ? document.getElementById(obj) : ( document.all ? document.all[obj] : null ) );
}
function displayObj(obj, status)
{
var x = getObj(obj);
if( x && x.style ) x.style.display = status;
}

var queueInterval = 20; // milliseconds between queued steps.
var execInterval = 0;
var queuedSteps;
var currentStep;

function queueStep(o, s)
{
this.obj = o;
this.status = s;
}
function execQueue()
{
if( currentStep < queuedSteps.length )
{
var obj = queuedSteps[currentStep].obj;
var status = queuedSteps[currentStep].status;
displayObj(obj, status);
if( menuCats[obj] ) menuCats[obj].status = status;
currentStep++;
setTimeout("execQueue();", execInterval);
}
else
{
execInterval = queueInterval;
}
}
function onMenuCatClick(cat_id)
{
var currentCat, currentStatus;

currentCat = 'menuCat_'+cat_id;
currentStatus = menuCats[currentCat].status;

queuedSteps = new Array();
currentStep = 0;

for( var catName in menuCats )
{
if( menuCats[catName].status == 'none' ) continue;

for( var i=(menuCats[catName].cat_rows-1); i >= 0; i-- )
{
queuedSteps[currentStep++] = new queueStep(catName+'_'+i, 'none');
}
queuedSteps[currentStep++] = new queueStep(catName, 'none');
}

if( currentStatus == 'none' )
{
queuedSteps[currentStep++] = new queueStep(currentCat, 'block');
for( var i=0; i < menuCats[currentCat].cat_rows; i++ )
{
queuedSteps[currentStep++] = new queueStep(currentCat+'_'+i, 'block');
}
var expdate = new Date(); // 72 Hours from now
expdate.setTime(expdate.getTime() + (72 * 60 * 60 * 1000));
setCookie('{COOKIE_NAME}_menu_cat_id', cat_id, expdate,
('{COOKIE_PATH}' == '') ? null : '{COOKIE_PATH}',
('{COOKIE_DOMAIN}' == '') ? null : '{COOKIE_DOMAIN}',
('{COOKIE_SECURE}' == '0') ? false : true);
}
else
{
delCookie('{COOKIE_NAME}_menu_cat_id',
('{COOKIE_PATH}' == '') ? null : '{COOKIE_PATH}',
('{COOKIE_DOMAIN}' == '') ? null : '{COOKIE_DOMAIN}');
}

currentStep = 0;
setTimeout("execQueue();", execInterval);
}

function doOnLoadMenuACP()
{
var cat_id;

if( getObj('menuCat_0') )
{
cat_id = getCookie('{COOKIE_NAME}_menu_cat_id');
if( !menuCats['menuCat_'+cat_id] )
{
cat_id = 0;
}
else
{
menuCats['menuCat_'+cat_id].status = 'none';
}
onMenuCatClick(cat_id);
}
if( oldOnLoadMenuACP )
{
oldOnLoadMenuACP();
}
}
var oldOnLoadMenuACP = window.onload;
window.onload = doOnLoadMenuACP;

// -->
</script>

<table width="100%" cellpadding="4" cellspacing="0" border="0" align="center">
<tr>
<td align="center" ><a href="{U_FORUM_INDEX}" target="_parent"><img src="../templates/subSilver/images/logo_phpBB_med.gif" border="0" /></a></td>
</tr>
<tr>
<td align="center" >
<table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline">
<tr>
<th height="25" class="thHead"><b>{L_ADMIN}</b></th>
</tr>
<tr>
<td class="row1"><span class="genmed"><a href="{U_ADMIN_INDEX}" target="main" class="genmed">{L_ADMIN_INDEX}</a></span></td>
</tr>
<tr>
<td class="row1"><span class="genmed"><a href="{U_FORUM_INDEX}" target="_parent" class="genmed">{L_FORUM_INDEX}</a></span></td>
</tr>
<tr>
<td class="row1"><span class="genmed"><a href="{U_FORUM_INDEX}" target="main" class="genmed">{L_PREVIEW_FORUM}</a></span></td>
</tr>
<!-- BEGIN catrow -->
<tr>
<td height="28" class="catSides" style="cursor:pointer;cursor:hand;" onclick="onMenuCatClick('{catrow.MENU_CAT_ID}');"><span class="cattitle">{catrow.ADMIN_CATEGORY}</span></td>
</tr>
<tr>
<td class="row1">
<div id="menuCat_{catrow.MENU_CAT_ID}" style="display:block;">
<table width="100%" cellpadding="4" cellspacing="1" border="0" class="bodyline">
<!-- BEGIN modulerow -->
<tr>
<td class="row1"><div id="menuCat_{catrow.MENU_CAT_ID}_{catrow.modulerow.ROW_COUNT}" style="display:block;" class="genmed"><a href="{catrow.modulerow.U_ADMIN_MODULE}" target="main" class="genmed">{catrow.modulerow.ADMIN_MODULE}</a></div>
</td>
</tr>
<!-- END modulerow -->
</table>
</div>
</td>
</tr>
<!-- END catrow -->
</table>
</td>
</tr>
</table><div align="center"><span class="copyright">
<script language="javascript" type="text/javascript">
<!--
document.write(menuVersion);
// -->
</script>
</span></div>


<br />

(admin) index.php wrote: <?php
/***************************************************************************
* (admin) index.php
* -------------------
* begin : Saturday, Feb 13, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
*
* $Id: index.php,v 1.40.2.5 2003/08/03 11:50:51 acydburn 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', 1);

//
// Load default header
//
$no_page_header = TRUE;
$phpbb_root_path = "./../";
require($phpbb_root_path . 'extension.inc');
require('./pagestart.' . $phpEx);

// ---------------
// Begin functions
//
function inarray($needle, $haystack)
{
for($i = 0; $i < sizeof($haystack); $i++ )
{
if( $haystack[$i] == $needle )
{
return true;
}
}
return false;
}
//
// End functions
// -------------

//
// Generate relevant output
//
if( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'left' )
{
$dir = @opendir(".");

$setmodules = 1;
while( $file = @readdir($dir) )
{
if( preg_match("/^admin_.*?\." . $phpEx . "$/", $file) )
{
include($file);
}
}

@closedir($dir);

unset($setmodules);

include('./page_header_admin.'.$phpEx);

$template->set_filenames(array(
"body" => "admin/index_navigate.tpl")
);

$template->assign_vars(array(
"U_FORUM_INDEX" => append_sid("../index.$phpEx"),
"U_ADMIN_INDEX" => append_sid("index.$phpEx?pane=right"),
//+MOD: DHTML Menu for ACP
'COOKIE_NAME' => $board_config['cookie_name'],
'COOKIE_PATH' => $board_config['cookie_path'],
'COOKIE_DOMAIN' => $board_config['cookie_domain'],
'COOKIE_SECURE' => $board_config['cookie_secure'],
//-MOD: DHTML Menu for ACP

"L_FORUM_INDEX" => $lang['Main_index'],
"L_ADMIN_INDEX" => $lang['Admin_Index'],
"L_PREVIEW_FORUM" => $lang['Preview_forum'])
);

ksort($module);
//+MOD: DHTML Menu for ACP
$menu_cat_id = 0;
//-MOD: DHTML Menu for ACP

while( list($cat, $action_array) = each($module) )
{
$cat = ( !empty($lang[$cat]) ) ? $lang[$cat] : preg_replace("/_/", " ", $cat);

$template->assign_block_vars("catrow", array(
//+MOD: DHTML Menu for ACP
'MENU_CAT_ID' => $menu_cat_id,
'MENU_CAT_ROWS' => count($action_array),
//-MOD: DHTML Menu for ACP

"ADMIN_CATEGORY" => $cat)
);

ksort($action_array);

$row_count = 0;
while( list($action, $file) = each($action_array) )
{
$row_color = ( !($row_count%2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($row_count%2) ) ? $theme['td_class1'] : $theme['td_class2'];

$action = ( !empty($lang[$action]) ) ? $lang[$action] : preg_replace("/_/", " ", $action);

$template->assign_block_vars("catrow.modulerow", array(
"ROW_COLOR" => "#" . $row_color,
"ROW_CLASS" => $row_class,
//+MOD: DHTML Menu for ACP
'ROW_COUNT' => $row_count,
//-MOD: DHTML Menu for ACP

"ADMIN_MODULE" => $action,
"U_ADMIN_MODULE" => append_sid($file))
);
$row_count++;
}
//+MOD: DHTML Menu for ACP
$menu_cat_id++;
//-MOD: DHTML Menu for ACP

}

$template->pparse("body");

include('./page_footer_admin.'.$phpEx);
}
elseif( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'right' )
{

include('./page_header_admin.'.$phpEx);

$template->set_filenames(array(
"body" => "admin/index_body.tpl")
);

$template->assign_vars(array(
"L_WELCOME" => $lang['Welcome_phpBB'],
"L_ADMIN_INTRO" => $lang['Admin_intro'],
"L_FORUM_STATS" => $lang['Forum_stats'],
"L_WHO_IS_ONLINE" => $lang['Who_is_Online'],
"L_USERNAME" => $lang['Username'],
"L_LOCATION" => $lang['Location'],
"L_LAST_UPDATE" => $lang['Last_updated'],
"L_IP_ADDRESS" => $lang['IP_Address'],
"L_STATISTIC" => $lang['Statistic'],
"L_VALUE" => $lang['Value'],
"L_NUMBER_POSTS" => $lang['Number_posts'],
"L_POSTS_PER_DAY" => $lang['Posts_per_day'],
"L_NUMBER_TOPICS" => $lang['Number_topics'],
"L_TOPICS_PER_DAY" => $lang['Topics_per_day'],
"L_NUMBER_USERS" => $lang['Number_users'],
"L_USERS_PER_DAY" => $lang['Users_per_day'],
"L_BOARD_STARTED" => $lang['Board_started'],
"L_AVATAR_DIR_SIZE" => $lang['Avatar_dir_size'],
"L_DB_SIZE" => $lang['Database_size'],
"L_FORUM_LOCATION" => $lang['Forum_Location'],
"L_STARTED" => $lang['Login'],
"L_GZIP_COMPRESSION" => $lang['Gzip_compression'])
);

//
// Get forum statistics
//
$total_posts = get_db_stat('postcount');
$total_users = get_db_stat('usercount');
$total_topics = get_db_stat('topiccount');

$start_date = create_date($board_config['default_dateformat'], $board_config['board_startdate'], $board_config['board_timezone']);

$boarddays = ( time() - $board_config['board_startdate'] ) / 86400;

$posts_per_day = sprintf("%.2f", $total_posts / $boarddays);
$topics_per_day = sprintf("%.2f", $total_topics / $boarddays);
$users_per_day = sprintf("%.2f", $total_users / $boarddays);

$avatar_dir_size = 0;

if ($avatar_dir = @opendir($phpbb_root_path . $board_config['avatar_path']))
{
while( $file = @readdir($avatar_dir) )
{
if( $file != "." && $file != ".." )
{
$avatar_dir_size += @filesize($phpbb_root_path . $board_config['avatar_path'] . "/" . $file);
}
}
@closedir($avatar_dir);

//
// This bit of code translates the avatar directory size into human readable format
// Borrowed the code from the PHP.net annoted manual, origanally written by:
// Jesse (jesse@jess.on.ca)
//
if($avatar_dir_size >= 1048576)
{
$avatar_dir_size = round($avatar_dir_size / 1048576 * 100) / 100 . " MB";
}
else if($avatar_dir_size >= 1024)
{
$avatar_dir_size = round($avatar_dir_size / 1024 * 100) / 100 . " KB";
}
else
{
$avatar_dir_size = $avatar_dir_size . " Bytes";
}

}
else
{
// Couldn't open Avatar dir.
$avatar_dir_size = $lang['Not_available'];
}

if($posts_per_day > $total_posts)
{
$posts_per_day = $total_posts;
}

if($topics_per_day > $total_topics)
{
$topics_per_day = $total_topics;
}

if($users_per_day > $total_users)
{
$users_per_day = $total_users;
}

//
// DB size ... MySQL only
//
// This code is heavily influenced by a similar routine
// in phpMyAdmin 2.2.0
//
if( preg_match("/^mysql/", SQL_LAYER) )
{
$sql = "SELECT VERSION() AS mysql_version";
if($result = $db->sql_query($sql))
{
$row = $db->sql_fetchrow($result);
$version = $row['mysql_version'];

if( preg_match("/^(3\.23|4\.)/", $version) )
{
$db_name = ( preg_match("/^(3\.23\.[6-9])|(3\.23\.[1-9][1-9])|(4\.)/", $version) ) ? "`$dbname`" : $dbname;

$sql = "SHOW TABLE STATUS
FROM " . $db_name;
if($result = $db->sql_query($sql))
{
$tabledata_ary = $db->sql_fetchrowset($result);

$dbsize = 0;
for($i = 0; $i < count($tabledata_ary); $i++)
{
if( $tabledata_ary[$i]['Type'] != "MRG_MyISAM" )
{
if( $table_prefix != "" )
{
if( strstr($tabledata_ary[$i]['Name'], $table_prefix) )
{
$dbsize += $tabledata_ary[$i]['Data_length'] + $tabledata_ary[$i]['Index_length'];
}
}
else
{
$dbsize += $tabledata_ary[$i]['Data_length'] + $tabledata_ary[$i]['Index_length'];
}
}
}
} // Else we couldn't get the table status.
}
else
{
$dbsize = $lang['Not_available'];
}
}
else
{
$dbsize = $lang['Not_available'];
}
}
else if( preg_match("/^mssql/", SQL_LAYER) )
{
$sql = "SELECT ((SUM(size) * 8.0) * 1024.0) as dbsize
FROM sysfiles";
if( $result = $db->sql_query($sql) )
{
$dbsize = ( $row = $db->sql_fetchrow($result) ) ? intval($row['dbsize']) : $lang['Not_available'];
}
else
{
$dbsize = $lang['Not_available'];
}
}
else
{
$dbsize = $lang['Not_available'];
}

if ( is_integer($dbsize) )
{
if( $dbsize >= 1048576 )
{
$dbsize = sprintf("%.2f MB", ( $dbsize / 1048576 ));
}
else if( $dbsize >= 1024 )
{
$dbsize = sprintf("%.2f KB", ( $dbsize / 1024 ));
}
else
{
$dbsize = sprintf("%.2f Bytes", $dbsize);
}
}

$template->assign_vars(array(
"NUMBER_OF_POSTS" => $total_posts,
"NUMBER_OF_TOPICS" => $total_topics,
"NUMBER_OF_USERS" => $total_users,
"START_DATE" => $start_date,
"POSTS_PER_DAY" => $posts_per_day,
"TOPICS_PER_DAY" => $topics_per_day,
"USERS_PER_DAY" => $users_per_day,
"AVATAR_DIR_SIZE" => $avatar_dir_size,
"DB_SIZE" => $dbsize,
"GZIP_COMPRESSION" => ( $board_config['gzip_compress'] ) ? $lang['ON'] : $lang['OFF'])
);
//
// End forum statistics
//

//
// Get users online information.
//
$sql = "SELECT u.user_id, u.username, u.user_session_time, u.user_session_page, s.session_logged_in, s.session_ip, s.session_start
FROM " . USERS_TABLE . " u, " . SESSIONS_TABLE . " s
WHERE s.session_logged_in = " . TRUE . "
AND u.user_id = s.session_user_id
AND u.user_id <> " . ANONYMOUS . "
AND u.user_session_time >= " . ( time() - 300 ) . "
ORDER BY u.user_session_time DESC";
if(!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Couldn't obtain regd user/online information.", "", __LINE__, __FILE__, $sql);
}
$onlinerow_reg = $db->sql_fetchrowset($result);

$sql = "SELECT session_page, session_logged_in, session_time, session_ip, session_start
FROM " . SESSIONS_TABLE . "
WHERE session_logged_in = 0
AND session_time >= " . ( time() - 300 ) . "
ORDER BY session_time DESC";
if(!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Couldn't obtain guest user/online information.", "", __LINE__, __FILE__, $sql);
}
$onlinerow_guest = $db->sql_fetchrowset($result);

$sql = "SELECT forum_name, forum_id
FROM " . FORUMS_TABLE;
if($forums_result = $db->sql_query($sql))
{
while($forumsrow = $db->sql_fetchrow($forums_result))
{
$forum_data[$forumsrow['forum_id']] = $forumsrow['forum_name'];
}
}
else
{
message_die(GENERAL_ERROR, "Couldn't obtain user/online forums information.", "", __LINE__, __FILE__, $sql);
}

$reg_userid_ary = array();

if( count($onlinerow_reg) )
{
$registered_users = 0;

for($i = 0; $i < count($onlinerow_reg); $i++)
{
if( !inarray($onlinerow_reg[$i]['user_id'], $reg_userid_ary) )
{
$reg_userid_ary[] = $onlinerow_reg[$i]['user_id'];

$username = $onlinerow_reg[$i]['username'];

if( $onlinerow_reg[$i]['user_allow_viewonline'] || $userdata['user_level'] == ADMIN )
{
$registered_users++;
$hidden = FALSE;
}
else
{
$hidden_users++;
$hidden = TRUE;
}

if( $onlinerow_reg[$i]['user_session_page'] < 1 )
{
switch($onlinerow_reg[$i]['user_session_page'])
{
case PAGE_INDEX:
$location = $lang['Forum_index'];
$location_url = "index.$phpEx?pane=right";
break;
case PAGE_POSTING:
$location = $lang['Posting_message'];
$location_url = "index.$phpEx?pane=right";
break;
case PAGE_LOGIN:
$location = $lang['Logging_on'];
$location_url = "index.$phpEx?pane=right";
break;
case PAGE_SEARCH:
$location = $lang['Searching_forums'];
$location_url = "index.$phpEx?pane=right";
break;
case PAGE_PROFILE:
$location = $lang['Viewing_profile'];
$location_url = "index.$phpEx?pane=right";
break;
case PAGE_VIEWONLINE:
$location = $lang['Viewing_online'];
$location_url = "index.$phpEx?pane=right";
break;
case PAGE_VIEWMEMBERS:
$location = $lang['Viewing_member_list'];
$location_url = "index.$phpEx?pane=right";
break;
case PAGE_PRIVMSGS:
$location = $lang['Viewing_priv_msgs'];
$location_url = "index.$phpEx?pane=right";
break;
case PAGE_FAQ:
$location = $lang['Viewing_FAQ'];
$location_url = "index.$phpEx?pane=right";
break;
case PAGE_ACTIVITY:
$location = $lang['Activity'];
$location_url = "activity.$phpEx";
break;
case PAGE_ALBUM:
$location = $lang['Album'];
$location_url = "index.$phpEx?pane=right";
break;
default:
$location = $lang['Forum_index'];
$location_url = "index.$phpEx?pane=right";
}
}
else
{
$location_url = append_sid("admin_forums.$phpEx?mode=editforum&" . POST_FORUM_URL . "=" . $onlinerow_reg[$i]['user_session_page']);
$location = $forum_data[$onlinerow_reg[$i]['user_session_page']];
}

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

$reg_ip = decode_ip($onlinerow_reg[$i]['session_ip']);

$template->assign_block_vars("reg_user_row", array(
"ROW_COLOR" => "#" . $row_color,
"ROW_CLASS" => $row_class,
"USERNAME" => $username,
"STARTED" => create_date($board_config['default_dateformat'], $onlinerow_reg[$i]['session_start'], $board_config['board_timezone']),
"LASTUPDATE" => create_date($board_config['default_dateformat'], $onlinerow_reg[$i]['user_session_time'], $board_config['board_timezone']),
"FORUM_LOCATION" => $location,
"IP_ADDRESS" => $reg_ip,

"U_WHOIS_IP" => "http://network-tools.com/default.asp?host=$reg_ip",
"U_USER_PROFILE" => append_sid("admin_users.$phpEx?mode=edit&" . POST_USERS_URL . "=" . $onlinerow_reg[$i]['user_id']),
"U_FORUM_LOCATION" => append_sid($location_url))
);
}
}

}
else
{
$template->assign_vars(array(
"L_NO_REGISTERED_USERS_BROWSING" => $lang['No_users_browsing'])
);
}

//
// Guest users
//
if( count($onlinerow_guest) )
{
$guest_users = 0;

for($i = 0; $i < count($onlinerow_guest); $i++)
{
$guest_userip_ary[] = $onlinerow_guest[$i]['session_ip'];
$guest_users++;

if( $onlinerow_guest[$i]['session_page'] < 1 )
{
switch( $onlinerow_guest[$i]['session_page'] )
{
case PAGE_INDEX:
$location = $lang['Forum_index'];
$location_url = "index.$phpEx?pane=right";
break;
case PAGE_POSTING:
$location = $lang['Posting_message'];
$location_url = "index.$phpEx?pane=right";
break;
case PAGE_LOGIN:
$location = $lang['Logging_on'];
$location_url = "index.$phpEx?pane=right";
break;
case PAGE_SEARCH:
$location = $lang['Searching_forums'];
$location_url = "index.$phpEx?pane=right";
break;
case PAGE_PROFILE:
$location = $lang['Viewing_profile'];
$location_url = "index.$phpEx?pane=right";
break;
case PAGE_VIEWONLINE:
$location = $lang['Viewing_online'];
$location_url = "index.$phpEx?pane=right";
break;
case PAGE_VIEWMEMBERS:
$location = $lang['Viewing_member_list'];
$location_url = "index.$phpEx?pane=right";
break;
case PAGE_PRIVMSGS:
$location = $lang['Viewing_priv_msgs'];
$location_url = "index.$phpEx?pane=right";
break;
case PAGE_FAQ:
$location = $lang['Viewing_FAQ'];
$location_url = "index.$phpEx?pane=right";
break;
default:
$location = $lang['Forum_index'];
$location_url = "index.$phpEx?pane=right";
}
}
else
{
$location_url = append_sid("admin_forums.$phpEx?mode=editforum&" . POST_FORUM_URL . "=" . $onlinerow_guest[$i]['session_page']);
$location = $forum_data[$onlinerow_guest[$i]['session_page']];
}

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

$guest_ip = decode_ip($onlinerow_guest[$i]['session_ip']);

$template->assign_block_vars("guest_user_row", array(
"ROW_COLOR" => "#" . $row_color,
"ROW_CLASS" => $row_class,
"USERNAME" => $lang['Guest'],
"STARTED" => create_date($board_config['default_dateformat'], $onlinerow_guest[$i]['session_start'], $board_config['board_timezone']),
"LASTUPDATE" => create_date($board_config['default_dateformat'], $onlinerow_guest[$i]['session_time'], $board_config['board_timezone']),
"FORUM_LOCATION" => $location,
"IP_ADDRESS" => $guest_ip,

"U_WHOIS_IP" => "http://network-tools.com/default.asp?host=$guest_ip",
"U_FORUM_LOCATION" => append_sid($location_url))
);
}

}
else
{
$template->assign_vars(array(
"L_NO_GUESTS_BROWSING" => $lang['No_users_browsing'])
);
}

$template->pparse("body");

include('./page_footer_admin.'.$phpEx);

}
else
{
//
// Generate frameset
//
$template->set_filenames(array(
"body" => "admin/index_frameset.tpl")
);

$template->assign_vars(array(
"S_FRAME_NAV" => append_sid("index.$phpEx?pane=left"),
"S_FRAME_MAIN" => append_sid("index.$phpEx?pane=right"))
);

header ("Expires: " . gmdate("D, d M Y H:i:s", time()) . " GMT");
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");

$template->pparse("body");

$db->sql_close();
exit;

}

?>


Some of the code in the files may look out of place, and they are, but they were like that before the editing.

What'd I do wrong?

Posted: Thu Sep 09, 2004 12:35 am
by markus_petrux
onigumo:

Please, edit your post and remove all the code. Restore your backups and re-try carefully following each step. It would be much better if you use EasyMOD to install this MOD. It works like a charm.

If still in trouble, then please try to describe the problem, rather than posting code. I can only try to follow "small" pieces of code posted in forums. I'm human. :roll: :wink:

Posted: Thu Sep 09, 2004 1:48 am
by onigumo
Edited post. I hope I highlighted all the proper code in red color correctly.

Posted: Thu Sep 09, 2004 2:36 am
by Zeyr
I have confirmation from a friend that AdMuncher blocks this mod from working. I installed it on our test board and she never saw the changes, we narrowed it down to AdMuncher. With that disabled you will see the mod, with AdMuncher running you won't see the panels collapse and slide.

All around excellent mod, and much loved by me :D

Posted: Thu Sep 09, 2004 3:41 am
by Shof515
Whats AdMuncher?..and i think thats whats making this mod not work

Posted: Thu Sep 09, 2004 9:19 am
by markus_petrux
onigumo wrote: Edited post. I hope I highlighted all the proper code in red color correctly.

Problem seems to be here:
<table width="100%" cellpadding="4" cellspacing="1" border="0" class="bodyline"><!-- BEGIN modulerow -->

That HTML comment is actually a phpBB template statement. It should be placed in its own line.

Edited: And here:
</tr> <!-- END catrow -->

Posted: Thu Sep 09, 2004 9:22 am
by markus_petrux
Yeah! Zeyr, I have no idea what "AdMuncher" is. Do you have a link or any other additional reference.
Please, PM it (to avoid any possible conflict with phpBB rules). Thank you.

Shof515: Thanks ;)