Forum Replies Created
-
Hello again!
I’ve been working on this a bit more, while the above option I posted earlier will let you list the info, it doesnt actually work as a link to anything, it only displays the stats. I wanted to take this a step further and actually have links to post and whatnot.I had initially made a child template for the UserPro Plugin, I was stuck for a bit, the file I needed to edit is called view.php. You would find this file in UserPro/templates/view.php. I am not sure why but for whatever reason if I edit this file in a child theme, the changes I make do not display, which is likely why Lucas (who started this topic) isnt seeing any results with the recommendation from Ahmed to use:
<?php bbp_get_template_part( $user_id, ‘topics-created’ ); ?>
The ” $user_id ” is the correct call for the user, however these changes only seem to become active if you directly edit the view.php file in the original UserPro plugin, instead of the child theme. I am not sure why I can’t get it to excute via child theme, so any insight on that would be helpful, as I dont want it to overwrite changes after an update.
Anyway, after determining that it does in fact work, this is what I have added to the bottom of the view.php file.
<div id=”bbp-user-topics-started” class=”myforumtest”>
<div class=”bbp-user-section”> <h2 class=”entry-title”><?php _e( ‘Forum Topics Started’, ‘bbpress’ ); ?></h2>
<?php if ( bbp_get_user_topics_started( $user_id, ‘topics-created’) ) : ?>
<?php bbp_get_template_part( ‘pagination’, ‘topics’ ); ?>
<?php bbp_get_template_part( ‘loop’, ‘topics’ ); ?>
<?php else : ?>
<p><?php bbp_is_user_home() ? _e( ‘You have not created any topics.’, ‘bbpress’ ) : _e( ‘This user has not created any topics.’, ‘bbpress’ ); ?></p>
<?php endif; ?>
</div>
</div><!– #bbp-user-topics-started –><div id=”bbp-user-replies-created” class=”myforumtest”>
<div class=”bbp-user-section”> <h2 class=”entry-title”><?php _e( ‘Forum Replies Created’, ‘bbpress’ ); ?></h2>
<?php if ( bbp_get_user_replies_created( $user_id, ‘replies-created’) ) : ?>
<?php bbp_get_template_part( ‘pagination’, ‘replies’ ); ?>
<?php bbp_get_template_part( ‘loop’, ‘replies’ ); ?>
<?php else : ?>
<p><?php bbp_is_user_home() ? _e( ‘You have not replied to any topics.’, ‘bbpress’ ) : _e( ‘This user has not replied to any topics.’, ‘bbpress’ ); ?></p>
<?php endif; ?>
</div>
</div><!– #bbp-user-replies-created –><div id=”bbp-user-favorites” class=”myforumtest”>
<div class=”bbp-user-section”> <h2 class=”entry-title”><?php _e( ‘Favorite Forum Topics’, ‘bbpress’ ); ?></h2>
<?php if ( bbp_get_user_favorites( $user_id, ‘favorites’) ) : ?>
<?php bbp_get_template_part( ‘pagination’, ‘topics’ ); ?>
<?php bbp_get_template_part( ‘loop’, ‘topics’ ); ?>
<?php else : ?>
<p><?php bbp_is_user_home() ? _e( ‘You currently have no favorite topics.’, ‘bbpress’ ) : _e( ‘This user has no favorite topics.’, ‘bbpress’ ); ?></p>
<?php endif; ?>
</div>
</div><!– #bbp-user-favorites –><div id=”bbp-user-subscriptions” class=”myforumtest”>
<div class=”bbp-user-section”> <h2 class=”entry-title”><?php _e( ‘Subscribed Forums’, ‘bbpress’ ); ?></h2>
<?php if ( bbp_get_user_forum_subscriptions( $user_id, ‘subscriptions’) ) : ?>
<?php bbp_get_template_part( ‘pagination’, ‘topics’ ); ?>
<?php bbp_get_template_part( ‘loop’, ‘forums’ ); ?>
<?php else : ?>
<p><?php bbp_is_user_home() ? _e( ‘You are not currently subscribed to any forums.’, ‘bbpress’ ) : _e( ‘This user is not currently subscribed to any forums.’, ‘bbpress’ ); ?></p>
<?php endif; ?>
</div>
</div><!– #bbp-user-subscriptions –><div id=”bbp-user-subscriptions” class=”myforumtest”>
<div class=”bbp-user-section” ><h2 class=”entry-title”><?php _e( ‘Subscribed Topics’, ‘bbpress’ ); ?></h2>
<?php if ( bbp_get_user_topic_subscriptions( $user_id, ‘subscriptions’) ) : ?>
<?php bbp_get_template_part( ‘pagination’, ‘topics’ ); ?>
<?php bbp_get_template_part( ‘loop’, ‘topics’ ); ?>
<?php else : ?>
<p><?php bbp_is_user_home() ? _e( ‘You are not currently subscribed to any topics.’, ‘bbpress’ ) : _e( ‘This user is not currently subscribed to any topics.’, ‘bbpress’ ); ?></p>
<?php endif; ?>
</div>
</div><!– #bbp-user-topic-subscriptions –>Adding this to the view.php file, allows the user specific forums post for each individual user, so we can now see recent post, recent replies, subscriptions and favorites, and then link to the appropriate post. If anyone could shed any light as to why I can’t do this via a child theme I would be most happy! ^_^
in reply to: bbPress Profile Info on UserPro ProfileHi there! I am not sure if you found a solution to this or not. I also was looking to get the profile info from BBPress to show up on the UserPro profile page. The solution that worked for me is as follows!
<?php
echo ‘<br>Role: ‘.bbp_get_user_display_role(bbp_get_reply_author_id());
echo ‘<br>Replies: ‘.bbp_get_user_reply_count_raw(bbp_get_reply_author_id());
echo ‘<br>Topics: ‘. bbp_get_user_topic_count_raw(bbp_get_reply_author_id());
?>Hope that lends a hand! 🙂
in reply to: bbPress Profile Info on UserPro Profile