Example #1
0
<?php

if (buddyblog_user_has_posted()) {
    if (bp_is_my_profile() || is_super_admin()) {
        $status = 'any';
    } else {
        $status = 'publish';
    }
    $query_args = array('author' => bp_displayed_user_id(), 'post_type' => buddyblog_get_posttype(), 'post_status' => $status, 'p' => intval(buddyblog_get_post_id(bp_action_variable(0))));
    query_posts($query_args);
    global $post;
    // global $withcomments;
    // $withcomments = true;
    while (have_posts()) {
        the_post();
        ?>
    
    <?php 
        //used to unhook BuddyPress Theme compatibility comment closing function
        do_action('buddyblog_before_blog_post');
        ?>
    <div class="user-post">
        <h2><?php 
        the_title();
        ?>
</h2>

        <div class="post-entry">

            <p class="alignright"><?php 
        printf(__('Postend on %1$s', 'buddyblog'), get_the_time('m/j/Y'));
Example #2
0
function buddyblog_modify_page_title($full_title, $title, $sep, $seplocation)
{
    if (!bp_is_buddyblog_component()) {
        return $full_title;
    }
    $post_type_obj = get_post_type_object(buddyblog_get_posttype());
    $full_title = bp_get_displayed_user_fullname() . ' ' . $sep . ' ' . $post_type_obj->labels->name . ' ' . $sep . ' ';
    if (buddyblog_is_single_post()) {
        $post_id = buddyblog_get_post_id(bp_action_variable(0));
        $post = get_post($post_id);
        $full_title .= $post->post_title . ' ' . $sep . ' ';
    } elseif (buddyblog_is_edit_post()) {
        $full_title .= $post_type_obj->labels->edit_item . ' ' . $sep . ' ';
    } elseif (buddyblog_is_new_post()) {
        $full_title .= $post_type_obj->labels->new_item . ' ' . $sep . ' ';
    }
    return $full_title;
    //  bp_get_displayed_user_fullname(), ucwords( $component_name ), $sep
    //if we are here, we are on
}