当前位置: 首页>>代码示例>>PHP>>正文


PHP XoopsUser::isActive方法代码示例

本文整理汇总了PHP中XoopsUser::isActive方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsUser::isActive方法的具体用法?PHP XoopsUser::isActive怎么用?PHP XoopsUser::isActive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XoopsUser的用法示例。


在下文中一共展示了XoopsUser::isActive方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: xhnewbb_show_tree

function xhnewbb_show_tree(&$arr, $current = 0, $key = 0, $prefix = '', $foundusers = array())
{
    global $xoopsConfig;
    if ($key != 0) {
        if (0 != $arr[$key]['obj']->uid()) {
            if (!isset($foundusers[$arr[$key]['obj']->uid()])) {
                $eachposter = new XoopsUser($arr[$key]['obj']->uid());
                $foundusers[$arr[$key]['obj']->uid()] =& $eachposter;
            } else {
                $eachposter =& $foundusers[$arr[$key]['obj']->uid()];
            }
            $poster_rank = $eachposter->rank();
            if (!empty($poster_rank['image'])) {
                $poster_rank['image'] = '<img src="' . XOOPS_UPLOAD_URL . '/' . $poster_rank['image'] . '" alt="" />';
            }
            if ($eachposter->isActive()) {
                $posterarr = array('poster_uid' => $eachposter->getVar('uid'), 'poster_uname' => '<a href="' . XOOPS_URL . '/userinfo.php?uid=' . $eachposter->getVar('uid') . '">' . $eachposter->getVar('uname') . '</a>');
            } else {
                $posterarr = array('poster_uid' => 0, 'poster_uname' => $xoopsConfig['anonymous']);
            }
        } else {
            $posterarr = array('poster_uid' => 0, 'poster_uname' => $xoopsConfig['anonymous']);
        }
        $posticon = $arr[$key]['obj']->icon();
        if (isset($posticon) && $posticon != '') {
            $post_image = '<img src="' . XOOPS_URL . '/modules/xhnewbb/images/' . $posticon . '" alt="" />';
        } else {
            $post_image = '<img src="' . XOOPS_URL . '/images/icons/no_posticon.gif" alt="" />';
        }
        if ($current != $key) {
            $subject = '<a href="viewtopic.php?topic_id=' . $arr[$key]['obj']->topic() . '&amp;post_id=' . $arr[$key]['obj']->postid() . '&amp;viewmode=thread#forumpost' . $arr[$key]['obj']->postid() . '">' . $arr[$key]['obj']->subject() . '</a>';
            $GLOBALS['xoopsTpl']->append("topic_trees", array_merge($posterarr, array("post_id" => $arr[$key]['obj']->postid(), "post_parent_id" => $arr[$key]['obj']->parent(), "post_date" => formatTimestamp($arr[$key]['obj']->posttime(), "m"), "post_image" => $post_image, "post_title" => $subject, "post_prefix" => $prefix)));
        } else {
            $subject = '<b>' . $arr[$key]['obj']->subject() . '</b>';
            $thisprefix = substr($prefix, 0, -6) . "<b>&raquo;</b>";
            $GLOBALS['xoopsTpl']->append("topic_trees", array_merge($posterarr, array("post_id" => $arr[$key]['obj']->postid(), "post_parent_id" => $arr[$key]['obj']->parent(), "post_date" => formatTimestamp($arr[$key]['obj']->posttime(), "m"), "post_image" => $post_image, "post_title" => $subject, "post_prefix" => $thisprefix)));
        }
    }
    if (isset($arr[$key]['replies']) && !empty($arr[$key]['replies'])) {
        $prefix .= "&nbsp;&nbsp;";
        foreach ($arr[$key]['replies'] as $replykey) {
            $current = $current == 0 ? $replykey : $current;
            xhnewbb_show_tree($arr, $current, $replykey, $prefix, $foundusers);
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:peakxoops-svn,代码行数:46,代码来源:viewtopic.php

示例2: Criteria

 include XOOPS_ROOT_PATH . '/header.php';
 $criteria = new Criteria('to_userid', $xoopsUser->getVar('uid'));
 $criteria->setLimit(1);
 $criteria->setStart($start);
 $criteria->setSort('msg_time');
 $pm_arr =& $pm_handler->getObjects($criteria);
 echo "<div><h4>" . _PM_PRIVATEMESSAGE . "</h4></div><br /><a href='userinfo.php?uid=" . $xoopsUser->getVar("uid") . "'>" . _PM_PROFILE . "</a>&nbsp;<span style='font-weight:bold;'>&raquo;&raquo;</span>&nbsp;<a href='viewpmsg.php'>" . _PM_INBOX . "</a>&nbsp;<span style='font-weight:bold;'>&raquo;&raquo;</span>&nbsp;\n";
 if (empty($pm_arr)) {
     echo '<br /><br />' . _PM_YOUDONTHAVE;
 } else {
     if (!$pm_handler->setRead($pm_arr[0])) {
         //echo "failed";
     }
     echo $pm_arr[0]->getVar("subject") . "<br /><form action='readpmsg.php' method='post' name='delete" . $pm_arr[0]->getVar("msg_id") . "'><table border='0' cellpadding='4' cellspacing='1' class='outer' width='100%'><tr><th colspan='2'>" . _PM_FROM . "</th></tr><tr class='even'>\n";
     $poster = new XoopsUser($pm_arr[0]->getVar("from_userid"));
     if (!$poster->isActive()) {
         $poster = false;
     }
     echo "<td valign='top'>";
     if ($poster != false) {
         // we need to do this for deleted users
         echo "<a href='userinfo.php?uid=" . $poster->getVar("uid") . "'>" . $poster->getVar("uname") . "</a><br />\n";
         if ($poster->getVar("user_avatar") != "") {
             echo "<img src='uploads/" . $poster->getVar("user_avatar") . "' alt='' /><br />\n";
         }
         if ($poster->getVar("user_from") != "") {
             echo _PM_FROMC . "" . $poster->getVar("user_from") . "<br /><br />\n";
         }
         if ($poster->isOnline()) {
             echo "<span style='color:#ee0000;font-weight:bold;'>" . _PM_ONLINE . "</span><br /><br />\n";
         }
开发者ID:BackupTheBerlios,项目名称:xoops4-svn,代码行数:31,代码来源:readpmsg.php

示例3: foreach

     $quick_reply = $form->render();
     $xoopsTpl->assign('mp_quik_reply', "<a href='#quick_reply' onclick='javascript: document.getElementById(\"quick_reply\").style.display=\"block\";'>" . _MP_QUICKREPLY . "</a>");
     $xoopsTpl->assign('mp_quik_post', "<div name='quick_reply' id='quick_reply' style='display: none;'>" . $quick_reply . "</div>");
 }
 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 .= "&nbsp;&nbsp;");
             $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);
         }
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:viewbox.php

示例4: showThreadPost

 function showThreadPost($order, $mode, $adminview = 0, $color_num = 1)
 {
     global $xoopsConfig, $xoopsUser;
     $edit_image = "";
     $reply_image = "";
     $delete_image = "";
     $post_date = formatTimestamp($this->getVar("date"), "m");
     if ($this->getVar("user_id") != 0) {
         $poster = new XoopsUser($this->getVar("user_id"));
         if (!$poster->isActive()) {
             $poster = 0;
         }
     } else {
         $poster = 0;
     }
     if ($this->getVar("icon") != null && $this->getVar("icon") != "") {
         $subject_image = "<a name='" . $this->getVar("comment_id") . "' id='" . $this->getVar("comment_id") . "'></a><img src='" . XOOPS_URL . "/images/subject/" . $this->getVar("icon") . "' alt='' />";
     } else {
         $subject_image = "<a name='" . $this->getVar("comment_id") . "' id='" . $this->getVar("comment_id") . "'></a><img src='" . XOOPS_URL . "/images/icons/no_posticon.gif' alt='' />";
     }
     if ($adminview) {
         $ip_image = "<img src='" . XOOPS_URL . "/images/icons/ip.gif' alt='" . $this->getVar("ip") . "' />";
     } else {
         $ip_image = "<img src='" . XOOPS_URL . "/images/icons/ip.gif' alt='' />";
     }
     if ($adminview || $xoopsUser && $this->getVar("user_id") == $xoopsUser->getVar("uid")) {
         $edit_image = "<a href='editcomment.php?comment_id=" . $this->getVar("comment_id") . "&amp;mode=" . $mode . "&amp;order=" . intval($order) . "'><img src='" . XOOPS_URL . "/images/icons/edit.gif' alt='" . _EDIT . "' /></a>";
     }
     if ($xoopsConfig['anonpost'] || $xoopsUser) {
         $reply_image = "<a href='replycomment.php?comment_id=" . $this->getVar("comment_id") . "&amp;mode=" . $mode . "&amp;order=" . intval($order) . "'><img src='" . XOOPS_URL . "/images/icons/reply.gif' alt='" . _REPLY . "' /></a>";
     }
     if ($adminview) {
         $delete_image = "<a href='deletecomment.php?comment_id=" . $this->getVar("comment_id") . "&amp;mode=" . $mode . "&amp;order=" . intval($order) . "'><img src='" . XOOPS_URL . "/images/icons/delete.gif' alt='" . _DELETE . "' /></a>";
     }
     if ($poster) {
         $text = $this->getVar("comment");
         if ($poster->getVar("attachsig")) {
             $text .= "<p><br />_________________<br />" . $poster->user_sig() . "</p>";
         }
         $reg_date = _CM_JOINED;
         $reg_date .= formatTimestamp($poster->getVar("user_regdate"), "s");
         $posts = _CM_POSTS;
         $posts .= $poster->getVar("posts");
         $user_from = _CM_FROM;
         $user_from .= $poster->getVar("user_from");
         $rank = $poster->rank();
         if ($rank['image'] != "") {
             $rank['image'] = "<img src='" . XOOPS_UPLOAD_URL . "/" . $rank['image'] . "' alt='' />";
         }
         $avatar_image = "<img src='" . XOOPS_UPLOAD_URL . "/" . $poster->getVar("user_avatar") . "' alt='' />";
         if ($poster->isOnline()) {
             $online_image = "<span style='color:#ee0000;font-weight:bold;'>" . _ONLINE . "</span>";
         } else {
             $online_image = "";
         }
         $profile_image = "<a href='" . XOOPS_URL . "/userinfo.php?uid=" . $poster->getVar("uid") . "'><img src='" . XOOPS_URL . "/images/icons/profile.gif' alt='" . _PROFILE . "' /></a>";
         if ($xoopsUser) {
             $pm_image = "<a href='javascript:openWithSelfMain(\"" . XOOPS_URL . "/pmlite.php?send2=1&amp;to_userid=" . $poster->getVar("uid") . "\",\"pmlite\",450,370);'><img src='" . XOOPS_URL . "/images/icons/pm.gif' alt='" . sprintf(_SENDPMTO, $poster->getVar("uname", "E")) . "' /></a>";
         } else {
             $pm_image = "";
         }
         if ($poster->getVar("user_viewemail")) {
             $email_image = "<a href='mailto:" . $poster->getVar("email", "E") . "'><img src='" . XOOPS_URL . "/images/icons/email.gif' alt='" . sprintf(_SENDEMAILTO, $poster->getVar("uname", "E")) . "' /></a>";
         } else {
             $email_image = "";
         }
         $posterurl = $poster->getVar("url");
         if ($posterurl != "") {
             $www_image = "<a href='{$posterurl}' target='_blank'><img src='" . XOOPS_URL . "/images/icons/www.gif' alt='" . _VISITWEBSITE . "' /></a>";
         } else {
             $www_image = "";
         }
         if ($poster->getVar("user_icq") != "") {
             $icq_image = "<a href='http://wwp.icq.com/scripts/search.dll?to=" . $poster->getVar("user_icq", "E") . "'><img src='" . XOOPS_URL . "/images/icons/icq_add.gif' alt='" . _ADD . "' /></a>";
         } else {
             $icq_image = "";
         }
         if ($poster->getVar("user_aim") != "") {
             $aim_image = "<a href='aim:goim?screenname=" . $poster->getVar("user_aim", "E") . "&message=Hi+" . $poster->getVar("user_aim") . "+Are+you+there?'><img src='" . XOOPS_URL . "/images/icons/aim.gif' alt='aim' /></a>";
         } else {
             $aim_image = "";
         }
         if ($poster->getVar("user_yim") != "") {
             $yim_image = "<a href='http://edit.yahoo.com/config/send_webmesg?.target=" . $poster->getVar("user_yim", "E") . "&.src=pg'><img src='" . XOOPS_URL . "/images/icons/yim.gif' alt='yim' /></a>";
         } else {
             $yim_image = "";
         }
         if ($poster->getVar("user_msnm") != "") {
             $msnm_image = "<a href='" . XOOPS_URL . "/userinfo.php?uid=" . $poster->getVar("uid") . "'><img src='" . XOOPS_URL . "/images/icons/msnm.gif' alt='msnm' /></a>";
         } else {
             $msnm_image = "";
         }
         showThread($color_num, $subject_image, $this->getVar("subject"), $text, $post_date, $ip_image, $reply_image, $edit_image, $delete_image, $poster->getVar("uname"), $rank['title'], $rank['image'], $avatar_image, $reg_date, $posts, $user_from, $online_image, $profile_image, $pm_image, $email_image, $www_image, $icq_image, $aim_image, $yim_image, $msnm_image);
     } else {
         showThread($color_num, $subject_image, $this->getVar("subject"), $this->getVar("comment"), $post_date, $ip_image, $reply_image, $edit_image, $delete_image, $xoopsConfig['anonymous']);
     }
 }
开发者ID:amjadtbssm,项目名称:website,代码行数:97,代码来源:xoopscomments.php

示例5: array

     exit;
 }
 if ($nextid == 0) {
     $nextid = $xoopsDB->getInsertId();
 }
 // RMV-NOTIFY
 $tags = array();
 $tags['FORUM_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewforum.php?forum=' . $nextid;
 $tags['FORUM_NAME'] = $name;
 $tags['FORUM_DESCRIPTION'] = $desc;
 $notification_handler =& xoops_gethandler('notification');
 $notification_handler->triggerEvents('global', 0, 'new_forum', $tags);
 $count = 0;
 while (list($mod_number, $mod) = each($HTTP_POST_VARS["mods"])) {
     $mod_data = new XoopsUser($mod);
     if ($mod_data->isActive() && $mod_data->level() < 2) {
         if (!isset($user_query)) {
             $user_query = "UPDATE " . $xoopsDB->prefix("users") . " SET level = 2 WHERE ";
         }
         if ($count > 0) {
             $user_query .= "OR ";
         }
         $user_query .= "uid = {$mod} ";
         $count++;
     }
     $mod_query = "INSERT INTO " . $xoopsDB->prefix("bb_forum_mods") . " (forum_id, user_id) VALUES ({$nextid}, {$mod})";
     if (!$xoopsDB->query($mod_query)) {
         redirect_header("./index.php", 1);
         exit;
     }
 }
开发者ID:amjadtbssm,项目名称:website,代码行数:31,代码来源:admin_forums.php

示例6: XoopsUser

 /**
  * Get Text with Signature
  *
  * @param   string  $text
  * @param   int  $uid
  * @return  string
  *
  * @access	private
  **/
 function _getText($text = '', $uid = 0)
 {
     global $xoopsConfig, $xoopsUser;
     if ($uid != 0) {
         $poster = new XoopsUser($uid);
         if (!$poster->isActive()) {
             $poster = 0;
         }
     } else {
         $poster = 0;
     }
     if ($poster) {
         if ($poster->getVar("attachsig")) {
             $text .= "<p><br />_________________<br />" . $poster->user_sig() . "</p>";
         }
     }
     return $text;
 }
开发者ID:trabisdementia,项目名称:xuups,代码行数:27,代码来源:commentrenderer.php

示例7: foreach

 foreach (array('name', 'desc') as $k) {
     ${$k} = !empty($_POST[$k]) ? trim($myts->stripSlashesGPC($_POST[$k])) : '';
 }
 foreach (array('type', 'cat', 'forum_access', 'html', 'sig', 'ppp', 'hot', 'tpp', 'forum') as $k) {
     ${$k} = !empty($_POST[$k]) ? intval($_POST[$k]) : 0;
 }
 $sql = sprintf("UPDATE %s SET forum_name = %s, forum_desc = %s, forum_type = %s, cat_id = %u, forum_access = %u, allow_html = %s, allow_sig = %s, posts_per_page = %u, hot_threshold = %u, topics_per_page = %u WHERE forum_id = %u", $xoopsDB->prefix("bb_forums"), $xoopsDB->quoteString($name), $xoopsDB->quoteString($desc), $xoopsDB->quoteString($type), $cat, $forum_access, $xoopsDB->quoteString($html), $xoopsDB->quoteString($sig), $ppp, $hot, $tpp, $forum);
 if (!($r = $xoopsDB->query($sql))) {
     redirect_header("./index.php", 1);
     exit;
 }
 $count = 0;
 if (isset($_POST["mods"])) {
     while (list($null, $mod) = each($_POST["mods"])) {
         $mod_data = new XoopsUser($mod);
         if ($mod_data->isActive()) {
             $sql = sprintf("INSERT INTO %s (forum_id, user_id) VALUES (%u, %u)", $xoopsDB->prefix("bb_forum_mods"), $forum, $mod);
             if (!$xoopsDB->query($sql)) {
                 redirect_header("./index.php", 1);
                 exit;
             }
         }
     }
 }
 if (empty($_POST["mods"])) {
     $current_mods = "SELECT count(*) AS total FROM " . $xoopsDB->prefix("bb_forum_mods") . " WHERE forum_id = {$forum}";
     $r = $xoopsDB->query($current_mods);
     list($total) = $xoopsDB->fetchRow($r);
 } else {
     $total = count($_POST["mods"]) + 1;
 }
开发者ID:koki-h,项目名称:xoops_utf8,代码行数:31,代码来源:admin_forums.php

示例8: 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()を掛けられるので&amp;ではなく&と記述しておく
             //				$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('/&amp;/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'));
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:peakxoops-svn,代码行数:101,代码来源:PmessageAction.php

示例9: mp_post

function mp_post($view_perms, $pm, $mpstop)
{
    global $xoopsConfig, $xoopsModule, $xoopsModuleConfig, $xoopsUser, $myts, $xoopsTpl, $sortorder, $order, $start, $mp_alert;
    $xoopsTpl->assign('xoops_pagetitle', $myts->htmlSpecialChars($xoopsModule->name()) . " - " . $myts->htmlSpecialChars($pm->getVar('subject')));
    $poster = new XoopsUser($pm->getVar("from_userid"));
    if (!$poster->isActive()) {
        $poster = array('name' => $myts->HtmlSpecialChars($xoopsConfig['anonymous']));
    } else {
        $poster_rank = $poster->rank();
        if ($poster->isOnline()) {
            $msg_uline = '<div class="comUserStatus"><img src="' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/images/online.png" title="' . _MP_ONLINE . '" style="width: 20px; height: 20px;"/></div>';
        } else {
            $msg_uline = '<div class="comUserStatus"><img src="' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/images/offline.png" title="' . _MP_OFFLINE . '" style="width: 20px; height: 20px;"/></div>';
        }
        if ($poster->getVar("attachsig")) {
            $signature = "<p><br />_________________<br />" . $poster->user_sig() . "</p>";
        } else {
            $signature = false;
        }
        if (is_file(XOOPS_UPLOAD_PATH . "/" . $poster->getVar('user_avatar'))) {
            $avatar = '<img class="comUserImg" src="' . XOOPS_UPLOAD_URL . "/" . $poster->getVar("user_avatar") . '" alt=""/>';
        } else {
            $avatar = '<img class="comUserImg" src="' . XOOPS_UPLOAD_URL . '"/blank.gif" alt=""/>';
        }
        $poster = array('name' => '<a href="' . XOOPS_URL . '/userinfo.php?uid=' . $poster->getVar("uid") . '">' . $poster->getVar("uname") . '</a>', 'title' => $poster_rank['title'], 'img' => '<img class="comUserRankImg" src="' . XOOPS_UPLOAD_URL . "/" . $poster_rank['image'] . '" alt="" />', 'avatar' => $avatar, 'regdate' => formatTimestamp($poster->getVar('user_regdate'), 's'), 'from' => $poster->getVar('user_from'), 'posts' => $poster->getVar('posts'), 'id' => $pm->getVar('msg_id'), 'uline' => $msg_uline, 'sign' => $signature, 'addcont' => "<img onclick='document.prvmsg.action=\"contbox.php?op=envoimp&to_userid[]=" . $poster->getVar("uid") . "\";document.prvmsg.submit()' src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/addcont.png' title=" . _MP_ADDCONT . " style='cursor:pointer; width: 15px; height: 15px;'></a>");
    }
    if ($pm->getVar('file_msg') > 0) {
        $file_msg = "";
        $up_handler =& xoops_gethandler('priv_msgsup');
        $criteria = new CriteriaCompo();
        $criteria->add(new Criteria('u_id', $pm->getVar('file_msg')));
        $pm_up =& $up_handler->getObjects($criteria);
        foreach (array_keys($pm_up) as $i) {
            $file_msg .= "<br /><br /><img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/upload.png' alt='' />&nbsp;" . _MP_MIMEFILE . "<a href='visit.php?fileup=" . $pm_up[$i]->getVar('u_file') . "'>" . $pm_up[$i]->getVar('u_name') . "</a> (" . $pm_up[$i]->getVar('u_mimetype') . " | " . MPPrettySize($pm_up[$i]->getVar('u_weight')) . ")";
        }
    } else {
        $file_msg = false;
    }
    if (!$pm->getVar('msg_image')) {
        $msg_img = "<img src='" . XOOPS_URL . "/images/read.gif' alt='' />";
    } else {
        $msg_img = "<img src='" . XOOPS_URL . "/images/subject/" . $pm->getVar('msg_image') . "' alt='' />";
    }
    if ($pm->getVar('anim_msg')) {
        $anim = '<div id="anim' . $pm->getVar('msg_id') . '" name="anim" style="width: 640px; position: absolute; height: 130px; left: 50%; 
 margin-left: -375px; text-align: center; visibility: hidden;"> 
 <embed src="' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/swf/' . $pm->getVar('anim_msg') . '" wmode="transparent" id="flash' . $pm->getVar('msg_id') . '" name="flash" loop="false"  autostart="0" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="640" height="380"></embed>
 <NOEMBED>' . _MP_NOOEIL . '</NOEMBED></div><a href="#' . $pm->getVar('msg_id') . '" onclick="document.getElementById(\'anim' . $pm->getVar('msg_id') . '\').style.visibility=\'visible\';flash' . $pm->getVar('msg_id') . '.TPlay(\'_level0\');" >' . _MP_OEIL . '</a> / <a href="#' . $pm->getVar('msg_id') . '" onclick="document.getElementById(\'anim' . $pm->getVar('msg_id') . '\').style.visibility=\'hidden\';flash' . $pm->getVar('msg_id') . '.TStopPlay(\'_level0\');" >' . _MP_OEILOFF . '</a>';
    } else {
        $anim = false;
    }
    //boutton message
    if ($view_perms & GPERM_MESS) {
        if (empty($mpstop)) {
            if ($pm->getVar('cat_msg') == 2) {
                $view_actions[] = "<input type='submit'  class='xo-message-form' name='quote_messages'  value='" . _MP_QUOTE . "' onclick='javascript: document.getElementById(\"msg_mp[]\").value=\"" . $pm->getVar('msg_id') . "\";document.prvmsg.action=\"msgbox.php?op=sendbox&reply=1&quotedac=1\";' id='stop' disabled>";
                $view_actions[] = "<input type='submit'  class='xo-message-form'  name='reply'  value='" . _MP_MREPLY . "' onclick='javascript: document.getElementById(\"msg_mp[]\").value=\"" . $pm->getVar('msg_id') . "\";document.prvmsg.action=\"msgbox.php?op=sendbox&reply=1\";' id='stop' disabled>";
            } else {
                $view_actions[] = "<input type='submit' class='xo-message-form'  name='quote_messages'  value='" . _MP_QUOTE . "' onclick='javascript: document.getElementById(\"msg_mp[]\").value=\"" . $pm->getVar('msg_id') . "\";document.prvmsg.action=\"msgbox.php?op=sendbox&reply=1&quotedac=1\";' >";
                $view_actions[] = "<input type='submit'  class='xo-message-form'  value='" . _MP_MREPLY . "' onclick='javascript: document.getElementById(\"msg_mp[]\").value=\"" . $pm->getVar('msg_id') . "\";document.prvmsg.action=\"msgbox.php?op=sendbox&reply=1\";' >";
            }
        } else {
            $view_actions[] = "<input type='submit'  class='xo-message-form'  name='quote_messages'  value='" . _MP_QUOTE . "' onclick='javascript: document.getElementById(\"msg_mp\").value=\"" . $pm->getVar('msg_id') . "\";document.prvmsg.action=\"msgbox.php?op=sendbox&reply=1&quotedac=1\";' id='stop' disabled>";
            $view_actions[] = "<input type='submit' class='xo-message-form'  value='" . _MP_MREPLY . "' onclick='javascript: document.getElementById(\"msg_mp[]\").value=\"" . $pm->getVar('msg_id') . "\";document.prvmsg.action=\"msgbox.php?op=sendbox&reply=1\";' id='stop' disabled>";
        }
    }
    $view_actions[] = "<input type='submit'  class='xo-message-form'  id='del' value='" . _MP_MDEL . "' onclick='document.getElementById(\"msg_mp[]\").value=\"" . $pm->getVar('msg_id') . "\";document.prvmsg.action=\"delbox.php?option=delete_messages\"'>";
    $view_actions[] = "<input type='submit' class='xo-message-form'  onclick='document.prvmsg.action=\"delbox.php?option=read_messages&read=0\"' id='nlu' value='" . _MP_MNLU . "'>";
    $view_actions[] = "<input type='submit' class='xo-message-form'  onclick='document.prvmsg.action=\"delbox.php?option=move_messages\"' id='move'  value='" . _MP_MMOVE . "'>";
    //$xoopsTpl->assign('view_actions', $view_actions);
    if ($view_perms & GPERM_EXP) {
        $exporte = "<img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/smallprint.png' style=\" cursor:pointer; border-width: 0px; width: 16px; height: 20px;\" onclick='document.getElementById(\"msg_mp[]\").value=\"" . $pm->getVar('msg_id') . "\";document.prvmsg.action=\"print.php?option=print_messages\";document.prvmsg.submit()'>&nbsp;<img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/smallpdf.png' style=\"cursor:pointer; border-width: 0px; width: 16px; height: 20px;\" onclick='document.getElementById(\"msg_mp[]\").value=\"" . $pm->getVar('msg_id') . "\";document.prvmsg.action=\"makepdf.php?option=pdf_messages\";document.prvmsg.submit()'>&nbsp;<img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/smallemail.png' title='" . _MP_DESCEMAIL . "' style=\" cursor:pointer; border-width: 0px; width: 16px; height: 20px;\" onclick='document.getElementById(\"msg_mp[]\").value=\"" . $pm->getVar('msg_id') . "\";document.prvmsg.action=\"email.php?option=email_messages\";document.prvmsg.submit()'>";
    } else {
        $exporte = false;
    }
    $mp_subject = $pm->getVar('subject') ? $myts->displayTarea($pm->getVar('subject')) : _MP_NONESUBJ;
    $xoopsTpl->append('prive', array('msg_time' => '<a id="' . $pm->getVar('msg_id') . '"></a>' . formatTimestamp($pm->getVar('msg_time')), 'msg_subject' => $mp_subject, 'msg_text' => $myts->displayTarea($myts->undoHtmlSpecialChars($pm->getVar('msg_text')), $xoopsModuleConfig['html']), 'file_msg' => $file_msg, 'msg_img' => $msg_img, 'poster' => $poster, 'anim' => $anim, 'export' => $exporte, 'view_actions' => $view_actions));
    unset($thread_buttons);
    unset($eachposter);
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:80,代码来源:priv_msgs.php


注:本文中的XoopsUser::isActive方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。