Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'display users posts'

Viewing 25 results - 26 through 50 (of 135 total)
  • Author
    Search Results
  • #241512
    djsteveb
    Participant

    @d_enajetic – I am playing with a few plugins that deal with a similar issue with animated gifs. A few say they will take a gif and make a thumbnail that you click to play… instead of having a dozen animated gifs playing in the activity stream and sidebar from users posts – hoping one of these will work.

    Luckily I have not had the same issue with videos yet (currently most of my users just add videos to activity stream directly, not in a blog post which would double display – glad to be thinking of that as a possible issue now)

    In your situation, I wonder if you create a screenshot thumbnail and put a “play icon” on it – then put that at the top of your post… would that show up in the activity stream instead of the video embed? I’d try making that the featured image as well to see if that static image showed up in my sidebar display (instead of the actual video itself)

    I would put the screen shot thumbnail image at the top of the post, and then add an H2 tag below something like <h2 id=”playjuneseminar> – then make the screenshot / thumbnail linked to the anchor tag – so that if people clicked the image in the activity stream, or on the actual post itself, it would scroll down to the video.

    I’d consider adding a lazy load / play type thing to the video so it does not auto play unless it’s in focus or something.

    Not sure if this is what you are going for, or if it would even work, but it’s what I would try first.

    Of course it would be cool to see a plugin that combined the “if activity stream item and detect video in post, create a thumbnail, show thumbnail instead of embedded video, link to that section of post, kind of thing.

    like a mashup of the wp video posts plugin, with one of these gif stop/create single frame-click-to-play instead of auto, with an added “if image is from a post link to post”

    random thoughts from my limited bp / wp experiences.

    #241496
    killabien
    Participant

    Okay, so while I’ve made some progress thanks to you two, I’m still missing something. I thought it was working tomorrow but the code wasn’t logical(I had to use author__not_in to display posts from all Spanish users but it didn’t work with other countries).

    So first of all, this code gives me only the users from a given country:
    <?php $Members = array((bp_has_members( my_custom_ids( 'country', 'Spain' ) )) ); ?>

    I’ve used the example Here and it displays only those two users I have with Spain. When I change to France it displays only one user, which is correct. So this one is good to go.
    I’m having trouble with the rest though.

    <?php 
     $query = new WP_Query( array( 'author__in' =>array($Members)));
     if ($query->have_posts()) :
    	// Start the Loop.
        query_posts($query);
       
    	while ($query->have_posts() ) : $query->the_post();
       
    
    		/*
    		 * Include the post format-specific template for the content. If you want to
    		 * use this in a child theme, then include a file called called content-___.php
    		 * (where ___ is the post format) and that will be used instead.
    		 */
             get_template_part( 'page-parts/post-content-small' ); 
             get_template_part( 'page-parts/posts-social-share' ); 
             
            ?>
    
            
    
            <?php if ( sq_option( 'page_comments', 0 ) == 1 ): ?>
    
                <!-- Begin Comments -->
                <?php comments_template( '', true ); ?>
                <!-- End Comments -->
    
            <?php endif; ?>
    
        <?php
     endwhile;
    
     endif;
    ?>
    

    Is what I’ve been trying to do. Putting (bp_has_members( my_custom_ids( 'country', 'Spain' ) )) into an array like this:
    $query = new WP_Query( array( 'author__in' =>array(bp_has_members( my_custom_ids( 'country', 'Spain' ) ))));
    Didn’t give me the results I wanted. What am I doing wrong? Once when I put author__not_in it worked but only with Spain and no other country. Now it’s not working even with Spain.
    Any suggestions? What should I do? Please help.

    Regards

    David

    #241382
    killabien
    Participant

    Okay, I’ve been trying this a bit and I still don’t get it.

    I used 'who'=>'authors' to get all the authors’ posts displayed on a page. What I still can’t get is how to extract the data from wp_bp_xprofile_data. I tried putting that in an array

    $country = array (
    'key'=>'country',
    'value'=>'Spain');

    And then putting it like this
    $query = new WP_Query( array( 'author__in' => $country ) );

    But still nothing. Ive found also this piece of code:

    $user_query = new WP_User_Query( array( 'meta_key' => 'country', 'meta_value' => 'Israel' ) );

    Which is almost the same thing I want to do just that I want to filter posts by such users. Here they’re using meta_key and meta_value again and I’ve got no idea how to do the same with wp_bp_xprofile_data.

    Am I getting close or am I still far from achieving what I want?

    Thank you for your help

    Vignesh M
    Participant

    i found and solve the issue on my ownway.. This is the code for display posts count for individual users(members).. Hope it works….

    <?php
    $user_id = bp_get_member_user_id();
    $query = new WP_Query( ‘author=’ . $user_id );

    if ( $query->have_posts() ) {
    while ( $query->have_posts() ) {
    $query->the_post();
    //display title
    /*the_title();*/
    //display content
    /*the_title();*/

    }
    }
    echo ‘Number of posts published by user: ‘ . count_user_posts($user_id);
    //reset for next member
    wp_reset_postdata();
    ?>

    #236692
    djsteveb
    Participant

    @giorgosnl – I am confused what you are asking to do.

    You could have one blog where new users are all added to that blog as authors, or editors.. and that would be just one blog where multiple people can post..

    or you could give each user a new blog (aka “site”) – and that would have a different blog at:
    yourdotcom/kevins-site
    yourdotcom/mandys-site

    you could easily make it so all new user blogs had the same header and theme etc.. and use a plugin to display “sitewide blog posts” onto one page.. so you could have a page that showed each member’s blog posts (or snippets from each) and click to read the whole post, which would take them to the individuals blog..

    or one main blog where each person is given access as a contributor, editor, admin.. whatever and they all post on just one main blog..

    both are similar, both are easy with wp+bp… one takes the extra step of making wp multi-site… and a plugin to pull in sitewide blog posts onto a single page…

    #230656
    colabsadmin
    Participant

    Sorry I thought I was clear. I dont need an example of how to create the tab and the submenus.

    What I did was write a class that creates a top level member area tab called Favorites that consolidates all types of favorites within a single tab. https://github.com/colabsadmin/bp-favorites/blob/master/bp-favorites.php

    The submenus that have been created so far are Activity, Topics, Posts and a few more for some CPTs that I’ve written. This will make it easier for my users to find their favorites when they cant remember if it came from a topic, posts, activity, etc. Instead of jumping around from tab to tab, its all in one tab. The only submenu that doesnt work is Activity. The code, which I provided in my first question, was copied directly from Buddypress core code with one change to use ‘bp_core_new_subnav_item’. I used similar code to display content in all the other submenus. For example, the following shows the favorite topics

    // Favorite topics
    bp_core_new_subnav_item( array(
    		'name'            => __( 'Topics', 'kleo' ),
    		'slug'            => "topics",
    		'parent_url'      => $bp->displayed_user->domain . $bp->bp_nav['favorites']['slug'] . '/',
    		'parent_slug'     => $bp->bp_nav['favorites']['slug'],
    		'screen_function' => 'bbp_member_forums_screen_favorites',
    		'position'        => 10,
    		'item_css_id'     => 'favorites'
    ));
    

    So, my question, does bp_activity_screen_favorites() only work within the context of /members/membername/activity action? Or can it be used elsewhere as in /members/membersname/favorites?

    #186135

    In reply to: Add Member Type Class

    LucidStrike
    Participant

    Hi.

    The subnav item comes from the app ‘BP Posts on Profile‘. The theme is ‘X‘ by Theme Co.

    Targetting the element with

    #posts-personal-li {
    display: none;
    }

    Removes it, but, of course, it removes it from ALL profiles. I need it on admin profiles only. It links to the author page, and other users can’t author posts anyway.

    Here is my admin profile.

    Ross Wintle
    Participant

    Thanks again Shane. I’ll try to explain again.

    At high level, I want users, in their user profile, to be able to select one or more skills that they have. Skills are posts of a post type.

    At lower level, I want, in a BP user profile, a field which is either a multi-select, or a set of checkboxes. The values selectable should be titles of posts from the “Skills” post type (I’ll actually save the IDs of the posts, but the titles should be displayed).

    The user should be able to select these values both when registering and when editing their profile.

    Possible implementations I can think of would be:
    – Implement a new field TYPE called “skill”, create a field of that type in BuddyPress, and write some hooks that display and save the field.
    – Add some custom code using action hooks to the bottom of the registration and edit profile screens.

    I know it’s kinda hard to explain in a short forum post. There just doesn’t seem to be some simple, documented hooks that a plugin can use to extend the user profiles with new custom fields of new types and I was looking for some guidance/best practice for doing this.

    Thanks again for your help.

    Ross

    #184978
    danbp
    Participant

    hello @optiqal,
    using snippets from 2012 leads to errors in many case. 😉

    Here’s a new version of what you used. I tested it on BP 2.1 and 2013 theme.
    (original code comes from here) As it contained errors i corrected them and adjusted the code to get content everywhere.

    /* we're building the nav button and add it to the profile main menu */
    function mb_bp_profile_menu_posts() {
    	global $bp;
    	bp_core_new_nav_item(
    	array(
    	'name' => 'My Posts',
    	'slug' => 'posts', 
    	'position' => 11, 
    	'default_subnav_slug' => 'published', 
    	'screen_function' => 'mb_author_posts'
    	)
    	);
    }
    add_action('bp_setup_nav', 'mb_bp_profile_menu_posts', 301 );
    
    /* we're building 2 sub item
     * the first is the one showing by default
     */
    
    function mb_bp_profile_submenu_posts() {
    	global $bp;
    	if(!is_user_logged_in()) return '';
    	bp_core_new_subnav_item( array( 
    	'name' => 'Published',
    	'slug' => 'published', 
    	'parent_url' => $bp->loggedin_user->domain . $bp->bp_nav['posts']['slug'] . '/' ,
    	'parent_slug' => $bp->bp_nav['posts']['slug'],
    	'position' => 10,
    	'screen_function' => 'mb_author_posts' //the function is declared below
    	) 
    	); 
    	bp_core_new_subnav_item( array( 
    	'name' => 'Drafts',
    	'slug' => 'drafts', 
    	'parent_url' => $bp->loggedin_user->domain . $bp->bp_nav['posts']['slug'] . '/' ,
    	'parent_slug' => $bp->bp_nav['posts']['slug'],
    	'position' => 20,
    	'screen_function' => 'mb_author_drafts' //the function is declared below
    	) 
    	); 
    }
    add_action('bp_setup_nav', 'mb_bp_profile_submenu_posts', 302 );
    
    /* here we control our 1st sub item
     * first function is the screen_function
     * second function displays the content
    */
    function mb_author_posts(){	
    	add_action( 'bp_template_content', 'mb_show_posts' );
    	bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
    }
    function mb_show_posts() {
    	echo 'Function to Generate the displayed users posts.';
    	// add yout stuff here
    }
    
    /* here we control our 2nd sub item
     * first function is the screen_function
     * second function displays the content
     */
    function mb_author_drafts() {
    	add_action( 'bp_template_content', 'mb_show_drafts' );
    	bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
    }
    function mb_show_drafts() {
    	echo 'Another function to Generate the displayed users drafts.';
    	// add yout stuff here
    }
    #182328
    djsteveo
    Participant

    @jconti – glad you jumped into this thread!

    The simplest thing would be a basic report this button that could appear next to all content displayed with a buddypress install. As mentioned above sending an email to the superadmin with the referring url would be nice.. added functionality has been discussed up above that would make this even better.

    I’d like to mention here, although it probably deserves it’s own thread, it would be a good idea to give users and option to ‘block user’ or auto-ignore / bozo other users.. this way people who may not get their account deleted for not violating rules after a report – could be blocked from having their pms show up, or activity show to the other user who wanted to block them.

    Combining the “report this” with an option to further “block all content (pms, activity stream messages, group posts, etc) – from appearing while user A is logged in.. that would make buddypress much more professional and user friendly.

    #177712
    webauthor
    Participant

    I’ve been reading a lot about this issue and it looks like BP is missing some very basic functionality. This is the first time using it and right out of the gate I see that there are some things that have me baffled.

    1) No way to create conditional fields. I’ve tried using the Gravity Forms User Registration Add-On plugin but there is no way to map fields properly. For example, in Gravity Forms I have Country, State and City fields. If someone selects United States as a Country for example, the next field that the user sees is the State field, but then I run into a problem when someone selects a City. In order to use conditional fields with Gravity Forms, I need to create many City fields (alabama-cities, alaska-cities etc). One City field for each State. These City fields are conditional fields that displayed to the user Cities based on what the user selects in the State field.

    The problem is that Gravity Forms wants me to first create User Profile Fields in BuddyPress. Then map each Gravity Forms field to the appropriate User Profile Field. Since I have many Gravity Forms cities field, there is no way I can tell Gravity Forms to use the City that the user selects and map it to a City User Profile field in BuddyPress.

    I’ve read a lot of posts on this forum dating back 5 years and no one has offered a working solution.

    2) Also, Why is there no option for an admin to be able to deny users from changing their Screenname? How about an option that prevents user from modifying a specific field such as Gender? All I see is havoc and chaos if you allow users to change certain fields.

    3) Why doesn’t BuddyPress offer a way to have different registration fields based on the user? Teacher / Student Registration, Doctor / Patient etc? It doesn’t make sense. Look at the core of BuddyPress. It’s a social network plugin. In almost every circumstance you have a need for one user have certain fields and another to have other fields. Trying to figure out how to show certain profile fields for one user and not another should be at the core of this plugin. Not to mention making it easy for the site owner to layout those fields so that they look nice. For example something as easy as defining the length of the fields. You can’t make those modifications without Firebug and CSS and PHP experience, or worse yet another plugin. If you use a plugin, then you have to pray to God the author of that plugin not to fall off a cliff or pray that he / she keeps that plugin conducive with the latest version of BP.

    I don’t mean to gripe but BuddyPress it seems to me that at it’s core, very little thought was given to how people would actually use it. Almost like it’s piecemealed together.

    Another big complaint is that it’s not compatible with the best WordPress themes on the planet – StudioPress. Shouldn’t the contributors of BP make sure that BP and StudioPress be compatible?

    I’m sorry if this sounds like a rant, it’s not. It’s just frustration. BP looks awesome but underneath the hood, there are a lot of obvious problems. My suggestion is to do what WooCommerce, StudioPress and others do. Sit down and figure out how to handle the big issues first. If need be, charge for BuddyPress. If the problem is that you have a bunch of contributors who work on things “they” deem important and at their own leisure, then the plugin suffers. Charge for it. Sit down and listen to the complaints and address them based on customer priority. Pay someone to reply to this forum so we’re not waiting days for a response. You’ll have much happier users and a much better plugin. Just my 2 cents worth. Honestly, since BP is virtually the only Plugin of it’s kind, not taking my advice will lead to someone creating a better wheel and that point, it’s only a matter of time before BP becomes obsolete.

    It’s been close to 24 hours and no response to my original question. If ANYONE has an answer as to how I can get a user to simply select a Country, then State, then City based on previous fields, I’d greatly appreciate it. Also if someone could please tell me how to prevent users from modifying certain fields that would be appreciated as well.

    Thanks

    #177482
    Justin
    Participant

    I couldn’t get any of those hooks to work. I ended up editing the members.php file in the profile progression plugin and that worked. Obviously not ideal for updating plugins but it’s working!

    I also was then able to hide the progression bar from users who didn’t own that profile and hide it altogether once it was complete. Those features weren’t part of the original plugin.

    Here’s the code if anybody wants it:

    if (bp_is_my_profile()) {
    
    
        $percent = bppp_get_user_progression_percent();
    
        if ($percent == 100 && !current_user_can('edit_posts')) {
                    my_update_profile_mark();
        }
    
        if ($percent == 100) {
           echo '<div class="bppp-stat-no-display">';
    
        } else {
            echo '<div class="bppp-stat">';
        }
    
    
                echo '<span class="bppp-stat-title">';
                bppp_title();
                echo '</span> ';
                
                echo '<div class="bppp-stat-block">';
                        echo '<div class="bppp-bar">';
                echo '<div class="bppp-bar-mask" style="width:';
                echo (int)(100-bppp_get_user_progression_percent());
                echo '%"></div>';
                echo '</div>';
                        
                echo '</div>';
                echo '<span class="bppp-stat-percent">';
                echo bppp_get_user_progression_percent();
                echo '%</span>';
                echo '</div>';
    
    }
    

    Here’s the function that’s referenced that I added to functions.php:

    function my_update_profile_mark() {
    
       $user_ID = get_current_user_id();
       $power_level = 9001;
       update_user_meta( $user_ID, '_power_level', $power_level);
       
    }

    Oh and of course this got added to style.css:

    .bppp-stat-no-display {
        display: none;
    }
    

    Now I just need to build a custom menu in the backend that queries users based on their role level and the custom user meta key that’s updated here. Hopefully it’s a smoother process!

    Thanks all for your help!

    #177181
    SK
    Participant

    Better customisation options of the activity stream: ie to be able to define a set of “or” filters for content type, and who. So (with plugin support) I can define a feed to include things from “me or friends or followers” showing “topics and topic replies and posts and new users” (and ideally be able to have a permalink to this with no other fluff on display). The current activity feed selectors are a mess and don’t provide what most people want to see.

    There are about 50-75 Premium BuddyPress themes online for sale and 99% of them have the same activity stream page-layout. While all those premium theme developers can do lots of customization to all other pages the activity stream is like Twitter’s Bootstrap to BuddyPress it always tells you it’s a BuddyPress website without looking at the code.

    The reason all those themes activity look alike is because previously it was a nightmare to create something that wasn’t derivative of bp-default and it’s heavy-handed javascript. This is not the case anymore.

    In other words, this issue has already been fixed. Now it is upto the theme developers to customize the feed aesthetics to their hearts’ content.

    #175885
    Shmoo
    Participant

    Better customisation options of the activity stream: ie to be able to define a set of “or” filters for content type, and who. So (with plugin support) I can define a feed to include things from “me or friends or followers” showing “topics and topic replies and posts and new users” (and ideally be able to have a permalink to this with no other fluff on display). The current activity feed selectors are a mess and don’t provide what most people want to see.

    Should be nummer 1.

    And I don’t even want lots of new features to the activity stream but first just an easy way to customize the default lay-out would be so much pleasant!

    All BP pages are very easy to customize, move code around to give the page an unique feeling but when it comes to the activity stream the code is very fixed.

    There are about 50-75 Premium BuddyPress themes online for sale and 99% of them have the same activity stream page-layout. While all those premium theme developers can do lots of customization to all other pages the activity stream is like Twitter’s Bootstrap to BuddyPress it always tells you it’s a BuddyPress website without looking at the code.

    #174517
    Martyn_
    Participant

    * Better customisation options of the activity stream: ie to be able to define a set of “or” filters for content type, and who. So (with plugin support) I can define a feed to include things from “me or friends or followers” showing “topics and topic replies and posts and new users” (and ideally be able to have a permalink to this with no other fluff on display). The current activity feed selectors are a mess and don’t provide what most people want to see.

    * A way to select which filters and views are available in activity/, and persistently set the default activity feed view (from the admin panel)

    * live activity updates

    * A reply by PM hook into bbpress

    * Better options for users to self delete

    * Improved management/rethink of the tabs on profile pages (because this rapidly piles up as you add in plugins) : “Activity Profile Messages Friends Following Followers Location Groups Blog Forums Events Gallery Settings Links” Is not viable for a one line menu bar – this is maybe a display issue, but…!

    * be able to pass a function to the members loop, thats called to determine the display order (e.g. so I can easily order by City or age or any xprofile field)

    Maybe these are already there, but these are the things that are bugging me as a non-expert dev right now…

    #173830
    Sergio De Falco
    Participant

    Thanks Paul, I made it :), it’s something really rough, but if somebody needs it here it is:

    <?php
    
    // parametri del database
    $db_host = "localhost";         //Your database host
    $db_user = "database";          //Your database username
    $db_password = "password";      //Your database password
    $db_name = "database_01";       //Your database name
    
    $db = mysql_connect($db_host, $db_user, $db_password);
    set_time_limit(0);
    
    if ($db == FALSE)
    die ("Connection Error.");
    
    mysql_select_db($db_name, $db)
    or die ("Database Error.");
    
    $n = 0;
    $query = "SELECT * FROM <code>wp_posts</code> WHERE post_type = 'topic' OR post_type = 'reply' ORDER BY post_date ASC";
    
    $result = mysql_query($query, $db);
    
    while ($row = mysql_fetch_array($result))
    
    	{
    		unset($user_id);
    		unset($reg);
    		unset($guid);
    		unset($id);
    		unset($post_parent);
    		unset($post_date);
    		unset($nicename);
    		unset($displayname);
    		unset($title);
    		unset($forum);
    		unset($forumurl);
    		unset($post_type);
    		unset($forum_id);
    		unset($acttype);
    	
    		$user_id = $row['post_author'];
    		$guid = $row['guid'];
    		$reg = $row['user_registered'];
    		$id = $row['ID'];
    		$post_parent = $row['post_parent'];
    		$post_date = $row['post_date'];
    		$title = $row['post_title'];
    		$content = $row['post_content'];
    		$post_type = $row['post_type'];
    		$forum_id = $post_parent;
    		
    		$q1 = "SELECT * FROM <code>wp_users</code> WHERE ID = '$user_id'";
    		$r1 = mysql_query($q1, $db);
    		$e1 = mysql_fetch_array($r1);
    		
    		$nicename = $e1['user_nicename'];
    		$displayname = $e1['display_name'];
    		
    		if ( $post_type == 'reply' ) {
    			$q1 = "SELECT * FROM <code>wp_posts</code> WHERE ID = '$post_parent'";
    			$r1 = mysql_query($q1, $db);
    			$e1 = mysql_fetch_array($r1);
    			
    			$post_parent = $e1['post_parent'];
    			$title = $e1['post_title'];
    			$guid = $e1['guid'];
    		}
    		
    		$q1 = "SELECT * FROM <code>wp_posts</code> WHERE ID = '$forum_id'";
    		$r1 = mysql_query($q1, $db);
    		$e1 = mysql_fetch_array($r1);
    		
    		$forum = $e1['post_title'];
    		$forumurl = $e1['guid'];
    
    		if ( $post_type == 'topic' ) {
    			$action = mysql_real_escape_string('<a href="http://www.yoursite.com/users/' . $nicename . '/" rel="nofollow">' . $displayname . '</a> ha iniziato la discussione <a href="' . $guid . '">' . $title . '</a> nel forum <a href="' . $forumurl . '">' . $forum . '</a>');
    			$acttype = 'bbp_topic_create';
    		} else {
    			$action = mysql_real_escape_string('<a href="http://www.yoursite.com/users/' . $nicename . '/" rel="nofollow">' . $displayname . '</a> ha risposto alla discussione <a href="' . $guid . '">' . $title . '</a> nel forum <a href="' . $forumurl . '">' . $forum . '</a>');
    			$acttype = 'bbp_reply_create';
    		}
    		
    		$content = mysql_real_escape_string( $content );
    
    		if ( $user_id > 0 ) {
    			$q1 = "SELECT COUNT(umeta_id) AS conto FROM <code>wp_usermeta</code> WHERE user_id = '$user_id' AND meta_key = 'last_activity'";
    			$r1 = mysql_query($q1, $db);
    			$e1 = mysql_fetch_array($r1);
    			
    			if ( $e1['conto'] > 0 ) {
    				$q = "UPDATE wp_usermeta SET meta_value = '$post_date' WHERE user_id = '$user_id' AND meta_key = 'last_activity'";
    				mysql_query($q, $db);
    			} else {
    				$q = "INSERT INTO <code>wp_usermeta</code> (<code>umeta_id</code>, <code>user_id</code>, <code>meta_key</code>, <code>meta_value</code> ) VALUES ( NULL, '$user_id', 'last_activity', '$post_date' );";
    				mysql_query($q, $db);
    			}
    		}
    		
    		$q = "INSERT INTO <code>wp_bp_activity</code> (<code>id</code>, <code>user_id</code>, <code>component</code>, <code>type</code>, <code>action</code>, <code>content</code>, <code>primary_link</code>, <code>item_id</code>, <code>secondary_item_id</code>, <code>date_recorded</code>, <code>hide_sitewide</code>, <code>mptt_left</code>, <code>mptt_right</code>, <code>is_spam</code> ) VALUES ";
    		$q .= "(NULL, '$user_id', 'bbpress', '$acttype', '$action', '$content', '$guid', '$id', '$post_parent', '$post_date', '0', '0', '0', '0')";
    		mysql_query($q, $db);
    
                    $n++;
    	}
    
    mysql_close($db);
    
    echo "Done! inserted $n activity entries";
    ?>
    

    The action is in italian, you can modify as you want

    #172257
    lucamoretto
    Participant

    Hi guys is the same if i wannainsert a list of all products uploaded by author in my site woocommerce + buddypress. Every users (subscriber) can upload a new products, I wanna display in the user buddypress profile a list with a link of all products published by author. Is Possible? Can help me to solve this problem? Ty in advance!

    Dainismichel
    Participant

    i think i remember what i did a few years back — i forced users to jump out to the posts themselves to make comments. i think i did this by just not displaying the comment buttons in the activity stream … something like that.

    #161676
    azchipka
    Participant

    Sorry there was an error in the above code, that results in a no results dialog error for users who have no posts. You can download a bundled plugin by clicking here.

    if ( !function_exists( 'add_action' ) ) {
    	echo 'Hi there!  I\'m just a plugin, not much I can do when called directly.';
    	exit;
    }
    define('TCH_PostsOnProfilesVersion', '0.1');
    define('TCH_PostsOnProfilesVersion_PLUGIN_URL', plugin_dir_url( __FILE__ ));
    
    add_action( 'bp_setup_nav', 'add_profileposts_tab', 100 );
    function add_profileposts_tab() {
    global $bp;
    bp_core_new_nav_item( array(
    'name' => 'My Posts',
    'slug' => 'posts',
    'screen_function' => 'bp_postsonprofile',
    'default_subnav_slug' => 'My Posts', 
    'position' => 25
    )
    );
    // show feedback when 'Posts' tab is clicked
    function bp_postsonprofile() {
    add_action( 'bp_template_content', 'profile_screen_posts_show' );
    bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
    }
    
    function profile_screen_posts_show() {
    $theuser = bp_displayed_user_id(); 
    query_posts("author=$theuser" );
    if ( have_posts() ) :
    get_template_part( 'loop', 'archive' );
    else: ?>
    
    		
    
    	    
    #161657
    azchipka
    Participant

    OK went through the plugin and updated the code to function in current versions of buddy press, its a bit sloppy but it does work. Just place the below code in your bp-custom.php file and it will add a new tab to each users profile that displays the blog posts they have written. Display is based off of your archive.php file so it matches the theme.

    //POSTS ON PROFILE STARTS HERE
    add_action( 'bp_setup_nav', 'add_profileposts_tab', 100 );
    function add_profileposts_tab() {
    global $bp;
    bp_core_new_nav_item( array(
    'name' => 'My Posts',
    'slug' => 'posts',
    'screen_function' => 'bp_postsonprofile',
    'default_subnav_slug' => 'My Posts', 
    'position' => 25
    )
    );
    // show feedback when 'Posts' tab is clicked
    function bp_postsonprofile() {
    add_action( 'bp_template_content', 'profile_screen_posts_show' );
    bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
    }
    
    function profile_screen_posts_show() {
    $theuser = bp_displayed_user_id(); 
    query_posts("author=$theuser" );
    get_template_part( 'loop', 'archive' ); //call your archive template
    
    }
    
    }
    
    //POSTS ON PROFILE ENDS HERE
    #160190
    danbpfr
    Participant

    @funmi-omoba,

    please open a new tread, this one is 3 years old, and give some details about your config (version, theme name) and what you want to do.


    @opencode
    , thank you for sharing, but updating such old posts hasn’t much effect for most users. Also give some indication about BP version where your code will work on.

    #158504
    @mercime
    Participant

    @udgang99 “create a new field in the members profile, where all the POSTS they have contributed with to the site, are displayed” plus post from the front-end

    Introducing BuddyBlog: Allow Users to blog from their BuddyPress Profile

    Aventador
    Participant

    Hallo @talha8877

    Excuse me, my English is not so good, unfortunately.

    I used the plugin Cartpauj PM Plugin from Mingle, as I have found as yet no viable solution to the buttons (message etc) of the BuddyPress insertion into posts / Articels.

    So now I turn off the message part of BuddyPress and linking all the Cartpauj PM, which works wonderfully, except out of BuddyPress. There does not work.

    Of Cartpauj in single.php just the link:

    <a href = "/ news / pmaction newmessage = & to = “> Send

    . put But as I said, the link works in BuddyPress indeed, but does not with the member users, which I will write. Since I’m still looking for a solution. Evtentuell with: bp user id, funktioiert might not.

    So who has a solution to integrate Cartpauj PM in buddybress, bring it on.

    That´s it

    Thank you

    talha8877
    Participant

    Hi Chouf,

    Thanks for the response. Although I’m having hard time connecting the dots.
    I’d already used
    `bp_add_friend_button( $user_ids[‘users’][$i]->id ) ?>`

    directly in my code but it didn’t return any results.
    Do I need to use an action hook to display it in posts?

    #150695
    Ben Hansen
    Participant

    well that’s not the way it works at all when network activated some aspects of buddypress provide network wide functionality but the front end display is only as i say on the primary blog/site for instance you can use buddypress to give your users the ability to create their own sub sites (in a more user friendly fashion then wordpress itself provides alone) and any activity on the various sub sites will be displayed in the network wide activity feed which again only displays on the primary blog by default.

Viewing 25 results - 26 through 50 (of 135 total)
Skip to toolbar