33 $type = Request::getCmd(
'type',
'');
36 $xoops->simpleHeader(
false);
42 $op = Request::getCmd(
'op',
'sendform');
44 if (!
$xoops->security()->check() ||
$op ==
"sendform") {
46 $yname =
$xoops->user->getVar(
"uname",
'e');
47 $ymail =
$xoops->user->getVar(
"email",
'e');
61 $form->addElement(
new Xoops\Form\Hidden(
'action',
'showpopups'));
62 $form->addElement(
new Xoops\Form\Hidden(
'type',
'friend'));
68 $button->setClass(
'btn btn-success');
73 $button_2->setExtra(
"onclick='javascript:window.close();'");
78 $tpl->assign(
'closebutton', 0);
80 } elseif (
$op ==
"sendsite") {
81 $myts = MyTextsanitizer::getInstance();
83 $ymail =
$xoops->user->getVar(
"email");
85 $ymail = isset($_POST[
'ymail']) ?
$myts->stripSlashesGPC(trim($_POST[
'ymail'])) :
'';
87 if (!isset($_POST[
'yname']) || trim($_POST[
'yname']) ==
"" || $ymail ==
''
88 || !isset($_POST[
'fname']) || trim($_POST[
'fname']) ==
"" || !isset($_POST[
'fmail'])
89 || trim($_POST[
'fmail']) ==
'') {
93 $yname =
$myts->stripSlashesGPC(trim($_POST[
'yname']));
94 $fname =
$myts->stripSlashesGPC(trim($_POST[
'fname']));
95 $fmail =
$myts->stripSlashesGPC(trim($_POST[
'fmail']));
96 if (!
$xoops->checkEmail($fmail) || !
$xoops->checkEmail($ymail) || preg_match(
"/[\\0-\\31]/", $yname)) {
98 $xoops->redirect(
$xoops_url .
"/misc.php?action=showpopups&type=friend&op=sendform", 2, $errormessage);
100 $xoopsMailer =
$xoops->getMailer();
101 $xoopsMailer->setTemplate(
"tellfriend.tpl");
102 $xoopsMailer->assign(
"SITENAME",
$xoops->getConfig(
'sitename'));
103 $xoopsMailer->assign(
"ADMINMAIL",
$xoops->getConfig(
'adminmail'));
104 $xoopsMailer->assign(
"SITEURL",
$xoops_url .
"/");
105 $xoopsMailer->assign(
"YOUR_NAME", $yname);
106 $xoopsMailer->assign(
"FRIEND_NAME", $fname);
107 $xoopsMailer->setToEmails($fmail);
108 $xoopsMailer->setFromEmail($ymail);
109 $xoopsMailer->setFromName($yname);
112 $tpl->assign(
'closebutton', 1);
113 if (!$xoopsMailer->send()) {
114 $tpl->assign(
'message', $xoopsMailer->getErrors());
119 $tpl->display(
'module:system/system_misc_friend.tpl');
122 $isadmin =
$xoops->userIsAdmin;
123 $start = Request::getInt(
'start', 0);
124 $online_handler =
$xoops->getHandlerOnline();
125 $online_total = $online_handler->getCount();
126 $limit = ($online_total > 20) ? 20 : $online_total;
130 $onlines = $online_handler->getAll(
$criteria, null,
false,
false);
134 $onlineUsers = array();
136 $onlineUsers[
$i][
'uid'] = $onlines[
$i][
'online_uid'];
137 $onlineUsers[
$i][
'ip'] = $onlines[
$i][
'online_ip'];
138 $onlineUsers[
$i][
'updated'] = $onlines[
$i][
'online_updated'];
139 $onlineUsers[
$i][
'module'] = ($onlines[
$i][
'online_module'] > 0) ?
$modules[$onlines[
$i][
'online_module']] :
'';
140 if ($onlines[
$i][
'online_uid'] != 0 && is_object(
$user =
new XoopsUser($onlines[
$i][
'online_uid']))) {
141 $onlineUsers[
$i][
'name'] =
$user->getVar(
'uname');
147 $onlineUsers[
$i][
'name'] =
$xoops->getConfig(
'anonymous');
153 if ($online_total > 20) {
154 $nav =
new XoopsPageNav($online_total, 20,
$start,
'start',
'action=showpopups&type=online');
155 $tpl->assign(
'nav', $nav->renderNav());
157 $tpl->assign(
'onlineusers', $onlineUsers);
158 $tpl->assign(
'isadmin', $isadmin);
159 $tpl->assign(
'closebutton', $closebutton);
160 $tpl->display(
'module:system/system_misc_online.tpl');
163 if (
$xoops->getConfig(
'use_ssl') && isset($_POST[
$xoops->getConfig(
'sslpost_name')]) &&
$xoops->isUser()) {
164 $xoops->loadLanguage(
'user');
166 echo
'<div style="text-align:center;"><input class="formButton" value="' .
XoopsLocale::A_CLOSE .
'" type="button" onclick="window.opener.location.reload();window.close();" /></div>';
167 $closebutton =
false;
const S_REFERENCE_TO_SITE_SENT
const E_YOU_NEED_TO_ENTER_REQUIRED_INFO
const EMAIL_PROVIDED_IS_INVALID
defined('DS') or define('DS' DIRECTORY_SEPARATOR
if($xoops->isUser()&&$isAdmin) $response
const RECOMMEND_SITE_TO_FRIEND
const E_CHECK_EMAIL_AND_TRY_AGAIN