Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 3,001 through 3,025 (of 32,517 total)
  • Author
    Search Results
  • thetoolman123
    Participant

    Hi there,

    Is there a simple PHP code snippet that will display the number of new posts/threads a user has after the logo in? I’m looking to add a simple text displaying these figures after a user logs in?

    If there is a snippet available, that would be great!

    Thanks

    #209769
    Robin W
    Moderator

    Put this in your child theme’s function file – or use

    Code Snippets

    add_filter(  'ngettext',  'rew_bbpress_translate' , 20 , 5 );
    
    function rew_bbpress_translate( $translation, $single, $plural, $number, $domain ) {
    	if ($domain == 'bbpress') {
        if ($translation == 'Viewing %1$s topic') $translation = 'Viewing %1$s messages' ;
    	if ($translation == 'Viewing %1$s topics') $translation = 'Viewing %1$s messages' ;
    	if ($translation == 'Viewing topic %2$s (of %4$s total)') $translation = 'Viewing message %2$s (of %4$s total)' ;
    	if ($translation == 'Viewing %1$s topics - %2$s through %3$s (of %4$s total)') $translation = 'Viewing %1$s messages - %2$s through %3$s (of %4$s total)' ;
    	}
    return apply_filters ('rew_bbpress_translate', $translation, $single, $plural, $number, $domain ) ;
    }
    #209762
    thetoolman123
    Participant

    Thank you, I have created a new page and a new template and now added in the shortcode via PHP:

    <?php
    /* Template Name: HOMEPAGE */
    /**
     * The template for displaying 404 pages (not found)
     *
     * @package olympus
     */
    
    get_header(); ?>
    <?php echo do_shortcode("[bbp-forum-index]"); ?>

    Thanks again

    #209761
    Robin W
    Moderator

    create a homepage called anything you like.

    then put this shortcode in it

    [bbp-forum-index]

    #209756

    In reply to: Which widget is this

    Robin W
    Moderator

    @sirlouen – thanks, I’ve incorporated all those changes in 4.4.2

    Let me know if I missed anything

    and thanks so much for helping me improve my plugin – as a one man developer/tester it’s hard to spot where code can be improved !

    #209749

    In reply to: Which widget is this

    Manuel Camargo
    Participant

    Also, I’m not sure if this is intended but similarly to the other elements this last two don’t have their “show-icon” class with

    font-family: 'dashicons';
    content: '\f155';

    and

    font-family: 'dashicons';
    content: '\f147';

    But could be included with this CSS code (I’ve included in my custom anyway but just to get the same format)

    .sidebar .bsp-st-info-list li.topic-favorite:before {
    	font-family: 'dashicons';
        content: '\f155';
    }
    .sidebar .bsp-st-info-list li.topic-subscribe:before, .sidebar .bsp-sf-info-list li.forum-subscribe:before {
        font-family: 'dashicons';
    	content: '\f147';
    }

    About the other topic here the two snippets (I’m copying a little in the top and in the bottom:

    Around 555

    <?php if ( !empty( $time_since  ) ) : ?>
                            <li class="topic-freshness-time <?php echo $show_iconla ; ?> ">
                            <?php
                                    echo $settings['last_activity'];
                                    echo $time_since ;
                            ?></li>
                    <?php endif; ?>
                    <?php if ( is_user_logged_in() ) : ?>
                            <?php $_topic_id = bbp_is_reply_edit() ? bbp_get_reply_topic_id() : $topic_id; ?>
                            
                            <li class="topic-subscribe"><?php bbp_topic_subscription_link( array( 'before' => '', 'topic_id' => $_topic_id ) ); ?></li>
                            <li class="topic-favorite"><?php bbp_topic_favorite_link( array( 'topic_id' => $_topic_id ) ); ?></li>
                            
                    <?php endif; ?>
                    <?php
                    echo '</ul>' ; // end of '<ul class="bsp-st-info-list">;
                    echo '</div>'; // end of '<div class="bsp-st-title-container">';
            }

    Around 725

    <li class="topic-freshness-time <?php echo $show_iconla ; ?> ">
                            <?php
                                    echo $settings['last_activity'];
                                    echo $time_since ;
                            ?></li>
    
                    <?php endif; ?>
                    <?php if ( is_user_logged_in() ) : ?>
                            <li class="forum-subscribe">
                                    <?php 
                                            bbp_forum_subscription_link( array( 'forum_id' => $forum_id ) ); 
                            ?></li>
                    <?php endif; ?>
                    <?php 
                            echo '</ul>' ;
                            echo '</div>' ; // end of <div class="bsp-st-title-container">
            }
    #209748

    In reply to: Which widget is this

    Robin W
    Moderator

    sorry I’m really busy at the moment – it would really help me if you could paste revised code 🙂

    #209747

    In reply to: Which widget is this

    Manuel Camargo
    Participant

    Another tweak (both for st and sf)
    You could move from 556 to 562

    over the 555:
    echo '</ul>' ; //end of '<ul class="bsp-st-info-list">'; ?>

    To have all “li” in the same “ul”

    (Same in line 725)

    Remember to close some of the ?> lingering afterwards 🙂

    #209745

    In reply to: Which widget is this

    Manuel Camargo
    Participant

    484 and 652

    echo '<div class="widget bsp-st-title-container">';

    echo '<div class="widget bsp-sf-title-container">';

    #209720
    Chuckie
    Participant

    Great! I also use Code Snippets for some things too. Well done.

    #209719
    ericsims
    Participant

    Hallelujah, it worked! Thank you so much!! I ended up using the Code Snippets plugin because I’m not super comfortable with php, child themes, etc.

    #209717
    007elt
    Participant

    Hi Annie, Thanks so much for your help and taking the time to write!!! I am going to try this. I also am not keen on adding any more plugins..I have too many already as it is. I am not a developer and don’t write code so it is really great when someone shares information like this.
    All the best!

    #209716
    AnnieBVT
    Participant

    Hi 007elt, After much searching and some testing I found a solution that converts the HTML version of the text editor into a basic TinyMCE editor. However, you must have FTP or cPanel access to the backend files in order to add code to your theme/child theme’s functions.php file. Otherwise a plugin is the only other resort, and I prefer not to load up on plugins.

    If you have access, add these two code snippets. The first one will convert the text editor to a basic TinyMCE, and the second will strip out html code from content pasted into the text editor that was copied from another web page.

    function bbp_enable_visual_editor( $args = array() ) {
    $args[‘tinymce’] = true;
    $args[‘quicktags’] = false;
    return $args;
    }
    add_filter( ‘bbp_after_get_the_content_parse_args’, ‘bbp_enable_visual_editor’ );

    function bbp_tinymce_paste_plain_text( $plugins = array() ) {
    $plugins[] = ‘paste’;
    return $plugins;
    }
    add_filter( ‘bbp_get_tiny_mce_plugins’, ‘bbp_tinymce_paste_plain_text’ );

    And, if you want to get rid of the word “Private” that displays in the title of a forum that is set to private, put this code in your child theme’s functions.php file also:

    function remove_private_prefix_from_title( $title ) {
    return ‘%s’;
    }
    add_filter( ‘private_title_format’, ‘remove_private_prefix_from_title’ );

    #209712
    Robin W
    Moderator

    or use

    Code Snippets

    #209706
    Robin W
    Moderator

    the problem is that there are dozens and dozens of membership plugins, each with its own bespoke code that it uses when members leave. Some will have a hook that a coder can link to, but it is specific to that plugin, some have no hook, so it can only be a manual process, or one linked to a daily routine.

    Without knowing which membership plugin and knowing if it has a hook, it is impossible to answer this question.

    in all cases it will be ‘custom code’ whether written by you or someone else 🙂

    #209705
    mrmillercoach
    Participant

    I was wondering whether anyone had come up with a solution. This is not an unusual problem.

    I did find this plugin https://en-gb.wordpress.org/plugins/bbp-toolkit/ which I will try.

    I really do not want to generate custom code.

    #209704
    Robin W
    Moderator

    @mrmillercoach – do you need help for you to code it, or someone to code it for you ?

    robertstaddon
    Participant

    This typo still exists, which continues to publicly display Private or Scheduled sticky posts in the latest version of bbPress 2.6.4.

    It can be easily fixed by correcting line 404 of the “bbpress/includes/topics/template.php” file to set $sticky_query[‘perm’] instead of $sticky_query[‘post_status’].

    This is the correct code that works:

    
    // Allowed statuses, or lean on the 'perm' argument (probably 'readable')
    $sticky_query['perm'] = bbp_get_view_all( 'edit_others_topics' )			? 
      $r['post_status']
      : $r['perm'];
    
    #209661
    Robin W
    Moderator
    #209656
    Robin W
    Moderator

    Put this in your child theme’s function file – or use

    Code Snippets

    
    add_filter(  'gettext',  'rew_bbpress_translate', 20 , 3  );
    add_filter(  'ngettext',  'rew_bbpress_translate' , 20 , 3 );
    
    function rew_bbpress_translate( $translated, $text, $domain ) {
    	if ($domain == 'bbpress') {
         $words = array(
                            
                            '%s day' => '%s jour',
    						'%s days' => '%s jours',
    						'Last Post' => 'Dernier message',
                 );
         $translated = str_replace(  array_keys($words),  $words,  $translated );
    	}
         return $translated;
    }
    oibc
    Participant

    @jack_tyler

    @wpweaver

    I have the same and other problem.
    would you pls help me?

    I am wondering if is there any existing feature on the BBPress to have a login, register, forgot password, email confirmation only in front-end? I know that there are [bbp-login], [bbp-register], and [bbp-lost-pass] short-codes that you can place in the page so that it will display on the front-end but the issue is when user enters an incorrect password or account, it will redirect to admin login. What I wanted is to stay always in the front-end. Or do you have any suggestion what plugin I can use that and compatible?

    I like plugin “Weaver for bbPress” .
    but some problems happens after I installed the plugin “Weaver for bbPress” .
    May I ask?
    1.It is OK that a new user(registered) logged in from frontend,and hide the wp-admin. But after logout ,”Sorry, you don’t have permission to view this profile.”shown on http://mysite.com/forums/users/oi/subscriptions/?loggedout=true
    2. It is OK that admin logged in from frontend. But after logout ,”Sorry, you don’t have permission to view this profile.”shown on http://mysite.com /forums/users/oi/subscriptions/?loggedout=true .
    3. when user enters an incorrect password or account, it will redirect to admin login.

    What I wanted is to stay always in the front-end. Or do you have any suggestion what plugin I can use that and compatible?

    winchester234
    Participant

    Hi,

    My issue is that when I add the forum root at the forum settings, the page displays the following error in the header and the footer of the page:

    Notice: Undefined property: WP_Post_Type::$post_type in /home1/smilingsun/public_html/vanlifemagazine.co/wp-content/plugins/td-composer/includes/shortcodes/vc_row.php on line 415

    The page is at:

    Vanlife Community Forum

    The theme I’m currently using is Newspaper by TagDiv.

    Many thanks,
    Francesco

    #209626
    levangelista2013
    Participant

    Same problem: not possibile to replay to a replay. I get a message saying (I translate from Italian) ‘you don’t have the permissions. the variable does not match’. As I am unable to deal with the code, I will use a different plugin.

    drjohndimi
    Participant

    I have searched online for days and I have not found how to make profile fields mandatory/required by users so that if they don’t complete those fields they cannot use the forum.
    I’m sure there are code ninjas out there that have done this in their sleep or just know how to do it, so can you please the code and where to find/replace them?
    Thank you so much.
    JD
    – If I have my way, I’d rather not have yet another plugin installed for this. Thanks.

    #209609
    adishor22
    Participant

    I have this problem too, and it also occurs on another, larger bbPress forum where I am a moderator.

    I’ve asked someone who knows PHP to take a look at the code in bbpress/includes/extend/buddypress/notifications.php, but the couldn’t find any problem there.

    I’m not sure if they were onto something or not, but they said the bug might originate in an incorrect reference to the database topic/post IDs, similarly to what @nikbond said above.

    Robin’s solution above does not seem to work for me either.

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