Search Results for 'code'
-
AuthorSearch Results
-
February 4, 2020 at 5:15 pm #208474
Chuckie
ParticipantAccording to the trac it states:
Add
bbp-has-subforumsif forum has subforumsWhy am I not seeing this class present in the latest version of bbPress 2.6.4?
February 4, 2020 at 4:37 pm #208472Chuckie
ParticipantI saw this discussion:
It implied it was fixed in bbpress 2.1:
https://bbpress.trac.wordpress.org/ticket/1803
But I don’t get it.
This is a sub forum with child forums:
<a class="bbp-forum-title" href="https://www.publictalksoftware.co.uk/support-forums/forum/meeting-schedule-assistant/midweek-editor/">Midweek Editor</a>This is a forum with no child forums:
<a class="bbp-forum-title" href="https://www.publictalksoftware.co.uk/support-forums/forum/meeting-schedule-assistant/assignments-editor/">Assignments Editor</a>As you can see, the code is exactly the same. I understood from the associated discussion that the forum with child forums would have a additional class specified so that we could use pseudo before / after to add a symbol to indicate it is a forum with sub forums.
Or do I have to go about this differently?
I am using bbp style pack.
Thanks for shedding any light on this.
February 4, 2020 at 4:02 pm #208469In reply to: Why can’t I see my list of sub forums?
Chuckie
ParticipantI found some links about this with custom code but I don’t know how reliable that is because someone spoke about getting a white screen.
I think I would be happy just to have some kind of symbol next to the forum to indicate it has sub-forums. That would be less code requirement and might be able to be part of bbp style pack as an option?
February 4, 2020 at 3:12 pm #208467In reply to: Headings in forum are to long
Robin W
Moderatortry
.bbp-header { font-size : 10px ; }February 4, 2020 at 5:55 am #208452In reply to: sub topics not showing
Oxibug
ParticipantHey Guyes,
This issue because you are using this function [bbp_list_forums] in [loop-single-forum.php] with old (2.5.0) default args array in your active theme.
You must use [bbp_get_forum_id()] in function’s args, So try to find this function inside the active theme and change the value of the [forum_id] argument.
bbp_list_forums( array( 'before' => '<ul class="bbp-forums-list">', 'after' => '</ul>', 'link_before' => '<li class="bbp-forum">', 'link_after' => '</li>', 'count_before' => ' (', 'count_after' => ')', 'count_sep' => ', ', 'sep' => '', 'forum_id' => bbp_get_forum_id(), /* Fix for bbPv2.6.3 */ 'show_topic_count' => true, 'show_reply_count' => true ) );Hope it helps.
February 4, 2020 at 5:45 am #208451Topic: Undefined variable topic_id since bbPress 2.6.4
in forum TroubleshootingOxibug
ParticipantHey Guys,
Since bbPress v2.6.4 undefined variable message appears in both admin and frontend pagesNotice: Undefined variable: topic_id in [PATH]\wp-content\plugins\bbpress\includes\replies\template.php on line 456 Notice: Undefined variable: topic_id in [PATH]\wp-content\plugins\bbpress\includes\replies\template.php on line 461 Notice: Undefined variable: topic_id in [PATH]\wp-content\plugins\bbpress\includes\replies\template.php on line 467I found variable [topic_id] inside two if statements in function [bbp_get_reply_url] so I think that you should move the variable definition in the function scope not inside the if.
If you google that [undefined variable: topic_id replies\template.php] you will find that a lot of online forums using bbPress generate that error in the front-end pages.
P.S. some people taking about BuddyPress but I think it should be fixed in the bbPress functions.
Thanks
February 4, 2020 at 2:05 am #208444In reply to: sub topics not showing
haddly
Participant@robin-w
The reason that it is dequeued is that it was built that way by the software company that built our theme. This, I assume, was so that the forum would look like the rest of our site.
My issue, by adding the($args)arguments (to that snippet of code) and by removing that one line of CSS has now resolved this issue completely.
Thank you!February 3, 2020 at 4:48 pm #208442In reply to: Error while attempting to migrate from phpbb
1ef501b557
Blockedyou can use this code :
*/
class phpBB extends BBP_Converter_Base {/**
* Main Constructor
*
*/
public function __construct() {
parent::__construct();
}/**
* Sets up the field mappings
*/
public function setup_globals() {// Setup smiley URL & path
$this->bbcode_parser_properties = array(
‘smiley_url’ => false,
‘smiley_dir’ => false
);/** Forum Section *****************************************************/
// Old forum id (Stored in postmeta)
$this->field_map[] = array(
‘from_tablename’ => ‘forums’,
‘from_fieldname’ => ‘forum_id’,
‘to_type’ => ‘forum’,
‘to_fieldname’ => ‘_bbp_old_forum_id’
);// Forum parent id (If no parent, then 0, Stored in postmeta)
$this->field_map[] = array(
‘from_tablename’ => ‘forums’,
‘from_fieldname’ => ‘parent_id’,
‘to_type’ => ‘forum’,
‘to_fieldname’ => ‘_bbp_old_forum_parent_id’
);// Forum topic count (Stored in postmeta)
$this->field_map[] = array(
‘from_tablename’ => ‘forums’,
‘from_fieldname’ => ‘forum_topics’,
‘to_type’ => ‘forum’,
‘to_fieldname’ => ‘_bbp_topic_count’
);February 3, 2020 at 8:52 am #208435In reply to: sub topics not showing
haddly
ParticipantI have it dequeued in my functions.php file:
wp_dequeue_style( 'bbp-default' );February 3, 2020 at 5:07 am #208428In reply to: sub topics not showing
haddly
Participant@robin-w, @hydrogriff:
Hi, for me, the CSS styling issue is definitely a theme problem. In my styles.css file I have additional CSS for the styling of BBpress forum.
#bbpress-forums .bbp-forums-list li {font-size: 11px;}
I simply removed this line (font-size) from my style sheet and the standard BBPress kicked in.February 3, 2020 at 4:55 am #208423In reply to: sub topics not showing
hydrogriff
ParticipantRegarding the first code, you are right. This dequeues bbPress related style-sheets for most of the users who don’t visit forum page.
The second code highlights the lead topic, like it does on this forum. I used the code from the codex.
February 2, 2020 at 12:07 pm #208415In reply to: Topics are not shown in forum overview
chickencurry
ParticipantDear Robin,
thanks for coming up with a solution but this is not working for me. Because of two reasons, if I create a page for every forum (and subforum I am using), I don’t have real forum overview anymore.
The second reason is, I am using BuddyPress, where people can create facebook like groups. Those groups will get there own forum, which won’t appear on the site if I do it this way.
So it looks like I have to do some tweaks to the code that adds topic title to the output. Honestly it’s really weird that bbPress is behaving like this. I’ve never seen a forum that doesn’t show a titles on the front page.
February 2, 2020 at 11:32 am #208414In reply to: Topics are not shown in forum overview
Robin W
Moderatorok it is showing what I would expect.
topics are shown only when you go into each forum which is standard bbpress behavior.
If you would like all the forums listed with titles, then create a WordPress page for your firums and put a list of forums in it as shortcode
[bbp-single-forum id=$forum_id] – Display a single forums topics. eg. [bbp-single-forum id=32]
so for instance out this on a page
[bbp-single-forum id=32]
[bbp-single-forum id=33]
[bbp-single-forum id=34].
February 2, 2020 at 5:21 am #208412In reply to: How can I change the title of the main forum?
Robin W
Moderatorthis is theme specific issue, so could be many things.
you could try
item 3 method 2, that might force your theme to use a page name
February 1, 2020 at 1:41 pm #208406In reply to: sub topics not showing
Robin W
Moderatorand this one tends to suggest that your theme or anther plugin is doing stuff with the replies side of bbpress
//Lead Topic Enable function custom_bbp_show_lead_topic( $show_lead ) { $show_lead[] = 'true'; return $show_lead; } add_filter('bbp_show_lead_topic', 'custom_bbp_show_lead_topic' );February 1, 2020 at 1:40 pm #208405In reply to: sub topics not showing
Robin W
Moderatorlooked in pastebin.
I’m not sure what this function is there for, except possibly to speed up site display if they have not accessed the forum part ?
function dequeue_bbpress_style() { if ( class_exists('bbPress') ) { if ( ! is_bbpress() ) { wp_dequeue_style('bbp-default'); wp_dequeue_style( 'bbp_private_replies_style'); wp_dequeue_script('bbpress-editor'); } } } add_action( 'wp_enqueue_scripts', 'dequeue_bbpress_style', 99 );it does tend to suggest that you have bbp_private_replies enabled ???
February 1, 2020 at 1:34 pm #208404In reply to: Edit the bbPress login widget
Robin W
ModeratorThe best solution is to clone this widget and then amend.
so put this in your functions.php
It creates a duplicate login widget, but you’ll find it in dashboard>appearance>widgets called
(mat) login Widget. You can then add your code to this versionfunction register_mat_login_widget() { register_widget("MAT_Login_Widget"); } add_action('widgets_init', 'register_mat_login_widget'); class MAT_Login_Widget extends WP_Widget { /** * MAT Login Widget amended * */ public function __construct() { $widget_ops = apply_filters( 'mat_login_widget_options', array( 'classname' => 'mat_widget_login', 'description' => esc_html__( 'A simple login form with optional links to sign-up and lost password pages.', 'bbpress' ), 'customize_selective_refresh' => true ) ); parent::__construct( false, esc_html__( '(mat) Login Widget', 'bbpress' ), $widget_ops ); } /** * Register the widget * * */ public static function register_widget() { register_widget( 'MAT_Login_Widget' ); } /** * Displays the output, the login form * * * @param array $args Arguments * @param array $instance Instance */ public function widget( $args = array(), $instance = array() ) { // Get widget settings $settings = $this->parse_settings( $instance ); // Typical WordPress filter $settings['title'] = apply_filters( 'widget_title', $settings['title'], $instance, $this->id_base ); // mat filters $settings['title'] = apply_filters( 'mat_login_widget_title', $settings['title'], $instance, $this->id_base ); $settings['register'] = apply_filters( 'mat_login_widget_register', $settings['register'], $instance, $this->id_base ); $settings['lostpass'] = apply_filters( 'mat_login_widget_lostpass', $settings['lostpass'], $instance, $this->id_base ); echo $args['before_widget']; if ( ! empty( $settings['title'] ) ) { echo $args['before_title'] . $settings['title'] . $args['after_title']; } if ( ! is_user_logged_in() ) : ?> <form method="post" action="<?php bbp_wp_login_action( array( 'context' => 'login_post' ) ); ?>" class="bbp-login-form"> <fieldset class="bbp-form"> <legend><?php esc_html_e( 'Log In', 'bbpress' ); ?></legend> <div class="bbp-username"> <label for="user_login"><?php esc_html_e( 'Username', 'bbpress' ); ?>: </label> <input type="text" name="log" value="<?php bbp_sanitize_val( 'user_login', 'text' ); ?>" size="20" maxlength="100" id="user_login" autocomplete="off" /> </div> <div class="bbp-password"> <label for="user_pass"><?php esc_html_e( 'Password', 'bbpress' ); ?>: </label> <input type="password" name="pwd" value="<?php bbp_sanitize_val( 'user_pass', 'password' ); ?>" size="20" id="user_pass" autocomplete="off" /> </div> <div class="bbp-remember-me"> <input type="checkbox" name="rememberme" value="forever" <?php checked( bbp_get_sanitize_val( 'rememberme', 'checkbox' ) ); ?> id="rememberme" /> <label for="rememberme"><?php esc_html_e( 'Keep me signed in', 'bbpress' ); ?></label> </div> <?php do_action( 'login_form' ); ?> <div class="bbp-submit-wrapper"> <button type="submit" name="user-submit" id="user-submit" class="button submit user-submit"><?php esc_html_e( 'Log In', 'bbpress' ); ?></button> <?php bbp_user_login_fields(); ?> </div> <?php if ( ! empty( $settings['register'] ) || ! empty( $settings['lostpass'] ) ) : ?> <div class="bbp-login-links"> <?php if ( ! empty( $settings['register'] ) ) : ?> <a href="<?php echo esc_url( $settings['register'] ); ?>" title="<?php esc_attr_e( 'Register', 'bbpress' ); ?>" class="bbp-register-link"><?php esc_html_e( 'Register', 'bbpress' ); ?></a> <?php endif; ?> <?php if ( ! empty( $settings['lostpass'] ) ) : ?> <a href="<?php echo esc_url( $settings['lostpass'] ); ?>" title="<?php esc_attr_e( 'Lost Password', 'bbpress' ); ?>" class="bbp-lostpass-link"><?php esc_html_e( 'Lost Password', 'bbpress' ); ?></a> <?php endif; ?> </div> <?php endif; ?> </fieldset> </form> <?php else : ?> <div class="bbp-logged-in"> <a href="<?php bbp_user_profile_url( bbp_get_current_user_id() ); ?>" class="submit user-submit"><?php echo get_avatar( bbp_get_current_user_id(), '40' ); ?></a> <h4><?php bbp_user_profile_link( bbp_get_current_user_id() ); ?></h4> <?php bbp_logout_link(); ?> </div> <?php endif; echo $args['after_widget']; } /** * Update the login widget options * * * @param array $new_instance The new instance options * @param array $old_instance The old instance options */ public function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags( $new_instance['title'] ); $instance['register'] = esc_url_raw( $new_instance['register'] ); $instance['lostpass'] = esc_url_raw( $new_instance['lostpass'] ); return $instance; } /** * Output the login widget options form * * * @param $instance Instance */ public function form( $instance = array() ) { // Get widget settings $settings = $this->parse_settings( $instance ); ?> <p> <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php esc_html_e( 'Title:', 'bbpress' ); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $settings['title'] ); ?>" /></label> </p> <p> <label for="<?php echo $this->get_field_id( 'register' ); ?>"><?php esc_html_e( 'Register URI:', 'bbpress' ); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'register' ); ?>" name="<?php echo $this->get_field_name( 'register' ); ?>" type="text" value="<?php echo esc_url( $settings['register'] ); ?>" /></label> </p> <p> <label for="<?php echo $this->get_field_id( 'lostpass' ); ?>"><?php esc_html_e( 'Lost Password URI:', 'bbpress' ); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'lostpass' ); ?>" name="<?php echo $this->get_field_name( 'lostpass' ); ?>" type="text" value="<?php echo esc_url( $settings['lostpass'] ); ?>" /></label> </p> <?php } /** * Merge the widget settings into defaults array. * * @since 2.3.0 bbPress (r4802) * * @param $instance Instance */ public function parse_settings( $instance = array() ) { return bbp_parse_args( $instance, array( 'title' => '', 'register' => '', 'lostpass' => '' ), 'login_widget_settings' ); } }February 1, 2020 at 7:23 am #208401In reply to: sub topics not showing
hydrogriff
ParticipantIf my post cannot be found, here are the custom functions I use – https://pastebin.com/n27s5S9s.
The only plugin related to bbPress I use is – bbPress Do Shortcode and WP-Avatar.Hope this helps.
February 1, 2020 at 7:12 am #208400In reply to: sub topics not showing
hydrogriff
Participant@robin-w, I typed a reply with plugin information and customization that I have used and submitted. The code format was messed. I am unable to find it or edit it. Guess it should’ve been caught in moderation or spam. Can you please check it? It should be of some help.
The subforum issue is fixed by adding
$args.But the other issues like missing stylesheet and missing replies for topics exist.
January 31, 2020 at 3:58 pm #208391In reply to: Edit the bbPress login widget
Robin W
Moderatorno, core code does not get changed in child themes
what did you change?
January 31, 2020 at 3:47 pm #208390In reply to: Edit the bbPress login widget
Matthias
ParticipantHi Robin,
this code works fine, thanks. I put it in functions.phpAfter this I changed some code in bbpress/includes/common/widgets.php
The changes work fine, but it only works when I change the core file.When I copy widgets.php into child theme it does not work.
Is there now way to put core code to child theme?Thanks
MatthiasJanuary 31, 2020 at 3:30 pm #208389In reply to: Edit the bbPress login widget
Robin W
Moderatoruntested, but try this
add_filter ('bbp_get_user_profile_link' , 'rew_get_user_name', 10 , 2) ; function rew_get_user_name ($user_link, $user_id ) { // Validate user id $user_id = bbp_get_user_id( $user_id ); if ( empty( $user_id ) ) { return false; } $user = get_userdata( $user_id ); $user_link = esc_html( $user->display_name ) ; // Filter & return return apply_filters( 'rew_get_user_name', $user_link, $user_id ); }Put this in your child theme’s function file – or use
January 31, 2020 at 3:20 pm #208388In reply to: Edit the bbPress login widget
Matthias
Participant<?php bbp_user_profile_link( bbp_get_current_user_id() ); ?>How can I change the code above, to show only the name, without the link to bbpress profile?
Thanks
MatthiasJanuary 31, 2020 at 3:11 am #208380samtime
ParticipantIs there any code in buddypress > notifications that we can copy over to bbpress > includes > extend > buddypress > notifications.php (or vice versa), to make bbPress notifications automatically dismiss like Private Message, Friend Request, and other BuddyPress notifications do?
If it’s not that straight forward, then is there a way to disable this style off bbPress notifications being sent to BuddyPress?
My users (and I) really love the notification feature, but just find it really time-consuming to have to dismiss these notifications manually.
Appreciate any help / advice,
SamJanuary 30, 2020 at 8:45 pm #208375In reply to: Users Can Post Bad HTML Content
samtime
ParticipantOkay, thanks. I think I might have thought it was a bit more scary than it really is.
As long as those attributes listed above only affect the design of the post, and not allow any sort of strange code to run.Here’s one of the posts from the user, looks like it’s just some funky formatting. Not too bad.

Oh, and the skills tab he’s talking about in the post is to do with the Youzer plugin for BuddyPress. I think it just allows him to put more text there than neccessary, but not weird code.

-
AuthorSearch Results

