本文整理汇总了PHP中XoopsUser::getVar方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsUser::getVar方法的具体用法?PHP XoopsUser::getVar怎么用?PHP XoopsUser::getVar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XoopsUser
的用法示例。
在下文中一共展示了XoopsUser::getVar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: XoopsUser
/**
* @desc Envía correo de aprobación de publicación
* @param Object $res Publicación
**/
function mail_approved(RDResource &$res)
{
global $xoopsModuleConfig, $xoopsConfig;
$config_handler =& xoops_gethandler('config');
$mconfig = $config_handler->getConfigsByCat(XOOPS_CONF_MAILER);
$errors = '';
$user = new XoopsUser($res->getVar('owner'));
$member_handler =& xoops_gethandler('member');
$method = $user->getVar('notify_method');
$mailer = new RMMailer('text/plain');
$mailer->add_xoops_users($user);
$mailer->set_subject(sprintf(__('Publication <%s> approved!', 'docs'), $res->getVar('title')));
$mailer->assign('dear_user', $user->getVar('name') != '' ? $user->getVar('name') : $user->getVar('uname'));
$mailer->assign('link_to_resource', $res->permalink());
$mailer->assign('site_name', $xoopsConfig['sitename']);
$mailer->assign('resource_name', $res->getVar('title'));
$mailer->template(RMTemplate::get()->get_template('mail/resource_approved.php', 'module', 'docs'));
switch ($method) {
case '1':
$mailer->set_from_xuser($mconfig['fromuid']);
$ret = $mailer->send_pm();
break;
case '2':
$ret = $mailer->send();
break;
}
$page = rmc_server_var($_POST, 'page', 1);
return $ret;
}
示例2: empty
function b_weblog_links_show($options)
{
global $xoopsDB, $xoopsUser;
$mydirname = empty($options[0]) ? basename(dirname(dirname(__FILE__))) : $options[0];
$link_module = $options[1];
$link_num = $options[2];
$only_post = $options[3];
$showdsc = $options[4];
if ($only_post == "1") {
if (!preg_match("|weblog\\d*/post\\.php\$|", $_SERVER['SCRIPT_NAME'])) {
return false;
}
}
$currentuid = !empty($xoopsUser) ? $xoopsUser->getVar('uid', 'E') : 0;
$user_id = !empty($_GET['user_id']) ? intval($_GET['user_id']) : 0;
$submitter = empty($user_id) ? $currentuid : $user_id;
$block = array();
if (preg_match("/^mylinks\\d*\$/", $options[0])) {
// in case of mylinks module
$sql = sprintf('SELECT c.title as category, l.title as title, url, description as dsc FROM %s as c, %s as l, %s as d WHERE c.cid=l.cid and d.lid=l.lid and status=1 ', $xoopsDB->prefix($options[0] . '_cat'), $xoopsDB->prefix($options[0] . '_links'), $xoopsDB->prefix($options[0] . '_text'));
if ($submitter) {
$sql = sprintf('%s and submitter=%d', $sql, $submitter);
}
$sql .= " order by l.cid,l.date ";
} elseif (preg_match("/^weblinks\\d*\$/", $options[0])) {
// in case of weblink module
$sql = sprintf('select link.title as title, link.url as url, link.description as dsc, cat.title as category from %s as cat, %s as link, %s as clink where link.lid=clink.lid and clink.cid=cat.cid ', $xoopsDB->prefix($options[0] . '_category'), $xoopsDB->prefix($options[0] . '_link'), $xoopsDB->prefix($options[0] . '_catlink'));
if ($submitter) {
$sql = sprintf('%s and link.uid=%d', $sql, $submitter);
}
$sql .= " order by clink.cid,clink.lid ";
}
if (!isset($sql)) {
return array();
}
$result = $xoopsDB->query($sql, $link_num, 0);
while ($myrow = $xoopsDB->fetchArray($result)) {
$category = $myrow['category'];
if (!isset($block['links'][$category])) {
$block['links'][$category] = array();
}
$block['links'][$category][] = array("title" => $myrow['title'], "url" => $myrow['url'], "dsc" => $myrow['dsc']);
}
if ($submitter) {
$blogOwner = new XoopsUser($submitter);
$block['lang_whose'] = sprintf(_MB_WEBLOG_LANG_LINKS_FOR, $blogOwner->getVar('uname', 'E'));
} else {
$block['lang_whose'] = _MB_WEBLOG_LANG_LINKS_FOR_EVERYONE;
}
if ($showdsc) {
$block['showdsc'] = 1;
}
return $block;
}
示例3: getUserTimestamp
/**
* Get User Timestamp
*
* @param mixed $time
* @param string $timeoffset
*
* @return int
*/
public function getUserTimestamp($time, $timeoffset = '')
{
if ($timeoffset == '') {
if ($this->isUser()) {
$timeoffset = $this->user->getVar('timezone_offset');
} else {
$timeoffset = $this->getConfig('default_TZ');
}
}
$usertimestamp = (int) $time + ((double) $timeoffset - $this->getConfig('server_TZ')) * 3600;
return (int) $usertimestamp;
}
示例4: getShouts
function getShouts($online, $bbcode, $limit)
{
global $xoopsUser;
$shouts = array();
$myts =& MyTextSanitizer::getInstance();
$objs = $this->handler->getShouts($limit);
$i = 0;
foreach ($objs as $obj) {
$uid = $obj->getVar('uid');
$shouts[$i]['uid'] = $uid;
$shouts[$i]['online'] = 0;
$shouts[$i]['url'] = '';
$shouts[$i]['email'] = '';
$shouts[$i]['avatar'] = $this->getDefaultAvatar();
$shouts[$i]['uname'] = $obj->getVar('uname');
$shouts[$i]['time'] = $obj->time(shoutbox_getOption('stamp_format'));
$shouts[$i]['ip'] = $obj->getVar('ip');
$obj->setVar('doxcode', $bbcode);
$shouts[$i]['message'] = $myts->censorString($obj->getVar('message'));
if ($wordwrap = shoutbox_getOption('wordwrap_setting')) {
$shouts[$i]['message'] = wordwrap($shouts[$i]['message'], $wordwrap, "\r\n", true);
}
if ($uid != 0) {
$thisUser = new XoopsUser($uid);
if ($thisUser->isOnline()) {
$shouts[$i]['online'] = 1;
}
if ($thisUser->getVar("url") != "") {
$shouts[$i]['url'] = $thisUser->getVar("url");
}
if ($thisUser->getVar("user_viewemail") == 1 || $xoopsUser && $xoopsUser->isAdmin()) {
$shouts[$i]['email'] = $thisUser->getVar("email");
}
$shouts[$i]['avatar'] = XOOPS_URL . '/uploads/' . $thisUser->getVar("user_avatar");
}
$i++;
}
return $shouts;
}
示例5: sendPM
/**
* @param int $uid
* @param string $subject
* @param string $body
* @return bool
*/
private function sendPM($uid, $subject, $body)
{
$xoops = Xoops::getInstance();
$pm_handler = $xoops->getHandlerPrivmessage();
$pm = $pm_handler->create();
$pm->setVar("subject", $subject);
// RMV-NOTIFY
$pm->setVar('from_userid', !empty($this->fromUser) ? $this->fromUser->getVar('uid') : (!$xoops->isUser() ? 1 : $xoops->user->getVar('uid')));
$pm->setVar("msg_text", $body);
$pm->setVar("to_userid", $uid);
$pm->setVar('msg_time', time());
if (!$pm_handler->insert($pm)) {
return false;
}
return true;
}
示例6: b_mp_cont_show
function b_mp_cont_show($options)
{
global $xoopsDB, $xoopsUser, $xoopsModuleConfig, $HTTP_SERVER_VARS;
if (is_object($xoopsUser)) {
$uid = $xoopsUser->getVar('uid');
$uname = $xoopsUser->getVar('uname');
} else {
$uid = 0;
$uname = '';
}
$block = array();
if (!is_object($xoopsUser)) {
$block['lang_none'] = _MP_BL_YOUDONTHAVE;
} else {
$online = 0;
$offline = 0;
$user = '';
$cont_handler =& xoops_gethandler('priv_msgscont');
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('ct_userid', $xoopsUser->getVar('uid')));
$amount = $cont_handler->getCount($criteria);
$criteria->setSort('ct_uname');
$criteria->setOrder('desc');
$pm_cont =& $cont_handler->getObjects($criteria);
foreach (array_keys($pm_cont) as $i) {
$poster = new XoopsUser($pm_cont[$i]->getVar('ct_contact'));
/* Online poster */
if ($poster->isOnline()) {
$user .= "<a href='javascript:openWithSelfMain(\"" . XOOPS_URL . "/pmlite.php?send2=1&to_userid=" . $pm_cont[$i]->getVar('ct_contact') . "\",\"pmlite\", 450, 380)'>" . $poster->getVar('uname') . "</a>, ";
$online++;
} else {
$offline++;
}
}
$block['online_total'] = $amount;
$block['online'] = $online;
$block['offline'] = $offline;
$block['user'] = $user;
$block['lang_online'] = _MP_BLOCK_ONLINE;
$block['lang_offline'] = _MP_BLOCK_OFFLINE;
$block['lang_contact'] = _MP_BLOCK_CONTACT;
}
return $block;
}
示例7: xoops_module_update_mpmanager
function xoops_module_update_mpmanager(&$module)
{
global $xoopsConfig, $xoopsDB, $xoopsUser, $xoopsModule;
if (file_exists(XOOPS_ROOT_PATH . "/modules/mpmanager/language/" . $xoopsConfig['language'] . "/admin.php")) {
include XOOPS_ROOT_PATH . "/modules/mpmanager/language/" . $xoopsConfig['language'] . "/admin.php";
} else {
include XOOPS_ROOT_PATH . "/modules/mpmanager/language/english/admin.php";
}
$xoopsDB->queryF("UPDATE " . $xoopsDB->prefix('modules') . " SET weight = 0 WHERE mid = " . $module->getVar('mid') . "");
if (is_object($xoopsUser) && $xoopsUser->isAdmin($xoopsModule->mid())) {
if (!TableExists($xoopsDB->prefix('priv_msgs'))) {
$xoopsDB->queryFromFile(XOOPS_ROOT_PATH . "/modules/mpmanager/sql/mysqlmsg.sql");
}
//mise ajour table message
if (!FieldExists('msg_pid', $xoopsDB->prefix('priv_msgs'))) {
$result = $xoopsDB->queryF("ALTER TABLE `" . $xoopsDB->prefix('priv_msgs') . "` ADD msg_pid MEDIUMINT( 8 ) UNSIGNED DEFAULT '0' NOT NULL AFTER msg_id");
}
if (!FieldExists('reply_msg', $xoopsDB->prefix('priv_msgs'))) {
$sq1 = $xoopsDB->queryF("ALTER TABLE `" . $xoopsDB->prefix('priv_msgs') . "` ADD reply_msg TINYINT(1) UNSIGNED DEFAULT '0' NOT NULL AFTER read_msg");
}
if (!FieldExists('anim_msg', $xoopsDB->prefix('priv_msgs'))) {
$sq1 = $xoopsDB->queryF("ALTER TABLE `" . $xoopsDB->prefix('priv_msgs') . "` ADD anim_msg VARCHAR(100) AFTER reply_msg");
}
if (!FieldExists('cat_msg', $xoopsDB->prefix('priv_msgs'))) {
$sq1 = $xoopsDB->queryF("ALTER TABLE `" . $xoopsDB->prefix('priv_msgs') . "` ADD cat_msg MEDIUMINT( 8 ) UNSIGNED DEFAULT '1' NOT NULL AFTER anim_msg");
}
if (!FieldExists('file_msg', $xoopsDB->prefix('priv_msgs'))) {
$sq1 = $xoopsDB->queryF("ALTER TABLE `" . $xoopsDB->prefix('priv_msgs') . "` ADD file_msg MEDIUMINT( 8 ) UNSIGNED DEFAULT '0' NOT NULL AFTER cat_msg");
}
//mise a jour message
if (TableExists($xoopsDB->prefix('priv_msgsave'))) {
$sq2 = "SELECT * FROM " . $xoopsDB->prefix('priv_msgsave') . "";
$result2 = $xoopsDB->query($sq2);
while ($row = $xoopsDB->fetchArray($result2)) {
$sql = "INSERT INTO `" . $xoopsDB->prefix("priv_msgs") . "` (msg_id, msg_image,subject,from_userid,to_userid,msg_time,msg_text,read_msg,reply_msg,anim_msg,cat_msg,file_msg) VALUES('','" . $row['msg_image'] . "','" . $row['subject'] . "','" . $row['sauv_userid'] . "','" . $row['to_userid'] . "','" . $row['msg_time'] . "','" . $row['msg_text'] . "','" . $row['read_msg'] . "','" . $row['reply_msg'] . "','" . $row['anim_msg'] . "', '3','') ";
$result = $xoopsDB->queryF($sql);
}
$result = $xoopsDB->queryF("DROP TABLE `" . $xoopsDB->prefix("priv_msgsave") . "`");
}
//add table priv_msgscat
if (!TableExists($xoopsDB->prefix('priv_msgscat'))) {
$xoopsDB->queryFromFile(XOOPS_ROOT_PATH . "/modules/mpmanager/sql/mysqlcat.sql");
}
$sq1 = $xoopsDB->queryF("INSERT INTO `" . $xoopsDB->prefix('priv_msgscat') . "` (`cid`, `pid`, `title`, `uid`, `ver`) VALUES (1, 0, '" . _MP_BOX1 . "', NULL, 1)");
$sq1 = $xoopsDB->queryF("INSERT INTO `" . $xoopsDB->prefix('priv_msgscat') . "` (`cid`, `pid`, `title`, `uid`, `ver`) VALUES (2, 0, '" . _MP_BOX2 . "', NULL, 1)");
$sq1 = $xoopsDB->queryF("INSERT INTO `" . $xoopsDB->prefix('priv_msgscat') . "` (`cid`, `pid`, `title`, `uid`, `ver`) VALUES (3, 0, '" . _MP_BOX3 . "', NULL, 1)");
//add and update priv_msgscont
if (!TableExists($xoopsDB->prefix('priv_msgscont'))) {
$xoopsDB->queryFromFile(XOOPS_ROOT_PATH . "/modules/mpmanager/sql/mysqlcont.sql");
} else {
if (!FieldExists('ct_name', $xoopsDB->prefix('priv_msgscont'))) {
$sql = "ALTER TABLE `" . $xoopsDB->prefix("priv_msgscont") . "` ADD `ct_name` varchar(60) NOT NULL default '' AFTER `ct_contact`";
$result = $xoopsDB->queryF($sql);
}
if (!FieldExists('ct_uname', $xoopsDB->prefix('priv_msgscont'))) {
$sql = "ALTER TABLE `" . $xoopsDB->prefix("priv_msgscont") . "` ADD `ct_uname` varchar(25) NOT NULL default '' AFTER `ct_name`";
$result = $xoopsDB->queryF($sql);
}
if (!FieldExists('ct_regdate', $xoopsDB->prefix('priv_msgscont'))) {
$sql = "ALTER TABLE `" . $xoopsDB->prefix("priv_msgscont") . "` ADD `ct_regdate` int(10) NOT NULL default '0' AFTER `ct_uname`";
$result = $xoopsDB->queryF($sql);
}
$sq3 = "SELECT * FROM " . $xoopsDB->prefix('priv_msgscont') . "";
$result3 = $xoopsDB->query($sq3);
while ($row = $xoopsDB->fetchArray($result3)) {
$poster = new XoopsUser($row['ct_contact']);
$sql = "UPDATE `" . $xoopsDB->prefix('priv_msgscont') . "` SET ct_name='" . $poster->getVar('name') . "', ct_uname='" . $poster->getVar('uname') . "', ct_regdate='" . $poster->getVar('user_regdate') . "' WHERE ct_contact='" . $row['ct_contact'] . "'";
$result = $xoopsDB->queryF($sql);
}
}
////add and update tables priv_msgsopt
if (!TableExists($xoopsDB->prefix('priv_msgsopt'))) {
$xoopsDB->queryFromFile(XOOPS_ROOT_PATH . "/modules/mpmanager/sql/mysqlopt.sql");
} else {
if (!FieldExists('resend', $xoopsDB->prefix('priv_msgsopt'))) {
$sql = "ALTER TABLE `" . $xoopsDB->prefix("priv_msgsopt") . "` ADD `resend` tinyint(1) NOT NULL default '0'";
$result = $xoopsDB->queryF($sql);
}
if (!FieldExists('limite', $xoopsDB->prefix('priv_msgsopt'))) {
$sq1 = "ALTER TABLE `" . $xoopsDB->prefix("priv_msgsopt") . "` ADD `limite` tinyint(2) default NULL";
$result = $xoopsDB->queryF($sql);
}
if (!FieldExists('home', $xoopsDB->prefix('priv_msgsopt'))) {
$sql = "ALTER TABLE " . $xoopsDB->prefix("priv_msgsopt") . " ADD `home` tinyint(2) DEFAULT '1' NOT NULL AFTER `limite`";
$result = $xoopsDB->queryF($sql);
}
if (!FieldExists('sortname', $xoopsDB->prefix('priv_msgsopt'))) {
$sql = "ALTER TABLE " . $xoopsDB->prefix("priv_msgsopt") . " ADD `sortname` varchar(15) AFTER `home`";
$result = $xoopsDB->queryF($sql);
}
if (!FieldExists('sortorder', $xoopsDB->prefix('priv_msgsopt'))) {
$sql = "ALTER TABLE " . $xoopsDB->prefix("priv_msgsopt") . " ADD `sortorder` varchar(15) AFTER `sortname`";
$result = $xoopsDB->queryF($sql);
}
if (!FieldExists('vieworder', $xoopsDB->prefix('priv_msgsopt'))) {
$sql = "ALTER TABLE " . $xoopsDB->prefix("priv_msgsopt") . " ADD `vieworder` varchar(15) AFTER `sortorder`";
$result = $xoopsDB->queryF($sql);
}
if (!FieldExists('formtype', $xoopsDB->prefix('priv_msgsopt'))) {
$sql = "ALTER TABLE " . $xoopsDB->prefix("priv_msgsopt") . " ADD `formtype` tinyint(1) AFTER `vieworder`";
//.........这里部分代码省略.........
示例8: getOutputValue
/**
* Returns a value for output of this field
*
* @param XoopsUser $user {@link XoopsUser} object to get the value of
* @param profileProfile $profile object to get the value of
*
* @return mixed
**/
function getOutputValue(&$user, $profile)
{
if (file_exists($file = $GLOBALS['xoops']->path('modules/profile/language/' . $GLOBALS['xoopsConfig']['language'] . '/modinfo.php'))) {
include_once $file;
} else {
include_once $GLOBALS['xoops']->path('modules/profile/language/english/modinfo.php');
}
$value = in_array($this->getVar('field_name'), $this->getUserVars()) ? $user->getVar($this->getVar('field_name')) : $profile->getVar($this->getVar('field_name'));
switch ($this->getVar('field_type')) {
default:
case "textbox":
if ($this->getVar('field_name') == 'url' && $value != '') {
return '<a href="' . formatURL($value) . '" rel="external">' . $value . '</a>';
} else {
return $value;
}
break;
case "textarea":
case "dhtml":
case 'theme':
case "language":
case "list":
return $value;
break;
case "select":
case "radio":
$options = $this->getVar('field_options');
if (isset($options[$value])) {
$value = htmlspecialchars(defined($options[$value]) ? constant($options[$value]) : $options[$value]);
} else {
$value = "";
}
return $value;
break;
case "select_multi":
case "checkbox":
$options = $this->getVar('field_options');
$ret = array();
if (count($options) > 0) {
foreach (array_keys($options) as $key) {
if (in_array($key, $value)) {
$ret[$key] = htmlspecialchars(defined($options[$key]) ? constant($options[$key]) : $options[$key]);
}
}
}
return $ret;
break;
case "group":
$member_handler =& xoops_gethandler('member');
$options = $member_handler->getGroupList();
$ret = isset($options[$value]) ? $options[$value] : '';
return $ret;
break;
case "group_multi":
$member_handler =& xoops_gethandler('member');
$options = $member_handler->getGroupList();
$ret = array();
foreach (array_keys($options) as $key) {
if (in_array($key, $value)) {
$ret[$key] = htmlspecialchars($options[$key]);
}
}
return $ret;
break;
case "longdate":
//return YYYY/MM/DD format - not optimal as it is not using local date format, but how do we do that
//when we cannot convert it to a UNIX timestamp?
return str_replace("-", "/", $value);
case "date":
return formatTimestamp($value, 's');
break;
case "datetime":
if (!empty($value)) {
return formatTimestamp($value, 'm');
} else {
return $value = _PROFILE_MI_NEVER_LOGGED_IN;
}
break;
case "autotext":
$value = $user->getVar($this->getVar('field_name'), 'n');
//autotext can have HTML in it
$value = str_replace("{X_UID}", $user->getVar("uid"), $value);
$value = str_replace("{X_URL}", XOOPS_URL, $value);
$value = str_replace("{X_UNAME}", $user->getVar("uname"), $value);
return $value;
break;
case "rank":
$userrank = $user->rank();
$user_rankimage = "";
if (isset($userrank['image']) && $userrank['image'] != "") {
$user_rankimage = '<img src="' . XOOPS_UPLOAD_URL . '/' . $userrank['image'] . '" alt="' . $userrank['title'] . '" /><br />';
}
//.........这里部分代码省略.........
示例9: isset
$start = isset($_GET['start']) ? intval($_GET['start']) : 0;
$online_handler =& xoops_gethandler('online');
$online_total =& $online_handler->getCount();
$limit = $online_total > 2 ? 20 : $online_total;
$criteria = new CriteriaCompo();
$criteria->setLimit($limit);
$criteria->setStart($start);
$onlines =& $online_handler->getAll($criteria);
$count = count($onlines);
$anonymous_count = 0;
for ($i = 0; $i < $count; $i++) {
if ($onlines[$i]['online_uid'] == 0) {
$onlineUsers[$i]['uname'] = $xoopsConfig['anonymous'];
$onlineUsers[$i]['uid'] = 0;
$anonymous_count++;
} else {
$thisUser = new XoopsUser($onlines[$i]['online_uid']);
$onlineUsers[$i]['uname'] = $thisUser->getVar('uname');
$onlineUsers[$i]['uid'] = $thisUser->getVar('uid');
}
}
if ($online_total > 20) {
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
$nav = new XoopsPageNav($online_total, 20, $start, 'start', '');
$xoopsTpl->assign('online_navigation', $nav->renderNav());
}
$xoopsTpl->assign('users', $onlineUsers);
$xoopsTpl->assign('anonymous_count', $anonymous_count);
$xoopsTpl->assign('online_total', $online_total);
$xoopsTpl->xoops_setCaching(0);
$xoopsTpl->display('db:shoutbox_online.html');
示例10: foreach
}
foreach (array_keys($pm_tree) as $i) {
$result = $xoopsDB->queryF("UPDATE " . $xoopsDB->prefix("priv_msgs") . " SET read_msg = '1' WHERE msg_id=" . $pm_tree[$i]->getVar('msg_id') . "");
if ($vieworder == 'thread') {
$msg_thread = !empty($_REQUEST['msg_thread']) ? intval($_REQUEST['msg_thread']) : $pm_tree[$i]->getVar('msg_pid');
if ($msg_thread != $pm_tree[$i]->getVar('msg_id')) {
if (!$pm_tree[$i]->getVar('msg_image')) {
$tree_img = "<img src='../../images/read.gif' alt='' />";
} else {
$tree_img = "<img src='../../images/subject/" . $pm_tree[$i]->getVar('msg_image') . "' alt='' />";
}
$tree_poster = new XoopsUser($pm_tree[$i]->getVar("from_userid"));
if (!$tree_poster->isActive()) {
$poster = $myts->HtmlSpecialChars($xoopsConfig['anonymous']);
} else {
$poster = '<a href="' . XOOPS_URL . '/userinfo.php?uid=' . $tree_poster->getVar("uid") . '">' . $tree_poster->getVar("uname") . '</a>';
}
if (strlen($pm_tree[$i]->getVar("subject")) >= $xoopsModuleConfig['MPmaxtitle']) {
$mp_treesubject = $pm_tree[$i]->getVar('subject') ? $myts->displayTarea(substr($pm_tree[$i]->getVar('subject'), 0, $xoopsModuleConfig['MPmaxtitle'])) . '...' : _MP_NONESUBJ;
} else {
$mp_treesubject = $pm_tree[$i]->getVar('subject') ? $myts->displayTarea($pm_tree[$i]->getVar('subject')) : _MP_NONESUBJ;
}
//$mp_treesubject = $pm_tree[$i]->getVar('subject') ? $myts->displayTarea($pm_tree[$i]->getVar('subject')) : _MP_NONESUBJ ;
@($prefix .= " ");
$xoopsTpl->append("topic_trees", array("post_id" => $pm_tree[$i]->getVar('msg_id'), "post_time" => formatTimestamp($pm_tree[$i]->getVar('msg_time')), "post_image" => $tree_img, "post_title" => '<a href="viewbox.php?op=view&start=' . $start . '&sortname=' . $sortname . '&sortorder=' . $sortorder . '&vieworder=' . $vieworder . '&treesortorder=' . $treesortorder . '&catbox=' . $catbox . '&viewstart=' . $viewstart . '&msg_thread=' . $pm_tree[$i]->getVar('msg_id') . '#' . $pm_tree[$i]->getVar('msg_id') . '">' . $mp_treesubject . '</a>', "post_prefix" => $prefix, "poster" => $poster));
} else {
$eachpost = mp_post($view_perms, $pm_tree[$i], @$mpstop);
}
} else {
$eachpost = mp_post($view_perms, $pm_tree[$i], @$mpstop);
}
示例11: getDetailView
function getDetailView()
{
if (isset($_POST['cancel'])) {
$base_url = XMOBILE_URL . '/?act=pmessage&sess=' . $this->sessionHandler->getSessionID();
header('Location: ' . $base_url);
exit;
}
$this->controller->render->template->assign('show_detail', true);
$myts =& MyTextSanitizer::getInstance();
// $op = $myts->makeTboxData4Show($this->utils->getGetPost('op', ''));
$msg_id = intval($this->utils->getGetPost('msg_id', 0));
$session_id = $this->sessionHandler->getSessionID();
$uid = $this->sessionHandler->getUid();
$message = '';
/*
if(isset($_POST['reply']))
{
$base_url = XMOBILE_URL.'/?act=pmessage&view=confirm&reply=1&msg_id='.$msg_id.'&sess='.$this->sessionHandler->getSessionID();
header('Location: '.$base_url);
exit();
}
*/
if ($uid == 0) {
$base_url = $this->utils->getLinkUrl('register', null, null, $this->sessionHandler->getSessionID());
$message = _MD_XMOBILE_PM_SORRY . '<br /><a href="' . $base_url . '">' . _MD_XMOBILE_REGISTERNOW . '</a>.';
$this->controller->render->redirectHeader($message, 5, $base_url);
exit;
}
$pm_handler =& xoops_gethandler('privmessage');
/*
if(!empty($_POST['delete']))
{
$pm =& $pm_handler->get(intval($_POST['msg_id']));
if(!is_object($pm) || $pm->getVar('to_userid') != $uid || !$pm_handler->delete($pm))
{
$base_url = $this->utils->getLinkUrl($this->controller->getActionState(),null,null,$this->sessionHandler->getSessionID());
$this->controller->render->redirectHeader(_MD_XMOBILE_DELETE_FAILED,5,$base_url);
exit();
}
else
{
$base_url = $this->utils->getLinkUrl($this->controller->getActionState(),null,null,$this->sessionHandler->getSessionID());
$this->controller->render->redirectHeader(_MD_XMOBILE_PM_DELETED,3,$base_url);
exit();
}
}
*/
// $start = !empty($_GET['start']) ? intval($_GET['start']) : 0;
// $total_messages = !empty($_GET['total_messages']) ? intval($_GET['total_messages']) : 0;
/*
$criteria = new Criteria('to_userid', $uid);
$criteria->setLimit($limit);
$criteria->setStart($start);
$criteria->setSort('msg_time');
$criteria->setOrder('DESC');
$pm_arr =& $pm_handler->getObjects($criteria);
*/
$criteria =& new Criteria('to_userid', $uid);
$criteria->setSort('msg_time');
$criteria->setOrder('DESC');
$extra_arg = $this->baseUrl;
$total_messages = $pm_handler->getCount($criteria);
$limit = 1;
$pageNavi =& new XmobilePageNavigator($total_messages, $limit, 'start', $extra_arg);
$criteria->setLimit($limit);
$criteria->setStart($pageNavi->getStart());
$pm_arr =& $pm_handler->getObjects($criteria);
if (empty($pm_arr)) {
$has_message = false;
} else {
$has_message = true;
$pm_handler->setRead($pm_arr[0]);
// check read_msg
$poster = new XoopsUser($pm_arr[0]->getVar('from_userid'));
if ($poster->isActive()) {
$poster_name = $poster->getVar('uname');
// $extの値はgetLinkUrl()でhtmlspecialchars()を掛けられるので&ではなく&と記述しておく
// $ext = 'uid='.$pm_arr[0]->getVar('from_userid');
$ext = 'uid=' . $poster->getVar('uid');
$base_url = $this->utils->getLinkUrl('userinfo', null, null, $this->controller->sessionHandler->getSessionID(), $ext);
$poster_name = '<a href="' . $base_url . '">' . $poster->getVar('uname') . '</a>';
$reply = true;
} else {
$poster_name = $xoopsConfig['anonymous'];
$reply = false;
}
$token =& XoopsMultiTokenHandler::quickCreate('pm');
// $base_url = $this->utils->getLinkUrl($this->controller->getActionState(),$this->controller->getViewState(),null,$this->sessionHandler->getSessionID());
$ext = 'send=1';
$base_url = $this->utils->getLinkUrl('pmessage', 'confirm', null, $this->controller->sessionHandler->getSessionID(), $ext);
$base_url = preg_replace('/&/i', '&', $base_url);
$this->controller->render->template->assign('base_url', $base_url);
$this->controller->render->template->assign('ticket_html', $token->getHtml());
$this->controller->render->template->assign('session_name', session_name());
$this->controller->render->template->assign('session_id', session_id());
$this->controller->render->template->assign('referer_url', $this->getBaseUrl());
$this->controller->render->template->assign('subject', $pm_arr[0]->getVar('subject'));
$this->controller->render->template->assign('poster_name', $poster_name);
$this->controller->render->template->assign('msg_time', formatTimestamp($pm_arr[0]->getVar('msg_time')));
$this->controller->render->template->assign('msg_text', $pm_arr[0]->getVar('msg_text'));
//.........这里部分代码省略.........
示例12: order_notify
function order_notify($data, $email, $value)
{
global $xoopsModuleConfig, $xoopsUser, $xoopsModule;
$poster = new XoopsUser($data['uid']);
$eid = $data['eid'];
$exid = $data['exid'];
$url = EGUIDE_URL . '/event.php?eid=' . $eid . ($exid ? "&sub={$exid}" : '');
$xoopsMailer =& getMailer();
$xoopsMailer->useMail();
$tplname = $data['autoaccept'] ? "accept%s.tpl" : "order%s.tpl";
$extra = eguide_form_options('reply_extension');
$tplfile = sprintf($tplname, '');
// default template name
$tmpdir = template_dir($tplfile);
if ($extra) {
$vals = unserialize_text($value);
if (isset($vals[$extra])) {
$extpl = sprintf($tplname, $vals[$extra]);
if (file_exists("{$tmpdir}{$extpl}")) {
$tplfile = $extpl;
}
}
} else {
$extra = eguide_form_options('reply_tpl_suffix');
if ($extra) {
$extpl = sprintf($tplname, $extra);
if (file_exists("{$tmpdir}{$extpl}")) {
$tplfile = $extpl;
}
}
}
$xoopsMailer->setTemplateDir($tmpdir);
$xoopsMailer->setTemplate($tplfile);
if ($xoopsModuleConfig['member_only'] && is_object($xoopsUser)) {
$user = $xoopsUser;
if (isset($data['reserv_uid'])) {
$ruid = $data['reserv_uid'];
$user = new XoopsUser($ruid);
} else {
$xoopsMailer->setToUsers($user);
}
$uinfo = sprintf("%s: %s (%s)\n", _MD_UNAME, $user->getVar('uname'), $user->getVar('name'));
} else {
if (!empty($email)) {
$xoopsMailer->setToEmails($email);
}
$uinfo = "";
}
if ($email) {
$uinfo .= sprintf("%s: %s\n", _MD_EMAIL, $email);
}
$rvid = $data['rvid'];
$conf = $data['confirm'];
$edate = eventdate($data['edate']);
$tags = array("EVENT_URL" => $url, "RVID" => $rvid, "CANCEL_KEY" => $conf, "CANCEL_URL" => EGUIDE_URL . "/reserv.php?op=cancel&rvid={$rvid}&key={$conf}", "INFO" => $uinfo . $value, "TITLE" => $edate . " " . $data['title'], "EVENT_DATE" => $edate, "EVENT_TITLE" => $data['title'], "SUMMARY" => strip_tags($data['summary']));
$subj = eguide_form_options('reply_subject', _MD_SUBJECT);
$xoopsMailer->assign($tags);
$xoopsMailer->setSubject($subj);
$xoopsMailer->setFromEmail($poster->getVar('email'));
$xoopsMailer->setFromName(eguide_from_name());
$ret = $xoopsMailer->send();
// send to order person
if (!$ret) {
return $ret;
}
$xoopsMailer->reset();
$xoopsMailer->useMail();
$xoopsMailer->setTemplateDir(template_dir($tplfile));
$xoopsMailer->setTemplate($tplfile);
$xoopsMailer->assign($tags);
$xoopsMailer->setSubject($subj);
$xoopsMailer->setFromEmail($poster->getVar('email'));
$xoopsMailer->setFromName(eguide_from_name());
if ($data['notify']) {
if (!in_array($xoopsModuleConfig['notify_group'], $poster->groups())) {
$xoopsMailer->setToUsers($poster);
}
$member_handler =& xoops_gethandler('member');
$notify_group = $member_handler->getGroup($xoopsModuleConfig['notify_group']);
$xoopsMailer->setToGroups($notify_group);
$xoopsMailer->send();
}
return $ret;
}
示例13: sanitize
$signature = sanitize($row['com_sig']);
$status = sanitize($row['com_status']);
$params = sanitize($row['com_exparams']);
$dohtml = sanitize($row['dohtml']);
$dosmiley = sanitize($row['dosmiley']);
$xcode = sanitize($row['doxcode']);
$doimage = sanitize($row['doimage']);
$linebreak = sanitize($row['dobr']);
$user = new XoopsUser($row['com_uid']);
$avatar = $user->user_avatar($row['com_uid']);
$rank = $user->rank($row['com_uid']);
$rank_title = $rank['title'];
$rank_image = XOOPS_UPLOAD_URL . "/" . $rank['image'];
$regdate = date("d-m-Y", $user->user_regdate($row['com_uid']));
$userLocation = $user->user_from($row['com_uid']);
$numposts = $user->getVar("posts");
$checkstatus = $user->isOnline();
if ($checkstatus > 0) {
$status = "Online";
} else {
$status = "Offline";
}
if ($icon = '') {
$comment_image = '';
} else {
$comment_image = '<img src="' . XOOPS_UPLOAD_URL . "/" . $icon . '" alt=""></img>';
}
if ($avatar == '') {
$avatar = 'blank.gif';
}
$uname = $user->getVar('uname');
示例14: isset
$view = isset($_GET['view']) && array_key_exists(intval($_GET['view']), $view_array) ? intval($_GET['view']) : $d_view;
$d_limit = $xoopsModuleConfig['comnum'];
$limit_array = array('5' => 5, '10' => 10, '20' => 20, '50' => 50, '100' => 100);
$limit = isset($_GET['limit']) && array_key_exists(intval($_GET['limit']), $limit_array) ? intval($_GET['limit']) : $d_limit;
if ($uid == 0) {
redirect_header(XOOPS_URL, 2, _NOPERM);
exit;
}
$myts =& MyTextSanitizer::getInstance();
$xoopsOption['template_main'] = 'mycomments_comments.html';
include_once XOOPS_ROOT_PATH . '/header.php';
$thisuser = new XoopsUser($uid);
switch ($xoopsModuleConfig['displayname']) {
case 1:
// Username
$username = $thisuser->getVar('uname');
break;
case 2:
// Display full name (if it is not empty)
if (xoops_trim($thisuser->getVar('name')) == '') {
$username = $thisuser->getVar('uname');
} else {
$username = $thisuser->getVar('name');
}
break;
}
// admins can view all comments and IPs, others can only view approved(active) comments
if (is_object($xoopsUser) && $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
$admin_view = true;
} else {
$admin_view = false;
示例15: XoopsUser
} else {
$currentUser =& new XoopsUser();
$currentUser->setVar('uid', 0);
$useroffset = $xoopsConfig['default_TZ'] - $xoopsConfig['server_TZ'];
}
$isAdmin = $currentUser->isAdmin($xoopsModule->mid());
$currentuid = $currentUser->getVar('uid');
// specify template
$xoopsOption['template_main'] = 'weblog' . $mydirnumber . '_entries.html';
// obtain class instances
$myts =& MyTextSanitizer::getInstance();
$weblog =& Weblog::getInstance();
$weblogcat =& WeblogCategories::getInstance();
if ($user_id > 0) {
$blogOwner = new XoopsUser($user_id);
$page_subtitle = sprintf(_BL_ENTRIES_FOR, $blogOwner->getVar('uname', 'E'));
$page_rss = sprintf(_BL_RSS_RECENT_FOR, $blogOwner->getVar('uname', 'E'));
} else {
$page_subtitle = _BL_MOST_RECENT;
$page_rss = _BL_RSS_RECENT;
}
if ($xoopsModuleConfig['update_reads_when'] == 2 && $user_id > 0 || $xoopsModuleConfig['update_reads_when'] == 3) {
$updateReads = true;
} else {
$updateReads = false;
}
// obtain row count
//$count = $weblog->getCountByUser($currentuid, $user_id);
//$count = $weblog->getCountByCategory($currentuid, $cat_id, $user_id);
$count = $weblog->getCountByDate($currentuid, $cat_id, $user_id, $date, $useroffset);
// obtain entries