From: <dj...@us...> - 2011-12-24 12:12:14
|
Revision: 8539 http://xoops.svn.sourceforge.net/xoops/?rev=8539&view=rev Author: djculex Date: 2011-12-24 12:12:03 +0000 (Sat, 24 Dec 2011) Log Message: ----------- Full opload of smallworld 1.0 for beta testing. Added Paths: ----------- XoopsModules/smallworld/trunk/Get_Count.php XoopsModules/smallworld/trunk/admin/ XoopsModules/smallworld/trunk/admin/admin_header.php XoopsModules/smallworld/trunk/admin/admintool.php XoopsModules/smallworld/trunk/admin/div_useradmin.php XoopsModules/smallworld/trunk/admin/index.html XoopsModules/smallworld/trunk/admin/index.php XoopsModules/smallworld/trunk/admin/menu.php XoopsModules/smallworld/trunk/avatarupload.php XoopsModules/smallworld/trunk/class/ XoopsModules/smallworld/trunk/class/adminclass.php XoopsModules/smallworld/trunk/class/class_collector.php XoopsModules/smallworld/trunk/class/db.php XoopsModules/smallworld/trunk/class/forms.php XoopsModules/smallworld/trunk/class/friends.php XoopsModules/smallworld/trunk/class/images.php XoopsModules/smallworld/trunk/class/index.html XoopsModules/smallworld/trunk/class/mail.php XoopsModules/smallworld/trunk/class/profile.php XoopsModules/smallworld/trunk/class/uploadclass.php XoopsModules/smallworld/trunk/class/user.php XoopsModules/smallworld/trunk/class/wall.php XoopsModules/smallworld/trunk/comment_ajax.php XoopsModules/smallworld/trunk/complaint.php XoopsModules/smallworld/trunk/css/ XoopsModules/smallworld/trunk/css/SmallworldAdmin.css XoopsModules/smallworld/trunk/css/apprise.css XoopsModules/smallworld/trunk/css/base/ XoopsModules/smallworld/trunk/css/base/images/ XoopsModules/smallworld/trunk/css/base/images/Thumbs.db XoopsModules/smallworld/trunk/css/base/images/index.html XoopsModules/smallworld/trunk/css/base/images/ui-bg_flat_0_aaaaaa_40x100.png XoopsModules/smallworld/trunk/css/base/images/ui-bg_flat_75_ffffff_40x100.png XoopsModules/smallworld/trunk/css/base/images/ui-bg_glass_55_fbf9ee_1x400.png XoopsModules/smallworld/trunk/css/base/images/ui-bg_glass_65_ffffff_1x400.png XoopsModules/smallworld/trunk/css/base/images/ui-bg_glass_75_dadada_1x400.png XoopsModules/smallworld/trunk/css/base/images/ui-bg_glass_75_e6e6e6_1x400.png XoopsModules/smallworld/trunk/css/base/images/ui-bg_glass_95_fef1ec_1x400.png XoopsModules/smallworld/trunk/css/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png XoopsModules/smallworld/trunk/css/base/images/ui-icons_222222_256x240.png XoopsModules/smallworld/trunk/css/base/images/ui-icons_2e83ff_256x240.png XoopsModules/smallworld/trunk/css/base/images/ui-icons_454545_256x240.png XoopsModules/smallworld/trunk/css/base/images/ui-icons_888888_256x240.png XoopsModules/smallworld/trunk/css/base/images/ui-icons_cd0a0a_256x240.png XoopsModules/smallworld/trunk/css/base/index.html XoopsModules/smallworld/trunk/css/base/jquery.ui.accordion.css XoopsModules/smallworld/trunk/css/base/jquery.ui.all.css XoopsModules/smallworld/trunk/css/base/jquery.ui.autocomplete.css XoopsModules/smallworld/trunk/css/base/jquery.ui.base.css XoopsModules/smallworld/trunk/css/base/jquery.ui.button.css XoopsModules/smallworld/trunk/css/base/jquery.ui.core.css XoopsModules/smallworld/trunk/css/base/jquery.ui.datepicker.css XoopsModules/smallworld/trunk/css/base/jquery.ui.dialog.css XoopsModules/smallworld/trunk/css/base/jquery.ui.progressbar.css XoopsModules/smallworld/trunk/css/base/jquery.ui.resizable.css XoopsModules/smallworld/trunk/css/base/jquery.ui.selectable.css XoopsModules/smallworld/trunk/css/base/jquery.ui.slider.css XoopsModules/smallworld/trunk/css/base/jquery.ui.tabs.css XoopsModules/smallworld/trunk/css/base/jquery.ui.theme.css XoopsModules/smallworld/trunk/css/basic.css XoopsModules/smallworld/trunk/css/black.css XoopsModules/smallworld/trunk/css/border-radius.htc XoopsModules/smallworld/trunk/css/galleriffic-5.css XoopsModules/smallworld/trunk/css/index.html XoopsModules/smallworld/trunk/css/jquery.fileupload-ui.css XoopsModules/smallworld/trunk/css/oembed.css XoopsModules/smallworld/trunk/css/smallworld.css XoopsModules/smallworld/trunk/css/ui-lightness/ XoopsModules/smallworld/trunk/css/ui-lightness/images/ XoopsModules/smallworld/trunk/css/ui-lightness/images/Thumbs.db XoopsModules/smallworld/trunk/css/ui-lightness/images/index.html XoopsModules/smallworld/trunk/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png XoopsModules/smallworld/trunk/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png XoopsModules/smallworld/trunk/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png XoopsModules/smallworld/trunk/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png XoopsModules/smallworld/trunk/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png XoopsModules/smallworld/trunk/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png XoopsModules/smallworld/trunk/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png XoopsModules/smallworld/trunk/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png XoopsModules/smallworld/trunk/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png XoopsModules/smallworld/trunk/css/ui-lightness/images/ui-icons_222222_256x240.png XoopsModules/smallworld/trunk/css/ui-lightness/images/ui-icons_228ef1_256x240.png XoopsModules/smallworld/trunk/css/ui-lightness/images/ui-icons_ef8c08_256x240.png XoopsModules/smallworld/trunk/css/ui-lightness/images/ui-icons_ffd27a_256x240.png XoopsModules/smallworld/trunk/css/ui-lightness/images/ui-icons_ffffff_256x240.png XoopsModules/smallworld/trunk/css/ui-lightness/index.html XoopsModules/smallworld/trunk/css/ui-lightness/jquery-ui-1.8.11.custom.css XoopsModules/smallworld/trunk/css/ui-lightness/jquery.ui.accordion.css XoopsModules/smallworld/trunk/css/ui-lightness/jquery.ui.all.css XoopsModules/smallworld/trunk/css/ui-lightness/jquery.ui.autocomplete.css XoopsModules/smallworld/trunk/css/ui-lightness/jquery.ui.base.css XoopsModules/smallworld/trunk/css/ui-lightness/jquery.ui.button.css XoopsModules/smallworld/trunk/css/ui-lightness/jquery.ui.core.css XoopsModules/smallworld/trunk/css/ui-lightness/jquery.ui.datepicker.css XoopsModules/smallworld/trunk/css/ui-lightness/jquery.ui.dialog.css XoopsModules/smallworld/trunk/css/ui-lightness/jquery.ui.progressbar.css XoopsModules/smallworld/trunk/css/ui-lightness/jquery.ui.resizable.css XoopsModules/smallworld/trunk/css/ui-lightness/jquery.ui.selectable.css XoopsModules/smallworld/trunk/css/ui-lightness/jquery.ui.slider.css XoopsModules/smallworld/trunk/css/ui-lightness/jquery.ui.tabs.css XoopsModules/smallworld/trunk/css/ui-lightness/jquery.ui.theme.css XoopsModules/smallworld/trunk/delete_comment_ajax.php XoopsModules/smallworld/trunk/delete_message_ajax.php XoopsModules/smallworld/trunk/docs/ XoopsModules/smallworld/trunk/docs/index.html XoopsModules/smallworld/trunk/down_vote.php XoopsModules/smallworld/trunk/editimages.php XoopsModules/smallworld/trunk/editprofile.php XoopsModules/smallworld/trunk/friendinvite.php XoopsModules/smallworld/trunk/friends.php XoopsModules/smallworld/trunk/galleryshow.php XoopsModules/smallworld/trunk/image_edit_submit.php XoopsModules/smallworld/trunk/images/ XoopsModules/smallworld/trunk/images/1.png XoopsModules/smallworld/trunk/images/2.png XoopsModules/smallworld/trunk/images/3.png XoopsModules/smallworld/trunk/images/accountdelete.png XoopsModules/smallworld/trunk/images/ajaxloader.gif XoopsModules/smallworld/trunk/images/alert.png XoopsModules/smallworld/trunk/images/ano_man.png XoopsModules/smallworld/trunk/images/ano_woman.png XoopsModules/smallworld/trunk/images/arrow_left_48.png XoopsModules/smallworld/trunk/images/arrow_right_48.png XoopsModules/smallworld/trunk/images/bdayballoons_l.png XoopsModules/smallworld/trunk/images/bdayballoons_r.png XoopsModules/smallworld/trunk/images/bg.png XoopsModules/smallworld/trunk/images/bookmarks.png XoopsModules/smallworld/trunk/images/calendar.gif XoopsModules/smallworld/trunk/images/caption.png XoopsModules/smallworld/trunk/images/complaint.png XoopsModules/smallworld/trunk/images/controls.png XoopsModules/smallworld/trunk/images/dislike.png XoopsModules/smallworld/trunk/images/dl-arr.png XoopsModules/smallworld/trunk/images/down-arr.gif XoopsModules/smallworld/trunk/images/edit_icon.png XoopsModules/smallworld/trunk/images/editavatar.png XoopsModules/smallworld/trunk/images/edituserprofile.png XoopsModules/smallworld/trunk/images/error.png XoopsModules/smallworld/trunk/images/genderless.png XoopsModules/smallworld/trunk/images/group.png XoopsModules/smallworld/trunk/images/house.png XoopsModules/smallworld/trunk/images/hr.png XoopsModules/smallworld/trunk/images/icon_start.png XoopsModules/smallworld/trunk/images/index.html XoopsModules/smallworld/trunk/images/information.png XoopsModules/smallworld/trunk/images/like.png XoopsModules/smallworld/trunk/images/loader.gif XoopsModules/smallworld/trunk/images/loaderWhite.gif XoopsModules/smallworld/trunk/images/main-red-bg.gif XoopsModules/smallworld/trunk/images/messenger.png XoopsModules/smallworld/trunk/images/next.png XoopsModules/smallworld/trunk/images/nextPageArrow.gif XoopsModules/smallworld/trunk/images/nextPageArrowWhite.gif XoopsModules/smallworld/trunk/images/nofriendbg.png XoopsModules/smallworld/trunk/images/pbar-ani.gif XoopsModules/smallworld/trunk/images/picture.png XoopsModules/smallworld/trunk/images/prev.png XoopsModules/smallworld/trunk/images/prevPageArrow.gif XoopsModules/smallworld/trunk/images/prevPageArrowWhite.gif XoopsModules/smallworld/trunk/images/smallworld.png XoopsModules/smallworld/trunk/images/socialnetworkicons/ XoopsModules/smallworld/trunk/images/socialnetworkicons/facebook.png XoopsModules/smallworld/trunk/images/socialnetworkicons/googleplus.png XoopsModules/smallworld/trunk/images/socialnetworkicons/icq.png XoopsModules/smallworld/trunk/images/socialnetworkicons/index.html XoopsModules/smallworld/trunk/images/socialnetworkicons/msn.png XoopsModules/smallworld/trunk/images/socialnetworkicons/myspace.png XoopsModules/smallworld/trunk/images/socialnetworkicons/skype.png XoopsModules/smallworld/trunk/images/socialnetworkicons/twitter.png XoopsModules/smallworld/trunk/images/socialnetworkicons/xoops.png XoopsModules/smallworld/trunk/images/socialnetworkicons/yahoo.png XoopsModules/smallworld/trunk/images/socialnetworkicons/youtube.png XoopsModules/smallworld/trunk/images/sp.png XoopsModules/smallworld/trunk/images/statistics.png XoopsModules/smallworld/trunk/images/text_bg.png XoopsModules/smallworld/trunk/images/time_add.png XoopsModules/smallworld/trunk/images/time_delete.png XoopsModules/smallworld/trunk/images/ul-breaker.png XoopsModules/smallworld/trunk/images/upd_critical.png XoopsModules/smallworld/trunk/images/upd_normal.png XoopsModules/smallworld/trunk/images/upd_ok.png XoopsModules/smallworld/trunk/images/user_green.png XoopsModules/smallworld/trunk/images/user_orange.png XoopsModules/smallworld/trunk/images/user_red.png XoopsModules/smallworld/trunk/images/user_silhouette.png XoopsModules/smallworld/trunk/images/userinfo.png XoopsModules/smallworld/trunk/img_upload.php XoopsModules/smallworld/trunk/imgupload.php XoopsModules/smallworld/trunk/include/ XoopsModules/smallworld/trunk/include/arrays.php XoopsModules/smallworld/trunk/include/functions.php XoopsModules/smallworld/trunk/include/getSelects.php XoopsModules/smallworld/trunk/include/index.html XoopsModules/smallworld/trunk/index.php XoopsModules/smallworld/trunk/js/ XoopsModules/smallworld/trunk/js/adminsmallworld.js XoopsModules/smallworld/trunk/js/ajaxupload.3.5.js XoopsModules/smallworld/trunk/js/apprise-1.5.full.js XoopsModules/smallworld/trunk/js/formToWizard.js XoopsModules/smallworld/trunk/js/gallery_mod.js XoopsModules/smallworld/trunk/js/geoname.js XoopsModules/smallworld/trunk/js/geoname_now.js XoopsModules/smallworld/trunk/js/index.html XoopsModules/smallworld/trunk/js/jquery-1.5.1.min.js XoopsModules/smallworld/trunk/js/jquery-ui-1.8.11.custom.js XoopsModules/smallworld/trunk/js/jquery.avatar_helper.js XoopsModules/smallworld/trunk/js/jquery.bookmark.js XoopsModules/smallworld/trunk/js/jquery.countdown.js XoopsModules/smallworld/trunk/js/jquery.elastic.source.js XoopsModules/smallworld/trunk/js/jquery.fileupload-ui.js XoopsModules/smallworld/trunk/js/jquery.fileupload-uix.js XoopsModules/smallworld/trunk/js/jquery.fileupload.js XoopsModules/smallworld/trunk/js/jquery.form.js XoopsModules/smallworld/trunk/js/jquery.galleriffic.js XoopsModules/smallworld/trunk/js/jquery.history.js XoopsModules/smallworld/trunk/js/jquery.innerfade.js XoopsModules/smallworld/trunk/js/jquery.oembed.js XoopsModules/smallworld/trunk/js/jquery.opacityrollover.js XoopsModules/smallworld/trunk/js/jquery.stepy.js XoopsModules/smallworld/trunk/js/jquery.validate.js XoopsModules/smallworld/trunk/js/jquery.validation.functions.js XoopsModules/smallworld/trunk/js/smallworld.js XoopsModules/smallworld/trunk/js/smallworld_tabs.js XoopsModules/smallworld/trunk/js/ui.geo_autocomplete.js XoopsModules/smallworld/trunk/js/ui.geo_autocomplete_now.js XoopsModules/smallworld/trunk/js/upload_application.js XoopsModules/smallworld/trunk/js/wall.js XoopsModules/smallworld/trunk/language/ XoopsModules/smallworld/trunk/language/danish/ XoopsModules/smallworld/trunk/language/danish/index.html XoopsModules/smallworld/trunk/language/danish/js/ XoopsModules/smallworld/trunk/language/danish/js/index.html XoopsModules/smallworld/trunk/language/danish/js/jquery.ui.datepicker-language.js XoopsModules/smallworld/trunk/language/english/ XoopsModules/smallworld/trunk/language/english/admin.php XoopsModules/smallworld/trunk/language/english/index.html XoopsModules/smallworld/trunk/language/english/js/ XoopsModules/smallworld/trunk/language/english/js/index.html XoopsModules/smallworld/trunk/language/english/js/jquery.countdown.js XoopsModules/smallworld/trunk/language/english/js/jquery.ui.datepicker-language.js XoopsModules/smallworld/trunk/language/english/js/variables.js XoopsModules/smallworld/trunk/language/english/mailTpl/ XoopsModules/smallworld/trunk/language/english/mailTpl/index.html XoopsModules/smallworld/trunk/language/english/mailTpl/mail_attencionneeded.html XoopsModules/smallworld/trunk/language/english/mailTpl/mail_complaint.html XoopsModules/smallworld/trunk/language/english/mailTpl/mail_newcomment.html XoopsModules/smallworld/trunk/language/english/mailTpl/mail_register.html XoopsModules/smallworld/trunk/language/english/main.php XoopsModules/smallworld/trunk/language/english/modinfo.php XoopsModules/smallworld/trunk/language/index.html XoopsModules/smallworld/trunk/loadmore.php XoopsModules/smallworld/trunk/message_ajax.php XoopsModules/smallworld/trunk/partnersearch.php XoopsModules/smallworld/trunk/permalink.php XoopsModules/smallworld/trunk/preloads/ XoopsModules/smallworld/trunk/preloads/core.php XoopsModules/smallworld/trunk/preloads/index.html XoopsModules/smallworld/trunk/register.php XoopsModules/smallworld/trunk/search.php XoopsModules/smallworld/trunk/smallworldshare.php XoopsModules/smallworld/trunk/sql/ XoopsModules/smallworld/trunk/sql/index.html XoopsModules/smallworld/trunk/sql/mysql.sql XoopsModules/smallworld/trunk/stats.php XoopsModules/smallworld/trunk/submit.php XoopsModules/smallworld/trunk/templates/ XoopsModules/smallworld/trunk/templates/getStat.html XoopsModules/smallworld/trunk/templates/getlastcom.html XoopsModules/smallworld/trunk/templates/getlastmsg.html XoopsModules/smallworld/trunk/templates/getmore.html XoopsModules/smallworld/trunk/templates/index.html XoopsModules/smallworld/trunk/templates/smallworld_admin.html XoopsModules/smallworld/trunk/templates/smallworld_alluserstodiv.html XoopsModules/smallworld/trunk/templates/smallworld_friends_template.html XoopsModules/smallworld/trunk/templates/smallworld_galleryshow.html XoopsModules/smallworld/trunk/templates/smallworld_images_edittemplate.html XoopsModules/smallworld/trunk/templates/smallworld_index.html XoopsModules/smallworld/trunk/templates/smallworld_permalink.html XoopsModules/smallworld/trunk/templates/smallworld_share.html XoopsModules/smallworld/trunk/templates/smallworld_userprofile_edittemplate.html XoopsModules/smallworld/trunk/templates/smallworld_userprofile_imgupload.html XoopsModules/smallworld/trunk/templates/smallworld_userprofile_regtemplate.html XoopsModules/smallworld/trunk/templates/smallworld_userprofile_template.html XoopsModules/smallworld/trunk/up_vote.php XoopsModules/smallworld/trunk/userprofile.php XoopsModules/smallworld/trunk/xoops_version.php Added: XoopsModules/smallworld/trunk/Get_Count.php =================================================================== --- XoopsModules/smallworld/trunk/Get_Count.php (rev 0) +++ XoopsModules/smallworld/trunk/Get_Count.php 2011-12-24 12:12:03 UTC (rev 8539) @@ -0,0 +1,31 @@ +<?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 +* @package modules +* @subpackage Small World +* @since 1.0.0 +* @author Culex - homepage.: http://culex.dk & email.: cu...@cu... +**/ +include '../../mainfile.php'; +include_once (XOOPS_ROOT_PATH.'/class/template.php'); +include_once(XOOPS_ROOT_PATH."/modules/smallworld/include/functions.php"); +include_once(XOOPS_ROOT_PATH."/modules/smallworld/class/class_collector.php"); + +global $xoopsUser, $xoopsLogger, $xoopsDB; +$xoopsLogger->activated = false; +if ($xoopsUser) { + if($_GET['SmallworldGetUserMsgCount']) { + $counts = smallworld_getCountFriendMessagesEtc (); + header('Content-type: application/json'); + echo "{\"NewUserMsgCount\":$counts}"; + } +} +?> \ No newline at end of file Added: XoopsModules/smallworld/trunk/admin/admin_header.php =================================================================== --- XoopsModules/smallworld/trunk/admin/admin_header.php (rev 0) +++ XoopsModules/smallworld/trunk/admin/admin_header.php 2011-12-24 12:12:03 UTC (rev 8539) @@ -0,0 +1,40 @@ +<?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 +* @package modules +* @subpackage Small World +* @since 1.0.0 +* @author Culex - homepage.: http://culex.dk & email.: cu...@cu... +**/ + + 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 Added: XoopsModules/smallworld/trunk/admin/admintool.php =================================================================== --- XoopsModules/smallworld/trunk/admin/admintool.php (rev 0) +++ XoopsModules/smallworld/trunk/admin/admintool.php 2011-12-24 12:12:03 UTC (rev 8539) @@ -0,0 +1,51 @@ +<?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 +* @package modules +* @subpackage Small World +* @since 1.0.0 +* @author Culex - homepage.: http://culex.dk & email.: cu...@cu... +**/ + +require_once 'admin_header.php'; +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); + } + +} +if ($_POST['type'] == 'deletetime') { + $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 Added: XoopsModules/smallworld/trunk/admin/div_useradmin.php =================================================================== --- XoopsModules/smallworld/trunk/admin/div_useradmin.php (rev 0) +++ XoopsModules/smallworld/trunk/admin/div_useradmin.php 2011-12-24 12:12:03 UTC (rev 8539) @@ -0,0 +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. +* 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 +* @package modules +* @subpackage Small World +* @since 1.0.0 +* @author Culex - homepage.: http://culex.dk & email.: cu...@cu... +**/ + +require_once 'admin_header.php'; +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(); +$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['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['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 Added: XoopsModules/smallworld/trunk/admin/index.html =================================================================== --- XoopsModules/smallworld/trunk/admin/index.html (rev 0) +++ XoopsModules/smallworld/trunk/admin/index.html 2011-12-24 12:12:03 UTC (rev 8539) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsModules/smallworld/trunk/admin/index.php =================================================================== --- XoopsModules/smallworld/trunk/admin/index.php (rev 0) +++ XoopsModules/smallworld/trunk/admin/index.php 2011-12-24 12:12:03 UTC (rev 8539) @@ -0,0 +1,179 @@ +<?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 +* @package modules +* @subpackage Small World +* @since 1.0.0 +* @author Culex - homepage.: http://culex.dk & email.: cu...@cu... +**/ + +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 . '/class/template.php'; +if (!isset($xoopsTpl)) {$xoopsTpl = new XoopsTpl();} +$xoopsTpl->xoops_setCaching(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()); +// Get days number +$totaldays = $admin->CountDays(); +// get average messages per day +$avgperday = $admin->AvgMsgDay ($totaldays); +// XIM version number +$installversion = $admin->ModuleInstallVersion (); +// XIM install date +$installdate = $admin->ModuleInstallDate (); + +//check current version of XIM, return desc,link,version if new available +$installCheck = $admin->doCheckUpdate (); + +// Count members using XIM +$sumallusers = $admin->TotalUsers (); +// Find list of most active users (total) +$admin->mostactiveusers_allround(); +// Find list of most active users (24 hours) +$admin->mostactiveusers_today(); + +// FInd list of best rated users overall +$admin->topratedusers('up'); + +// 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['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['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(); +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.'/modules/smallworld/language/english/js/jquery.ui.datepicker-language.js'); + $xoTheme->addScript(XOOPS_URL.'/modules/smallworld/language/english/js/jquery.countdown.js'); + } + $xoTheme->addScript(XOOPS_URL . '/modules/smallworld/js/adminsmallworld.js'); + +xoops_cp_footer(); +?> Added: XoopsModules/smallworld/trunk/admin/menu.php =================================================================== --- XoopsModules/smallworld/trunk/admin/menu.php (rev 0) +++ XoopsModules/smallworld/trunk/admin/menu.php 2011-12-24 12:12:03 UTC (rev 8539) @@ -0,0 +1,20 @@ +<?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 +* @package modules +* @subpackage Small World +* @since 1.0.0 +* @author Culex - homepage.: http://culex.dk & email.: cu...@cu... +**/ + +$adminmenu[1]['title'] = _MI_SMALLWORLD_ADMENU; +$adminmenu[1]['link'] = 'admin/index.php'; +?> \ No newline at end of file Added: XoopsModules/smallworld/trunk/avatarupload.php =================================================================== --- XoopsModules/smallworld/trunk/avatarupload.php (rev 0) +++ XoopsModules/smallworld/trunk/avatarupload.php 2011-12-24 12:12:03 UTC (rev 8539) @@ -0,0 +1,47 @@ +<?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 +* @package modules +* @subpackage Small World +* @since 1.0.0 +* @author Culex - homepage.: http://culex.dk & email.: cu...@cu... +**/ +global $xoopsUser, $xoopsLogger; +include_once("../../mainfile.php"); +include_once(XOOPS_ROOT_PATH."/modules/smallworld/class/class_collector.php"); +include_once(XOOPS_ROOT_PATH."/modules/smallworld/include/functions.php"); + if ($xoopsUser) { + $xoopsLogger->activated = false; + $userID = $xoopsUser->getVar('uid'); + $user = new XoopsUser($userID); + $db = new SmallWorldDB; + + $uploaddir = XOOPS_ROOT_PATH.'/uploads/avatars/'; + $file = $uploaddir . basename($_FILES['smallworld_uploadfile']['name']); + $newname = time().rand(0,99999); + + // Generate new name for file + $f = explode(".",basename(stripslashes($_FILES['smallworld_uploadfile']['name']))); + $newname = time().rand(0000,9999).".".$f[1]; + $newfile = $uploaddir . basename($newname); + // Save new name to users profile in DB + $dbuserimage = "avatars/".basename(stripslashes($newfile )); + $db->updateSingleValue ('smallworld_user', $userID, 'userimage',$dbuserimage ); + $db->updateSingleValue ('smallworld_admin', $userID, 'userimage',$dbuserimage ); + + // Return json array [0] = succes text and [1]= basename of the new file name... + if (move_uploaded_file($_FILES['smallworld_uploadfile']['tmp_name'], $newfile)) { + echo json_encode( array( 'success', basename(stripslashes($newfile ))) ) ; + } else { + echo "error"; + } + } +?> \ No newline at end of file Added: XoopsModules/smallworld/trunk/class/adminclass.php =================================================================== --- XoopsModules/smallworld/trunk/class/adminclass.php (rev 0) +++ XoopsModules/smallworld/trunk/class/adminclass.php 2011-12-24 12:12:03 UTC (rev 8539) @@ -0,0 +1,273 @@ +<?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 +* @package modules +* @subpackage Small World +* @since 1.0.0 +* @author Culex - homepage.: http://culex.dk & email.: cu...@cu... +**/ + + +class SmallworldAdmin { + // Get oldes message in Db + function oldestMsg () { + global $xoopsDB; + $sql = "SELECT * FROM ".$xoopsDB->prefix('smallworld_messages')." ORDER BY created limit 1"; + $result = $xoopsDB->queryF($sql); + $counter = $xoopsDB->getRowsNum($result); + if ($counter < 1) {$date = _AM_SMALLWORLD_NONEYET;} + while ($sqlfetch = $xoopsDB->fetchArray($result)) { + $date = $sqlfetch['created']; + } + return $date; + } + + // Get average messages sent per day + function AvgMsgDay ($totaldays) { + global $xoopsDB; + $sql = "SELECT count( * ) / ".$totaldays." AS averg FROM ".$xoopsDB->prefix('smallworld_messages').""; + $result = $xoopsDB->queryF($sql); + while ($sqlfetch = $xoopsDB->fetchArray($result)) { + $avg = number_format($sqlfetch['averg'], 2, '.', ','); + } + return $avg; + } + + // total users using smallworld + function TotalUsers () { + global $xoopsDB; + $sql = "SELECT * FROM ".$xoopsDB->prefix('smallworld_user').""; + $result = $xoopsDB->queryF($sql); + $counter = $xoopsDB->getRowsNum($result); + if ($counter < 1) { + $sum = 0; + } else { + $i = 0; + while ( $myrow = $xoopsDB->fetchArray($result) ) { + $user[$i]['username'] = $myrow['username']; + $i++; + } + $all = $this->flatten($user); + $sum = count(array_unique($all)); + $unique = array_unique($all); + } + return $sum; + } + + // Get version of module + function ModuleInstallVersion () { + global $xoopsModule; + $version = round($xoopsModule->getVar('version') / 100, 2); + return $version; + } + + // Get date when Module was installed + function ModuleInstallDate () { + global $xoopsModule; + $date = formatTimestamp($xoopsModule->getVar('last_update'),'m'); + return $date; + } + + // Count total days represented in db + function CountDays () { + global $xoopsDB,$xoopsModule; + $date = $xoopsModule->getVar('last_update'); + $now = time(); + $diff = ($now - $date) / (60); + return $diff; + } + // find user with most posted messages + function mostactiveusers_allround() { + global $xoopsDB,$xoopsUser,$xoopsTpl; + $sql = "SELECT uid_fk, COUNT( * ) as cnt "; + $sql .= "FROM ( "; + $sql .= "SELECT uid_fk "; + $sql .= "FROM xoops_smallworld_messages "; + $sql .= "UNION ALL SELECT uid_fk "; + $sql .= "FROM xoops_smallworld_comments "; + $sql .= ") AS u "; + $sql .= "GROUP BY uid_fk "; + $sql .= "ORDER BY count( * ) DESC limit 20"; + $result = $xoopsDB->queryF($sql); + $counter = $xoopsDB->getRowsNum($result); + + if ($counter < 1) { + $msg['cnt'] = _AM_SMALLWORLD_NO; + $msg['uid_fk'] = _AM_SMALLWORLD_THEREARE; + $xoopsTpl->append('topuser', $msg); + } else { + $msg = array(); + $counter = 1; + while ($row = $xoopsDB->fetchArray($result)) { + $msg["counter"] = $counter; + $msg["img"] = "<img src = '../images/".$counter.".png'></img>"; + if ($msg['counter'] > 3) { $msg["img"] = '';} + $msg["cnt"] = $row["cnt"]; + $msg["from"] = $xoopsUser->getUnameFromId($row["uid_fk"]); + $xoopsTpl->append('topuser', $msg); + $counter++; + } + } + return $msg; + } + // find user with most posted messages in last 24 hours + function mostactiveusers_today() { + global $xoopsDB,$xoopsUser,$xoopsTpl; + $sql = "SELECT uid_fk, COUNT( * ) as cnt "; + $sql .= "FROM ( "; + $sql .= "SELECT uid_fk "; + $sql .= "FROM ".$xoopsDB->prefix('smallworld_messages')." "; + $sql .= "WHERE `created` > UNIX_TIMESTAMP(DATE_SUB( NOW( ) , INTERVAL 1 DAY )) "; + $sql .= "UNION ALL SELECT uid_fk "; + $sql .= "FROM ".$xoopsDB->prefix('smallworld_comments')." "; + $sql .= "WHERE `created` > UNIX_TIMESTAMP(DATE_SUB( NOW( ) , INTERVAL 1 DAY )) "; + $sql .= ") AS u "; + $sql .= "GROUP BY uid_fk "; + $sql .= "ORDER BY count( * ) DESC limit 20"; + $result = $xoopsDB->queryF($sql); + if ($xoopsDB->getRowsNum($result) > 0) { + $msgtoday = array(); + $counter = 1; + while ($row = $xoopsDB->fetchArray($result)) { + $msgtoday["counter"] = $counter; + $msgtoday["img"] = "<img src = '../images/".$counter.".png'></img>"; + if ($msgtoday['counter'] > 3) { $msgtoday["img"] = '';} + $msgtoday["cnt"] = $row["cnt"]; + $msgtoday["from"] = $xoopsUser->getUnameFromId($row["uid_fk"]); + $xoopsTpl->append('topusertoday', $msgtoday); + $counter++; + } + } else { + $msgtoday['cnt'] = _AM_SMALLWORLD_NO; + $msgtoday['from'] = _AM_SMALLWORLD_THEREARE; + $xoopsTpl->append('topusertoday', $msgtoday); + } + return $msgtoday; + } + + // Find best rated users overall + function topratedusers($direction) { + global $xoopsUser, $xoopsDB,$xoopsTpl; + $array = array(); + $counter = 1; + if ($direction == 'up') { + $sql = "SELECT owner, count(*) as cnt FROM ".$xoopsDB->prefix('smallworld_vote')." where up='1' GROUP by owner ORDER BY cnt DESC limit 20"; + $result = $xoopsDB->queryF($sql); + while ($row = $xoopsDB->fetchArray($result)) { + $array['counter'] = $counter; + $array['img'] = "<img src = '../images/".$counter.".png'></img>"; + if ($array['counter'] > 3) { $array["img"] = '';} + $array['cnt'] = $row['cnt']; + $array['user'] = $xoopsUser->getUnameFromId($row["owner"]); + $xoopsTpl->append('topratedusers', $array); + $counter++; + } + } else { + $sql = "SELECT owner, count(*) as cnt FROM ".$xoopsDB->prefix('smallworld_vote')." where down='1' GROUP by owner ORDER BY cnt DESC limit 20"; + $result = $xoopsDB->queryF($sql); + while ($row = $xoopsDB->fetchArray($result)) { + $array['counter'] = $counter; + $array['img'] = "<img src = '../images/".$counter.".png'></img>"; + if ($array['counter'] > 3) { $array["img"] = '';} + $array['cnt'] = $row['cnt']; + $array['user'] = $xoopsUser->getUnameFromId($row["owner"]); + $xoopsTpl->append('bottomratedusers', $array); + $counter++; + } + } + + } + + // Get all users to loop in admin for administration + function getAllUsers ($inspect) { + global $xoopsDB, $xoopsUser, $xoopsTpl; + $data = array(); + if ($inspect == 'yes') { + $sql = "SELECT * FROM ".$xoopsDB->prefix('smallworld_admin')." WHERE (inspect_start + inspect_stop) >= ".time()." ORDER BY username"; + } else { + $sql = "SELECT * FROM ".$xoopsDB->prefix('smallworld_admin')." WHERE (inspect_start + inspect_stop) < ".time()." ORDER BY username"; + } + $result = $xoopsDB->queryF($sql); + $count = $xoopsDB->getRowsNum($result); + if ($count != 0) { + while ($row = $xoopsDB->fetchArray($result)) { + $data[]=$row; + } + } + if(!empty($data)) { + return $data; + } + } + + // check server if update is available + // Server currently at culex.dk + // Variable $version = current xim version number + // return csv file with (version, description, status, downloadUrl) + function doCheckUpdate () { + $version = $this->ModuleInstallVersion (); + $critical = FALSE; + $update = FALSE; + $rt = ''; + + $url = "http://www.culex.dk/updates/smallworld_version.csv"; + $fileC = file_get_contents($url); + $read = explode(";", $fileC); + $upd_img = '../images/upd_ok.png'; + if ($read[0] > $version && $read[2] == "1") { + $critical = TRUE; + $upd_img = '../images/upd_critical.png'; + } + if ($read[0] > $version && $read[2] != "1") { + $update = TRUE; + $upd_img = '../images/upd_normal.png'; + } + if ($critical) { + $rt = "<div class='smallworld_update'><span class='smallworld_update_header'><img class='smallworld_upd_img' src='".$upd_img."' />"._AM_SMALLWORLD_UPDATE_CRITICAL_UPD."</span></div></p>"; + $rt .="<textarea class='xim_update_changelog'>".$read[1]."</textarea><br /><br />"; + $rt .=_AM_SMALLWORLD_UPDATE_SERVER_FILE."<br /><a href='".$read[3]."'>".$read[3]."</a></div><br/>"; + } else if ($update) { + $rt = "<div class='smallworld_update'><span class='smallworld_update_header'><img class='smallworld_upd_img' src='".$upd_img."' />"._AM_SMALLWORLD_UPDATE_NORMAL_UPD."</span></div></p>"; + $rt .= "<textarea class='smallworld_update_changelog'>".$read[1]."</textarea><br /><br />"; + $rt .="<p>". _AM_SMALLWORLD_UPDATE_SERVER_FILE."<br /><a href='".$read[3]."'>".$read[3]."</a>"; + } else { + $rt = "<div class='smallworld_update'><span class='smallworld_update_header'><img class='smallworld_upd_img' src='".$upd_img."' />"._AM_SMALLWORLD_UPDATE_YOUHAVENEWESTVERSION."</span></div><br />"; + } + return $rt; + } + + // flatten multidimentional arrays to one dimentional + function flatten($array) { + $return = array(); + while(count($array)) { + $value = array_shift($array); + if(is_array($value)) + foreach($value as $sub) + $array[] = $sub; + else + $return[] = $value; + } + return $return; + } + + function sanitize($text) { + $text = htmlspecialchars($text, ENT_QUOTES); + //$text = preg_replace('/([^\s]{10})(?=[^\s])/m', '$1<br />', $text); + $myts = MyTextSanitizer::getInstance(); + $text = $myts->displayTarea($text,1,1,1,1); + $text = str_replace("\n\r","\n",$text); + $text = str_replace("\r\n","\n",$text); + $text = str_replace("\n","<br />",$text); + $text = str_replace("\"","'",$text); + + return $text; + } +} +?> \ No newline at end of file Added: XoopsModules/smallworld/trunk/class/class_collector.php =================================================================== --- XoopsModules/smallworld/trunk/class/class_collector.php (rev 0) +++ XoopsModules/smallworld/trunk/class/class_collector.php 2011-12-24 12:12:03 UTC (rev 8539) @@ -0,0 +1,28 @@ +<?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 +* @package modules +* @subpackage Small World +* @since 1.0.0 +* @author Culex - homepage.: http://culex.dk & email.: cu...@cu... +**/ +include_once(XOOPS_ROOT_PATH."/modules/smallworld/class/adminclass.php"); +include_once(XOOPS_ROOT_PATH."/modules/smallworld/class/db.php"); +include_once(XOOPS_ROOT_PATH."/modules/smallworld/class/user.php"); +include_once(XOOPS_ROOT_PATH."/modules/smallworld/class/images.php"); +include_once(XOOPS_ROOT_PATH."/modules/smallworld/class/profile.php"); +include_once(XOOPS_ROOT_PATH."/modules/smallworld/class/wall.php"); +include_once(XOOPS_ROOT_PATH."/modules/smallworld/class/forms.php"); +include_once(XOOPS_ROOT_PATH."/modules/smallworld/class/uploadclass.php"); +include_once(XOOPS_ROOT_PATH."/modules/smallworld/class/friends.php"); +include_once(XOOPS_ROOT_PATH."/modules/smallworld/class/mail.php"); + +?> \ No newline at end of file Added: XoopsModules/smallworld/trunk/class/db.php =================================================================== --- XoopsModules/smallworld/trunk/class/db.php (rev 0) +++ XoopsModules/smallworld/trunk/class/db.php 2011-12-24 12:12:03 UTC (rev 8539) @@ -0,0 +1,454 @@ +<?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 +* @package modules +* @subpackage Small World +* @since 1.0.0 +* @author Culex - homepage.: http://culex.dk & email.: cu...@cu... +**/ + +class SmallWorldDB { + + function getJobsToDiv ($id) { + global $xoopsUser, $xoopsDB; + $msg=array(); + $new=array(); + $sql = "SELECT employer,position,jobstart,jobstop,description FROM ".$xoopsDB->prefix("smallworld_user")." WHERE userid ='".$id."'"; + $result = $xoopsDB->query($sql); + while ($row = $xoopsDB->fetchArray($result)) { + $employer = unserialize($row['employer']); + $position = unserialize($row['position']); + $jobstart = unserialize($row['jobstart']); + $jobstop = unserialize($row['jobstop']); + $description = unserialize($row['description']); + } + $start = 0; + $end = count($employer)-1; + while ($start<=$end) { + $msg[$start]['employer'] = $employer[$start]; + $msg[$start]['position'] = $position[$start]; + $msg[$start]['jobstart'] = date('d-m-Y',$jobstart[$start]); + $msg[$start]['jobstop'] = date('d-m-Y',$jobstop[$start]); + $msg[$start]['description'] = $description[$start]; + $start++; + } + return $msg; + } + + + function getSchoolToDiv ($id) { + global $xoopsUser, $xoopsDB,$arr7; + $msg=array(); + $sql = "SELECT school_type,school,schoolstart,schoolstop FROM ".$xoopsDB->prefix("smallworld_user")." WHERE userid ='".$id."'"; + $result = $xoopsDB->query($sql); + while ($row = $xoopsDB->fetchArray($result)) { + $school_type = unserialize($row['school_type']); + $school = unserialize($row['school']); + $schoolstart = unserialize($row['schoolstart']); + $schoolstop = unserialize($row['schoolstop']); + } + $start = 0; + $end = count($school_type)-1; + while ($start<=$end) { + $msg[$start]['school_type'] = $school_type[$start]; + $msg[$start]['school'] = $arr7[$school[$start]]; + $msg[$start]['schoolstart'] = date('d-m-Y',$schoolstart[$start]); + $msg[$start]['schoolstop'] = date('d-m-Y',$schoolstop[$start]); + $start++; + } + return $msg; + } + + function getScreennamesToDiv ($id) { + global $xoopsUser, $xoopsDB,$arr06; + $msg=array(); + $sql = "SELECT screenname_type,screenname FROM ".$xoopsDB->prefix("smallworld_user")." WHERE userid ='".$id."'"; + $result = $xoopsDB->query($sql); + while ($row = $xoopsDB->fetchArray($result)) { + $screenname_type = unserialize($row['screenname_type']); + $screenname = unserialize($row['screenname']); + } + $start = 0; + $end = count($screenname_type)-1; + while ($start<=$end) { + $msg[$start]['screenname'] = $screenname_type[$start]; + $msg[$start]['screenname_type'] = $arr06[$screenname[$start]]; + $msg[$start]['link'] = "<span class='smallworld_website'>".Smallworld_sociallinks($screenname[$start], $msg[$start]['screenname']); + $start++; + } + return $msg; + } + +// Do query in db + function getVar ($id, $var) { + global $xoopsUser, $xoopsDB; + $sql = "SELECT ".$var." FROM ".$xoopsDB->prefix('smallworld_user')." WHERE userid = '".$id."'"; + $result = $xoopsDB->queryF($sql); + if ($xoopsDB->getRowsNum($result) < 1) { + return _SMALLWORLD_REPLY_NOTSPECIFIYED; + } + while ($row = $xoopsDB->fetchArray($result)) { + $msg[$var] = $row[$var]; + } + return $msg[$var]; + } + + function updateSingleValue ($table, $userid, $field, $value) { + global $xoopsUser, $xoopsDB; + $myts =& MyTextSanitizer::getInstance(); + $sql = "UPDATE ".$xoopsDB->prefix($table)." SET ".$field."='".$myts->addSlashes($value)."' WHERE userid='".intval($userid)."'"; + $result =$xoopsDB->queryF($sql); + } + + function saveImage ($values) { + global $xoopsUser, $xoopsDB; + $myts =& MyTextSanitizer::getInstance(); + $sql = "INSERT INTO ".$xoopsDB->prefix('smallworld_images')." VALUES (".$values.")"; + $result =$xoopsDB->queryF($sql); + } + + function DeleteImage ($userid, $imagename) { + global $xoopsUser, $xoopsDB; + $myts =& MyTextSanitizer::getInstance(); + $sql = "DELETE FROM ".$xoopsDB->prefix('smallworld_images')." WHERE imgname = '".stripslashes($imagename)."' AND userid='".$userid."'"; + $result =$xoopsDB->queryF($sql); + } + + function handlePosts () { + global $xoopsUser,$xoopsDB; + $myts =& MyTextSanitizer::getInstance(); + + $uid = $xoopsUser->getVar('uid'); + $user = new XoopsUser($uid); + $img = new SmallWorldImages; + + if ($this->getVar($uid,'userimage') =='') { + $avatar =$user->user_avatar(); + } else { + $avatar = $this->getVar($uid, 'userimage'); + } + + if ($_POST['relationship'] != '2') { + $partner = sanitize($_POST['partner']); + } else { + $partner = ''; + } + + $regdate = time(); + $username = $user->uname(); + $realname = sanitize($_POST['realname']); + $gender = sanitize($_POST['gender']); + $intingender = sanitize(serialize($_POST['intingender'])); + $relationship = sanitize($_POST['relationship']); + $searchrelat = sanitize(serialize($_POST['searchrelat'])); + $birthday = sanitize(euroToUsDate($_POST['birthday'])); + $birthplace = sanitize($_POST['birthplace']); + $birthplace_lat = sanitize($_POST['birthplace_lat']); + $birthplace_lng = sanitize($_POST['birthplace_lng']); + $birthplace_country = sanitize($_POST['birthplace_country']); + $birthplace_country_img = sanitize($_POST['birthplace_country_img']); + $politic = sanitize($_POST['politic']); + $religion = sanitize($_POST['religion']); + $emailtype = sanitize(serialize($_POST['emailtype'])); + $screenname_type = sanitize(serialize($_POST['screenname_type'])); + $screenname = sanitize(serialize($_POST['screenname'])); + $mobile = sanitize($_POST['mobile']); + $phone = sanitize($_POST['phone']); + $adress = sanitize($_POST['adress']); + $present_city = sanitize($_POST['present_city']); + $present_lat = sanitize($_POST['present_lat']); + $present_lng = sanitize($_POST['present_lng']); + $present_country = sanitize($_POST['present_country']); + $present_country_img = sanitize($_POST['present_country_img']); + $website = sanitize($_POST['website']); + $interests = sanitize($_POST['interests']); + $music = sanitize($_POST['music']); + $tvshow = sanitize($_POST['tvshow']); + $movie = sanitize($_POST['movie']); + $books = sanitize($_POST['books']); + $aboutme = sanitize($_POST['aboutme']); + $school_type = sanitize(serialize($_POST['school_type'])); + $school = sanitize(serialize($_POST['school'])); + $schoolstart = sanitize(serialize(DateOfArray ($_POST['schoolstart']))); + $schoolstop = sanitize(serialize(DateOfArray ($_POST['schoolstop']))); + $jobemployer = sanitize(serialize($_POST['employer'])); + $jobposition = sanitize(serialize($_POST['position'])); + $jobstart = sanitize(serialize(DateOfArray ($_POST['jobstart']))); + $jobstop = sanitize(serialize(DateOfArray ($_POST['jobstop']))); + $jobdescription = sanitize(serialize($_POST['description'])); + + $sql = ''; + + if ($_POST['function']=='edit') { + // Update all values in user_table + $sql = "UPDATE ".$xoopsDB->prefix('smallworld_user')." SET "; + $sql .= "realname = '".$realname."', username= '".$username."', userimage = '".$avatar."', gender = '".$gender."',"; + $sql .= "intingender = '".$intingender."',relationship = '".$relationship."', partner = '".$partner."', searchrelat = '".$searchrelat."',"; + $sql .= "birthday = '".$birthday."',birthplace = '".$birthplace."',birthplace_lat = '".floatval($birthplace_lat)."',"; + $sql .= "birthplace_lng = '".floatval($birthplace_lng)."',birthplace_country = '".$birthplace_country."',politic = '".$politic."',"; + $sql .= "religion = '".$religion."',emailtype = '".$emailtype."',screenname_type = '".$screenname_type."',"; + $sql .= "screenname = '".$screenname."',mobile = '".floatval($mobile)."',phone = '".floatval($phone)."',adress = '".$adress."',"; + $sql .= "present_city = '".$present_city."',present_lat = '".floatval($present_lat)."',present_lng = '".floatval($present_lng)."',"; + $sql .= "present_country = '".$present_country."',website = '".$website."',interests = '".$interests."',"; + $sql .= "music = '".$music."',tvshow = '".$tvshow."',movie = '".$movie."',"; + $sql .= "books = '".$books."',aboutme = '".$aboutme."',school_type = '".$school_type."',"; + $sql .= "school = '".$school."', schoolstart = '".$schoolstart."',sc... [truncated message content] |