From: <dj...@us...> - 2012-02-07 21:58:05
|
Revision: 8905 http://xoops.svn.sourceforge.net/xoops/?rev=8905&view=rev Author: djculex Date: 2012-02-07 21:57:57 +0000 (Tue, 07 Feb 2012) Log Message: ----------- Reverting back...these condesed line confuses me :-S 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 XoopsModules/smallworld/trunk/smallworld/class/adminclass.php XoopsModules/smallworld/trunk/smallworld/class/class_collector.php XoopsModules/smallworld/trunk/smallworld/class/db.php XoopsModules/smallworld/trunk/smallworld/class/forms.php XoopsModules/smallworld/trunk/smallworld/class/friends.php XoopsModules/smallworld/trunk/smallworld/class/images.php XoopsModules/smallworld/trunk/smallworld/class/mail.php XoopsModules/smallworld/trunk/smallworld/class/profile.php XoopsModules/smallworld/trunk/smallworld/class/uploadclass.php XoopsModules/smallworld/trunk/smallworld/class/user.php XoopsModules/smallworld/trunk/smallworld/class/wall.php XoopsModules/smallworld/trunk/smallworld/include/arrays.php XoopsModules/smallworld/trunk/smallworld/include/functions.php XoopsModules/smallworld/trunk/smallworld/include/getSelects.php Modified: XoopsModules/smallworld/trunk/smallworld/admin/about.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/admin/about.php 2012-02-07 21:12:44 UTC (rev 8904) +++ XoopsModules/smallworld/trunk/smallworld/admin/about.php 2012-02-07 21:57:57 UTC (rev 8905) @@ -1,26 +1,24 @@ <?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 -* @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$ +* @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_once dirname(__FILE__) . '/admin_header.php'; xoops_cp_header(); @@ -37,6 +35,4 @@ echo $aboutAdmin->addNavigation('about.php'); echo $aboutAdmin->renderAbout('', false); - - include 'admin_footer.php'; \ No newline at end of file Modified: XoopsModules/smallworld/trunk/smallworld/admin/admin_footer.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/admin/admin_footer.php 2012-02-07 21:12:44 UTC (rev 8904) +++ XoopsModules/smallworld/trunk/smallworld/admin/admin_footer.php 2012-02-07 21:57:57 UTC (rev 8905) @@ -1,36 +1,32 @@ <?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 -* @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$ +* @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$ **/ echo "<div class='adminfooter'>\n" - . " <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>"; + ." <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>"; -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-07 21:12:44 UTC (rev 8904) +++ XoopsModules/smallworld/trunk/smallworld/admin/admin_header.php 2012-02-07 21:57:57 UTC (rev 8905) @@ -1,41 +1,38 @@ <?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 -* @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$ +* @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$ **/ $path = dirname(dirname(dirname(dirname(__FILE__)))); -require_once $path . '/mainfile.php'; -require_once $path . '/include/cp_functions.php'; -require_once $path . '/kernel/module.php'; +include_once $path . '/mainfile.php'; +include_once $path . '/include/cp_functions.php'; +include_once $path . '/kernel/module.php'; require_once $path . '/include/cp_header.php'; global $xoopsModule; $pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin'); -$pathIconSmall = '../' . $xoopsModule->getInfo('icons16'); -$pathIconBig = '../' . $xoopsModule->getInfo('icons32'); -$modAurl = '/Frameworks/moduleclasses/moduleadmin/moduleadmin.php'; +$pathIcon16 = '../' . $xoopsModule->getInfo('icons16'); +$pathIcon32 = '../' . $xoopsModule->getInfo('icons32'); -if (file_exists($GLOBALS['xoops']->path($modAurl))) { - require_once $GLOBALS['xoops']->path($modAurl); +if (file_exists($GLOBALS['xoops']->path('/Frameworks/moduleclasses/moduleadmin/moduleadmin.php'))) { + include_once $GLOBALS['xoops']->path('/Frameworks/moduleclasses/moduleadmin/moduleadmin.php'); } else { redirect_header("../../../admin.php", 5, _AM_MODULEADMIN_MISSING, false); } Modified: XoopsModules/smallworld/trunk/smallworld/admin/admintool.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/admin/admintool.php 2012-02-07 21:12:44 UTC (rev 8904) +++ XoopsModules/smallworld/trunk/smallworld/admin/admintool.php 2012-02-07 21:57:57 UTC (rev 8905) @@ -1,68 +1,55 @@ <?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 -* @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$ +* @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$ **/ -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, $xoopsLogger; - +global $xoopsDB, $xoTheme, $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-07 21:12:44 UTC (rev 8904) +++ XoopsModules/smallworld/trunk/smallworld/admin/div_useradmin.php 2012-02-07 21:57:57 UTC (rev 8905) @@ -1,86 +1,72 @@ <?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 -* @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$ +* @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$ **/ require_once 'admin_header.php'; -require_once(XOOPS_ROOT_PATH."/modules/smallworld/include/functions.php"); -require_once(XOOPS_ROOT_PATH."/modules/smallworld/class/class_collector.php"); -global $xoopsLogger; +global $xoopsDB, $xoTheme, $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(); -$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_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)); -$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)); +$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)); -$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-07 21:12:44 UTC (rev 8904) +++ XoopsModules/smallworld/trunk/smallworld/admin/help.php 2012-02-07 21:57:57 UTC (rev 8905) @@ -1,121 +1,64 @@ <?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 -* @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$ +* @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$ **/ require_once 'admin_header.php'; require_once '../../../include/cp_header.php'; -require_once(XOOPS_ROOT_PATH . "/modules/smallworld/include/functions.php"); -require_once( - XOOPS_ROOT_PATH . "/modules/smallworld/class/class_collector.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 . '/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; -// 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 - ); - +$admin = new SmallworldAdmin(); +$tpl = new XoopsTpl(); - $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 +// 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(); +?> Modified: XoopsModules/smallworld/trunk/smallworld/admin/index.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/admin/index.php 2012-02-07 21:12:44 UTC (rev 8904) +++ XoopsModules/smallworld/trunk/smallworld/admin/index.php 2012-02-07 21:57:57 UTC (rev 8905) @@ -1,331 +1,201 @@ <?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 -* @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$ +* @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$ **/ -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(); -$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; -} - + $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; + } // Find list of most active users (24 hours) $maToday = $admin->mostactiveusers_today(); -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; -} - + 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; + } // FInd list of best rated users overall $topusers = $admin->topratedusers('up'); -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; -} + 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; + } // FInd list of worst rated users overall $lowusers = $admin->topratedusers('down'); -$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; -} + $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; + } +//----------------------- + // template assignments -$xoopsTpl->assign('lang_moduleinfo', _AM_SMALLWORLD_MODULEINFO); -$xoopsTpl->assign('lang_installversion', _AM_SMALLWORLD_MODULEINSTALL); + $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('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 ($matCnt != 0) { - $indexAdmin->addInfoBoxLine( - _AM_SMALLWORLD_USERSTATS, - "<p class='smallworldadmin'>" - . _AM_SMALLWORLD_TOPCHATTERS_TODAY." : %s</p>", - $mat, - 'Red', - 'default' - ); +if ($mat_cnt != 0 ) { + $indexAdmin->addInfoBoxLine( _AM_SMALLWORLD_USERSTATS, "<p class='smallworldadmin'>"._AM_SMALLWORLD_TOPCHATTERS_TODAY." : %s</p>", $mat, 'Red','default'); } -if ($maCnt != 0) { - $indexAdmin->addInfoBoxLine( - _AM_SMALLWORLD_USERSTATS, - "<p class='smallworldadmin'>" - . _AM_SMALLWORLD_TOPCHATTERS." : %s</p>", - $ma, - 'Red', - 'default' - ); +if ($ma_cnt != 0 ) { + $indexAdmin->addInfoBoxLine( _AM_SMALLWORLD_USERSTATS, "<p class='smallworldadmin'>"._AM_SMALLWORLD_TOPCHATTERS." : %s</p>", $ma, 'Red','default'); } - -if ($topCnt != 0) { - $indexAdmin->addInfoBoxLine( - _AM_SMALLWORLD_USERSTATS, - "<p class='smallworldadmin'>" - . _AM_SMALLWORLD_TOPRATEDUSERS." : %s</p>", - $top, - 'Red', - 'default' - ); +if ($top_cnt != 0 ) { + $indexAdmin->addInfoBoxLine( _AM_SMALLWORLD_USERSTATS, "<p class='smallworldadmin'>"._AM_SMALLWORLD_TOPRATEDUSERS." : %s</p>", $top, 'Red','default'); } -if ($lowCnt != 0) { - $indexAdmin->addInfoBoxLine( - _AM_SMALLWORLD_USERSTATS, - "<p class='smallworldadmin'>" - . _AM_SMALLWORLD_BOTTOMRATEDUSERS." : %s</p>", - $low, - 'Red', - 'default' - ); +if ($low_cnt != 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(); -require_once "admin_footer.php"; \ No newline at end of file + echo $indexAdmin->addNavigation('index.php'); + echo $indexAdmin->renderIndex(); +include "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-07 21:12:44 UTC (rev 8904) +++ XoopsModules/smallworld/trunk/smallworld/admin/main.php 2012-02-07 21:57:57 UTC (rev 8905) @@ -1,61 +1,60 @@ <?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 -* @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$ +* @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$ **/ require_once 'admin_header.php'; require_once '../../../include/cp_header.php'; -require_once XOOPS_ROOT_PATH . "/modules/smallworld/include/functions.php"; -require_once XOOPS_ROOT_PATH - . "/modules/smallworld/class/class_collector.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 . '/class/template.php'; -global $xoopsConfig, $xoTheme, $xoopsModule; +if (!isset($xoopsTpl)) {$xoopsTpl = new XoopsTpl();} +$xoopsTpl->xoops_setCaching(0); -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) @@ -67,196 +66,122 @@ // FInd list of worst rated users overall $admin->topratedusers('down'); -$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_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)); -$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)); +$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)); // ---------------- end of tabs ---------------- // // template assignments -$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 . '/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(); + // 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(); SCRIPT; -$xoTheme->addStyleSheet('modules/smallworld/css/SmallworldAdmin.css'); -$xoTheme->addScript(XOOPS_URL.'/browse.php?Frameworks/jquery/jquery.js'); -$xoTheme->addScript( - XOOPS_URL.'/modules/smallworld/js/jquery-ui-1.8.11.custom.js' -); -$xoTheme->addScript('modules/smallworld/js/smallworld_tabs.js'); -$xoTheme->addScript('', '', $adminscript); -$xoTheme->addScript(XOOPS_URL . '/modules/smallworld/js/jquery.form.js'); -$xoTheme->addScript(XOOPS_URL . '/modules/smallworld/js/jquery.countdown.js'); - -if (file_exists( - XOOPS_ROOT_PATH . '/modules/smallworld/language/js/' - . $lang.'/jquery.ui.datepicker-language.js' -)) { - $xoTheme->addScript( - XOOPS_URL.'/modules/smallworld/language/' - . $lang . '/js/jquery.ui.datepicker-language.js' - ); - $xoTheme->addScript( - XOOPS_URL.'/modules/smallworld/language/' - . $lang.'/js/jquery.countdown.js' - ); -} else { - $xoTheme->addScript( - XOOPS_URL - . '/m... [truncated message content] |