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


PHP UserHelper::getDisplayNameFromUserId方法代码示例

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


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

示例1: forum_header

function forum_header($params)
{
    global $HTML, $group_id, $forum_name, $thread_id, $msg_id, $forum_id, $et, $et_cookie, $Language;
    $hp = Codendi_HTMLPurifier::instance();
    $uh = new UserHelper();
    $params['group'] = $group_id;
    $params['toptab'] = 'forum';
    $params['help'] = 'WebForums.html';
    /*
    	bastardization for news
    	Show icon bar unless it's a news forum
    */
    if ($group_id == $GLOBALS['sys_news_group']) {
        //this is a news item, not a regular forum
        if ($forum_id) {
            /*
            	Show this news item at the top of the page
            */
            $sql = "SELECT * FROM news_bytes WHERE forum_id=" . db_ei($forum_id);
            $result = db_query($sql);
            //backwards shim for all "generic news" that used to be submitted
            //as of may, "generic news" is not permitted - only project-specific news
            if (db_result($result, 0, 'group_id') != $GLOBALS['sys_news_group']) {
                $params['group'] = db_result($result, 0, 'group_id');
                $params['toptab'] = 'news';
                $group_id = db_result($result, 0, 'group_id');
                site_project_header($params);
            } else {
                $HTML->header($params);
                echo '
					<H2>' . $GLOBALS['sys_name'] . ' <A HREF="/news/">' . $Language->getText('forum_forum_utils', 'news') . '</A></H2><P>';
            }
            echo '<TABLE><TR><TD VALIGN="TOP">';
            if (!$result || db_numrows($result) < 1) {
                echo '
					<h3>' . $Language->getText('forum_forum_utils', 'news_not_found') . '</h3>';
            } else {
                echo '
				<B>' . $Language->getText('forum_forum_utils', 'posted_by') . ':</B> ' . $hp->purify($uh->getDisplayNameFromUserId(db_result($result, 0, 'submitted_by')), CODENDI_PURIFIER_CONVERT_HTML) . '<BR>
				<B>' . $Language->getText('forum_forum', 'date') . ':</B> ' . format_date($GLOBALS['Language']->getText('system', 'datefmt'), db_result($result, 0, 'date')) . '<BR>
				<B>' . $Language->getText('forum_forum_utils', 'summary') . ':</B><A HREF="/forum/forum.php?forum_id=' . db_result($result, 0, 'forum_id') . '">' . db_result($result, 0, 'summary') . '</A>
				<P>
				' . util_make_links(nl2br(db_result($result, 0, 'details')), $group_id);
                echo '<P>';
                $crossref_fact = new CrossReferenceFactory($forum_id, ReferenceManager::REFERENCE_NATURE_NEWS, $group_id);
                $crossref_fact->fetchDatas();
                if ($crossref_fact->getNbReferences() > 0) {
                    echo '<b> ' . $Language->getText('cross_ref_fact_include', 'references') . '</b>';
                    $crossref_fact->DisplayCrossRefs();
                }
            }
            echo '</TD><TD VALIGN="TOP" WIDTH="35%">';
            echo $HTML->box1_top($Language->getText('forum_forum_utils', 'proj_latest_news'), 0);
            echo news_show_latest(db_result($result, 0, 'group_id'), 5, false);
            echo $HTML->box1_bottom();
            echo '</TD></TR></TABLE>';
        }
    } else {
        //this is just a regular forum, not a news item
        site_project_header($params);
    }
    /*
    	Show horizontal forum links
    */
    if ($forum_id && $forum_name) {
        echo '<P><H3>' . $Language->getText('forum_forum_utils', 'discuss_forum') . ': <A HREF="/forum/forum.php?forum_id=' . $forum_id . '">' . $forum_name . '</A></H3>';
    }
    if (!isset($params['pv']) || isset($params['pv']) && !$params['pv']) {
        echo '<P><B>';
        $request =& HTTPRequest::instance();
        if ($forum_id && user_isloggedin() && !$request->exist('delete')) {
            if (user_monitor_forum($forum_id, user_getid())) {
                $msg = $Language->getText('forum_forum_utils', 'stop_monitor');
            } else {
                $msg = $Language->getText('forum_forum_utils', 'monitor');
            }
            echo '<A HREF="/forum/monitor.php?forum_id=' . $forum_id . '">';
            echo html_image("ic/monitor_forum.png", array()) . ' ' . $msg . '</A> | ';
            echo '<A HREF="/forum/monitor_thread.php?forum_id=' . $forum_id . '"> ' . html_image("ic/monitor_thread.png", array()) . $Language->getText('forum_forum_utils', 'monitor_thread') . '</A> | ';
            echo '<A HREF="/forum/save.php?forum_id=' . $forum_id . '">';
            echo html_image("ic/save.png", array()) . ' ' . $Language->getText('forum_forum_utils', 'save_place') . '</A> | ';
            print ' <a href="forum.php?forum_id=' . $forum_id . '#start_new_thread">';
            echo html_image("ic/thread.png", array()) . ' ' . $Language->getText('forum_forum_utils', 'start_thread') . '</A> | ';
            if (isset($msg_id) && $msg_id) {
                echo "<A HREF='" . $_SERVER['PHP_SELF'] . "?msg_id={$msg_id}&pv=1'><img src='" . util_get_image_theme("msg.png") . "' border='0'>&nbsp;" . $Language->getText('global', 'printer_version') . "</A> | ";
            } else {
                echo "<A HREF='" . $_SERVER['PHP_SELF'] . "?forum_id={$forum_id}&pv=1'><img src='" . util_get_image_theme("msg.png") . "' border='0'>&nbsp;" . $Language->getText('global', 'printer_version') . "</A> | ";
            }
        }
        // The forum admin link is only displayed for the forum moderators
        if (user_ismember($group_id, 'F2')) {
            echo '  <A HREF="/forum/admin/?group_id=' . $group_id . '">' . $Language->getText('forum_forum_utils', 'admin') . '</A></B>';
            if (isset($params['help']) && $params['help']) {
                echo ' | ';
            }
        }
        if (isset($params['help']) && $params['help']) {
            echo help_button($params['help'], false, $Language->getText('global', 'help'));
        }
        echo '</B><P>';
//.........这里部分代码省略.........
开发者ID:nterray,项目名称:tuleap,代码行数:101,代码来源:forum_utils.php


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