// // ------------------------------------------------------------------------ // // This program is free software; you can redistribute it and/or modify // // it under the terms of the GNU General Public License as published by // // the Free Software Foundation; either version 2 of the License, or // // (at your option) any later version. // // // // 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. See the // // GNU General Public License for more details. // // // // You should have received a copy of the GNU General Public License // // along with this program; if not, write to the Free Software // // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // ------------------------------------------------------------------------ // include "mainfile.php"; // // Fall back on simple protector of common.php by checking the constant that // is defined in common.php // if (!defined("XOOPS_CACHE_PATH")) { die(); } include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/misc.php'; $action = isset($_GET['action']) ? trim($_GET['action']) : ''; $action = isset($_POST['action']) ? trim($_POST['action']) : $action; $type = isset($_GET['type']) ? trim($_GET['type']) : ''; $type = isset($_POST['type']) ? trim($_POST['type']) : $type; if ( $action == "showpopups" ) { xoops_header(false); // show javascript close button? $closebutton = 1; switch ( $type ) { case "smilies": $target = isset($_GET['target']) ? trim($_GET['target']) : ''; if ($target == '' || !preg_match('/^[0-9a-z_]*$/i', $target)) { } else { echo " "; echo ' '; if ($getsmiles = $xoopsDB->query("SELECT * FROM ".$xoopsDB->prefix("smiles"))) { $rcolor = 'even'; while ( $smile = $xoopsDB->fetchArray($getsmiles) ) { echo ""; $rcolor = ($rcolor == 'even') ? 'odd' : 'even'; } } else { echo "Could not retrieve data from the database."; } echo '
'._MSC_SMILIES.'
'._MSC_CODE.''._MSC_EMOTION.''._IMAGE.'
".$smile['code']."".$smile['emotion']."
'._MSC_CLICKASMILIE; } break; case "avatars": ?>

'> getList('S'); $cntavs = 0; $counter = isset($_GET['start']) ? intval($_GET['start']) : 0; foreach ($avatarslist as $file => $name) { echo ''; $counter++; $cntavs++; if ($cntavs > 8) { echo ''; $cntavs=0; } } echo '
'.$name.'
'.$name.'
'; break; case "friend": if (!is_object($xoopsUser)) { break; } if ( !isset($_POST['op']) || $_POST['op'] == "sendform" ) { $token=&XoopsMultiTokenHandler::quickCreate('misc_sendform'); $yname = $xoopsUser->getVar("uname", 'e'); $ymail = $xoopsUser->getVar("email", 'e'); $fname = ""; $fmail = ""; printCheckForm(); echo '
'; echo $token->getHtml(); echo "
'._MSC_RECOMMENDSITE.'
\n"; echo _MSC_YOURNAMEC."
"._MSC_YOUREMAILC."
"._MSC_FRIENDNAMEC."
"._MSC_FRIENDEMAILC."
  
\n"; $closebutton = 0; } elseif ($_POST['op'] == "sendsite") { if (!XoopsMultiTokenHandler::quickValidate('misc_sendform')) { exit(); } $myts =& MyTextsanitizer::getInstance(); $ymail = $xoopsUser->getVar("email"); if ( !isset($_POST['yname']) || trim($_POST['yname']) == "" || $ymail == '' || !isset($_POST['fname']) || trim($_POST['fname']) == "" || !isset($_POST['fmail']) || trim($_POST['fmail']) == '' ) { redirect_header(XOOPS_URL."/misc.php?action=showpopups&type=friend&op=sendform",2,_MSC_NEEDINFO); exit(); } $yname = $myts->stripSlashesGPC(trim($_POST['yname'])); $fname = $myts->stripSlashesGPC(trim($_POST['fname'])); $fmail = $myts->stripSlashesGPC(trim($_POST['fmail'])); if (!checkEmail($fmail) || !checkEmail($ymail) || preg_match("/[\\0-\\31]/",$yname)) { $errormessage = _MSC_INVALIDEMAIL1."
"._MSC_INVALIDEMAIL2.""; redirect_header(XOOPS_URL."/misc.php?action=showpopups&type=friend&op=sendform",2,$errormessage); exit(); } $xoopsMailer =& getMailer(); $xoopsMailer->setTemplate("tellfriend.tpl"); $xoopsMailer->assign("SITENAME", $xoopsConfig['sitename']); $xoopsMailer->assign("ADMINMAIL", $xoopsConfig['adminmail']); $xoopsMailer->assign("SITEURL", XOOPS_URL."/"); $xoopsMailer->assign("YOUR_NAME", $yname); $xoopsMailer->assign("FRIEND_NAME", $fname); $xoopsMailer->setToEmails($fmail); $xoopsMailer->setFromEmail($ymail); $xoopsMailer->setFromName($yname); $xoopsMailer->setSubject(sprintf(_MSC_INTSITE,$xoopsConfig['sitename'])); //OpenTable(); if ( !$xoopsMailer->send() ) { echo $xoopsMailer->getErrors(); } else { echo "

"._MSC_REFERENCESENT."

"; } //CloseTable(); } break; case 'online': $isadmin = $xoopsUserIsAdmin; echo ''; $start = isset($_GET['start']) ? intval($_GET['start']) : 0; $online_handler =& xoops_gethandler('online'); $online_total =& $online_handler->getCount(); $limit = ($online_total > 20) ? 20 : $online_total; $criteria = new CriteriaCompo(); $criteria->setLimit($limit); $criteria->setStart($start); $onlines =& $online_handler->getAll($criteria); $count = count($onlines); $module_handler =& xoops_gethandler('module'); $modules =& $module_handler->getList(new Criteria('isactive', 1)); for ($i = 0; $i < $count; $i++) { if ($onlines[$i]['online_uid'] == 0) { $onlineUsers[$i]['user'] = ''; } else { $onlineUsers[$i]['user'] =& new XoopsUser($onlines[$i]['online_uid']); } $onlineUsers[$i]['ip'] = $onlines[$i]['online_ip']; $onlineUsers[$i]['updated'] = $onlines[$i]['online_updated']; $onlineUsers[$i]['module'] = ($onlines[$i]['online_module'] > 0) ? $modules[$onlines[$i]['online_module']] : ''; } $class = 'even'; for ($i = 0; $i < $count; $i++) { $class = ($class == 'odd') ? 'even' : 'odd'; echo ''; if (is_object($onlineUsers[$i]['user'])) { $avatar = $onlineUsers[$i]['user']->getVar('user_avatar') ? '' : ' '; echo ''; } echo '
'._WHOSONLINE.'
'.$avatar."getVar('uid')."';window.close();\">".$onlineUsers[$i]['user']->getVar('uname').""; } else { echo ' '.$xoopsConfig['anonymous']; } if ($isadmin == 1) { echo '
('.$onlineUsers[$i]['ip'].')'; } echo '
'.$onlineUsers[$i]['module'].'

'; if ($online_total > 20) { include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; $nav = new XoopsPageNav($online_total, 20, $start, 'start', 'action=showpopups&type=online'); echo '
'.$nav->renderNav().'
'; } break; case 'ssllogin': if ($xoopsConfig['use_ssl'] && isset($_POST[$xoopsConfig['sslpost_name']]) && is_object($xoopsUser)) { include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/user.php'; echo sprintf(_US_LOGGINGU, $xoopsUser->getVar('uname')); echo '
'; $closebutton = false; } break; default: break; } if ($closebutton) { echo '
'; } xoops_footer(); } function printCheckForm() { ?>