Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 2,001 through 2,025 (of 32,466 total)
  • Author
    Search Results
  • #217478

    In reply to: Remove footer

    JLee
    Participant
    #bbpress-forums li.bbp-footer {
     
    display:none;
    }		

    I found it, posting it in case someone else needs to do it!

    #217474
    Robin W
    Moderator

    possibly

    bbp_theme_after_forum_title

    and

    bbp_template_before_replies_loop

    #217471
    Julia
    Participant

    How can I put on the search function above of the breadcrumb in forum,topic,reply page?
    I got the Adding action code in the bbPress codex page.
    but I did not get the hook point for the Adding action.
    Please show me the hook point(XXXXXXXXXX) .

    //display bbPress search form above sinle topics and forums
    function rk_bbp_search_form(){
    if ( bbp_allow_search()) {
    ?>
    <div class=”bbp-search-form”>
    <?php bbp_get_template_part( ‘form’, ‘search’ ); ?>
    </div>
    <?php
    }
    }
    add_action( ‘XXXXXXXXXX'(forum,topic-page), ‘rk_bbp_search_form’ );
    add_action( ‘XXXXXXXXXX'(reply-page), ‘rk_bbp_search_form’ );

    <default>

    〇〇〇>〇〇〇>〇〇〇    
    [Search function] 

    <Customize>

    [Search function] 

    〇〇〇>〇〇〇>〇〇〇 

    #217448

    In reply to: Dumb question

    wpturk
    Participant

    You can use normal html code to insert a picture. <img src="..." />

    #217418
    Robin W
    Moderator

    so something like

    $user_id = get_current_user_id()  ;
    $topic_count  = bbp_get_user_topic_count_raw( $user_id);
    $reply_count = bbp_get_user_reply_count_raw( $user_id);
    $post_count   = (int) $topic_count + $reply_count;		
    if ($post_count > 150) { 
    //show here
    }
    #217406
    mllapan
    Participant

    How do I check if user has X number of posts inside bbpress forum to allow him to see blog post.
    For example, for logged in user, it would be like:

    function show_to_logged( $atts, $content = null ) {
    if ( is_user_logged_in() ) {
        echo 'Welcome, registered user!';
    } else {
        echo 'Welcome, visitor!';
    };
    
    add_shortcode('show_to_logged', 'show_to_logged');
    function show_to_bbpress_user_with_x_posts( $atts, $content = null ) {
    if ( user_has_X_BBPRESS_topics_or_topic_replies() ) {
        echo 'Welcome, registered user!';
    } else {
        echo 'Welcome, visitor!';
    };
    
    add_shortcode('show_to_bbpress_user_with_x_posts', 'show_to_bbpress_user_with_x_posts');

    What would be correct function for user_has_X_BBPRESS_topics_or_topic_replies?

    #217394

    In reply to: Avatar issues

    JLee
    Participant

    Final post on this issue….all fixed…thank you neon67…never worked with CSS before…went in and explored all the bbPress css files…experimented and got it to work!!! YES!!!

    Below is the code that fixed the alignment issue as well as avatar size:

    #bbpress-forums .widget_display_replies img.avatar, #bbpress-forums .widget_display_topics img.avatar, #bbpress-forums div.bbp-template-notice img.avatar, #bbpress-forums p.bbp-topic-meta img.avatar, #bbpress-forums ul.bbp-reply-revision-log img.avatar, #bbpress-forums ul.bbp-topic-revision-log img.avatar
    {
    height: 20px;
    width: 20px;
    margin-right: 4px;
    margin-bottom: -6px;
    }  
    
    #217390

    In reply to: Avatar issues

    JLee
    Participant
    #bbpress-forums .widget_display_replies img.avatar, #bbpress-forums .widget_display_topics img.avatar, #bbpress-forums div.bbp-template-notice img.avatar, #bbpress-forums p.bbp-topic-meta img.avatar, #bbpress-forums ul.bbp-reply-revision-log img.avatar, #bbpress-forums ul.bbp-topic-revision-log img.avatar
    {
        margin-right: 4px;
    } 

    This fixed the horizontal spacing issue.

    Now whats left is the avatar size and moving avatar vertically slightly.

    #217385

    In reply to: Avatar issues

    neon67
    Participant

    Have an idea – take the avatar settings this forum. Here are the settings

    {
        float: none;
        vertical-align: middle;
        border: 3px double #ddd;
        max-height: 20px;
        max-width: 20px;
    box-shadow: none;
        display: inline-block;
        margin-right: 4px;
    }

    Get the same as here for begin
    change, add as you want.

    #217376

    In reply to: Avatar issues

    neon67
    Participant

    You can use the same css key, but instead of display: none! Important; experiment with padding – move 4 parameters up and down sideways as you like

    #217361

    In reply to: Avatar issues

    JLee
    Participant

    Hello neon67,

    try to css:
    #bbpress-forums .widget_display_replies img.avatar, #bbpress-forums .widget_display_topics img.avatar, #bbpress-forums div.bbp-template-notice img.avatar, #bbpress-forums p.bbp-topic-meta img.avatar, #bbpress-forums ul.bbp-reply-revision-log img.avatar, #bbpress-forums ul.bbp-topic-revision-log img.avatar
    {display:none !important;}

    The code above worked beautifully!!

    Thank you neon67!!

    #217358
    neon67
    Participant

    This is more a question to the author of the theme you are using. Start with this.

    If the theme is not intended for bbpress, you can make a separate page (item in the menu) – for example, using shortcodes – to create page user profile.

    The bbpress shortcodes are in the bbpress codex.

    If this is still difficult, there are special plugins

    #217354
    andyinspired
    Participant

    Hi,
    I’ve discovered a very minor HTML error where attachments are listed:

    <div class="d4p-bbp-att-wrapper">
    <a class="" download href="http://domain.org.uk/file.pdf" title="File.pdf">File.pdf</a>
    </div>

    Notice the word download should be inside the class quotes and not in between the quotes and the href tag.

    #217352
    Gunivortus
    Participant

    How can participants in the forum get to the page of their standard WP profile?
    I mean the page, which looks like the admin backend, but only shows the info of the logged in user. (I have a plugin for extended registering and logging in, but I cannot open that WordPress page with that).
    What can I use as a menu item to access to that page? Maybe a shortcode?

    #217351

    In reply to: GD Attachments Archive

    andyinspired
    Participant

    ok, so far I have this code:

    function display_attachments() {
    $args = array(
        'post_type'   => 'attachment',
        'post_status' => 'inherit',      
        'meta_query'  => array(
            array(
                'key'     => '_bbp_attachment',
                'value'   => '1'
            )
        )
    );
    $query = new WP_Query($args);
    	
    	print_r($query);
    }	
    add_shortcode( 'display_attachments', 'display_attachments' );	

    This appears to output the whole SQL query as well as the attachment url string. Can you help?

    #217349

    In reply to: GD Attachments Archive

    Milan Petrovic
    Participant

    I can’t provide you with example code here (I don’t have anything written to use).

    The easiest way to do this is with WP_Query for ‘attachment’ post type having ‘_bbp_attachment’ meta with value ‘1’.

    Milan

    neon67
    Participant

    ok ok – fixed a lot of syntax errors. Now the code looks like this and it works

    function add_image_responsive_class($content) {
        global $post;
        $pattern ="/<img(.*?)class=\"(.*?)\"(.*?)>/i";
        $replacement = '<img $1class="$2 img-responsive"$3>';
        $content = preg_replace($pattern, $replacement, $content);
        return $content;
    }
    add_filter ('bbp_get_reply_content', 'add_image_responsive_class');
    add_filter ('bbp_get_topic_content', 'add_image_responsive_class');

    Summary. I got a new picture class – img-responsive. But no new link appeared. How to make it open like a rel prettyPhoto … no ideas yet ..

    A feature is at stake – to allow all BBPforum pictures the last few years to open in a lightbox in full size. worth looking for a solution)

    Robin W
    Moderator

    might be taking out spaces after the $ signs eg

    return $ content;

    should be

    return $content;

    #217328
    MrFent37
    Participant

    I do have that code on those other templates as well, so it works well. You know what though, I just found out that I didn’t have any custom code added to form-topic.php, so that must be how they are creating new topics. SMH. I thought that I had all of the template files customized and that they were somehow creating new posts via URL, RSS, or some other “back door” method. Thanks for your time, you can close this post.

    #217327
    Robin W
    Moderator

    hhmm… not sure how that would prevent the forums being shown

    I’d suggest you add that code to

    form-topic.php and form-reply.php

    #217326
    MrFent37
    Participant

    Ok for example, in the template file loop-single-reply.php, at the bottom, instead of this normal code:

    <div class="bbp-reply-content">
    
    	<?php do_action( 'bbp_theme_before_reply_content' ); ?>
    
    	<?php bbp_reply_content(); ?>
    
    	<?php do_action( 'bbp_theme_after_reply_content' ); ?>
    
    </div><!-- .bbp-reply-content -->
    

    I have custom code wrapped around the bbp_reply_content(); function so that the reply form will only load for my active members:

    <div class="bbp-reply-content">
    
    	<?php do_action( 'bbp_theme_before_reply_content' ); ?>
    	<?php if (((function_exists('wc_memberships_is_user_active_member')) && (wc_memberships_is_user_active_member(get_current_user_id(), 'biotic-pro-membership'))) { ?>
    		<?php bbp_reply_content(); ?>
    	<?php } else {	
    		echo $noaccess;
    	} ?>
    	<?php do_action( 'bbp_theme_after_reply_content' ); ?>
    
    </div><!-- .bbp-reply-content -->
    Robin W
    Moderator

    probably filter on

    add_filter ('bbp_get_reply_content', 'add_image_responsive_class');
    add_filter ('bbp_get_topic_content', 'add_image_responsive_class');
    neon67
    Participant

    Thank you! But I’m looking for a way to apply link: data-rel=”prettyPhoto” target = “_ self” to all available bbpress images. It can be loaded in any way, it doesn’t matter.

    Found the code

    function add_image_responsive_class ($ content) {
        global $ post;
        $ pattern = "/ <img (. *?) class = \" (. *?) \ "(. *?)> / i";
        $ replacement = '<img $ 1class = "$ 2 img-responsive" $ 3>';
        $ content = preg_replace ($ pattern, $ replacement, $ content);
        return $ content;
    }
    add_filter ('the_content', 'add_image_responsive_class');

    but for wordpress. Will it work for bbpress?

    #217319
    Robin W
    Moderator

    you could try this in the custom css part of your theme

    #bbp_stats_widget-2 dt {
    padding-right: 10px;
    }
    #217311
    codestars
    Participant

    Thank you alriknijdam, this was exactly what I needed.

    I improved your code a bit, for example you can use bbp_get_topics_per_page() so the amount of replies per page will always be correct. And you can use bbp_get_root_slug() to dynamically get the root URL of where your forum is located.

    /**
     * Get reply in topic permalink.
     *
     * @param int $reply_id
     * @param int $topic_id
     *
     * @return string
     */
    function custom_get_reply_in_topic_permalink( $reply_id, $topic_id ) {
    
    	$position_raw = bbp_get_reply_position( $reply_id, $topic_id );
    	$position     = str_replace( ',', '', $position_raw );
    	$page_raw     = ceil( $position / bbp_get_topics_per_page() );
    	$page         = $page_raw > 1 ? '/page/' . $page_raw : '';
    
    	$slug = get_post_field( 'post_name', get_post( $topic_id ) );
    
    	return bbp_get_root_slug() . '/topic/' . $slug . $page . '/#post-' . $reply_id;
    }

    Can be used like this:
    <a href="<?php echo custom_get_reply_in_topic_permalink( $reply_id, $topic_id ); ?>">

    Enjoy!

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