Forum Replies Created
-
In reply to: Replies Created & Subscribed Forums
1. I created a new template file titled discussions-replies and discussions-subscriptions under my WordPress child theme.
2. I placed within discussions-replies the following code:
<?php /* Template Name: Discussions Replies Created */ get_header(); // Page options $header = ghostpool_option( 'page_header' ) == 'default' ? ghostpool_option( 'page_page_header' ) : ghostpool_option( 'page_header' ); $height = ghostpool_option( 'page_header_height', 'padding-bottom' ) != '' ? ghostpool_option( 'page_header_height', 'padding-bottom' ) : ghostpool_option( 'page_page_header_height', 'height' ); $format = ghostpool_option( 'blog_format' ); $style = ghostpool_option( 'blog_style' ); $alignment = ghostpool_option( 'blog_alignment' ); $cats = ghostpool_option( 'blog_cats' ) ? implode( ',', ghostpool_option( 'blog_cats' ) ) : ''; $post_types = ghostpool_option( 'blog_post_types' ) ? implode( ',', ghostpool_option( 'blog_post_types' ) ) : ghostpool_option( 'blog_post_types' ); $orderby = ghostpool_option( 'blog_orderby' ); $per_page = ghostpool_option( 'blog_per_page' ); $offset = ghostpool_option( 'blog_offset' ); $image_size = ghostpool_option( 'blog_image_size' ); $content_display = ghostpool_option( 'blog_content_display' ); $excerpt_length = ghostpool_option( 'blog_excerpt_length' ); $meta_author = ghostpool_option( 'blog_meta', 'author' ); $meta_date = ghostpool_option( 'blog_meta', 'date' ); $meta_comment_count = ghostpool_option( 'blog_meta', 'comment_count' ); $meta_views = ghostpool_option( 'blog_meta', 'views' ); $meta_likes = ghostpool_option( 'blog_meta', 'likes' ); $meta_cats = ghostpool_option( 'blog_meta', 'cats' ); $meta_tags = ghostpool_option( 'blog_meta', 'tags' ); $read_more_link = ghostpool_option( 'blog_read_more_link' ); $pagination = 'page-numbers'; ?> <div class="sub-nav-container"> <div class="sub-nav-pagetitle"> <h1><?php the_title(); ?></h1> </div> <div class="sub-nav-about-menu"> <?php wp_nav_menu( array( 'theme_location' => 'sub-nav-discuss-menu', 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'sub-nav-discuss-menu', 'fallback_cb' => 'null', 'walker' => new Ghostpool_Custom_Menu ) ); ?> </div> <div class="sub-nav-extramenu"> </div> </div> <div id="gp-content-wrapper" class="gp-container"> <?php do_action( 'ghostpool_begin_content_wrapper' ); ?> <div id="gp-inner-container"> <div id="gp-content"> <div class="gp-entry-content"> <div id="bbpress-forums"> <?php do_action( 'bbp_template_before_user_replies' ); ?> <div id="bbp-user-replies-created" class="bbp-user-replies-created"> <div class="bbp-user-section"> <?php global $current_user; get_currentuserinfo(); $uid = bbp_get_current_user_id(); ?> <?php if ( bbp_get_user_replies_created( $user_id = bp_loggedin_user_id() ) ) : ?> <?php bbp_get_template_part( 'pagination', 'replies' ); ?> <?php bbp_get_template_part( 'loop', 'replies' ); ?> <?php bbp_get_template_part( 'pagination', 'replies' ); ?> <?php else : ?> <p><?php _e( 'You have not replied to any topics.', 'bbpress' ); ?></p> <?php endif; ?> </div> </div> </div> </div> </div> <?php get_sidebar( 'left' ); ?> <?php get_sidebar( 'right' ); ?> </div> <?php do_action( 'ghostpool_end_content_wrapper' ); ?> <div class="gp-clear"></div> </div> <?php get_footer(); ?>
In discussions-subscriptions template I inserted the following code:
<?php /* Template Name: Discussions Subscriptions */ get_header(); // Page options $header = ghostpool_option( 'page_header' ) == 'default' ? ghostpool_option( 'page_page_header' ) : ghostpool_option( 'page_header' ); $height = ghostpool_option( 'page_header_height', 'padding-bottom' ) != '' ? ghostpool_option( 'page_header_height', 'padding-bottom' ) : ghostpool_option( 'page_page_header_height', 'height' ); $format = ghostpool_option( 'blog_format' ); $style = ghostpool_option( 'blog_style' ); $alignment = ghostpool_option( 'blog_alignment' ); $cats = ghostpool_option( 'blog_cats' ) ? implode( ',', ghostpool_option( 'blog_cats' ) ) : ''; $post_types = ghostpool_option( 'blog_post_types' ) ? implode( ',', ghostpool_option( 'blog_post_types' ) ) : ghostpool_option( 'blog_post_types' ); $orderby = ghostpool_option( 'blog_orderby' ); $per_page = ghostpool_option( 'blog_per_page' ); $offset = ghostpool_option( 'blog_offset' ); $image_size = ghostpool_option( 'blog_image_size' ); $content_display = ghostpool_option( 'blog_content_display' ); $excerpt_length = ghostpool_option( 'blog_excerpt_length' ); $meta_author = ghostpool_option( 'blog_meta', 'author' ); $meta_date = ghostpool_option( 'blog_meta', 'date' ); $meta_comment_count = ghostpool_option( 'blog_meta', 'comment_count' ); $meta_views = ghostpool_option( 'blog_meta', 'views' ); $meta_likes = ghostpool_option( 'blog_meta', 'likes' ); $meta_cats = ghostpool_option( 'blog_meta', 'cats' ); $meta_tags = ghostpool_option( 'blog_meta', 'tags' ); $read_more_link = ghostpool_option( 'blog_read_more_link' ); $pagination = 'page-numbers'; ?> <div class="sub-nav-container"> <div class="sub-nav-pagetitle"> <h1><?php the_title(); ?></h1> </div> <div class="sub-nav-about-menu"> <?php wp_nav_menu( array( 'theme_location' => 'sub-nav-discuss-menu', 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'sub-nav-discuss-menu', 'fallback_cb' => 'null', 'walker' => new Ghostpool_Custom_Menu ) ); ?> </div> <div class="sub-nav-extramenu"> </div> </div> <div id="gp-content-wrapper" class="gp-container"> <?php do_action( 'ghostpool_begin_content_wrapper' ); ?> <div id="gp-inner-container"> <div id="gp-content"> <div class="gp-entry-content"> <div id="bbpress-forums"> <div id="bbp-user-subscriptions" class="bbp-user-subscriptions"> <h2>Subscribed Forums</h2> <?php global $current_user; get_currentuserinfo(); $uid = bbp_get_current_user_id(); ?> <?php if ( bbp_get_user_forum_subscriptions( $uid ) ) : ?> <?php bbp_get_template_part( 'pagination', 'forums' ); ?> <?php bbp_get_template_part( 'loop', 'forums' ); ?> <?php bbp_get_template_part( 'pagination', 'forums' ); ?> <?php else : ?> <p><?php _e( 'You are not currently subscribed to any forums.', 'bbpress' ); ?></p> <?php endif; ?> <br><br> <h2>Subscribed Topics</h2> <?php global $current_user; get_currentuserinfo(); $uid = bbp_get_current_user_id(); ?> <?php if ( bbp_get_user_topic_subscriptions( $uid ) ) : ?> <?php bbp_get_template_part( 'pagination', 'topics' ); ?> <?php bbp_get_template_part( 'loop', 'topics' ); ?> <?php bbp_get_template_part( 'pagination', 'topics' ); ?> <?php else : ?> <p><?php _e( 'You are not currently subscribed to any topics.', 'bbpress' ); ?></p> <?php endif; ?> </div> </div> </div> </div> <?php get_sidebar( 'left' ); ?> <?php get_sidebar( 'right' ); ?> </div> <?php do_action( 'ghostpool_end_content_wrapper' ); ?> <div class="gp-clear"></div> </div> <?php get_footer(); ?>
3. I then created two new pages with WordPress under their parent named “Discussions”, one page titled Replies and the other Subscriptions. I then assigned each page to their proper template that I just had created.
4. Now when I load the pages, the code is asking for a current user, however it ignores and shows on Replies all replies made by all users; on Subscriptions it shows that the user has made NO subscriptions, even though they have.
In reply to: Replies Created & Subscribed ForumsHi Robin,
Not quite sure I understand the question. The template names are mentioned within the code I provided and they are located in a page I’ve created in the WordPress backend, not one that is already provided within Buddypress or BBpress.
Would it be at all helpful to receive access to my backend? Hope this was helpful.
In reply to: Replies Created & Subscribed ForumsHi Robin,
I’m pasting what I’ve wrote in earlier messages as the issue hasn’t changed. Feel free to access these pages through the login as I think that will help clarify things.
The ‘Replies Created’ template is replacing the one originally within the buddypress profile section. It currently displays a list of all global replies within the forum, versus just the current user’s replies.
(https://obeii.com/discussions/replies/) (testuser / test1234)<?php /* Template Name: Discussions Replies Created */ get_header(); ?> <div class="sub-nav-container"> <div class="sub-nav-pagetitle"> <h1><?php the_title(); ?></h1> </div> <div class="sub-nav-about-menu"> <?php wp_nav_menu( array( 'theme_location' => 'sub-nav-discuss-menu', 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'sub-nav-discuss-menu', 'fallback_cb' => 'null', 'walker' => new Ghostpool_Custom_Menu ) ); ?> </div> <div class="sub-nav-extramenu"> </div> </div> <div id="gp-content-wrapper" class="gp-container"> <?php do_action( 'ghostpool_begin_content_wrapper' ); ?> <div id="gp-inner-container"> <div id="gp-content"> <div class="gp-entry-content"> <div id="bbpress-forums"> <?php do_action( 'bbp_template_before_user_replies' ); ?> <div id="bbp-user-replies-created" class="bbp-user-replies-created"> <div class="bbp-user-section"> <?php global $current_user; get_currentuserinfo(); $uid = bbp_get_current_user_id(); ?> <?php if ( bbp_get_user_replies_created( $user_id = bp_loggedin_user_id() ) ) : ?> <?php bbp_get_template_part( 'pagination', 'replies' ); ?> <?php bbp_get_template_part( 'loop', 'replies' ); ?> <?php bbp_get_template_part( 'pagination', 'replies' ); ?> <?php else : ?> <p><?php _e( 'You have not replied to any topics.', 'bbpress' ); ?></p> <?php endif; ?> </div> </div> </div> </div> </div> <?php get_sidebar( 'left' ); ?> <?php get_sidebar( 'right' ); ?> </div> <?php do_action( 'ghostpool_end_content_wrapper' ); ?> <div class="gp-clear"></div> </div> <?php get_footer(); ?>
The ‘Subscribed Forums’ template is also replacing the one originally within the Buddypress profile section. It currently ignores the current user and claims they have no content even though they do. The page also contains ‘Subscribed Topics’ using similar code, which that sections works as expected with no known issues.
(https://obeii.com/discussions/subscriptions/) (testuser / test1234)<?php /* Template Name: Discussions Subscriptions */ get_header(); ?> <div class="sub-nav-container"> <div class="sub-nav-pagetitle"> <h1><?php the_title(); ?></h1> </div> <div class="sub-nav-about-menu"> <?php wp_nav_menu( array( 'theme_location' => 'sub-nav-discuss-menu', 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'sub-nav-discuss-menu', 'fallback_cb' => 'null', 'walker' => new Ghostpool_Custom_Menu ) ); ?> </div> <div class="sub-nav-extramenu"> </div> </div> <div id="gp-content-wrapper" class="gp-container"> <?php do_action( 'ghostpool_begin_content_wrapper' ); ?> <div id="gp-inner-container"> <div id="gp-content"> <div class="gp-entry-content"> <div id="bbpress-forums"> <div id="bbp-user-subscriptions" class="bbp-user-subscriptions"> <h2>Subscribed Forums</h2> <?php global $current_user; get_currentuserinfo(); $uid = bbp_get_current_user_id(); ?> <?php if ( bbp_get_user_forum_subscriptions( $uid ) ) : ?> <?php bbp_get_template_part( 'pagination', 'forums' ); ?> <?php bbp_get_template_part( 'loop', 'forums' ); ?> <?php bbp_get_template_part( 'pagination', 'forums' ); ?> <?php else : ?> <p><?php _e( 'You are not currently subscribed to any forums.', 'bbpress' ); ?></p> <?php endif; ?> <br><br> <h2>Subscribed Topics</h2> <?php global $current_user; get_currentuserinfo(); $uid = bbp_get_current_user_id(); ?> <?php if ( bbp_get_user_topic_subscriptions( $uid ) ) : ?> <?php bbp_get_template_part( 'pagination', 'topics' ); ?> <?php bbp_get_template_part( 'loop', 'topics' ); ?> <?php bbp_get_template_part( 'pagination', 'topics' ); ?> <?php else : ?> <p><?php _e( 'You are not currently subscribed to any topics.', 'bbpress' ); ?></p> <?php endif; ?> </div> </div> </div> </div> <?php get_sidebar( 'left' ); ?> <?php get_sidebar( 'right' ); ?> </div> <?php do_action( 'ghostpool_end_content_wrapper' ); ?> <div class="gp-clear"></div> </div> <?php get_footer(); ?>
In reply to: Replies Created & Subscribed ForumsHi Robin,
If you are referring to the url path they live within:
example.com/discussions/replies/
example.com/discussions/subscriptions/
In reply to: Replies Created & Subscribed ForumsIn reply to: Replies Created & Subscribed ForumsHi Robin,
The ‘Replies Created’ template is replacing the one originally within the buddypress profile section.
(https://obeii.com/discussions-replies-created/) (testuser / test1234)<?php /* Template Name: Discussions Replies Created */ get_header(); ?> <div class="sub-nav-container"> <div class="sub-nav-pagetitle"> <h1><?php the_title(); ?></h1> </div> <div class="sub-nav-about-menu"> <?php wp_nav_menu( array( 'theme_location' => 'sub-nav-discuss-menu', 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'sub-nav-discuss-menu', 'fallback_cb' => 'null', 'walker' => new Ghostpool_Custom_Menu ) ); ?> </div> <div class="sub-nav-extramenu"> </div> </div> <div id="gp-content-wrapper" class="gp-container"> <?php do_action( 'ghostpool_begin_content_wrapper' ); ?> <div id="gp-inner-container"> <div id="gp-content"> <div class="gp-entry-content"> <div id="bbpress-forums"> <?php do_action( 'bbp_template_before_user_replies' ); ?> <div id="bbp-user-replies-created" class="bbp-user-replies-created"> <div class="bbp-user-section"> <?php global $current_user; get_currentuserinfo(); $uid = bbp_get_current_user_id(); ?> <?php if ( bbp_get_user_replies_created( $user_id = bp_loggedin_user_id() ) ) : ?> <?php bbp_get_template_part( 'pagination', 'replies' ); ?> <?php bbp_get_template_part( 'loop', 'replies' ); ?> <?php bbp_get_template_part( 'pagination', 'replies' ); ?> <?php else : ?> <p><?php _e( 'You have not replied to any topics.', 'bbpress' ); ?></p> <?php endif; ?> </div> </div> </div> </div> </div> <?php get_sidebar( 'left' ); ?> <?php get_sidebar( 'right' ); ?> </div> <?php do_action( 'ghostpool_end_content_wrapper' ); ?> <div class="gp-clear"></div> </div> <?php get_footer(); ?>
The ‘Subscribed Forums’ template is also replacing the one originally within the buddypress profile section. It also contains ‘Subscribed Topics’ using similar code and that sections works as expected.
(https://obeii.com/discussions-subscriptions/) (testuser / test1234)<?php /* Template Name: Discussions Subscriptions */ get_header(); ?> <div class="sub-nav-container"> <div class="sub-nav-pagetitle"> <h1><?php the_title(); ?></h1> </div> <div class="sub-nav-about-menu"> <?php wp_nav_menu( array( 'theme_location' => 'sub-nav-discuss-menu', 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'sub-nav-discuss-menu', 'fallback_cb' => 'null', 'walker' => new Ghostpool_Custom_Menu ) ); ?> </div> <div class="sub-nav-extramenu"> </div> </div> <div id="gp-content-wrapper" class="gp-container"> <?php do_action( 'ghostpool_begin_content_wrapper' ); ?> <div id="gp-inner-container"> <div id="gp-content"> <div class="gp-entry-content"> <div id="bbpress-forums"> <div id="bbp-user-subscriptions" class="bbp-user-subscriptions"> <h2>Subscribed Forums</h2> <?php global $current_user; get_currentuserinfo(); $uid = bbp_get_current_user_id(); ?> <?php if ( bbp_get_user_forum_subscriptions( $uid ) ) : ?> <?php bbp_get_template_part( 'pagination', 'forums' ); ?> <?php bbp_get_template_part( 'loop', 'forums' ); ?> <?php bbp_get_template_part( 'pagination', 'forums' ); ?> <?php else : ?> <p><?php _e( 'You are not currently subscribed to any forums.', 'bbpress' ); ?></p> <?php endif; ?> <br><br> <h2>Subscribed Topics</h2> <?php global $current_user; get_currentuserinfo(); $uid = bbp_get_current_user_id(); ?> <?php if ( bbp_get_user_topic_subscriptions( $uid ) ) : ?> <?php bbp_get_template_part( 'pagination', 'topics' ); ?> <?php bbp_get_template_part( 'loop', 'topics' ); ?> <?php bbp_get_template_part( 'pagination', 'topics' ); ?> <?php else : ?> <p><?php _e( 'You are not currently subscribed to any topics.', 'bbpress' ); ?></p> <?php endif; ?> </div> </div> </div> </div> <?php get_sidebar( 'left' ); ?> <?php get_sidebar( 'right' ); ?> </div> <?php do_action( 'ghostpool_end_content_wrapper' ); ?> <div class="gp-clear"></div> </div> <?php get_footer(); ?>
In reply to: Replies Created & Subscribed ForumsHi Robin,
I’ve placed the following code into my page template:
<?php add_filter ('bbp_before_has_replies_parse_args' , 'rew_filter_for_user' ) ; ?> <?php bbp_get_template_part( 'pagination', 'replies' ); ?> <?php bbp_get_template_part( 'loop', 'replies' ); ?> <?php bbp_get_template_part( 'pagination', 'replies' ); ?>
I also placed the revised code into my theme functions:
function rew_filter_for_user ($args) { //not sure if the next two lines are needed, so have commented out //global $current_user; //get_currentuserinfo(); $uid = bbp_get_current_user_id(); $args[‘author’] = $uid ; return $args ; }
However, doing this results in a blank page for the user.
In reply to: Replies Created & Subscribed ForumsHi Robin,
Thanks for the quick response. Unfortunately this function caused errors for me and ultimately caused the website to hang so I reverted. Let me know how I can better help you troubleshoot this with me.
Thanks again!
In reply to: Replies Created & Subscribed ForumsAny ideas? I keep scratching my head on this one. The code couldn’t be more clear to pull all data from the current user but it seems to ignore it..
Any help at all would be greatly appreciated. Thanks!
Hi Robin,
It just ignores the current user field and says “This user is not currently subscribed to any forums.”
See result here: https://obeii.com/discussions-subscriptions/
Hi Robin, Oddly enough the Subscribed forums is the only chunk that has issues with this setup. It ignores the current user with the below code. See result at https://obeii.com/discussions-subscriptions/
<?php do_action( 'bbp_template_before_user_subscriptions' ); ?> <?php if ( bbp_is_subscriptions_active() ) : ?> <?php if ( bbp_is_user_home() || current_user_can( 'edit_users' ) ) : ?> <div id="bbp-user-subscriptions" class="bbp-user-subscriptions"> <h2 class="entry-title"><?php _e( 'Subscribed Forums', 'bbpress' ); ?></h2> <div class="bbp-user-section"> <?php $user_id = get_current_user_id() ; ?> <?php if ( bbp_get_user_forum_subscriptions($user_id) ) : ?> <?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> <?php endif; ?> <?php endif; ?> <?php do_action( 'bbp_template_after_user_subscriptions' ); ?>
Amazing. It worked! Thank you so much.
In reply to: “Already Installed.”if i change it back it goes back to normal
In reply to: “Already Installed.”i updated the .htaccess file to this http://pastebin.ca/582386 and now i have the “Internal Server Error” everywhere http://www.bqtrademark.com/
In reply to: “Already Installed.”does anyone know how to make macs show hidden files? i save a .htaccess file and it disappears
In reply to: “Already Installed.”nope. i installed the bbpress already, it’s just that it is corrupting the links for some reason. for example a link such as http://bqtrademark.com/bbpress/topic/your-first-topic/?replies=1 goes straight to http://bqtrademark.com/
In reply to: “Already Installed.”In reply to: “Already Installed.”well how can i send it when my computer automatically hides it on download?
In reply to: “Already Installed.”yep. in my main directory. want me to send that?
In reply to: “Already Installed.”the .htaccess file isnt in the main folder and i try to create it and my computer automatically hides it. here is what the contents are:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /bbpress/
RewriteRule ^forum/(.+)/page/([0-9]+)$ /bbpress/forum.php?id=$1&page=$2 [L,QSA]
RewriteRule ^forum/(.+)/?$ /bbpress/forum.php?id=$1 [L,QSA]
RewriteRule ^topic/(.+)/page/([0-9]+)$ /bbpress/topic.php?id=$1&page=$2 [L,QSA]
RewriteRule ^topic/(.+)/?$ /bbpress/topic.php?id=$1 [L,QSA]
RewriteRule ^tags/(.+)/page/([0-9]+)$ /bbpress/tags.php?tag=$1&page=$2 [L,QSA]
RewriteRule ^tags/(.+)/?$ /bbpress/tags.php?tag=$1 [L,QSA]
RewriteRule ^tags/?$ /bbpress/tags.php [L,QSA]
RewriteRule ^profile/(.+)/page/([0-9]+)$ /bbpress/profile.php?id=$1&page=$2 [L,QSA]
RewriteRule ^profile/(.+)/([a-z-]+)$ /bbpress/profile.php?id=$1&tab=$2 [L,QSA]
RewriteRule ^profile/(.+)/([a-z-]+)/page/([0-9]+)$ /bbpress/profile.php?id=$1&tab=$2&page=$3 [L,QSA]
RewriteRule ^profile/(.+)/?$ /bbpress/profile.php?id=$1 [L,QSA]
RewriteRule ^view/([a-z-]+)/page/([0-9]+)$ /bbpress/view.php?view=$1&page=$2 [L,QSA]
RewriteRule ^view/([a-z-]+)$ /bbpress/view.php?view=$1 [L,QSA]
RewriteRule ^rss/$ /bbpress/rss.php [L,QSA]
RewriteRule ^rss/forum/([0-9]+)$ /bbpress/rss.php?forum=$1 [L,QSA]
RewriteRule ^rss/topic/([0-9]+)$ /bbpress/rss.php?topic=$1 [L,QSA]
RewriteRule ^rss/tags/([a-z-]+)$ /bbpress/rss.php?tag=$1 [L,QSA]
RewriteRule ^rss/profile/([0-9]+)$ /bbpress/rss.php?profile=$1 [L,QSA]
</IfModule>
In reply to: “Already Installed.”ok wat files were u needing to look at and where can i find them?
In reply to: “Already Installed.”i was going to send you information and files you needed.
In reply to: “Already Installed.”do you have an email or something that we can discuss this over?
In reply to: “Already Installed.”yeah i read that but what seems to be the problem is that some links forget the /bbpress/ and it ends up broken. other links do it fine.
In reply to: “Already Installed.”that helped for the most part, but now the problem seems to exsist that the links are still broken http://www.bqtrademark.com/bbpress/