/**
 * Output the title of the current topic in the loop.
 */
function bp_the_topic_title()
{
    echo bp_get_the_topic_title();
}
예제 #2
0
 function set_title($default, $sep = "|")
 {
     global $wp_query;
     global $rtmedia_seo_title;
     if (!array_key_exists(RTMEDIA_MEDIA_SLUG, $wp_query->query_vars)) {
         return $default;
     }
     $title = "";
     $oldSep = " " . $sep . " ";
     $sep = "";
     global $bp;
     global $rtmedia_query;
     if (isset($rtmedia_query->query) && isset($rtmedia_query->query["media_type"])) {
         if ($rtmedia_query->query["media_type"] == "album") {
             if (isset($rtmedia_query->media_query) && isset($rtmedia_query->media_query["album_id"])) {
                 //print_r( $rtmedia_query ); die();
                 if (is_array($rtmedia_query->album) && count($rtmedia_query->album) > 0) {
                     foreach ($rtmedia_query->album as $single_album) {
                         if (intval($single_album->id) == intval($rtmedia_query->media_query["album_id"])) {
                             $title .= $sep . stripslashes(esc_html(ucfirst($single_album->media_title)));
                             $sep = $oldSep;
                         }
                     }
                 }
             }
         } else {
             if (isset($rtmedia_query->media) && $rtmedia_query->media && count($rtmedia_query->media) > 0) {
                 $title .= $sep . stripslashes(esc_html(ucfirst($rtmedia_query->media[0]->media_title)));
                 $sep = $oldSep;
             }
             $title .= $sep . ucfirst($rtmedia_query->query["media_type"]);
             $sep = $oldSep;
         }
     } else {
         if (isset($rtmedia_query->action_query) && isset($rtmedia_query->action_query->media_type)) {
             $title .= $sep . ucfirst($rtmedia_query->action_query->media_type);
             $sep = $oldSep;
         }
     }
     if (function_exists("bp_is_group")) {
         if (bp_is_group() or bp_is_group_forum() or bp_is_group_forum_topic()) {
             if (bp_is_group_forum_topic()) {
                 $title .= $sep . bp_get_the_topic_title();
                 $sep = $oldSep;
             }
             $title .= $sep . bp_get_current_group_name();
             $sep = $oldSep;
         }
     }
     if (function_exists("bp_get_displayed_user_fullname") && bp_displayed_user_id() != 0) {
         $title .= $sep . bp_get_displayed_user_fullname();
         $sep = $oldSep;
     } else {
         $user_info = get_userdata(get_current_user_id());
         if (isset($user_info->data->display_name)) {
             $title .= $sep . $user_info->data->display_name;
             $sep = $oldSep;
         }
     }
     $title .= $sep . RTMEDIA_MEDIA_LABEL;
     $sep = $oldSep;
     if (isset($this->context->type)) {
         switch ($this->context->type) {
             case 'group':
                 $title .= $sep . ucfirst($bp->groups->slug);
                 break;
             case 'profile':
                 if (class_exists('BuddyPress')) {
                     $title .= $sep . ucfirst($bp->profile->slug);
                 } else {
                     $title .= $sep . get_query_var('author_name');
                 }
                 break;
             default:
                 $title .= $sep . get_post_field('post_title', $this->context->id);
                 break;
         }
     }
     $title .= $sep . get_bloginfo('name');
     $rtmedia_seo_title = $title;
     return apply_filters("rtmedia_wp_title", $title, $default, $sep);
 }
예제 #3
0
/**
 * bp_forums_add_forum_topic_to_page_title( $title )
 *
 * Append forum topic to page title
 *
 * @global object $bp
 * @param string $title New page title; see bp_modify_page_title()
 * @param string $title Original page title
 * @param string $sep How to separate the various items within the page title.
 * @param string $seplocation Direction to display title
 * @return string
 * @see bp_modify_page_title()
 */
function bp_forums_add_forum_topic_to_page_title($title, $original_title, $sep, $seplocation)
{
    global $bp;
    if (bp_is_current_action('forum') && bp_is_action_variable('topic', 0)) {
        if (bp_has_forum_topic_posts()) {
            $title .= bp_get_the_topic_title() . " {$sep} ";
        }
    }
    return $title;
}
예제 #4
0
/**
 * bp_forums_add_forum_topic_to_page_title( $title )
 *
 * Append forum topic to page title
 *
 * @global object $bp
 * @param string $title
 * @return string
 */
function bp_forums_add_forum_topic_to_page_title( $title ) {
	global $bp;

	if ( $bp->current_action == 'forum' && $bp->action_variables[0] == 'topic' ) {
		if ( bp_has_forum_topic_posts() ) {
			$title .= ' | ' . bp_get_the_topic_title();
		}
	}

	return $title;
}