本文整理汇总了PHP中display_user_link函数的典型用法代码示例。如果您正苦于以下问题:PHP display_user_link函数的具体用法?PHP display_user_link怎么用?PHP display_user_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了display_user_link函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: api_get_user_info
echo '<td>' . $row['thread_replies'] . '</td>';
echo '<td>' . $row['thread_views'] . '</td>';
// display the author name
$tab_poster_info = api_get_user_info($row['user_id']);
$poster_username = sprintf(get_lang('LoginX'), $tab_poster_info['username']);
if ($origin != 'learnpath') {
echo '<td>' . display_user_link($row['user_id'], api_get_person_name($row['firstname'], $row['lastname']), '', $poster_username) . '</td>';
} else {
echo '<td>' . Display::tag('span', api_get_person_name($row['firstname'], $row['lastname']), array("title" => api_htmlentities($poster_username, ENT_QUOTES))) . '</td>';
}
$last_post_info = get_last_post_by_thread($row['c_id'], $row['thread_id'], $row['forum_id'], is_allowed_to_edit());
$last_post = null;
if ($last_post_info) {
$poster_info = api_get_user_info($last_post_info['poster_id']);
$post_date = api_convert_and_format_date($last_post_info['post_date']);
$last_post = $post_date . ' ' . get_lang('By') . ' ' . display_user_link($last_post_info['poster_id'], $poster_info['complete_name'], '', $poster_info['username']);
}
/*
if ($row['last_poster_user_id'] == '0') {
$name = $row['poster_name'];
$last_poster_username = "";
} else {
$name = api_get_person_name($row['last_poster_firstname'], $row['last_poster_lastname']);
$tab_last_poster_info = api_get_user_info($row['last_poster_user_id']);
$last_poster_username = sprintf(get_lang('LoginX'), $tab_last_poster_info['username']);
}
// If the last post is invisible and it is not the teacher who is looking then we have to find the last visible post of the thread.
if (($row['visible'] == '1' OR api_is_allowed_to_edit(false, true)) && $origin != 'learnpath') {
$last_post = $post_date.' '.get_lang('By').' '.display_user_link($row['last_poster_user_id'], $name, '', $last_poster_username);
} elseif ($origin != 'learnpath') {
$last_post_sql = "SELECT post.*, user.firstname, user.lastname, user.username FROM $table_posts post, $table_users user WHERE post.poster_id=user.user_id AND visible='1' AND thread_id='".$row['thread_id']."' AND post.c_id=".api_get_course_int_id()." ORDER BY post_id DESC";
示例2: isset
// the number of topics and posts
$my_number_threads = isset($forum['number_of_threads']) ? $forum['number_of_threads'] : '';
$my_number_posts = isset($forum['number_of_posts']) ? $forum['number_of_posts'] : '';
echo '<td>' . $my_number_threads . '</td>';
echo '<td>' . $my_number_posts . '</td>';
// the last post in the forum
if ($forum['last_poster_name'] != '') {
$name = $forum['last_poster_name'];
$poster_id = 0;
} else {
$name = api_get_person_name($forum['last_poster_firstname'], $forum['last_poster_lastname']);
$poster_id = $forum['last_poster_id'];
}
echo '<td>';
if (!empty($forum['last_post_id'])) {
echo $forum['last_post_date'] . ' ' . get_lang('By') . ' ' . display_user_link($poster_id, $name);
}
echo '</td>';
echo '<td class="td_actions">';
if (api_is_allowed_to_edit(false, true) && !($forum['session_id'] == 0 && intval(isset($_SESSION['id_session']) ? $_SESSION['id_session'] : null) != 0)) {
echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&forumcategory=' . Security::remove_XSS($_GET['forumcategory']) . '&action=edit&content=forum&id=' . $forum['forum_id'] . '">' . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>';
echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&forumcategory=' . Security::remove_XSS($_GET['forumcategory']) . '&action=delete&content=forum&id=' . $forum['forum_id'] . "\" onclick=\"javascript:if(!confirm('" . addslashes(api_htmlentities(get_lang('DeleteForum'), ENT_QUOTES)) . "')) return false;\">" . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
display_visible_invisible_icon('forum', $forum['forum_id'], $forum['visibility'], array('forumcategory' => $_GET['forumcategory']));
display_lock_unlock_icon('forum', $forum['forum_id'], $forum['locked'], array('forumcategory' => $_GET['forumcategory']));
display_up_down_icon('forum', $forum['forum_id'], $forums_in_category);
}
$iconnotify = 'send_mail.gif';
if (is_array(isset($_SESSION['forum_notification']['forum']) ? $_SESSION['forum_notification']['forum'] : null)) {
if (in_array($forum['forum_id'], $_SESSION['forum_notification']['forum'])) {
$iconnotify = 'send_mail_checked.gif';
}
示例3: get_lang
$html .= Display::return_icon('post-forum.png', get_lang('Forum'), null, ICON_SIZE_SMALL);
$html .= ' ' . $number_threads . '<br>' . $newPost . '</div>';
$html .= '<div class="col-md-6">';
// The last post in the forum.
if ($forum['last_poster_name'] != '') {
$name = $forum['last_poster_name'];
$poster_id = 0;
$username = "";
} else {
$name = api_get_person_name($forum['last_poster_firstname'], $forum['last_poster_lastname']);
$poster_id = $forum['last_poster_id'];
$userinfo = api_get_user_info($poster_id);
$username = sprintf(get_lang('LoginX'), $userinfo['username']);
}
if (!empty($forum['last_post_id'])) {
$html .= Display::return_icon('post-item.png', null, null, ICON_SIZE_TINY) . ' ' . api_convert_and_format_date($forum['last_post_date']) . '<br /> ' . get_lang('By') . ' ' . display_user_link($poster_id, $name, '', $username);
}
$html .= '</div>';
$html .= '<div class="col-md-4">';
if (api_is_allowed_to_edit(false, true) && !($forum['session_id'] == 0 && intval($sessionId) != 0)) {
$html .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=edit&content=forum&id=' . $forum['forum_id'] . '">' . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>';
$html .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=delete&content=forum&id=' . $forum['forum_id'] . "\" onclick=\"javascript:if(!confirm('" . addslashes(api_htmlentities(get_lang('DeleteForum'), ENT_QUOTES)) . "')) return false;\">" . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
$html .= return_visible_invisible_icon('forum', $forum['forum_id'], $forum['visibility']);
$html .= return_lock_unlock_icon('forum', $forum['forum_id'], $forum['locked']);
$html .= return_up_down_icon('forum', $forum['forum_id'], $forumsInCategory);
}
$iconnotify = 'notification_mail_na.png';
$session_forum_notification = isset($_SESSION['forum_notification']['forum']) ? $_SESSION['forum_notification']['forum'] : false;
if (is_array($session_forum_notification)) {
if (in_array($forum['forum_id'], $session_forum_notification)) {
$iconnotify = 'notification_mail.png';
示例4: sprintf
}
$indent = $post['indent_cnt'] * '20';
echo "<div style=\"margin-left: " . $indent . "px;\">";
echo "<table width=\"100%\" class=\"post\" cellspacing=\"5\" border=\"0\">";
echo "<tr>";
echo "<td rowspan=\"3\" class=\"{$leftclass}\">";
$username = sprintf(get_lang('LoginX'), $post['username']);
if ($post['user_id'] == '0') {
$name = $post['poster_name'];
} else {
$name = api_get_person_name($post['firstname'], $post['lastname']);
}
if (api_get_course_setting('allow_user_image_forum')) {
echo '<br />' . display_user_image($post['user_id'], $name, $origin) . '<br />';
}
echo display_user_link($post['user_id'], $name, $origin, $username) . "<br />";
echo api_convert_and_format_date($post['post_date']) . '<br /><br />';
// get attach id
$attachment_list = get_attachment($post['post_id']);
$id_attach = !empty($attachment_list) ? $attachment_list['id'] : '';
// The user who posted it can edit his thread only if the course admin allowed this in the properties of the forum
// The course admin him/herself can do this off course always
if (GroupManager::is_tutor_of_group(api_get_user_id(), $group_id) or $current_forum['allow_edit'] == 1 and $row['user_id'] == $_user['user_id'] or api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $_SESSION['id_session'])) {
if ($locked == false) {
echo "<a href=\"editpost.php?" . api_get_cidreq() . "&forum=" . $clean_forum_id . "&thread=" . $clean_thread_id . "&post=" . $post['post_id'] . "&id_attach=" . $id_attach . "\">" . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . "</a>";
}
}
if (GroupManager::is_tutor_of_group(api_get_user_id(), $group_id) or api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $_SESSION['id_session'])) {
if ($locked == false) {
echo "<a href=\"" . api_get_self() . "?" . api_get_cidreq() . "&gidReq=" . Security::remove_XSS($_GET['gidReq']) . "&forum=" . $clean_forum_id . "&thread=" . $clean_thread_id . "&action=delete&content=post&id=" . $post['post_id'] . "\" onclick=\"javascript:if(!confirm('" . addslashes(api_htmlentities(get_lang('DeletePost'), ENT_QUOTES)) . "')) return false;\">" . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . "</a>";
}
示例5: api_get_person_name
$html .= '<div class="row">';
$html .= '<div class="col-md-2">';
$html .= Display::return_icon('post-forum.png', null, null, ICON_SIZE_SMALL);
$html .= ' ' . $my_number_threads . '<br>' . $newPost . '</div>';
// the last post in the forum
if ($forum['last_poster_name'] != '') {
$name = $forum['last_poster_name'];
$poster_id = 0;
} else {
$name = api_get_person_name($forum['last_poster_firstname'], $forum['last_poster_lastname']);
$poster_id = $forum['last_poster_id'];
}
$html .= '<div class="col-md-6">';
if (!empty($forum['last_post_id'])) {
$html .= Display::return_icon('post-item.png', null, null, ICON_SIZE_TINY) . ' ';
$html .= api_convert_and_format_date($forum['last_post_date']) . ' ' . get_lang('By') . ' ' . display_user_link($poster_id, $name);
}
$html .= '</div>';
$html .= '<div class="col-md-4">';
if (api_is_allowed_to_edit(false, true) && !($forum['session_id'] == 0 && $sessionId != 0)) {
$html .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&forumcategory=' . Security::remove_XSS($_GET['forumcategory']) . '&action=edit&content=forum&id=' . $forum['forum_id'] . '">' . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>';
$html .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&forumcategory=' . Security::remove_XSS($_GET['forumcategory']) . '&action=delete&content=forum&id=' . $forum['forum_id'] . "\" onclick=\"javascript:if(!confirm('" . addslashes(api_htmlentities(get_lang('DeleteForum'), ENT_QUOTES)) . "')) return false;\">" . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
$html .= return_visible_invisible_icon('forum', $forum['forum_id'], $forum['visibility'], array('forumcategory' => $_GET['forumcategory']));
$html .= return_lock_unlock_icon('forum', $forum['forum_id'], $forum['locked'], array('forumcategory' => $_GET['forumcategory']));
$html .= return_up_down_icon('forum', $forum['forum_id'], $forums_in_category);
}
$iconnotify = 'notification_mail_na.png';
if (is_array(isset($_SESSION['forum_notification']['forum']) ? $_SESSION['forum_notification']['forum'] : null)) {
if (in_array($forum['forum_id'], $_SESSION['forum_notification']['forum'])) {
$iconnotify = 'notification_mail.png';
}
示例6: get_lang
$closedPost = Display::tag('div', '<i class="fa fa-exclamation-triangle"></i> ' . get_lang('ForumLocked'), array('class' => 'alert alert-warning post-closed'));
}
if ($current_thread['locked'] == 1) {
$closedPost = Display::tag('div', '<i class="fa fa-exclamation-triangle"></i> ' . get_lang('ThreadLocked'), array('class' => 'alert alert-warning post-closed'));
}
}
$html = '';
$html .= '<div class="panel panel-default forum-post">';
$html .= '<div class="panel-body">';
$html .= '<div class="row">';
$html .= '<div class="col-md-2">';
if ($origin != 'learnpath') {
if (api_get_course_setting('allow_user_image_forum')) {
$html .= '<div class="thumbnail">' . display_user_image($row['user_id'], $name) . '</div>';
}
$html .= Display::tag('h4', display_user_link($row['user_id'], $name), array('class' => 'title-username'));
} else {
$html .= Display::tag('span', $name, array('title' => api_htmlentities($username, ENT_QUOTES)));
}
$html .= Display::tag('p', api_convert_and_format_date($row['post_date']), array('class' => 'post-date'));
// get attach id
$attachment_list = get_attachment($row['post_id']);
$id_attach = !empty($attachment_list) ? $attachment_list['iid'] : '';
$iconEdit = '';
// The user who posted it can edit his thread only if the course admin allowed
// this in the properties of the forum
// The course admin him/herself can do this off course always
if (GroupManager::is_tutor_of_group($userId, $groupId) || $current_forum['allow_edit'] == 1 && $row['user_id'] == $_user['user_id'] || api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $sessionId)) {
if (api_is_allowed_to_session_edit(false, true)) {
if ($locked == false) {
$iconEdit .= "<a href=\"editpost.php?" . api_get_cidreq() . "&forum=" . $clean_forum_id . "&thread=" . $clean_thread_id . "&post=" . $row['post_id'] . "&origin=" . $origin . "&edit=edition&id_attach=" . $id_attach . "\">" . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . "</a>";
示例7: api_get_person_name
echo '<td>' . $number_threads . '</td>';
echo '<td>' . $number_posts . '</td>';
// The last post in the forum.
if ($forum['last_poster_name'] != '') {
$name = $forum['last_poster_name'];
$poster_id = 0;
$username = "";
} else {
$name = api_get_person_name($forum['last_poster_firstname'], $forum['last_poster_lastname']);
$poster_id = $forum['last_poster_id'];
$userinfo = api_get_user_info($poster_id);
$username = sprintf(get_lang('LoginX'), $userinfo['username']);
}
echo '<td nowrap="nowrap">';
if (!empty($forum['last_post_id'])) {
echo api_convert_and_format_date($forum['last_post_date']) . '<br /> ' . get_lang('By') . ' ' . display_user_link($poster_id, $name, '', $username);
}
echo '</td>';
echo '<td class="td_actions">';
if (api_is_allowed_to_edit(false, true) && !($forum['session_id'] == 0 && intval($session_id) != 0)) {
echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&gradebook=' . $gradebook . '&action=edit&content=forum&id=' . $forum['forum_id'] . '">' . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>';
echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&gradebook=' . $gradebook . '&action=delete&content=forum&id=' . $forum['forum_id'] . "\" onclick=\"javascript:if(!confirm('" . addslashes(api_htmlentities(get_lang('DeleteForum'), ENT_QUOTES)) . "')) return false;\">" . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
display_visible_invisible_icon('forum', $forum['forum_id'], $forum['visibility']);
display_lock_unlock_icon('forum', $forum['forum_id'], $forum['locked']);
display_up_down_icon('forum', $forum['forum_id'], $forumsInCategory);
}
$iconnotify = 'send_mail.gif';
$session_forum_notification = isset($_SESSION['forum_notification']['forum']) ? $_SESSION['forum_notification']['forum'] : false;
if (is_array($session_forum_notification)) {
if (in_array($forum['forum_id'], $session_forum_notification)) {
$iconnotify = 'send_mail_checked.gif';
示例8: prepare4display
$messageclass = 'forum_message_post_text';
$leftclass = 'forum_message_left';
}
echo "<tr>";
echo "<td rowspan=\"3\" class=\"{$leftclass}\">";
if ($row['user_id'] == '0') {
$name = prepare4display($row['poster_name']);
} else {
$name = api_get_person_name($row['firstname'], $row['lastname']);
}
$username = sprintf(get_lang('LoginX'), $row['username']);
if ($origin != 'learnpath') {
if (api_get_course_setting('allow_user_image_forum')) {
echo '<br />' . display_user_image($row['user_id'], $name) . '<br />';
}
echo display_user_link($row['user_id'], $name, '', $username) . '<br />';
} else {
echo Display::tag('span', $name, array('title' => api_htmlentities($username, ENT_QUOTES))) . '<br />';
}
$group_id = api_get_group_id();
echo api_convert_and_format_date($row['post_date']) . '<br /><br />';
// get attach id
$attachment_list = get_attachment($row['post_id']);
$id_attach = !empty($attachment_list) ? $attachment_list['id'] : '';
// The user who posted it can edit his thread only if the course admin allowed this in the properties of the forum
// The course admin him/herself can do this off course always
if (GroupManager::is_tutor_of_group(api_get_user_id(), $group_id) or $current_forum['allow_edit'] == 1 and $row['user_id'] == $_user['user_id'] or api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $_SESSION['id_session'])) {
if (api_is_allowed_to_session_edit(false, true)) {
if ($locked == false) {
echo "<a href=\"editpost.php?" . api_get_cidreq() . "&gidReq=" . Security::remove_XSS($_GET['gidReq']) . "&forum=" . $clean_forum_id . "&thread=" . $clean_thread_id . "&post=" . $row['post_id'] . "&origin=" . $origin . "&edit=edition&id_attach=" . $id_attach . "\">" . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . "</a>";
}
示例9: unset
// Displaying the message
// We mark the image we are displaying as set
unset($whatsnew_post_info[$forumId][$threadId][$rows[$display_post_id]['post_id']]);
echo "<table width=\"100%\" class=\"forum_table\" cellspacing=\"5\" border=\"0\">";
echo "<tr>";
echo "<td rowspan=\"3\" class=\"{$leftclass}\">";
$username = sprintf(get_lang('LoginX'), $rows[$display_post_id]['username']);
if ($rows[$display_post_id]['user_id'] == '0') {
$name = prepare4display($rows[$display_post_id]['poster_name']);
} else {
$name = api_get_person_name($rows[$display_post_id]['firstname'], $rows[$display_post_id]['lastname']);
}
if (api_get_course_setting('allow_user_image_forum')) {
echo '<br />' . display_user_image($rows[$display_post_id]['user_id'], $name, $origin) . '<br />';
}
echo display_user_link($rows[$display_post_id]['user_id'], $name, $origin, $username) . "<br />";
echo api_convert_and_format_date($rows[$display_post_id]['post_date']) . '<br /><br />';
// Get attach id
$attachment_list = get_attachment($display_post_id);
$id_attach = !empty($attachment_list) ? $attachment_list['id'] : '';
// The user who posted it can edit his thread only if the course admin allowed this in the properties of the forum
// The course admin him/herself can do this off course always
if (GroupManager::is_tutor_of_group(api_get_user_id(), $group_id) or $current_forum['allow_edit'] == 1 and $row['user_id'] == $_user['user_id'] or api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $_SESSION['id_session'])) {
if ($locked == false) {
echo "<a href=\"editpost.php?" . api_get_cidreq() . "&forum=" . $forumId . "&thread=" . $threadId . "&post=" . $rows[$display_post_id]['post_id'] . "&id_attach=" . $id_attach . "\">" . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>';
}
}
if (GroupManager::is_tutor_of_group(api_get_user_id(), $group_id) or api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $_SESSION['id_session'])) {
if ($locked == false) {
echo "<a href=\"" . api_get_self() . "?" . api_get_cidreq() . "&forum=" . $forumId . "&thread=" . $threadId . "&action=delete&content=post&id=" . $rows[$display_post_id]['post_id'] . "\" onclick=\"javascript:if(!confirm('" . addslashes(api_htmlentities(get_lang('DeletePost'), ENT_QUOTES)) . "')) return false;\">" . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . "</a>";
}
示例10: sprintf
$html .= '<div class="col-md-offset-' . $indent . '" >';
$html .= '<div class="panel panel-default forum-post">';
$html .= '<div class="panel-body">';
$html .= '<div class="row">';
$html .= '<div class="col-md-2">';
$username = sprintf(get_lang('LoginX'), $post['username']);
if ($post['user_id'] == '0') {
$name = $post['poster_name'];
} else {
$name = api_get_person_name($post['firstname'], $post['lastname']);
}
if ($origin != 'learnpath') {
if (api_get_course_setting('allow_user_image_forum')) {
$html .= '<div class="thumbnail">' . display_user_image($post['user_id'], $name, $origin) . '</div>';
}
$html .= Display::tag('h4', display_user_link($post['user_id'], $name, $origin, $username), array('class' => 'title-username'));
} else {
if (api_get_course_setting('allow_user_image_forum')) {
$html .= '<div class="thumbnail">' . display_user_image($post['user_id'], $name, $origin) . '</div>';
}
$html .= Display::tag('p', $name, array('title' => api_htmlentities($username, ENT_QUOTES), 'class' => 'lead'));
}
if ($origin != 'learnpath') {
$html .= Display::tag('p', api_convert_and_format_date($post['post_date']), array('class' => 'post-date'));
} else {
$html .= Display::tag('p', api_convert_and_format_date($post['post_date'], DATE_TIME_FORMAT_SHORT), array('class' => 'text-muted'));
}
// get attach id
$attachment_list = get_attachment($post['post_id']);
$id_attach = !empty($attachment_list) ? $attachment_list['iid'] : '';
$iconEdit = '';