Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 3,126 through 3,150 (of 32,517 total)
  • Author
    Search Results
  • #208496
    Chuckie
    Participant

    In an attempt to manually indicate that a given forum has sub forums I added the following to the forum description:

    Have you found a bug in the Midweek Editor? Or do you have a suggestion for a new feature? Then this is the forum to use. Sub forums: <a href="https://www.publictalksoftware.co.uk/support-forums/forum/meeting-schedule-assistant/midweek-editor/midweek-editor-styles/"><em>Custom Templates</em></a>, <a href="https://www.publictalksoftware.co.uk/support-forums/forum/meeting-schedule-assistant/midweek-editor/sample-midweek-editor-styles/"><em>Custom Templates – Samples</em></a>, <a href="https://www.publictalksoftware.co.uk/support-forums/forum/meeting-schedule-assistant/midweek-editor/monthly-workbook-information/"><em>Monthly Workbook Information</em></a>

    It works. The problem is if I add new lines into the description they get stripped.

    #208495
    dotplus
    Participant

    Hi Robin,

    If I put it in the CSS section of my theme it doesn’t work. Is there another place where I can put this code? Thanks!

    mvaneijgen
    Participant

    Sadly I had to publish my site with the old 2.5.x I’ve managed this by changing the version number of the plugin in bbpress.php and readme.txt to some insane version number which will never be hit in the near future.

    I would still love some pointers on how to implement the pagination of treaded replies, which works with the hack for 2.5.x version of bbpress.

    #208474
    Chuckie
    Participant

    According to the trac it states:

    Add bbp-has-subforums if forum has subforums

    Why am I not seeing this class present in the latest version of bbPress 2.6.4?

    Chuckie
    Participant

    I saw this discussion:

    a way to check for subforums

    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.

    #208469
    Chuckie
    Participant

    I 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?

    #208467
    Robin W
    Moderator

    try

    .bbp-header {
    font-size : 10px ;
    }
    #208452

    In reply to: sub topics not showing

    Oxibug
    Participant

    Hey 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.

    #208451
    Oxibug
    Participant

    Hey Guys,
    Since bbPress v2.6.4 undefined variable message appears in both admin and frontend pages

    Notice: 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 467

    I 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

    #208444

    In 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!

    #208442
    1ef501b557
    Blocked

    you 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’
    );

    #208435

    In reply to: sub topics not showing

    haddly
    Participant

    I have it dequeued in my functions.php file:
    wp_dequeue_style( 'bbp-default' );

    #208428

    In 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.

    #208423

    In reply to: sub topics not showing

    hydrogriff
    Participant

    Regarding 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.

    #208415
    chickencurry
    Participant

    Dear 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.

    #208414
    Robin W
    Moderator

    ok 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]

    .

    #208412
    Robin W
    Moderator

    this is theme specific issue, so could be many things.

    you could try

    Step by step guide to setting up a bbPress forum – Part 1

    item 3 method 2, that might force your theme to use a page name

    #208406

    In reply to: sub topics not showing

    Robin W
    Moderator

    and 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' );
    #208405

    In reply to: sub topics not showing

    Robin W
    Moderator

    looked 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 ???

    #208404
    Robin W
    Moderator

    The 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 version

    function 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' );
    	}
    }
    #208401

    In reply to: sub topics not showing

    hydrogriff
    Participant

    If 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.

    #208400

    In 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.

    #208391
    Robin W
    Moderator

    no, core code does not get changed in child themes

    what did you change?

    #208390
    Matthias
    Participant

    Hi Robin,
    this code works fine, thanks. I put it in functions.php

    After 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
    Matthias

    #208389
    Robin W
    Moderator

    untested, 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

    Code Snippets

Viewing 25 results - 3,126 through 3,150 (of 32,517 total)
Skip to toolbar