Search Results for 'code'
-
AuthorSearch Results
-
August 8, 2018 at 2:21 am #194261
In reply to: TinyMCE Error
Robin W
Moderatorthat error suggests that your theme Stockholm and file js/plugins.js is the problem.
So it initially looks like enabling tinymce within bbpress is calling the tinymce or other code within your theme – the bbpress code you are using just turns on the wordpress function.
to prove, try switching as a test to a default theme, such as twentyseventeen and see if the error goes away
August 3, 2018 at 10:27 am #194197In reply to: Adding content above forum – possible?
Robin W
Moderatoryou can do it by amending a template if you know how to do ftp
create a directory on your theme called ‘bbpress’
ie wp-content/themes/%your-theme-name%/bbpresswhere %your-theme-name% is the name of your theme
find
wp-content/plugins/bbpress/templates/default/bbpress/content-single-forum.php
Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
wp-content/themes/%your-theme-name%/bbpress/content-single-forum.php
bbPress will now use this template instead of the original
and you can amend thisso amend this template to read
<?php /** * Single Forum Content Part * * @package bbPress * @subpackage Theme */ ?> <div id="bbpress-forums"> <div id="forum-intro"> <?php if (bbp_get_forum_title() == 'technical' ) echo 'this is some content' ; ?> <?php if (bbp_get_forum_title() == 'leisure' ) echo 'this is some different content' ; ?> </div> <?php bbp_breadcrumb(); ?> <?php bbp_forum_subscription_link(); ?> <?php do_action( 'bbp_template_before_single_forum' ); ?> <?php if ( post_password_required() ) : ?> <?php bbp_get_template_part( 'form', 'protected' ); ?> <?php else : ?> <?php bbp_single_forum_description(); ?> <?php if ( bbp_has_forums() ) : ?> <?php bbp_get_template_part( 'loop', 'forums' ); ?> <?php endif; ?> <?php if ( !bbp_is_forum_category() && bbp_has_topics() ) : ?> <?php bbp_get_template_part( 'pagination', 'topics' ); ?> <?php bbp_get_template_part( 'loop', 'topics' ); ?> <?php bbp_get_template_part( 'pagination', 'topics' ); ?> <?php bbp_get_template_part( 'form', 'topic' ); ?> <?php elseif ( !bbp_is_forum_category() ) : ?> <?php bbp_get_template_part( 'feedback', 'no-topics' ); ?> <?php bbp_get_template_part( 'form', 'topic' ); ?> <?php endif; ?> <?php endif; ?> <?php do_action( 'bbp_template_after_single_forum' ); ?> </div>You will see I have added lines to change the content per forum
so the line
<?php if (bbp_get_forum_title() == 'technical' ) echo 'this is some content' ; ?>says that if the forum is called ‘technical’ then write ‘this is some content’ so you simply need to change the forum name and what you want that forum content to be.
You can add additional lines for each forum, my example has two forums ‘technical’ and ‘leisure’
August 3, 2018 at 4:02 am #194191In reply to: Adding content above forum – possible?
robineero
ParticipantI am thinking of soving this idea by creating new page for every forum page with shortcodes and by using redirection plugin to redirect original forum link to customised one.
Does it make sense?
August 1, 2018 at 5:54 pm #194176Topic: TinyMCE Error
in forum Troubleshootingross445
ParticipantI’m trying to enable Visual Editor for my forum.
I’m using this code – https://codex.bbpress.org/enable-visual-editor/However, it doesn’t work for me and i see this errors:
jquery.js?ver=1.12.4:2 Uncaught Error: no such method 'instance' for autocomplete widget instance ... tinymce.min.js?ver=4711-20180425:2 Uncaught TypeError: Cannot read property 'refreshContentEditable' of undefinedMy bbPress version is 2.5.14
Wordpress – 4.9.7Tried to disable all plugins, didn’t help..
July 25, 2018 at 2:30 pm #194074In reply to: Anonymous posting not working
Robin W
ModeratorI have a page with my topics on and the slug is ‘discussion.
are you using a shortcode on this page?
July 24, 2018 at 3:27 am #194057In reply to: Replies Created & Subscribed Forums
Robin W
Moderatorok, so this works on my test site
in discussions-replies
<?php add_filter ('bbp_before_has_replies_parse_args' , 'rew_filter_for_user' ) ?> <?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; ?>and in functions
function rew_filter_for_user ($args) { $uid = bbp_get_current_user_id(); $args['author'] = $uid ; return $args ; }let me know if it works on yours
July 23, 2018 at 7:25 pm #194055In reply to: Replies Created & Subscribed Forums
quigley05
Participant1. 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.
July 23, 2018 at 10:34 am #194053In reply to: Replies Created & Subscribed Forums
quigley05
ParticipantHi 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.
July 23, 2018 at 9:06 am #194051In reply to: Replies Created & Subscribed Forums
quigley05
ParticipantHi 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(); ?>July 22, 2018 at 1:56 pm #194020In reply to: Move forum information to the bottom
Robin W
ModeratorIf you know how to use ftp, then
create a directory on your theme called ‘bbpress’
ie wp-content/themes/%your-theme-name%/bbpresswhere %your-theme-name% is the name of your theme
Then on your pc create a text file called content-single-forum.php and put the following contents into it
<?php /** * Single Forum Content Part * * @package bbPress * @subpackage Theme */ ?> <div id="bbpress-forums"> <?php bbp_breadcrumb(); ?> <?php bbp_forum_subscription_link(); ?> <?php do_action( 'bbp_template_before_single_forum' ); ?> <?php if ( post_password_required() ) : ?> <?php bbp_get_template_part( 'form', 'protected' ); ?> <?php else : ?> <?php if ( bbp_has_forums() ) : ?> <?php bbp_get_template_part( 'loop', 'forums' ); ?> <?php endif; ?> <?php if ( !bbp_is_forum_category() && bbp_has_topics() ) : ?> <?php bbp_get_template_part( 'pagination', 'topics' ); ?> <?php bbp_get_template_part( 'loop', 'topics' ); ?> <?php bbp_get_template_part( 'pagination', 'topics' ); ?> <?php bbp_single_forum_description(); ?> <?php bbp_get_template_part( 'form', 'topic' ); ?> <?php elseif ( !bbp_is_forum_category() ) : ?> <?php bbp_get_template_part( 'feedback', 'no-topics' ); ?> <?php bbp_get_template_part( 'form', 'topic' ); ?> <?php endif; ?> <?php endif; ?> <?php do_action( 'bbp_template_after_single_forum' ); ?> </div>FTP this file to the directory you created above, so you end up with
wp-content/themes/%your-theme-name%/bbpress/content-single-forum.php
bbpress will then use this file.
July 22, 2018 at 7:50 am #194011Topic: Odd slow-query
in forum TroubleshootingIndrekkor
ParticipantHello,
Been optimizing my bbPress install, have managed to make it blazing fast with switching to MariaDB and configuring indexes.
Now i got rid of the usual slow-queries from my slow-query.log now something appeared that i haven’t seen before.
Is this a core bbPress query?
SELECT wp_posts.ID FROM wp_posts INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) WHERE 1=1 AND wp_posts.post_parent IN (LONG LIST OF IDs) AND ( ( wp_postmeta.meta_key = '_bbp_forum_id' AND CAST(wp_postmeta.meta_value AS SIGNED) NOT IN ('11212874','22','1778309','2273738') ) ) AND wp_posts.post_type = 'reply' AND ((wp_posts.post_status = 'publish')) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC, wp_posts.ID DESC LIMIT 0, 1;July 21, 2018 at 8:41 am #193998In reply to: Replies Created & Subscribed Forums
quigley05
ParticipantJuly 21, 2018 at 8:06 am #193994Topic: Migration from Invision Power Board 4
in forum Installationdinsl
ParticipantHello there!
Is it possible to migrate from IPB 4 to bbpress? From the importer i see only the option IPB 3 and doesn´t work as the IPB 4 database is different.
I saw also one thread https://codex.bbpress.org/getting-started/importing-data/import-forums/invision/ but not for the IPB 4x version. Can somebody help me please?
Thanks in advance
July 20, 2018 at 7:58 am #193974In reply to: New Topic Button ?
Robin W
Moderatorsorry, best I can do – you could always crack the plugin open and work out where the code is that does this
July 18, 2018 at 5:46 pm #193966In reply to: Autosuggest Userlist For Mentions
jameshogan03
ParticipantAutosuggest has never worked in my buddypress/bbpress group forums. Anyone with tips could really help me out. There is an old bit of code floating around which doesn’t seem to work anymore. Help appreciated!
July 15, 2018 at 6:12 am #193921Topic: Display of forum path
in forum Requests & Feedbackjonasgeschke
ParticipantHi,
in order to better use the single-forum shortcode, is it possible not to display the forum path (“Login => Forums =>”)?
Thanks for your help and best regards,
JonasJuly 14, 2018 at 1:09 pm #193919In reply to: Cannot Create New Forum
Robin W
Moderatorok, the best I can suggest is that you create a test site where you can try a different theme to eliminate
July 14, 2018 at 12:36 pm #193918In reply to: Cannot Create New Forum
hislordshipuk
ParticipantOk I removed the added code as detailed above. It made no difference. All buttons and free text are no operable in the ‘Add new’ of Forums.
July 14, 2018 at 11:56 am #193917In reply to: Replies Created & Subscribed Forums
quigley05
ParticipantHi 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(); ?>July 14, 2018 at 8:04 am #193916In reply to: Cannot Create New Forum
hislordshipuk
ParticipantI have gone through the plug-in checks and still found all buttons are disabled. As for changing themes, I don’t wish to do this as when I revert back to my current theme the formatting will be completely messed up which will take hours of work to put right.
One thought – I did add a piece of code to the theme to have the forum response placed in a sensible order. Could this be the culprit? It was added the Themes funcion.php.
function my_custom_display_topic_index_query () {
$args[‘orderby’] = ‘date’;
$args[‘order’] = ‘DESC’;return $args;
}
add_filter(‘bbp_before_has_topics_parse_args’, ‘my_custom_display_topic_index_query’ );July 13, 2018 at 6:58 pm #193912In reply to: Replies Created & Subscribed Forums
quigley05
ParticipantHi 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.
July 13, 2018 at 5:16 pm #193910In reply to: Replies Created & Subscribed Forums
Robin W
Moderatorok, quick debug of the function, so this won’t error (and will hopefully work!)
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 ; }July 13, 2018 at 12:45 pm #193903In reply to: Replies Created & Subscribed Forums
Robin W
Moderatoruntested but try
<?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' ); ?>and in your functions file put
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}
loop-replies from memory has the ‘no relies’ part in it, so you shouldn’t need the ‘if’ statement
I’m really pushed at the moment hence no time to test, but if it doesn’t work come back, and if I get time I’ll load it to my test site and debugJuly 13, 2018 at 11:10 am #193900In reply to: Replies Created & Subscribed Forums
quigley05
ParticipantAny 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!
July 12, 2018 at 4:40 pm #193881In reply to: Change the number of forums per page
Robin W
Moderatoradd this to your functions file
add_filter ('bbp_before_has_forums_parse_args', 'rew_number_of_forums') ; function rew_number_of_forums ($args) { $args['posts_per_page'] = 50 ; return $args ; }I’ll add it to my style pack plugin shortly if you don’t know how to do that
-
AuthorSearch Results