From: <dj...@us...> - 2012-02-06 14:52:02
|
Revision: 8892 http://xoops.svn.sourceforge.net/xoops/?rev=8892&view=rev Author: djculex Date: 2012-02-06 14:51:51 +0000 (Mon, 06 Feb 2012) Log Message: ----------- Standardising code - Shorten lines to max 80 characters - Renaming variables to fix /^[a-z_][a-zA-Z0-9]*$/ - Removing unused globals - Indenting properly Modified Paths: -------------- XoopsModules/smallworld/trunk/smallworld/admin/about.php XoopsModules/smallworld/trunk/smallworld/admin/admin_footer.php XoopsModules/smallworld/trunk/smallworld/admin/admin_header.php XoopsModules/smallworld/trunk/smallworld/admin/admintool.php XoopsModules/smallworld/trunk/smallworld/admin/div_useradmin.php XoopsModules/smallworld/trunk/smallworld/admin/help.php XoopsModules/smallworld/trunk/smallworld/admin/index.php XoopsModules/smallworld/trunk/smallworld/admin/main.php XoopsModules/smallworld/trunk/smallworld/admin/menu.php XoopsModules/smallworld/trunk/smallworld/admin/moduleinfo.php XoopsModules/smallworld/trunk/smallworld/admin/useradmin.php Removed Paths: ------------- XoopsModules/smallworld/trunk/smallworld/admin/admin_header2.php Modified: XoopsModules/smallworld/trunk/smallworld/admin/about.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/admin/about.php 2012-02-06 14:06:57 UTC (rev 8891) +++ XoopsModules/smallworld/trunk/smallworld/admin/about.php 2012-02-06 14:51:51 UTC (rev 8892) @@ -1,30 +1,36 @@ <?php /** * You may not change or alter any portion of this comment or credits -* of supporting developers from this source code or any supporting source code -* which is considered copyrighted (c) material of the original comment or credit authors. +* of supporting developers from this source code or any supporting +* source code which is considered copyrighted (c) material of the +* original comment or credit authors. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * -* @copyright: The XOOPS Project http://sourceforge.net/projects/xoops/ -* @license: http://www.fsf.org/copyleft/gpl.html GNU public license -* @module: Smallworld -* @Author: Michael Albertsen (http://culex.dk) <cu...@cu...> -* @copyright: 2011 Culex -* @Repository path: $HeadURL$ -* @Last committed: $Revision$ -* @Last changed by: $Author$ -* @Last changed date: $Date$ -* @ID: $Id$ +* @copyright: The XOOPS Project http://sourceforge.net/projects/xoops/ +* @license: http://www.fsf.org/copyleft/gpl.html GNU public license +* @packet: Modules +* @sub-packet: Smallworld +* @since: Xoops 2.5.4 +* @Author: Michael Albertsen (http://culex.dk) <cu...@cu...> +* @copyright: 2011 Culex +* @Last committed: $Revision$ +* @Last changed by: $Author$ +* @Last changed date: $Date$ +* @ID: $Id$ **/ - + include_once dirname(__FILE__) . '/admin_header.php'; xoops_cp_header(); global $xoTheme; -$xoTheme->addStylesheet(XOOPS_URL . '/modules/smallworld/css/SmallworldAdmin.css'); -$xoTheme->addScript(XOOPS_URL . '/modules/smallworld/js/adminsmallworld.js'); +$xoTheme->addStylesheet( + XOOPS_URL . '/modules/smallworld/css/SmallworldAdmin.css' +); +$xoTheme->addScript( + XOOPS_URL . '/modules/smallworld/js/adminsmallworld.js' +); $aboutAdmin = new ModuleAdmin(); Modified: XoopsModules/smallworld/trunk/smallworld/admin/admin_footer.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/admin/admin_footer.php 2012-02-06 14:06:57 UTC (rev 8891) +++ XoopsModules/smallworld/trunk/smallworld/admin/admin_footer.php 2012-02-06 14:51:51 UTC (rev 8892) @@ -1,32 +1,36 @@ <?php /** * You may not change or alter any portion of this comment or credits -* of supporting developers from this source code or any supporting source code -* which is considered copyrighted (c) material of the original comment or credit authors. +* of supporting developers from this source code or any supporting +* source code which is considered copyrighted (c) material of the +* original comment or credit authors. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * -* @copyright: The XOOPS Project http://sourceforge.net/projects/xoops/ -* @license: http://www.fsf.org/copyleft/gpl.html GNU public license -* @module: Smallworld -* @Author: Michael Albertsen (http://culex.dk) <cu...@cu...> -* @copyright: 2011 Culex -* @Repository path: $HeadURL$ -* @Last committed: $Revision$ -* @Last changed by: $Author$ -* @Last changed date: $Date$ -* @ID: $Id$ +* @copyright: The XOOPS Project http://sourceforge.net/projects/xoops/ +* @license: http://www.fsf.org/copyleft/gpl.html GNU public license +* @packet: Modules +* @sub-packet: Smallworld +* @since: Xoops 2.5.4 +* @Author: Michael Albertsen (http://culex.dk) <cu...@cu...> +* @copyright: 2011 Culex +* @Last committed: $Revision$ +* @Last changed by: $Author$ +* @Last changed date: $Date$ +* @ID: $Id$ **/ echo "<div class='adminfooter'>\n" - ." <div style='text-align: center;'>\n" - ." <a href='http://www.xoops.org' target='_blank'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n" - ." </div>\n" - ." " . _AM_SMALLWORLD_FOOTER . "\n" - ."</div>"; + . " <div style='text-align: center;'>\n" + . " <a href='http://www.xoops.org' target='_blank'>" + . "<img src='" . $pathIconBig . "/xoopsmicrobutton.gif' " + . "alt='XOOPS' title='XOOPS'></a>\n" + . " </div>\n" + . " " . _AM_SMALLWORLD_FOOTER . "\n" + . "</div>"; -echo "<span style='margin: 27%; height: 50px; position: relative;'>"._AM_SMALLWORLD_SP."</span>"; +echo "<span style='margin: 27%; height: 50px; position: relative;'>" + . _AM_SMALLWORLD_SP."</span>"; - xoops_cp_footer(); \ No newline at end of file Modified: XoopsModules/smallworld/trunk/smallworld/admin/admin_header.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/admin/admin_header.php 2012-02-06 14:06:57 UTC (rev 8891) +++ XoopsModules/smallworld/trunk/smallworld/admin/admin_header.php 2012-02-06 14:51:51 UTC (rev 8892) @@ -1,38 +1,41 @@ <?php /** * You may not change or alter any portion of this comment or credits -* of supporting developers from this source code or any supporting source code -* which is considered copyrighted (c) material of the original comment or credit authors. +* of supporting developers from this source code or any supporting +* source code which is considered copyrighted (c) material of the +* original comment or credit authors. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * -* @copyright: The XOOPS Project http://sourceforge.net/projects/xoops/ -* @license: http://www.fsf.org/copyleft/gpl.html GNU public license -* @module: Smallworld -* @Author: Michael Albertsen (http://culex.dk) <cu...@cu...> -* @copyright: 2011 Culex -* @Repository path: $HeadURL$ -* @Last committed: $Revision$ -* @Last changed by: $Author$ -* @Last changed date: $Date$ -* @ID: $Id$ +* @copyright: The XOOPS Project http://sourceforge.net/projects/xoops/ +* @license: http://www.fsf.org/copyleft/gpl.html GNU public license +* @packet: Modules +* @sub-packet: Smallworld +* @since: Xoops 2.5.4 +* @Author: Michael Albertsen (http://culex.dk) <cu...@cu...> +* @copyright: 2011 Culex +* @Last committed: $Revision$ +* @Last changed by: $Author$ +* @Last changed date: $Date$ +* @ID: $Id$ **/ $path = dirname(dirname(dirname(dirname(__FILE__)))); -include_once $path . '/mainfile.php'; -include_once $path . '/include/cp_functions.php'; -include_once $path . '/kernel/module.php'; +require_once $path . '/mainfile.php'; +require_once $path . '/include/cp_functions.php'; +require_once $path . '/kernel/module.php'; require_once $path . '/include/cp_header.php'; global $xoopsModule; $pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin'); -$pathIcon16 = '../' . $xoopsModule->getInfo('icons16'); -$pathIcon32 = '../' . $xoopsModule->getInfo('icons32'); +$pathIconSmall = '../' . $xoopsModule->getInfo('icons16'); +$pathIconBig = '../' . $xoopsModule->getInfo('icons32'); +$modAurl = '/Frameworks/moduleclasses/moduleadmin/moduleadmin.php'; -if (file_exists($GLOBALS['xoops']->path('/Frameworks/moduleclasses/moduleadmin/moduleadmin.php'))) { - include_once $GLOBALS['xoops']->path('/Frameworks/moduleclasses/moduleadmin/moduleadmin.php'); +if (file_exists($GLOBALS['xoops']->path($modAurl))) { + require_once $GLOBALS['xoops']->path($modAurl); } else { redirect_header("../../../admin.php", 5, _AM_MODULEADMIN_MISSING, false); } Deleted: XoopsModules/smallworld/trunk/smallworld/admin/admin_header2.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/admin/admin_header2.php 2012-02-06 14:06:57 UTC (rev 8891) +++ XoopsModules/smallworld/trunk/smallworld/admin/admin_header2.php 2012-02-06 14:51:51 UTC (rev 8892) @@ -1,44 +0,0 @@ -<?php -/** -* You may not change or alter any portion of this comment or credits -* of supporting developers from this source code or any supporting source code -* which is considered copyrighted (c) material of the original comment or credit authors. -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -* -* @copyright: The XOOPS Project http://sourceforge.net/projects/xoops/ -* @license: http://www.fsf.org/copyleft/gpl.html GNU public license -* @module: Smallworld -* @Author: Michael Albertsen (http://culex.dk) <cu...@cu...> -* @copyright: 2011 Culex -* @Repository path: $HeadURL$ -* @Last committed: $Revision$ -* @Last changed by: $Author$ -* @Last changed date: $Date$ -* @ID: $Id$ -**/ - - include '../../../mainfile.php'; - include_once XOOPS_ROOT_PATH.'/class/xoopsmodule.php'; - include XOOPS_ROOT_PATH.'/include/cp_functions.php'; - if ( $xoopsUser ) { - $xoopsModule = XoopsModule::getByDirname("smallworld"); - - if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) { - redirect_header(XOOPS_URL."/",2,_NOPERM); - exit(); - } - } - else { - redirect_header(XOOPS_URL."/",2,_NOPERM); - exit(); - } - - if ( file_exists("../language/".$xoopsConfig['language']."/admin.php") ) { - include("../language/".$xoopsConfig['language']."/admin.php"); - } - else { - include("../language/english/admin.php"); - } -?> \ No newline at end of file Modified: XoopsModules/smallworld/trunk/smallworld/admin/admintool.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/admin/admintool.php 2012-02-06 14:06:57 UTC (rev 8891) +++ XoopsModules/smallworld/trunk/smallworld/admin/admintool.php 2012-02-06 14:51:51 UTC (rev 8892) @@ -1,55 +1,68 @@ <?php /** * You may not change or alter any portion of this comment or credits -* of supporting developers from this source code or any supporting source code -* which is considered copyrighted (c) material of the original comment or credit authors. +* of supporting developers from this source code or any supporting +* source code which is considered copyrighted (c) material of the +* original comment or credit authors. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * -* @copyright: The XOOPS Project http://sourceforge.net/projects/xoops/ -* @license: http://www.fsf.org/copyleft/gpl.html GNU public license -* @module: Smallworld -* @Author: Michael Albertsen (http://culex.dk) <cu...@cu...> -* @copyright: 2011 Culex -* @Repository path: $HeadURL$ -* @Last committed: $Revision$ -* @Last changed by: $Author$ -* @Last changed date: $Date$ -* @ID: $Id$ +* @copyright: The XOOPS Project http://sourceforge.net/projects/xoops/ +* @license: http://www.fsf.org/copyleft/gpl.html GNU public license +* @packet: Modules +* @sub-packet: Smallworld +* @since: Xoops 2.5.4 +* @Author: Michael Albertsen (http://culex.dk) <cu...@cu...> +* @copyright: 2011 Culex +* @Last committed: $Revision$ +* @Last changed by: $Author$ +* @Last changed date: $Date$ +* @ID: $Id$ **/ +require_once(XOOPS_ROOT_PATH."/modules/smallworld/include/functions.php"); +require_once(XOOPS_ROOT_PATH."/modules/smallworld/class/class_collector.php"); require_once 'admin_header.php'; -global $xoopsDB, $xoTheme, $xoopsLogger ; +global $xoopsDB, $xoopsLogger; + $xoopsLogger->activated = false; -include_once(XOOPS_ROOT_PATH."/modules/smallworld/include/functions.php"); -include_once(XOOPS_ROOT_PATH."/modules/smallworld/class/class_collector.php"); if ($_POST['type'] == 'addtime') { - $userid = intval($_POST['userid']); - $amount = intval($_POST['amount']); - $test = "SELECT * FROM ".$xoopsDB->prefix('smallworld_admin')." WHERE userid = '".$userid."' AND (inspect_start+inspect_stop) > ".time().""; - $result = $xoopsDB->queryF($test); - if ($xoopsDB->getRowsNum($result) < 1) { - $sql = "UPDATE ".$xoopsDB->prefix('smallworld_admin')." SET inspect_start = '".time()."', inspect_stop = '".$amount."' WHERE userid='".$userid."'"; - $result = $xoopsDB->queryF($sql); - } else { - $sql = "UPDATE ".$xoopsDB->prefix('smallworld_admin')." SET inspect_stop = (inspect_stop + ".$amount.") WHERE userid='".$userid."'"; - $result = $xoopsDB->queryF($sql); - } - + $userid = intval($_POST['userid']); + $amount = intval($_POST['amount']); + $test = "SELECT * FROM " + . $xoopsDB->prefix('smallworld_admin') + . " WHERE userid = '".$userid + . "' AND (inspect_start+inspect_stop) > ".time().""; + $result = $xoopsDB->queryF($test); + if ($xoopsDB->getRowsNum($result) < 1) { + $sql = "UPDATE ".$xoopsDB->prefix('smallworld_admin') + . " SET inspect_start = '".time() + . "', inspect_stop = '".$amount + . "' WHERE userid='".$userid."'"; + $result = $xoopsDB->queryF($sql); + } else { + $sql = "UPDATE ".$xoopsDB->prefix('smallworld_admin') + . " SET inspect_stop = (inspect_stop + " + . $amount.") WHERE userid='" + . $userid."'"; + $result = $xoopsDB->queryF($sql); + } + } if ($_POST['type'] == 'deletetime') { - $sql = "UPDATE ".$xoopsDB->prefix('smallworld_admin')." SET inspect_start = '', inspect_stop = '' WHERE userid='".intval($_POST['deluserid'])."'"; - $result = $xoopsDB->queryF($sql); + $sql = "UPDATE ".$xoopsDB->prefix('smallworld_admin') + . " SET inspect_start = '', inspect_stop = '' WHERE userid='" + . intval($_POST['deluserid'])."'"; + $result = $xoopsDB->queryF($sql); } if ($_POST['type'] == 'deleteUser') { - $db = new SmallWorldDB; - - $userid = intval($_POST['deluserid']); - $db->deleteAccount ($userid); - -} -?> \ No newline at end of file + $db = new SmallWorldDB; + + $userid = intval($_POST['deluserid']); + $db->deleteAccount($userid); + +} \ No newline at end of file Modified: XoopsModules/smallworld/trunk/smallworld/admin/div_useradmin.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/admin/div_useradmin.php 2012-02-06 14:06:57 UTC (rev 8891) +++ XoopsModules/smallworld/trunk/smallworld/admin/div_useradmin.php 2012-02-06 14:51:51 UTC (rev 8892) @@ -1,72 +1,86 @@ <?php /** * You may not change or alter any portion of this comment or credits -* of supporting developers from this source code or any supporting source code -* which is considered copyrighted (c) material of the original comment or credit authors. +* of supporting developers from this source code or any supporting +* source code which is considered copyrighted (c) material of the +* original comment or credit authors. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * -* @copyright: The XOOPS Project http://sourceforge.net/projects/xoops/ -* @license: http://www.fsf.org/copyleft/gpl.html GNU public license -* @module: Smallworld -* @Author: Michael Albertsen (http://culex.dk) <cu...@cu...> -* @copyright: 2011 Culex -* @Repository path: $HeadURL$ -* @Last committed: $Revision$ -* @Last changed by: $Author$ -* @Last changed date: $Date$ -* @ID: $Id$ +* @copyright: The XOOPS Project http://sourceforge.net/projects/xoops/ +* @license: http://www.fsf.org/copyleft/gpl.html GNU public license +* @packet: Modules +* @sub-packet: Smallworld +* @since: Xoops 2.5.4 +* @Author: Michael Albertsen (http://culex.dk) <cu...@cu...> +* @copyright: 2011 Culex +* @Last committed: $Revision$ +* @Last changed by: $Author$ +* @Last changed date: $Date$ +* @ID: $Id$ **/ require_once 'admin_header.php'; -global $xoopsDB, $xoTheme, $xoopsLogger ; +require_once(XOOPS_ROOT_PATH."/modules/smallworld/include/functions.php"); +require_once(XOOPS_ROOT_PATH."/modules/smallworld/class/class_collector.php"); +global $xoopsLogger; $xoopsLogger->activated = false; -include_once(XOOPS_ROOT_PATH."/modules/smallworld/include/functions.php"); -include_once(XOOPS_ROOT_PATH."/modules/smallworld/class/class_collector.php"); -$Tpl = new XoopsTpl(); +$tpl = new XoopsTpl(); $admin = new SmallworldAdmin(); -$allusers_inspect = $admin->getAllUsers('yes'); - if (!empty($allusers_inspect)) { - foreach ($allusers_inspect as $data) { - $ai['id'] = $data['id']; - $ai['userid'] = $data['userid']; - $ai['username'] = $data['username']; - $ai['realname'] = $data['realname']; - $ai['userimage'] = smallworld_getAvatarLink ($data['userid'],$data['userimage']); - $ai['avatar_size'] = getimagesize($ai['userimage']); - $ai['avatar_highwide'] = smallworld_imageResize($ai['avatar_size'][0], $ai['avatar_size'][1], 50); - $ai['ip'] = $data['ip']; - $ai['complaint'] = $data['complaint']; - $ai['inspect_start'] = $data['inspect_start']; - $ai['inspect_stop'] = $data['inspect_stop']; - $ai['userinspect_timetotal'] = ($data['inspect_start'] + $data['inspect_stop'])-time(); - $Tpl->append('allusersinspect', $ai); - } - } - $Tpl->assign('allusersinspectcounter',count($ai)); +$allusersInspect = $admin->getAllUsers('yes'); + if (!empty($allusersInspect)) { + foreach ($allusersInspect as $data) { + $ai['id'] = $data['id']; + $ai['userid'] = $data['userid']; + $ai['username'] = $data['username']; + $ai['realname'] = $data['realname']; + $ai['userimage'] = smallworld_getAvatarLink( + $data['userid'], $data['userimage'] + ); + $ai['avatar_size'] = getimagesize($ai['userimage']); + $ai['avatar_highwide'] = smallworld_imageResize( + $ai['avatar_size'][0], $ai['avatar_size'][1], 50 + ); + $ai['ip'] = $data['ip']; + $ai['complaint'] = $data['complaint']; + $ai['inspect_start'] = $data['inspect_start']; + $ai['inspect_stop'] = $data['inspect_stop']; + $ai['userinspect_timetotal'] = ($data['inspect_start'] + + $data['inspect_stop']) - time(); + $tpl->append('allusersinspect', $ai); + } + } + $tpl->assign('allusersinspectcounter', count($ai)); -$allusers_noinspect = $admin->getAllUsers('no'); - if (!empty($allusers_noinspect)) { - foreach ($allusers_noinspect as $data) { - $ani['id'] = $data['id']; - $ani['userid'] = $data['userid']; - $ani['username'] = $data['username']; - $ani['realname'] = $data['realname']; - $ani['userimage'] = smallworld_getAvatarLink ($data['userid'],$data['userimage']); - $ani['avatar_size'] = getimagesize($ani['userimage']); - $ani['avatar_highwide'] = smallworld_imageResize($ani['avatar_size'][0], $ani['avatar_size'][1], 50); - $ani['ip'] = $data['ip']; - $ani['complaint'] = $data['complaint']; - $ani['inspect_start'] = ''; - $ani['inspect_stop'] = ''; - $ani['userinspect_timetotal'] = ''; - $Tpl->append('allusersnoinspect', $ani); - } - } - $Tpl->assign('allusersnoinspectcounter',count($ani)); +$allusersNoinspect = $admin->getAllUsers('no'); + if (!empty($allusersNoinspect)) { + foreach ($allusersNoinspect as $data) { + $ani['id'] = $data['id']; + $ani['userid'] = $data['userid']; + $ani['username'] = $data['username']; + $ani['realname'] = $data['realname']; + $ani['userimage'] = smallworld_getAvatarLink( + $data['userid'], $data['userimage'] + ); + $ani['avatar_size'] = getimagesize($ani['userimage']); + $ani['avatar_highwide'] = smallworld_imageResize( + $ani['avatar_size'][0], $ani['avatar_size'][1], 50 + ); + $ani['ip'] = $data['ip']; + $ani['complaint'] = $data['complaint']; + $ani['inspect_start'] = ''; + $ani['inspect_stop'] = ''; + $ani['userinspect_timetotal'] = ''; + $tpl->append('allusersnoinspect', $ani); + } + } + $tpl->assign('allusersnoinspectcounter', count($ani)); -$Tpl->display(XOOPS_ROOT_PATH .'/modules/smallworld/templates/smallworld_alluserstodiv.html'); -?> \ No newline at end of file +$tpl->display( + XOOPS_ROOT_PATH + . '/modules/smallworld/templates/' + . 'smallworld_alluserstodiv.html' +); \ No newline at end of file Modified: XoopsModules/smallworld/trunk/smallworld/admin/help.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/admin/help.php 2012-02-06 14:06:57 UTC (rev 8891) +++ XoopsModules/smallworld/trunk/smallworld/admin/help.php 2012-02-06 14:51:51 UTC (rev 8892) @@ -1,64 +1,121 @@ <?php /** * You may not change or alter any portion of this comment or credits -* of supporting developers from this source code or any supporting source code -* which is considered copyrighted (c) material of the original comment or credit authors. +* of supporting developers from this source code or any supporting +* source code which is considered copyrighted (c) material of the +* original comment or credit authors. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * -* @copyright: The XOOPS Project http://sourceforge.net/projects/xoops/ -* @license: http://www.fsf.org/copyleft/gpl.html GNU public license -* @module: Smallworld -* @Author: Michael Albertsen (http://culex.dk) <cu...@cu...> -* @copyright: 2011 Culex -* @Repository path: $HeadURL$ -* @Last committed: $Revision$ -* @Last changed by: $Author$ -* @Last changed date: $Date$ -* @ID: $Id$ +* @copyright: The XOOPS Project http://sourceforge.net/projects/xoops/ +* @license: http://www.fsf.org/copyleft/gpl.html GNU public license +* @packet: Modules +* @sub-packet: Smallworld +* @since: Xoops 2.5.4 +* @Author: Michael Albertsen (http://culex.dk) <cu...@cu...> +* @copyright: 2011 Culex +* @Last committed: $Revision$ +* @Last changed by: $Author$ +* @Last changed date: $Date$ +* @ID: $Id$ **/ require_once 'admin_header.php'; require_once '../../../include/cp_header.php'; -include_once(XOOPS_ROOT_PATH."/modules/smallworld/include/functions.php"); -include_once(XOOPS_ROOT_PATH."/modules/smallworld/class/class_collector.php"); - +require_once(XOOPS_ROOT_PATH . "/modules/smallworld/include/functions.php"); +require_once( + XOOPS_ROOT_PATH . "/modules/smallworld/class/class_collector.php" +); require_once XOOPS_ROOT_PATH . '/class/template.php'; -if (!isset($xoopsTpl)) {$xoopsTpl = new XoopsTpl();} -$xoopsTpl->xoops_setCaching(0); +if (!isset($xoopsTpl)) { + $xoopsTpl = new XoopsTpl(); +} + +$xoopsTpl->caching = 0; xoops_cp_header(); +global $xoTheme; -$admin = new SmallworldAdmin(); -$tpl = new XoopsTpl(); +// template assignments + + // help file from admin + $xoopsTpl->assign( + 'lang_hlp_requirements_t', + _AM_SMALLWORLD_HELP_HEADER_REQUIREMENTS + ); + + $xoopsTpl->assign( + 'lang_hlp_requirements', + _AM_SMALLWORLD_HELP_REQUIREMENTS + ); + + $xoopsTpl->assign( + 'lang_hlp_recommended_t', + _AM_SMALLWORLD_HELP_HEADER_RECOMMENDED + ); + + $xoopsTpl->assign( + 'lang_hlp_recommended', + _AM_SMALLWORLD_HELP_RECOMMENDED + ); + + $xoopsTpl->assign( + 'lang_hlp_installation_t', + _AM_SMALLWORLD_HELP_HEADER_INSTALLATION + ); + + $xoopsTpl->assign( + 'lang_hlp_firsttime', + _AM_SMALLWORLD_HELP_FIRSTTIMEINSTALL + ); + + $xoopsTpl->assign( + 'lang_hlp_hostedplatform_t', + _AM_SMALLWORLD_HELP_HEADER_HOSTED_PLATFORM + ); + + $xoopsTpl->assign( + 'lang_hlp_hostedplatform', + _AM_SMALLWORLD_HELP_HOSTED_PLATFORM + ); + + $xoopsTpl->assign( + 'lang_hlp_upgrading_t', + _AM_SMALLWORLD_HELP_HEADER_UPGRADING + ); + + $xoopsTpl->assign( + 'lang_hlp_upgrading', + _AM_SMALLWORLD_HELP_UPGRADING + ); + -// template assignments - $xoopsTpl->assign('lang_help',_AM_SMALLWORLD_HELP); - - // help file from admin - $xoopsTpl->assign('lang_hlp_about',_AM_SMALLWORLD_HELP_ABOUT); - $xoopsTpl->assign('lang_hlp_preface',_AM_SMALLWORLD_HELP_PREFACE); - $xoopsTpl->assign('lang_hlp_requirements_t',_AM_SMALLWORLD_HELP_HEADER_REQUIREMENTS); - $xoopsTpl->assign('lang_hlp_requirements',_AM_SMALLWORLD_HELP_REQUIREMENTS); - $xoopsTpl->assign('lang_hlp_recommended_t',_AM_SMALLWORLD_HELP_HEADER_RECOMMENDED); - $xoopsTpl->assign('lang_hlp_recommended',_AM_SMALLWORLD_HELP_RECOMMENDED); - $xoopsTpl->assign('lang_hlp_installation_t',_AM_SMALLWORLD_HELP_HEADER_INSTALLATION); - $xoopsTpl->assign('lang_hlp_firsttime',_AM_SMALLWORLD_HELP_FIRSTTIMEINSTALL); - $xoopsTpl->assign('lang_hlp_hostedplatform_t',_AM_SMALLWORLD_HELP_HEADER_HOSTED_PLATFORM); - $xoopsTpl->assign('lang_hlp_hostedplatform',_AM_SMALLWORLD_HELP_HOSTED_PLATFORM); - $xoopsTpl->assign('lang_hlp_upgrading_t',_AM_SMALLWORLD_HELP_HEADER_UPGRADING); - $xoopsTpl->assign('lang_hlp_upgrading',_AM_SMALLWORLD_HELP_UPGRADING); - $xoopsTpl->assign('lang_hlp_faq_t',_AM_SMALLWORLD_HELP_HEADER_FAQ); - $xoopsTpl->assign('lang_hlp_commen1_t',_AM_SMALLWORLD_HELP_HEADER_COMMENPROBLEMS1); - $xoopsTpl->assign('lang_hlp_commen1',_AM_SMALLWORLD_HELP_COMMENPROBLEMS1); - $xoopsTpl->assign('lang_hlp_contacts_t',_AM_SMALLWORLD_HELP_HEADER_CONTACTS); - $xoopsTpl->assign('lang_hlp_otherhelp',_AM_SMALLWORLD_HELP_OTHERHELP); - - $xoopsTpl->display(XOOPS_ROOT_PATH .'/modules/smallworld/templates/admin_help.html'); - - global $xoTheme; - $xoTheme->addStyleSheet('modules/smallworld/css/SmallworldAdmin.css'); - -xoops_cp_footer(); -?> + $xoopsTpl->assign( + 'lang_hlp_commen1_t', + _AM_SMALLWORLD_HELP_HEADER_COMMENPROBLEMS1 + ); + + $xoopsTpl->assign( + 'lang_hlp_commen1', + _AM_SMALLWORLD_HELP_COMMENPROBLEMS1 + ); + + $xoopsTpl->assign( + 'lang_hlp_contacts_t', + _AM_SMALLWORLD_HELP_HEADER_CONTACTS + ); + + $xoopsTpl->assign('lang_help', _AM_SMALLWORLD_HELP); + $xoopsTpl->assign('lang_hlp_about', _AM_SMALLWORLD_HELP_ABOUT); + $xoopsTpl->assign('lang_hlp_preface', _AM_SMALLWORLD_HELP_PREFACE); + $xoopsTpl->assign('lang_hlp_faq_t', _AM_SMALLWORLD_HELP_HEADER_FAQ); + $xoopsTpl->assign('lang_hlp_otherhelp', _AM_SMALLWORLD_HELP_OTHERHELP); + + $xoTheme->addStyleSheet('modules/smallworld/css/SmallworldAdmin.css'); + + $xoopsTpl->display( + XOOPS_ROOT_PATH .'/modules/smallworld/templates/admin_help.html' + ); + +xoops_cp_footer(); \ No newline at end of file Modified: XoopsModules/smallworld/trunk/smallworld/admin/index.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/admin/index.php 2012-02-06 14:06:57 UTC (rev 8891) +++ XoopsModules/smallworld/trunk/smallworld/admin/index.php 2012-02-06 14:51:51 UTC (rev 8892) @@ -1,201 +1,331 @@ <?php /** * You may not change or alter any portion of this comment or credits -* of supporting developers from this source code or any supporting source code -* which is considered copyrighted (c) material of the original comment or credit authors. +* of supporting developers from this source code or any supporting +* source code which is considered copyrighted (c) material of the +* original comment or credit authors. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * -* @copyright: The XOOPS Project http://sourceforge.net/projects/xoops/ -* @license: http://www.fsf.org/copyleft/gpl.html GNU public license -* @module: Smallworld -* @Author: Michael Albertsen (http://culex.dk) <cu...@cu...> -* @copyright: 2011 Culex -* @Repository path: $HeadURL$ -* @Last committed: $Revision$ -* @Last changed by: $Author$ -* @Last changed date: $Date$ -* @ID: $Id$ +* @copyright: The XOOPS Project http://sourceforge.net/projects/xoops/ +* @license: http://www.fsf.org/copyleft/gpl.html GNU public license +* @packet: Modules +* @sub-packet: Smallworld +* @since: Xoops 2.5.4 +* @Author: Michael Albertsen (http://culex.dk) <cu...@cu...> +* @copyright: 2011 Culex +* @Last committed: $Revision$ +* @Last changed by: $Author$ +* @Last changed date: $Date$ +* @ID: $Id$ **/ +require_once dirname(__FILE__) . '/admin_header.php'; -//require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php'; -include_once dirname(__FILE__) . '/admin_header.php'; - xoops_cp_header(); -global $xoTheme; -$xoTheme->addStylesheet(XOOPS_URL . '/modules/smallworld/css/SmallworldAdmin.css'); -$xoTheme->addScript(XOOPS_URL . '/modules/smallworld/js/adminsmallworld.js'); +global $xoTheme; + +$xoTheme->addStylesheet( + XOOPS_URL . '/modules/smallworld/css/SmallworldAdmin.css' +); +$xoTheme->addScript( + XOOPS_URL . '/modules/smallworld/js/adminsmallworld.js' +); - $indexAdmin = new ModuleAdmin(); - - +$indexAdmin = new ModuleAdmin(); $admin = new SmallworldAdmin(); // Find oldest message and apply to template $dfm = $admin->oldestMsg(); -if ($dfm==0) { - $dfm = _AM_SMALLWORLD_NONEYET; +if ($dfm == 0) { + $dfm = _AM_SMALLWORLD_NONEYET; } else { - $dfm = date(_SHORTDATESTRING, $admin->oldestMsg()); + $dfm = date(_SHORTDATESTRING, $admin->oldestMsg()); } $dateoffirstmessage = $dfm; // Get days number $totaldays = $admin->CountDays(); + // get average messages per day -$avgperday = $admin->AvgMsgDay ($totaldays); +$avgperday = $admin->AvgMsgDay($totaldays); + // Smallworld version number -$installversion = $admin->ModuleInstallVersion (); +$installversion = $admin->ModuleInstallVersion(); + // Smallworld install date -$installdate = $admin->ModuleInstallDate (); -//check current version of Smallworld, return desc,link,version if new available -$installCheck = $admin->doCheckUpdate (); +$installdate = $admin->ModuleInstallDate(); + +// check current version of Smallworld, +// return desc,link,version if new available +$installCheck = $admin->doCheckUpdate(); + // Count members using Smallworld -$sumallusers = $admin->TotalUsers (); +$sumallusers = $admin->TotalUsers(); + // Find list of most active users (total) $maAllround = $admin->mostactiveusers_allround(); - $ma_cnt = 0; - if (!empty($maAllround)) { - $count = count($maAllround['cnt']); - } else { - $count=0; - } - $mat_cnt = 0; - if ($count != 0) { - $ma_cnt = 1; - $ma = "<table class='smallworldadmin'><tr>"; - $ma .= "<td><b>"._AM_SMALLWORLD_STATS_POS."</b></td><td><b>"._AM_SMALLWORLD_STATS_IMG."</b></td><td><b>"._AM_SMALLWORLD_STATS_AMOUNT."</b></td><td><b>"._AM_SMALLWORLD_STATS_NAME."</b></td></tr>"; - $i = 1; - while ($i < count($maAllround)-1) { - $ma .= vsprintf('<tr><td>%s</td>',array($maAllround['counter'][$i])); - $ma .= vsprintf('<td>%s</td>',array($maAllround['img'][$i])); - $ma .= vsprintf('<td>%s</td>',array($maAllround['cnt'][$i])); - $ma .= vsprintf('<td>%s</td></tr>',array($maAllround['from'][$i])); - $i++; - } - $ma .= "</tr></table>"; - } else { - $maAllround = 0; - } +$maCnt = 0; +if (!empty($maAllround)) { + $count = count($maAllround['cnt']); +} else { + $count = 0; +} +$matCnt = 0; +if ($count != 0) { + $maCnt = 1; + $ma = "<table class='smallworldadmin'><tr>"; + $ma .= "<td><b>"._AM_SMALLWORLD_STATS_POS."</b></td>" + . "<td><b>"._AM_SMALLWORLD_STATS_IMG."</b></td>" + . "<td><b>"._AM_SMALLWORLD_STATS_AMOUNT."</b></td>" + . "<td><b>"._AM_SMALLWORLD_STATS_NAME."</b></td>" + . "</tr>"; + $i = 1; + $maAllroundCount = count($maAllround) - 1; + while ($i < $maAllroundCount) { + $ma .= vsprintf( + '<tr><td>%s</td>', array($maAllround['counter'][$i]) + ); + $ma .= vsprintf( + '<td>%s</td>', array($maAllround['img'][$i]) + ); + $ma .= vsprintf( + '<td>%s</td>', array($maAllround['cnt'][$i]) + ); + $ma .= vsprintf( + '<td>%s</td></tr>', array($maAllround['from'][$i]) + ); + $i++; + } + $ma .= "</tr></table>"; +} else { + $maAllround = 0; +} + // Find list of most active users (24 hours) $maToday = $admin->mostactiveusers_today(); - if (!empty($maToday)) { - $count = count($maToday['cnt']); - } else { - $count=0; - } - $mat_cnt = 0; - if ($count != 0) { - $mat_cnt = 1; - $mat = "<table class='smallworldadmin'><tr>"; - $mat .= "<td><b>"._AM_SMALLWORLD_STATS_POS."</b></td><td><b>"._AM_SMALLWORLD_STATS_IMG."</b></td><td><b>"._AM_SMALLWORLD_STATS_AMOUNT."</b></td><td><b>"._AM_SMALLWORLD_STATS_NAME."</b></td></tr>"; - $i = 1; - while ($i <= count(array($maToday))) { - $mat .= vsprintf('<tr><td>%s</td>',array($maToday['counter'][$i])); - $mat .= vsprintf('<td>%s</td>',array($maToday['img'][$i])); - $mat .= vsprintf('<td>%s</td>',array($maToday['cnt'][$i])); - $mat .= vsprintf('<td>%s</td></tr>',array($maToday['from'][$i])); - $i++; - } - $mat .= "</tr></table>"; - } else { - $mat = 0; - } +if (!empty($maToday)) { + $count = count($maToday['cnt']); +} else { + $count = 0; +} +$matCnt = 0; +if ($count != 0) { + $matCnt = 1; + $mat = "<table class='smallworldadmin'><tr>"; + $mat .= "<td><b>"._AM_SMALLWORLD_STATS_POS."</b></td>" + . "<td><b>"._AM_SMALLWORLD_STATS_IMG."</b></td>" + . "<td><b>"._AM_SMALLWORLD_STATS_AMOUNT."</b></td>" + . "<td><b>"._AM_SMALLWORLD_STATS_NAME."</b></td></tr>"; + $i = 1; + $matodayCount = count(array($maToday)); + while ($i <= $matodayCount) { + $mat .= vsprintf( + '<tr><td>%s</td>', array($maToday['counter'][$i]) + ); + $mat .= vsprintf( + '<td>%s</td>', array($maToday['img'][$i]) + ); + $mat .= vsprintf( + '<td>%s</td>', array($maToday['cnt'][$i]) + ); + $mat .= vsprintf( + '<td>%s</td></tr>', array($maToday['from'][$i]) + ); + $i++; + } + $mat .= "</tr></table>"; +} else { + $mat = 0; +} + // FInd list of best rated users overall $topusers = $admin->topratedusers('up'); - if (!empty($topusers)){ - $count = count($topusers['cnt']); - } else { - $count = 0; - } - $top_cnt = 0; - if ($count != 0) { - $top_cnt = 1; - $top = "<table class='smallworldadmin'><tr>"; - $top .= "<td><b>"._AM_SMALLWORLD_STATS_POS."</b></td><td><b>"._AM_SMALLWORLD_STATS_IMG."</b></td><td><b>"._AM_SMALLWORLD_STATS_AMOUNT."</b></td><td><b>"._AM_SMALLWORLD_STATS_NAME."</b></td></tr>"; - $i = 1; - while ($i <= $count) { - $top .= vsprintf('<tr><td>%s</td>',array($topusers['counter'][$i])); - $top .= vsprintf('<td>%s</td>',array($topusers['img'][$i])); - $top .= vsprintf('<td>%s</td>',array($topusers['cnt'][$i])); - $top .= vsprintf('<td>%s</td></tr>',array($topusers['user'][$i])); - $i++; - } - $top .= "</tr></table>"; - } else { - $top = 0; - } +if (!empty($topusers)) { + $count = count($topusers['cnt']); +} else { + $count = 0; +} +$topCnt = 0; +if ($count != 0) { + $topCnt = 1; + $top = "<table class='smallworldadmin'><tr>"; + $top .= "<td><b>"._AM_SMALLWORLD_STATS_POS."</b></td>" + . "<td><b>"._AM_SMALLWORLD_STATS_IMG."</b></td>" + . "<td><b>"._AM_SMALLWORLD_STATS_AMOUNT."</b></td>" + . "<td><b>"._AM_SMALLWORLD_STATS_NAME."</b></td></tr>"; + $i = 1; + while ($i <= $count) { + $top .= vsprintf( + '<tr><td>%s</td>', array($topusers['counter'][$i]) + ); + $top .= vsprintf( + '<td>%s</td>', array($topusers['img'][$i]) + ); + $top .= vsprintf( + '<td>%s</td>', array($topusers['cnt'][$i]) + ); + $top .= vsprintf( + '<td>%s</td></tr>', array($topusers['user'][$i]) + ); + $i++; + } + $top .= "</tr></table>"; +} else { + $top = 0; +} // FInd list of worst rated users overall $lowusers = $admin->topratedusers('down'); - $low_cnt = 0; - if (!empty($lowusers)) { - $count = count($lowusers['cnt']); - } else { - $count=0; - } - if ($count != 0) { - $low_cnt = 1; - $low = "<table class='smallworldadmin'><tr>"; - $low .= "<td><b>"._AM_SMALLWORLD_STATS_POS."</b></td><td><b>"._AM_SMALLWORLD_STATS_IMG."</b></td><td><b>"._AM_SMALLWORLD_STATS_AMOUNT."</b></td><td><b>"._AM_SMALLWORLD_STATS_NAME."</b></td></tr>"; - $i = 1; - while ($i <= $count) { - $low .= vsprintf('<tr><td>%s</td>',array($lowusers['counter'][$i])); - $low .= vsprintf('<td>%s</td>',array($lowusers['img'][$i])); - $low .= vsprintf('<td>%s</td>',array($lowusers['cnt'][$i])); - $low .= vsprintf('<td>%s</td></tr>',array($lowusers['user'][$i])); - $i++; - } - $low .= "</tr></table>"; - } else { - $low = 0; - } +$lowCnt = 0; +if (!empty($lowusers)) { + $count = count($lowusers['cnt']); +} else { + $count = 0; +} +if ($count != 0) { + $lowCnt = 1; + $low = "<table class='smallworldadmin'><tr>"; + $low .= "<td><b>"._AM_SMALLWORLD_STATS_POS."</b></td>" + . "<td><b>"._AM_SMALLWORLD_STATS_IMG."</b></td>" + . "<td><b>"._AM_SMALLWORLD_STATS_AMOUNT."</b></td>" + . "<td><b>"._AM_SMALLWORLD_STATS_NAME."</b></td></tr>"; + $i = 1; + while ($i <= $count) { + $low .= vsprintf( + '<tr><td>%s</td>', array($lowusers['counter'][$i]) + ); + $low .= vsprintf( + '<td>%s</td>', array($lowusers['img'][$i]) + ); + $low .= vsprintf( + '<td>%s</td>', array($lowusers['cnt'][$i]) + ); + $low .= vsprintf( + '<td>%s</td></tr>', array($lowusers['user'][$i]) + ); + $i++; + } + $low .= "</tr></table>"; +} else { + $low = 0; +} -//----------------------- - // template assignments - $xoopsTpl->assign('lang_moduleinfo', _AM_SMALLWORLD_MODULEINFO); - $xoopsTpl->assign('lang_installversion', _AM_SMALLWORLD_MODULEINSTALL); - $xoopsTpl->assign('lang_installversion_status', _AM_SMALLWORLD_UPDATE_STATUS); - $xoopsTpl->assign('lang_installdate', _AM_SMALLWORLD_INSTALLDATE); +$xoopsTpl->assign('lang_moduleinfo', _AM_SMALLWORLD_MODULEINFO); +$xoopsTpl->assign('lang_installversion', _AM_SMALLWORLD_MODULEINSTALL); - //$xoopsTpl->assign('installversion', $installversion); - //$xoopsTpl->assign('installdate', $installdate); - //$xoopsTpl->assign('installversion_status',$installCheck); - //$xoopsTpl->display(XOOPS_ROOT_PATH .'/modules/smallworld/templates/admin_moduleinfo.html'); -//----------------------- - +$xoopsTpl->assign( + 'lang_installversion_status', + _AM_SMALLWORLD_UPDATE_STATUS +); +$xoopsTpl->assign( + 'lang_installdate', + _AM_SMALLWORLD_INSTALLDATE +); + +// AdminModule assignments $indexAdmin->addInfoBox(_AM_SMALLWORLD_MODULEINFO); -$indexAdmin->addInfoBoxLine(_AM_SMALLWORLD_MODULEINFO, "<class='smallworldadmin'>"._AM_SMALLWORLD_MODULEINSTALL." : %s</br>",$installversion,'Green','default'); -$indexAdmin->addInfoBoxLine(_AM_SMALLWORLD_MODULEINFO, "<class='smallworldadmin'>"._AM_SMALLWORLD_INSTALLDATE.": %s",$installdate,'Green','default'); -$indexAdmin->addInfoBoxLine(_AM_SMALLWORLD_MODULEINFO, "<class='smallworldadmin'>"."%s",$installCheck,'Green','default'); - $indexAdmin->addInfoBox(_AM_SMALLWORLD_USERSTATS); -$indexAdmin->addInfoBoxLine( _AM_SMALLWORLD_USERSTATS, "<class='smallworldadmin'>"._AM_SMALLWORLD_DATEOFFIRSTMESSAGE." : %s</br>",$dateoffirstmessage,'Green','default'); -$indexAdmin->addInfoBoxLine( _AM_SMALLWORLD_USERSTATS, "<class='smallworldadmin'>"._AM_SMALLWORLD_TOTALUSERS." : %s</br>",$sumallusers, 'Red','default'); +$indexAdmin->addInfoBoxLine( + _AM_SMALLWORLD_MODULEINFO, + "<class='smallworldadmin'>"._AM_SMALLWORLD_MODULEINSTALL." : %s</br>", + $installversion, + 'Green', + 'default' +); + +$indexAdmin->addInfoBoxLine( + _AM_SMALLWORLD_MODULEINFO, + "<class='smallworldadmin'>"._AM_SMALLWORLD_INSTALLDATE.": %s", + $installdate, + 'Green', + 'default' +); + +$indexAdmin->addInfoBoxLine( + _AM_SMALLWORLD_MODULEINFO, + "<class='smallworldadmin'>"."%s", + $installCheck, + 'Green', + 'default' +); + +$indexAdmin->addInfoBoxLine( + _AM_SMALLWORLD_USERSTATS, + "<class='smallworldadmin'>" + . _AM_SMALLWORLD_DATEOFFIRSTMESSAGE." : %s</br>", + $dateoffirstmessage, + 'Green', + 'default' +); + +$indexAdmin->addInfoBoxLine( + _AM_SMALLWORLD_USERSTATS, + "<class='smallworldadmin'>" + . _AM_SMALLWORLD_TOTALUSERS." : %s</br>", + $sumallusers, + 'Red', + 'default' +); + if ($avgperday > 0) { - $indexAdmin->addInfoBoxLine( _AM_SMALLWORLD_USERSTATS, "<class='smallworldadmin'>"._AM_SMALLWORLD_AVERAGEMSGPERDAY." : %s</br>", $avgperday, 'Red','default'); + $indexAdmin->addInfoBoxLine( + _AM_SMALLWORLD_USERSTATS, + "<class='smallworldadmin'>" + . _AM_SMALLWORLD_AVERAGEMSGPERDAY." : %s</br>", + $avgperday, + 'Red', + 'default' + ); } -if ($mat_cnt != 0 ) { - $indexAdmin->addInfoBoxLine( _AM_SMALLWORLD_USERSTATS, "<p class='smallworldadmin'>"._AM_SMALLWORLD_TOPCHATTERS_TODAY." : %s</p>", $mat, 'Red','default'); +if ($matCnt != 0) { + $indexAdmin->addInfoBoxLine( + _AM_SMALLWORLD_USERSTATS, + "<p class='smallworldadmin'>" + . _AM_SMALLWORLD_TOPCHATTERS_TODAY." : %s</p>", + $mat, + 'Red', + 'default' + ); } -if ($ma_cnt != 0 ) { - $indexAdmin->addInfoBoxLine( _AM_SMALLWORLD_USERSTATS, "<p class='smallworldadmin'>"._AM_SMALLWORLD_TOPCHATTERS." : %s</p>", $ma, 'Red','default'); +if ($maCnt != 0) { + $indexAdmin->addInfoBoxLine( + _AM_SMALLWORLD_USERSTATS, + "<p class='smallworldadmin'>" + . _AM_SMALLWORLD_TOPCHATTERS." : %s</p>", + $ma, + 'Red', + 'default' + ); } -if ($top_cnt != 0 ) { - $indexAdmin->addInfoBoxLine( _AM_SMALLWORLD_USERSTATS, "<p class='smallworldadmin'>"._AM_SMALLWORLD_TOPRATEDUSERS." : %s</p>", $top, 'Red','default'); + +if ($topCnt != 0) { + $indexAdmin->addInfoBoxLine( + _AM_SMALLWORLD_USERSTATS, + "<p class='smallworldadmin'>" + . _AM_SMALLWORLD_TOPRATEDUSERS." : %s</p>", + $top, + 'Red', + 'default' + ); } -if ($low_cnt != 0 ) { -$indexAdmin->addInfoBoxLine( _AM_SMALLWORLD_USERSTATS, "<p class='smallworldadmin'>"._AM_SMALLWORLD_BOTTOMRATEDUSERS." : %s</p>", $low, 'Red','default'); +if ($lowCnt != 0) { + $indexAdmin->addInfoBoxLine( + _AM_SMALLWORLD_USERSTATS, + "<p class='smallworldadmin'>" + . _AM_SMALLWORLD_BOTTOMRATEDUSERS." : %s</p>", + $low, + 'Red', + 'default' + ); } - echo $indexAdmin->addNavigation('index.php'); - echo $indexAdmin->renderIndex(); -include "admin_footer.php"; -?> \ No newline at end of file +echo $indexAdmin->addNavigation('index.php'); +echo $indexAdmin->renderIndex(); +require_once "admin_footer.php"; \ No newline at end of file Modified: XoopsModules/smallworld/trunk/smallworld/admin/main.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/admin/main.php 2012-02-06 14:06:57 UTC (rev 8891) +++ XoopsModules/smallworld/trunk/smallworld/admin/main.php 2012-02-06 14:51:51 UTC (rev 8892) @@ -1,60 +1,61 @@ <?php /** * You may not change or alter any portion of this comment or credits -* of supporting developers from this source code or any supporting source code -* which is considered copyrighted (c) material of the original comment or credit authors. +* of supporting developers from this source code or any supporting +* source code which is considered copyrighted (c) material of the +* original comment or credit authors. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * -* @copyright: The XOOPS Project http://sourceforge.net/projects/xoops/ -* @license: http://www.fsf.org/copyleft/gpl.html GNU public license -* @module: Smallworld -* @Author: Michael Albertsen (http://culex.dk) <cu...@cu...> -* @copyright: 2011 Culex -* @Repository path: $HeadURL$ -* @Last committed: $Revision$ -* @Last changed by: $Author$ -* @Last changed date: $Date$ -* @ID: $Id$ +* @copyright: The XOOPS Project http://sourceforge.net/projects/xoops/ +* @license: http://www.fsf.org/copyleft/gpl.html GNU public license +* @packet: Modules +* @sub-packet: Smallworld +* @since: Xoops 2.5.4 +* @Author: Michael Albertsen (http://culex.dk) <cu...@cu...> +* @copyright: 2011 Culex +* @Last committed: $Revision$ +* @Last changed by: $Author$ +* @Last changed date: $Date$ +* @ID: $Id$ **/ require_once 'admin_header.php'; require_once '../../../include/cp_header.php'; -include_once(XOOPS_ROOT_PATH."/modules/smallworld/include/functions.php"); -include_once(XOOPS_ROOT_PATH."/modules/smallworld/class/class_collector.php"); - +require_once XOOPS_ROOT_PATH . "/modules/smallworld/include/functions.php"; +require_once XOOPS_ROOT_PATH + . "/modules/smallworld/class/class_collector.php"; require_once XOOPS_ROOT_PATH . '/class/template.php'; -if (!isset($xoopsTpl)) {$xoopsTpl = new XoopsTpl();} -$xoopsTpl->xoops_setCaching(0); +global $xoopsConfig, $xoTheme, $xoopsModule; +if (!isset($xoopsTpl)) { + $xoopsTpl = new XoopsTpl(); +} +$xoopsTpl->caching = 0; + xoops_cp_header(); -if (isset($_POST['xim_admin_message'])) {$_POST['xim_admin_message'] = '';} - -$admin = new SmallworldAdmin(); -$tpl = new XoopsTpl(); - $ai = array(); $ani = array(); // --------------- First tab in admin --------------- // Find oldest message and apply to template -$dateoffirstmessage = date('d-m-Y H:i:s',$admin->oldestMsg()); +$dateoffirstmessage = date('d-m-Y H:i:s', $admin->oldestMsg()); // Get days number $totaldays = $admin->CountDays(); // get average messages per day -$avgperday = $admin->AvgMsgDay ($totaldays); +$avgperday = $admin->AvgMsgDay($totaldays); // XIM version number -$installversion = $admin->ModuleInstallVersion (); +$installversion = $admin->ModuleInstallVersion(); // XIM install date -$installdate = $admin->ModuleInstallDate (); +$installdate = $admin->ModuleInstallDate(); //check current version of XIM, return desc,link,version if new available -$installCheck = $admin->doCheckUpdate (); +$installCheck = $admin->doCheckUpdate(); // Count members using XIM -$sumallusers = $admin->TotalUsers (); +$sumallusers = $admin->TotalUsers(); // Find list of most active users (total) $admin->mostactiveusers_allround(); // Find list of most active users (24 hours) @@ -66,122 +67,196 @@ // FInd list of worst rated users overall $admin->topratedusers('down'); -$allusers_inspect = $admin->getAllUsers('yes'); - if (!empty($allusers_inspect)) { - foreach ($allusers_inspect as $data) { - $ai['id'] = $data['id']; - $ai['userid'] = $data['userid']; - $ai['username'] = $data['username']; - $ai['realname'] = $data['realname']; - $ai['userimage'] = smallworld_getAvatarLink ($data['userid'],$data['userimage']); - $ai['avatar_size'] = getimagesize($ai['userimage']); - $ai['avatar_highwide'] = smallworld_imageResize($ai['avatar_size'][0], $ai['avatar_size'][1], 50); - $ai['ip'] = $data['ip']; - $ai['complaint'] = $data['complaint']; - $ai['inspect_start'] = $data['inspect_start']; - $ai['inspect_stop'] = $data['inspect_stop']; - $ai['userinspect_timetotal'] = ($data['inspect_start'] + $data['inspect_stop'])-time(); - $xoopsTpl->append('allusersinspect', $ai); - } - } - $xoopsTpl->assign('allusersinspectcounter',count($ai)); +$allusersInspect = $admin->getAllUsers('yes'); +if (!empty($allusersInspect)) { + foreach ($allusersInspect as $data) { + $ai['id'] = $data['id']; + $ai['userid'] = $data['userid']; + $ai['username'] = $data['username']; + $ai['realname'] = $data['realname']; + $ai['userimage'] = smallworld_getAvatarLink( + $data['userid'], $data['userimage'] + ); + $ai['avatar_size'] = getimagesize($ai['userimage']); + $ai['avatar_highwide'] = smallworld_imageResize( + $ai['avatar_size'][0], $ai['avatar_size'][1], 50 + ); + $ai['ip'] = $data['ip']; + $ai['complaint'] = $data['complaint']; + $ai['inspect_start'] = $data['inspect_start']; + $ai['inspect_stop'] = $data['inspect_stop']; + $ai['userinspect_timetotal'] = ($data['inspect_start'] + + $data['inspect_stop']) - time(); + $xoopsTpl->append('allusersinspect', $ai); + } +} +$xoopsTpl->assign('allusersinspectcounter', count($ai)); -$allusers_noinspect = $admin->getAllUsers('no'); - if (!empty($allusers_noinspect)) { - foreach ($allusers_noinspect as $data) { - $ani['id'] = $data['id']; - $ani['userid'] = $data['userid']; - $ani['username'] = $data['username']; - $ani['realname'] = $data['realname']; - $ani['userimage'] = smallworld_getAvatarLink ($data['userid'],$data['userimage']); - $ani['avatar_size'] = getimagesize($ani['userimage']); - $ani['avatar_highwide'] = smallworld_imageResize($ani['avatar_size'][0], $ani['avatar_size'][1], 50); - $ani['ip'] = $data['ip']; - $ani['complaint'] = $data['complaint']; - $ani['inspect_start'] = ''; - $ani['inspect_stop'] = ''; - $ani['userinspect_timetotal'] = ''; - $xoopsTpl->append('allusersnoinspect', $ani); - } - } - $xoopsTpl->assign('allusersnoinspectcounter',count($ani)); +$allusersNoinspect = $admin->getAllUsers('no'); +if (!empty($allusersNoinspect)) { + foreach ($allusersNoinspect as $data) { + $ani['id'] = $data['id']; + $ani['userid'] = $data['userid']; + $ani['username'] = $data['username']; + $ani['realname'] = $data['realname']; + $ani['userimage'] = smallworld_getAvatarLink( + $data['userid'], $data['userimage'] + ); + $ani['avatar_size'] = getimagesize($ani['userimage']); + $ani['avatar_highwide'] = smallworld_imageResize( + $ani['avatar_size'][0], $ani['avatar_size'][1], 50 + ); + $ani['ip'] = $data['ip']; + $ani['complaint'] = $data['complaint']; + $ani['inspect_start'] = ''; + $ani['inspect_stop'] = ''; + $ani['userinspect_timetotal'] = ''; + $xoopsTpl->append('allusersnoinspect', $ani); + } +} +$xoopsTpl->assign('allusersnoinspectcounter', count($ani)); // ---------------- end of tabs ---------------- // // template assignments - // tab titles - $xoopsTpl->assign('lang_statistics', _AM_SMALLWORLD_STATISTICS_TITLE); - $xoopsTpl->assign('lang_moduleinfo', _AM_SMALLWORLD_MODULEINFO); - $xoopsTpl->assign('lang_userstats', _AM_SMALLWORLD_USERSTATS); - $xoopsTpl->assign('lang_installversion', _AM_SMALLWORLD_MODULEINSTALL); - $xoopsTpl->assign('lang_installversion_status', _AM_SMALLWORLD_UPDATE_STATUS); - $xoopsTpl->assign('lang_installdate', _AM_SMALLWORLD_INSTALLDATE); - $xoopsTpl->assign('lang_dateoffirstmessage', _AM_SMALLWORLD_DATEOFFIRSTMESSAGE); - $xoopsTpl->assign('lang_totalusers', _AM_SMALLWORLD_TOTALUSERS); - $xoopsTpl->assign('lang_averagemsgperday', _AM_SMALLWORLD_AVERAGEMSGPERDAY); - $xoopsTpl->assign('lang_topchatters',_AM_SMALLWORLD_TOPCHATTERS); - $xoopsTpl->assign('lang_topchatterstoday',_AM_SMALLWORLD_TOPCHATTERS_TODAY); - $xoopsTpl->assign('lang_toprated',_AM_SMALLWORLD_TOPRATEDUSERS); - $xoopsTpl->assign('lang_bottomrated',_AM_SMALLWORLD_BOTTOMRATEDUSERS); - $xoopsTpl->assign('lang_useradmin',_AM_SMALLWORLD_USERADMIN_TITLE); - $xoopsTpl->assign('lang_help',_AM_SMALLWORLD_HELP); - $xoopsTpl->assign('lang_prefs',_MI_SYSTEM_ADMENU6); - $xoopsTpl->assign('lang_prefslink',"<a href='../../system/admin.php?fct=preferences&op=showmod&mod=".$xoopsModule ->getVar('mid')."'>"._MI_SYSTEM_ADMENU6."</a>"); - - // help file from admin - $xoopsTpl->assign('lang_hlp_about',_AM_SMALLWORLD_HELP_ABOUT); - $xoopsTpl->assign('lang_hlp_preface',_AM_SMALLWORLD_HELP_PREFACE); - $xoopsTpl->assign('lang_hlp_requirements_t',_AM_SMALLWORLD_HELP_HEADER_REQUIREMENTS); - $xoopsTpl->assign('lang_hlp_requirements',_AM_SMALLWORLD_HELP_REQUIREMENTS); - $xoopsTpl->assign('lang_hlp_recommended_t',_AM_SMALLWORLD_HELP_HEADER_RECOMMENDED); - $xoopsTpl->assign('lang_hlp_recommended',_AM_SMALLWORLD_HELP_RECOMMENDED); - $xoopsTpl->assign('lang_hlp_installation_t',_AM_SMALLWORLD_HELP_HEADER_INSTALLATION); - $xoopsTpl->assign('lang_hlp_firsttime',_AM_SMALLWORLD_HELP_FIRSTTIMEINSTALL); - $xoopsTpl->assign('lang_hlp_hostedplatform_t',_AM_SMALLWORLD_HELP_HEADER_HOSTED_PLATFORM); - $xoopsTpl->assign('lang_hlp_hostedplatform',_AM_SMALLWORLD_HELP_HOSTED_PLATFORM); - $xoopsTpl->assign('lang_hlp_upgrading_t',_AM_SMALLWORLD_HELP_HEADER_UPGRADING); - $xoopsTpl->assign('lang_hlp_upgrading',_AM_SMALLWORLD_HELP_UPGRADING); - $xoopsTpl->assign('lang_hlp_faq_t',_AM_SMALLWORLD_HELP_HEADER_FAQ); - $xoopsTpl->assign('lang_hlp_commen1_t',_AM_SMALLWORLD_HELP_HEADER_COMMENPROBLEMS1); - $xoopsTpl->assign('lang_hlp_commen1',_AM_SMALLWORLD_HELP_COMMENPROBLEMS1); - $xoopsTpl->assign('lang_hlp_contacts_t',_AM_SMALLWORLD_HELP_HEADER_CONTACTS); - $xoopsTpl->assign('lang_hlp_otherhelp',_AM_SMALLWORLD_HELP_OTHERHELP); - $xoopsTpl->assign('installversion', $installversion); - $xoopsTpl->assign('installdate', $installdate); - $xoopsTpl->assign('installversion_status',$installCheck); - $xoopsTpl->assign('dateoffirstmessage', $dateoffirstmessage); - $xoopsTpl->assign('totalusers', $sumallusers); - $xoopsTpl->assign('averagemsgperday', $avgperday); - $xoopsTpl->display('db:smallworld_admin.html'); - - global $xoTheme; - //Check Language - $lang = $xoopsConfig['language']; - // GET various variables from language folder - if ( file_exists(XOOPS_ROOT_PATH.'/modules/smallworld/language/js/'.$lang.'/variables.js')) { - $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/language/'.$lang.'/js/variables.js'); - } else { - $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/language/english/js/variables.js'); - } - -$adminscript= <<<SCRIPT - var smallworld_url="XOOPS_URL/modules/smallworld/"; - var $ = jQuery(); +$xoopsTpl->assign('lang_statistics', _AM_SMALLWORLD_STATISTICS_TITLE); +$xoopsTpl->assign('lang_moduleinfo', _AM_SMALLWORLD_MODULEINFO); +$xoopsTpl->assign('lang_userstats', _AM_SMALLWORLD_USERSTATS); +$xoopsTpl->assign('lang_installversion', _AM_SMALLWORLD_MODULEINSTALL); +$xoopsTpl->assign('lang_installdate', _AM_SMALLWORLD_INSTALLDATE); +$xoopsTpl->assign('lang_totalusers', _AM_SMALLWORLD_TOTALUSERS); +$xoopsTpl->assign('lang_topchatters', _AM_SMALLWORLD_TOPCHATTERS); +$xoopsTpl->assign('lang_toprated', _AM_SMALLWORLD_TOPRATEDUSERS); +$xoopsTpl->assign('lang_bottomrated', _AM_SMALLWORLD_BOTTOMRATEDUSERS); +$xoopsTpl->assign('lang_useradmin', _AM_SMALLWORLD_USERADMIN_TITLE); +$xoopsTpl->assign('lang_help', _AM_SMALLWORLD_HELP); +$xoopsTpl->assign('lang_prefs', _MI_SYSTEM_ADMENU6); +$xoopsTpl->assign('lang_installversion_status', _AM_SMALLWORLD_UPDATE_STATUS); +$xoopsTpl->assign('lang_averagemsgperday', _AM_SMALLWORLD_AVERAGEMSGPERDAY); +$xoopsTpl->assign('lang_topchatterstoday', _AM_SMALLWORLD_TOPCHATTERS_TODAY); + +// help file from admin +$xoopsTpl->assign('lang_hlp_about', _AM_SMALLWORLD_HELP_ABOUT); +$xoopsTpl->assign('lang_hlp_preface', _AM_SMALLWORLD_HELP_PREFACE); +$xoopsTpl->assign('lang_hlp_requirements', _AM_SMALLWORLD_HELP_REQUIREMENTS); +$xoopsTpl->assign('lang_hlp_recommended', _AM_SMALLWORLD_HELP_RECOMMENDED); +$xoopsTpl->assign('lang_hlp_firsttime', _AM_SMALLWORLD_HELP_FIRSTTIMEINSTALL); +$xoopsTpl->assign('lang_hlp_upgrading', _AM_SMALLWORLD_HELP_UPGRADING); +$xoopsTpl->assign('lang_hlp_faq_t', _AM_SMALLWORLD_HELP_HEADER_FAQ); +$xoopsTpl->assign('lang_hlp_commen1', _AM_SMALLWORLD_HELP_COMMENPROBLEMS1); +$xoopsTpl->assign('lang_hlp_contacts_t', _AM_SMALLWORLD_HELP_HEADER_CONTACTS); +$xoopsTpl->assign('lang_hlp_otherhelp', _AM_SMALLWORLD_HELP_OTHERHELP); +$xoopsTpl->assign('installversion', $installversion); +$xoopsTpl->assign('installdate', $installdate); +$xoopsTpl->assign('installversion_status', $installCheck); +$xoopsTpl->assign('dateoffirstmessage', $dateoffirstmessage); +$xoopsTpl->assign('totalusers', $sumallusers); +$xoopsTpl->assign('averagemsgperday', $avgperday); + +$xoopsTpl->assign( + 'lang_hlp_upgrading_t', + _AM_SMALLWORLD_HELP_HEADER_UPGRADING +); + +$xoopsTpl->assign( + 'lang_dateoffirstmessage', + _AM_SMALLWORLD_DATEOFFIRSTMESSAGE +); + +$xoopsTpl->assign( + 'lang_hlp_hostedplatform_t', + _AM_SMALLWORLD_HELP_HEADER_HOSTED_PLATFORM +); + +$xoopsTpl->assign( + 'lang_hlp_installation_t', + _AM_SMALLWORLD_HELP_HEADER_INSTALLATION +); + +$xoopsTpl->assign( + 'lang_hlp_requirements_t', + _AM_SMALLWORLD_HELP_HEADER_REQUIREMENTS +); + +$xoopsTpl->assign( + 'lang_hlp_recommended_t', + _AM_SMALLWORLD_HELP_HEADER_RECOMMENDED +); + +$xoopsTpl->assign( + 'lang_hlp_commen1_t', + _AM_SMALLWORLD_HELP_HEADER_COMMENPROBLEMS1 +); + +$xoopsTpl->assign( + 'lang_hlp_hostedplatform', + _AM_SMALLWORLD_HELP_HOSTED_PLATFORM +); + +$xoopsTpl->assign( + 'lang_prefslink', + "<a href='../../system/admin.php?fct=preferences&op=showmod&mod=" + . $xoopsModule->getVar('mid') . "'>" + . _MI_SYSTEM_ADMENU6 . "</a>" +); + +$xoopsTpl->display('db:smallworld_admin.html'); + +//Check Language +$lang = $xoopsConfig['language']; + +// GET various variables from language folder +if (file_exists( + XOOPS_ROOT_PATH + . '/modules/smallworld/language/js/'. $lang . '/variable... [truncated message content] |