本文整理汇总了PHP中get_user_profile_link函数的典型用法代码示例。如果您正苦于以下问题:PHP get_user_profile_link函数的具体用法?PHP get_user_profile_link怎么用?PHP get_user_profile_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_user_profile_link函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInfoHtml
function getInfoHtml($uid)
{
$avatar_width = 100;
$avatar_height = 100;
$avatar_class = "avatar";
$config = new avatarupload_config();
$avatar_img = "";
if ($a = avatarupload_get_avatar($uid, 1, 1)) {
$avatar_img = '<img src="' . $a[0] . '" width="' . $avatar_width . '" height="' . $avatar_height . '" alt="' . $a[4] . '" class="' . $class . '" />';
}
$user_name = get_user_name($uid);
$profile_link = get_user_profile_link($uid);
$html = $avatar_img . '<div class="nombre_usuario"><b><a href="' . $profile_link . '">' . $user_name . '</a></b></div>';
return $html;
}
示例2: em_do_linking
/**
* Links the users & tags in posts
*
* @see bp_activity_at_name_filter() BuddyPress Function
*
* @param $content The content to be parsed
*/
function em_do_linking($content)
{
global $em_plugopts;
if ($em_plugopts['link-tags'] == 1) {
preg_match_all('/[#]+([A-Za-z0-9-_]+)/', $content, $tags);
$tags = $tags[1];
foreach ((array) $tags as $tag) {
if (!($t = bb_get_tag($tag))) {
continue;
}
if ($link = bb_get_tag_link($t)) {
$content = str_replace("#{$tag}", "#<a href='" . $link . "'>{$tag}</a>", $content);
}
//should we add rel='nofollow'?
}
}
if ($em_plugopts['link-users'] == 1) {
preg_match_all('/[@]+([A-Za-z0-9-_]+)/', $content, $usernames);
$usernames = $usernames[1];
foreach ((array) $usernames as $username) {
if (!($user = bb_get_user($username, array('by' => 'login')))) {
//check #1, by username
if (!($user = bb_get_user($username, array('by' => 'nicename')))) {
//check #2, by nicename
continue;
}
}
/* Increase the number of new @ mentions for the user - maybe later */
/*$new_mention_count = (int)bb_get_usermeta( $user_id, 'em_mention_count' );
bb_update_usermeta( $user_id, 'em_mention_count', $new_mention_count + 1 );*/
if ('website' == $em_plugopts['link-user-to']) {
if (!($link = $user->user_url)) {
$link = get_user_profile_link($user->ID);
}
} else {
$link = get_user_profile_link($user->ID);
}
if ($link) {
$content = str_replace("@{$username}", "@<a href='" . $link . "'>{$username}</a>", $content);
}
//should we add rel='nofollow'?
}
}
return $content;
}
示例3: nm_rewrite_user_group_name
function nm_rewrite_user_group_name($post_id = 0)
{
$title = get_post_author_title($post_id);
if (false === $title) {
$r = __('Unregistered');
} else {
$r = '<a href="' . attribute_escape(get_user_profile_link(get_post_author_id($post_id))) . '">' . $title . '</a>';
}
$ug_name = apply_filters('post_author_title', $r);
if ($ug_name == "Member") {
$ug_name = bloginfo() . " Member";
} elseif ($ug_name == "Key Master") {
$ug_name = bloginfo() . " Administrator";
} elseif ($ug_name == "Moderator") {
$ug_name = bloginfo() . " Moderator";
} elseif ($ug_name == "Administrator") {
$ug_name = bloginfo() . " Administrator";
} else {
$ug_name = bloginfo() . " Member";
}
return $ug_name;
}
示例4: thanks_output_details
function thanks_output_details($post_id, $uid, $logged_in = true)
{
$out = "";
$meta = bb_get_post_meta("thanks", $post_id);
$report_length = 0;
if (isset($meta)) {
$vote_count = count($meta);
$msg_type = $vote_count == 0 ? "none" : ($vote_count == 1 ? "one" : "many");
$msg = thanks_get_voting_phrase("thanks_output_" . $msg_type);
$report_length = strlen($msg);
$out .= str_replace("#", "" . $vote_count, $msg);
$should_show_voters = thanks_get_voting_phrase("thanks_voters");
if ($should_show_voters == "yes") {
$out .= ' ' . thanks_get_voting_phrase("thanks_voters_prefix");
for ($i = 0; $i < count($meta); $i++) {
$link = get_user_profile_link($meta[$i]);
$voter = bb_get_user($meta[$i]);
if ($i > 0) {
$out .= ", ";
}
$out .= '<a href="' . $link . '">' . $voter->display_name . '</a>';
}
$out .= thanks_get_voting_phrase("thanks_voters_suffix");
}
}
if ($logged_in) {
if (!in_array($uid, $meta)) {
if (isset($meta) && $report_length > 0) {
$out .= " | ";
}
$msg = thanks_get_voting_phrase("thanks_voting");
$out .= "<a class=\"thanks-vote\" user=\"" . $uid . "\" id=\"" . $post_id . "\">" . $msg . "</a>";
}
}
return $out;
}
示例5: bb_ksd_submit
function bb_ksd_submit($submit, $type = false)
{
global $bb_ksd_api_host;
global $bb_ksd_api_port;
switch ($type) {
case 'ham':
case 'spam':
$path = '/1.1/submit-' . $type;
$bb_post = bb_get_post($submit);
if (!$bb_post) {
return;
}
$user = bb_get_user($bb_post->poster_id);
if (bb_is_trusted_user($user->ID)) {
return;
}
$_submit = array('blog' => bb_get_uri(null, null, BB_URI_CONTEXT_TEXT + BB_URI_CONTEXT_AKISMET), 'user_ip' => $bb_post->poster_ip, 'permalink' => get_topic_link($bb_post->topic_id), 'comment_type' => 'forum', 'comment_author' => get_user_name($user->ID), 'comment_author_email' => bb_get_user_email($user->ID), 'comment_author_url' => get_user_link($user->ID), 'comment_content' => $bb_post->post_text, 'comment_date_gmt' => $bb_post->post_time);
break;
case 'hammer':
case 'spammer':
$path = '/1.1/submit-' . substr($type, 0, -3);
$user = bb_get_user($submit);
if (!$user) {
return;
}
if (bb_is_trusted_user($user->ID)) {
return;
}
$_submit = array('blog' => bb_get_uri(null, null, BB_URI_CONTEXT_TEXT + BB_URI_CONTEXT_AKISMET), 'permalink' => get_user_profile_link($user->ID), 'comment_type' => 'profile', 'comment_author' => get_user_name($user->ID), 'comment_author_email' => bb_get_user_email($user->ID), 'comment_author_url' => get_user_link($user->ID), 'comment_content' => $user->occ . ' ' . $user->interests, 'comment_date_gmt' => $user->user_registered);
break;
default:
if (bb_is_trusted_user(bb_get_current_user())) {
return;
}
$path = '/1.1/comment-check';
$_submit = array('blog' => bb_get_uri(null, null, BB_URI_CONTEXT_TEXT + BB_URI_CONTEXT_AKISMET), 'user_ip' => preg_replace('/[^0-9., ]/', '', $_SERVER['REMOTE_ADDR']), 'user_agent' => $_SERVER['HTTP_USER_AGENT'], 'referrer' => $_SERVER['HTTP_REFERER'], 'comment_type' => isset($_POST['topic_id']) ? 'forum' : 'profile', 'comment_author' => bb_get_current_user_info('name'), 'comment_author_email' => bb_get_current_user_info('email'), 'comment_author_url' => bb_get_current_user_info('url'), 'comment_content' => $submit);
if (isset($_POST['topic_id'])) {
$_submit['permalink'] = get_topic_link($_POST['topic_id']);
// First page
}
break;
}
$query_string = '';
foreach ($_submit as $key => $data) {
$query_string .= $key . '=' . urlencode(stripslashes($data)) . '&';
}
return bb_ksd_http_post($query_string, $bb_ksd_api_host, $path, $bb_ksd_api_port);
}
示例6: bb_get_profile_link
function bb_get_profile_link($args = '')
{
if ($args && is_string($args) && false === strpos($args, '=')) {
$args = array('text' => $args);
} elseif (is_numeric($args)) {
$args = array('id' => $args);
}
$defaults = array('text' => __('View your profile'), 'before' => '', 'after' => '', 'id' => false);
$args = wp_parse_args($args, $defaults);
extract($args, EXTR_SKIP);
$id = (int) $id;
if (!$id) {
$id = bb_get_current_user_info('id');
}
return apply_filters('bb_get_profile_link', "{$before}<a href='" . esc_attr(get_user_profile_link($id)) . "'>{$text}</a>{$after}", $args);
}
示例7: printf
if ($bb_post->poster_id) {
printf(__('<a href="%1$s">Post</a> on <a href="%2$s">%3$s</a> by <a href="%4$s">%5$s</a>'), esc_attr(add_query_arg('view', 'all', get_post_link())), get_topic_link($bb_post->topic_id), get_topic_title($bb_post->topic_id), get_user_profile_link($bb_post->poster_id), get_post_author());
} else {
printf(__('<a href="%1$s">Post</a> on <a href="%2$s">%3$s</a> by %4$s'), esc_attr(add_query_arg('view', 'all', get_post_link())), get_topic_link($bb_post->topic_id), get_topic_title($bb_post->topic_id), get_post_author());
}
?>
</li>
<?php
} elseif ('topic' == $object['type']) {
global $topic;
$topic = $object['data'];
?>
<li>
<?php
if ($topic->topic_poster) {
printf(__('Topic titled <a href="%1$s">%2$s</a> started by <a href="%3$s">%4$s</a>'), esc_attr(add_query_arg('view', 'all', get_topic_link())), get_topic_title($topic->topic_id), get_user_profile_link($topic->topic_poster), get_topic_author($topic->topic_id));
} else {
printf(__('Topic titled <a href="%1$s">%2$s</a> started by %3$s'), esc_attr(add_query_arg('view', 'all', get_topic_link())), get_topic_title($topic->topic_id), get_topic_author($topic->topic_id));
}
?>
</li>
<?php
}
}
remove_filter('get_topic_where', 'bb_no_where');
?>
</ul>
<?php
} else {
?>
<p>
示例8: T_
}
$comment_content = $params['default_text'];
}
echo $params['form_title_start'];
echo T_('Leave a comment');
echo $params['form_title_end'];
$Form =& new Form($htsrv_url . 'comment_post.php', 'bComment_form_id_' . $Item->ID, 'post');
$Form->begin_form('bComment', '', array('target' => '_self'));
// TODO: dh> a plugin hook would be useful here to add something to the top of the Form.
// Actually, the best would be, if the $Form object could be changed by a plugin
// before display!
$Form->hidden('comment_post_ID', $Item->ID);
$Form->hidden('redirect_to', url_rel_to_same_host(regenerate_url('', '', $Blog->get('blogurl'), '&'), $htsrv_url));
if (is_logged_in()) {
// User is logged in:
$Form->info_field(T_('User'), '<strong>' . $current_User->get_preferred_name() . '</strong>' . ' ' . get_user_profile_link(' [', ']', T_('Edit profile')));
} else {
// User is not logged in:
// Note: we use funky field names to defeat the most basic guestbook spam bots
$Form->text('u', $comment_author, 40, T_('Name'), '', 100, 'bComment');
$Form->text('i', $comment_author_email, 40, T_('Email'), '<br />' . T_('Your email address will <strong>not</strong> be revealed on this site.'), 100, 'bComment');
$Form->text('o', $comment_author_url, 40, T_('Website'), '<br />' . T_('Your URL will be displayed.'), 100, 'bComment');
}
if ($Item->can_rate()) {
// Comment rating:
echo $Form->begin_field(NULL, T_('Your vote'), true);
$Comment->rating_input();
echo $Form->end_field();
}
if (!empty($params['policy_text'])) {
// We have a policy text to display
示例9: display
/**
* Display the widget!
*
* @param array MUST contain at least the basic display params
*/
function display($params)
{
if (!is_logged_in()) {
// Only logged in users can see this tools panel
return false;
}
$this->init_display($params);
// just in case it hasn't been done before
$this->disp_params['item_start'] .= '<strong>';
$this->disp_params['item_end'] = '</strong>' . $this->disp_params['item_end'];
$tools_links = '';
if ($this->get_param('user_postnew_link_show')) {
// Write new post - disp=edit
$tools_links .= get_item_new_link($this->disp_params['item_start'], $this->disp_params['item_end'], $this->disp_params['user_postnew_link']);
}
if ($this->get_param('user_messaging_link_show')) {
// Messaging - disp=threads
$tools_links .= get_user_messaging_link($this->disp_params['item_start'], $this->disp_params['item_end'], $this->disp_params['user_messaging_link'], $this->disp_params['user_messaging_link'], $this->disp_params['show_badge']);
}
if ($this->get_param('user_contacts_link_show')) {
// Contacts - disp=contacts
$tools_links .= get_user_contacts_link($this->disp_params['item_start'], $this->disp_params['item_end'], $this->disp_params['user_contacts_link'], $this->disp_params['user_contacts_link']);
}
if ($this->get_param('user_view_link_show')) {
// See profile - disp=user
$tools_links .= get_user_tab_link('user', $this->disp_params['item_start'], $this->disp_params['item_end'], $this->disp_params['user_view_link'], $this->disp_params['user_view_link']);
}
if ($this->get_param('user_profile_link_show')) {
// Edit profile - disp=profile
$tools_links .= get_user_profile_link($this->disp_params['item_start'], $this->disp_params['item_end'], $this->disp_params['user_profile_link'], $this->disp_params['user_profile_link']);
}
if ($this->get_param('user_picture_link_show')) {
// Edit picture - disp=avatar
$tools_links .= get_user_tab_link('avatar', $this->disp_params['item_start'], $this->disp_params['item_end'], $this->disp_params['user_picture_link'], $this->disp_params['user_picture_link']);
}
if ($this->get_param('user_password_link_show')) {
// Edit password - disp=pwdchange
$tools_links .= get_user_tab_link('pwdchange', $this->disp_params['item_start'], $this->disp_params['item_end'], $this->disp_params['user_password_link'], $this->disp_params['user_password_link']);
}
if ($this->get_param('user_preferences_link_show')) {
// Edit preferences - disp=userprefs
$tools_links .= get_user_tab_link('userprefs', $this->disp_params['item_start'], $this->disp_params['item_end'], $this->disp_params['user_preferences_link'], $this->disp_params['user_preferences_link']);
}
if ($this->get_param('user_subs_link_show')) {
// Edit notifications - disp=subs
$tools_links .= get_user_subs_link($this->disp_params['item_start'], $this->disp_params['item_end'], $this->disp_params['user_subs_link'], $this->disp_params['user_subs_link']);
}
if ($this->get_param('user_admin_link_show')) {
// Admin
$tools_links .= get_user_admin_link($this->disp_params['item_start'], $this->disp_params['item_end'], $this->disp_params['user_admin_link']);
}
if ($this->get_param('user_logout_link_show')) {
// Logout
$tools_links .= get_user_logout_link($this->disp_params['item_start'], $this->disp_params['item_end'], $this->disp_params['user_logout_link']);
}
if (empty($tools_links)) {
// No available links to display
return false;
}
// User tools:
echo $this->disp_params['block_start'];
if (!empty($this->disp_params['title'])) {
// Display title
echo $this->disp_params['block_title_start'];
echo $this->disp_params['title'];
echo $this->disp_params['block_title_end'];
}
echo $this->disp_params['list_start'];
echo $tools_links;
if (isset($this->BlockCache)) {
// Do NOT cache because some of these links are using a redirect_to param, which makes it page dependent.
// Note: also beware of the source param.
// so this will be cached by the PageCache; there is no added benefit to cache it in the BlockCache
// (which could have been shared between several pages):
$this->BlockCache->abort_collect();
}
echo $this->disp_params['list_end'];
echo $this->disp_params['block_end'];
}
示例10: elseif
} elseif ('blocked' != $role && array_key_exists('blocked', $user->capabilities)) {
bb_fix_password($user->ID);
}
}
foreach ($profile_admin_keys as $key => $label) {
if (${$key} != '' || isset($user->{$key})) {
bb_update_usermeta($user->ID, $key, ${$key});
}
}
foreach ($assignable_caps as $cap => $label) {
if (!($already = array_key_exists($cap, $user->capabilities)) && ${$cap}) {
$user_obj->add_cap($cap);
} elseif (!${$cap} && $already) {
$user_obj->remove_cap($cap);
}
}
}
if (bb_current_user_can('change_user_password', $user->ID) && !empty($_POST['pass1'])) {
$_POST['pass1'] = addslashes($_POST['pass1']);
bb_update_user_password($user->ID, $_POST['pass1']);
if (bb_get_current_user_info('ID') == $user->ID) {
bb_clear_auth_cookie();
bb_set_auth_cookie($user->ID);
}
}
do_action('profile_edited', $user->ID);
nxt_redirect(add_query_arg('updated', 'true', get_user_profile_link($user->ID)));
exit;
}
}
bb_load_template('profile-edit.php', array('profile_info_keys', 'profile_admin_keys', 'assignable_caps', 'user_email', 'bb_roles', 'errors', 'self'));
示例11: user_profile_link
/**
* Template tag: Display a link to user profile
*/
function user_profile_link($before = '', $after = '', $link_text = '', $link_title = '#')
{
echo get_user_profile_link($before, $after, $link_text, $link_title);
}
示例12: display
function display($show_search = true, $show_email = false)
{
global $wp_roles;
$r = '';
$now = date('Y-m-d H:i:s');
if (isset($this->title)) {
$title = $this->title;
} elseif ($this->is_search()) {
$title = sprintf(__('Users Matching "%s" by Role'), esc_html($this->search_term));
}
$h2_role = $this->roles[0];
$roles = $wp_roles->get_names();
if (in_array($h2_role, array_keys($roles))) {
$h2_role = $roles[$h2_role];
}
$h2_span = apply_filters('bb_user_search_description', sprintf(__('%1$s%2$s'), $h2_search, $h2_role), $h2_search, $h2_role, $this);
echo "<h2 class=\"first left\">" . apply_filters('bb_user_search_title', __('Users Waiting for Approval')) . $h2_span . "</h2>\n";
do_action('bb_admin_notices');
if ($this->get_results()) {
if ($this->results_are_paged()) {
$r .= "<div class='tablenav'>\n" . $this->paging_text . "</div><div class=\"clear\"></div>\n\n";
}
$r .= "<table class='widefat'>\n";
$r .= "<thead>\n";
$r .= "\t<tr>\n";
$r .= "\t\t<th style='width:10;'> </th>\n";
$r .= "\t\t<th>" . __('Username') . "</th>\n";
$r .= "\t\t<th>" . __('Email') . "</th>\n";
$r .= "\t\t<th>" . __('Registered') . "</th>\n";
$r .= "\t\t<th>" . __('Elapsed') . "</th>\n";
$r .= "\t</tr>\n";
$r .= "</thead>\n\n";
$r .= "<tbody id='role-{$role}'>\n";
foreach ((array) $this->get_results() as $user_object) {
//$r .= bb_user_row($user_object->ID, $role, $show_email);
$user = bb_get_user($user_object->ID);
$registered = date('Y/m/d H:i:s', bb_offset_time(bb_gmtstrtotime($user->user_registered)));
$date_eng = date('H:i:s - d/m/Y', bb_offset_time(bb_gmtstrtotime($user->user_registered)));
$difference = strtotime($now) - strtotime($registered);
$hours_ago = number_format($difference / 60 / 60, 0);
if ($hours_ago < '15') {
$reg_compare = '"color: red"';
$checked = '';
}
if ($hours_ago >= '15' && $hours_ago < '24') {
$reg_compare = '"color: blue"';
$checked = 'checked';
}
if ($hours_ago >= '24') {
$reg_compare = '"color: purple"';
$checked = 'checked';
}
$r .= "\t<tr id='user-{$user->ID}'" . get_alt_class("user-{$role}") . ">\n";
$r .= "\t\t<td><input type='checkbox' value='{$user->ID}' name='userids[]' {$checked}/></td>\n";
$r .= "\t\t<td><a href='" . get_user_profile_link($user->ID) . "' style=" . $reg_compare . ">" . get_user_name($user->ID) . "</a></td>\n";
$email = bb_get_user_email($user->ID);
$r .= "\t\t<td><a href='mailto:{$email}'>{$email}</a></td>\n";
$r .= "\t\t<td>" . $date_eng . "</td>\n";
$r .= "\t\t<td>" . $hours_ago . " hours</td>\n";
$r .= "\n\t</tr>";
}
$r .= "</tbody>\n";
$r .= "<tfoot>\n";
$r .= "\t<tr>\n";
$r .= "\t\t<th> </th>\n";
$r .= "\t\t<th>" . __('Username') . "</th>\n";
$r .= "\t\t<th>" . __('Email') . "</th>\n";
$r .= "\t\t<th>" . __('Registered') . "</th>\n";
$r .= "\t\t<th>" . __('Elapsed') . "</th>\n";
$r .= "\t</tr>\n";
$r .= "</tfoot>\n\n";
$r .= "</table>\n";
$r .= "<p style=\"text-align: right; color: #9f9f9f; font-size: small; font-style: normal;\">Registered: Red: < 15 hours ago. Blue: > 15 hours ago. Purple: > 24 hours ago.</p>";
if ($this->results_are_paged()) {
$r .= "<div class='tablenav bottom'>\n" . $this->paging_text_bottom . "</div><div class=\"clear\"></div>\n\n";
}
}
?>
<form class="settings" method="post" name="approve_user_registration_form">
<?php
echo $r;
?>
<fieldset class="submit">
<input type="submit" class="submit left" name="approve_user_registration_button_approve" value="Approve" />
<input type="submit" class="submit left" name="approve_user_registration_button_reject" value="Reject" />
</fieldset>
</form>
<?php
// }
}
示例13: foreach
foreach ($relevant as $topic) {
$bb_post = bb_get_first_post($topic);
?>
<li<?php
alt_class('relevant');
?>
>
<a class="result" href="<?php
post_link();
?>
"><?php
echo bb_show_topic_context($q, get_topic_title());
?>
</a>
<span class="freshness"><?php
printf(__('By <a href="%1$s">%2$s</a> on %3$s'), get_user_profile_link($topic->topic_poster), get_topic_author(), bb_datetime_format_i18n(get_topic_start_time(array('format' => 'timestamp'))));
?>
</span>
<p><?php
echo bb_show_context($q, $bb_post->post_text);
?>
</p>
</li>
<?php
}
?>
</ol>
</div>
<?php
}
?>
示例14: T_
<h4><?php
echo $comment_type == 'meta' ? T_('Leave a meta comment') : T_('Leave a comment');
?>
:</h4>
<?php
$Form = new Form($htsrv_url . 'comment_post.php', 'comment_checkchanges');
$Form->begin_form('bComment evo_form evo_form__comment ' . ($comment_type == 'meta' ? ' evo_form__comment_meta' : ''));
if ($comment_type == 'meta') {
echo '<b class="form_info">' . T_('Please remember: this comment will be included in a private discussion view and <u>only will be visible to other admins</u>') . '</b>';
}
$Form->add_crumb('comment');
$Form->hidden('comment_item_ID', $Item->ID);
$Form->hidden('comment_type', $comment_type);
$Form->hidden('redirect_to', $ReqURI);
$Form->info(T_('User'), $current_User->get_identity_link(array('link_text' => 'name')) . ' ' . get_user_profile_link(' [', ']', T_('Edit profile')));
$Form->textarea($dummy_fields['content'], '', 12, T_('Comment text'), '', 40, 'bComment autocomplete_usernames');
global $Plugins;
$Form->info(T_('Text Renderers'), $Plugins->get_renderer_checkboxes(array('default'), array('Blog' => &$Blog, 'setting_name' => 'coll_apply_comment_rendering')));
$Form->buttons_input(array(array('name' => 'submit', 'value' => T_('Send comment'), 'class' => 'SaveButton')));
?>
<div class="clear"></div>
<?php
$Form->end_form();
?>
<!-- ========== END of FORM to add a comment ========== -->
<?php
}
// / can comment
?>
示例15: bb_repermalink
function bb_repermalink()
{
global $page;
$location = bb_get_location();
$uri = $_SERVER['REQUEST_URI'];
if (isset($_GET['id'])) {
$id = $_GET['id'];
} else {
$id = bb_get_path();
}
$_original_id = $id;
do_action('pre_permalink', $id);
$id = apply_filters('bb_repermalink', $id);
switch ($location) {
case 'front-page':
$path = null;
$querystring = null;
if ($page > 1) {
if (bb_get_option('mod_rewrite')) {
$path = 'page/' . $page;
} else {
$querystring = array('page' => $page);
}
}
$permalink = bb_get_uri($path, $querystring, BB_URI_CONTEXT_HEADER);
$issue_404 = true;
break;
case 'forum-page':
if (empty($id)) {
$permalink = bb_get_uri(null, null, BB_URI_CONTEXT_HEADER);
break;
}
global $forum_id, $forum;
$forum = bb_get_forum($id);
$forum_id = $forum->forum_id;
$permalink = get_forum_link($forum->forum_id, $page);
break;
case 'topic-edit-page':
case 'topic-page':
if (empty($id)) {
$permalink = bb_get_uri(null, null, BB_URI_CONTEXT_HEADER);
break;
}
global $topic_id, $topic;
$topic = get_topic($id);
$topic_id = $topic->topic_id;
$permalink = get_topic_link($topic->topic_id, $page);
break;
case 'profile-page':
// This handles the admin side of the profile as well.
global $user_id, $user, $profile_hooks, $self;
if (isset($_GET['id'])) {
$id = $_GET['id'];
} elseif (isset($_GET['username'])) {
$id = $_GET['username'];
} else {
$id = bb_get_path();
}
$_original_id = $id;
if (!$id) {
$user = bb_get_current_user();
// Attempt to go to the current users profile
} else {
if (bb_get_option('mod_rewrite') === 'slugs') {
if (!($user = bb_get_user_by_nicename($id))) {
$user = bb_get_user($id);
}
} else {
if (!($user = bb_get_user($id))) {
$user = bb_get_user_by_nicename($id);
}
}
}
if (!$user || 1 == $user->user_status && !bb_current_user_can('moderate')) {
bb_die(__('User not found.'), '', 404);
}
$user_id = $user->ID;
bb_global_profile_menu_structure();
$valid = false;
if ($tab = isset($_GET['tab']) ? $_GET['tab'] : bb_get_path(2)) {
foreach ($profile_hooks as $valid_tab => $valid_file) {
if ($tab == $valid_tab) {
$valid = true;
$self = $valid_file;
}
}
}
if ($valid) {
$permalink = get_profile_tab_link($user->ID, $tab, $page);
} else {
$permalink = get_user_profile_link($user->ID, $page);
unset($self, $tab);
}
break;
case 'favorites-page':
$permalink = get_favorites_link();
break;
case 'tag-page':
// It's not an integer and tags.php pulls double duty.
$id = isset($_GET['tag']) ? $_GET['tag'] : false;
//.........这里部分代码省略.........