Ejemplo n.º 1
0
    } else {
        ?>
            <p><?php 
        _e('There are no posts by this user at the moment. Please check back later!', 'buddyblog');
        ?>
</p>
    <?php 
    }
    ?>

    <?php 
    wp_reset_postdata();
    wp_reset_query();
    ?>

<?php 
} elseif (bp_is_my_profile() && buddyblog_user_can_post(get_current_user_id())) {
    ?>
    <p> <?php 
    _e("You haven't posted anything yet.", 'buddyblog');
    ?>
 <a href="<?php 
    echo buddyblog_get_new_url();
    ?>
"> <?php 
    _e('New Post', 'buddyblog');
    ?>
</a></p>

<?php 
}
Ejemplo n.º 2
0
 /**
  * register post form for Posting/editing
  * @return type 
  */
 public function register_form()
 {
     //make sure the Front end simple post plugin is active
     if (!function_exists('bp_new_simple_blog_post_form')) {
         return;
     }
     $post_status = buddyblog_get_option('post_status');
     $user_id = get_current_user_id();
     if (!buddyblog_user_can_post($user_id)) {
         $post_status = 'draft';
     }
     $settings = array('post_type' => buddyblog_get_posttype(), 'post_status' => $post_status, 'comment_status' => buddyblog_get_option('comment_status'), 'show_comment_option' => buddyblog_get_option('show_comment_option'), 'custom_field_title' => '', 'custom_fields' => array('_is_buddyblog_post' => array('type' => 'hidden', 'label' => '', 'default' => 1)), 'upload_count' => 0, 'has_post_thumbnail' => 1, 'current_user_can_post' => current_user_can(buddyblog_get_option('post_cap')));
     if (buddyblog_get_option('enable_taxonomy')) {
         $taxonomies = array();
         $tax = buddyblog_get_option('allowed_taxonomies');
         if (!empty($tax)) {
             foreach ((array) $tax as $tax_name) {
                 $view = 'checkbox';
                 //is_taxonomy_hierarchical($tax_name);
                 $taxonomies[$tax_name] = array('taxonomy' => $tax_name, 'view_type' => 'checkbox');
             }
         }
         if (!empty($taxonomies)) {
             $settings['tax'] = $taxonomies;
         }
     }
     //use it to add extra fields or filter the post type etc
     $settings = apply_filters('buddyblog_post_form_settings', $settings);
     bp_new_simple_blog_post_form('buddyblog-user-posts', $settings);
     // the blog form
 }