Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 1,901 through 1,925 (of 32,458 total)
  • Author
    Search Results
  • #218137
    mllapan
    Participant

    Thanks again for the answer.
    Your code check if user is blocked.

    Should I write like if ($role == 'bbp_keymaster' || $role == 'bbp_moderator'|| $role == 'bbp_participant'|| $role == 'bbp_spectator' && $post_count > 4)

    Or I can use ! as counter statement to blocked somewhere in your code?

    #218136
    Robin W
    Moderator
    $role = bbp_get_user_role( $user_id );
    if ($role == 'bbp_blocked' && $post_count > 4)
    #218074
    neon67
    Participant

    I m using the Loco plugin for translation – there you can insert new words that are not in the 100%-translation list.

    In this case, if these words are not important to you, prohibit through css display: none

    #218066
    emanibr
    Participant

    Please check the red boxes are still not translated
    I tried to change the main code for translation
    https://drive.google.com/file/d/1FvUTGZoBl5etnrzeyjeDMTrM_zaSlIOK/view?usp=sharing

    #218039
    SirLouen
    Participant

    Hey @robin-w Tested but not working 🙁
    What can be failing in your idea?

    This doesn’t work either 🙁

    Remove NoFollow from BBPress Posts

    Will have to review the code and what’s going on with that filter nowadays

    anhduc.bkhn
    Participant

    My env:

    WooCommerce version: 4.9.0
    WordPress version: 5.6
    PHP version: 7.4.14
    MySQL version: 5.7.31
    
    Plugin:
    bbp style pack: 4.7.2
    bbPress: 2.6.6
    Easy WP SMTP: 1.4.4

    The feature “Notify me of follow-up replies via email” does not work on my site.
    I tested: go to Settings->bbp-style-pack->Subscriptions Emails -> 9. Send test email, click on ‘Send test email(s)’, but it still does not work.

    Pls guide me on this.

    purityboy83
    Participant

    Oh! mistake
    did not close the tag “< / a>”

    $replacement = '<a href="$1" rel="prettyPhoto"><img src="$1"/>';
    
    to
    
    $replacement = '<a href="$1" rel="prettyPhoto"><img src="$1"/></a>';
    purityboy83
    Participant

    Hi

    i finally solved it with your idea, and i modified the function a little bit

    function add_image_responsive_class($content) {
        global $post;
        $pattern ="/<img src=\"(.*?)\"(.*?)>/i";
        $replacement = '<a href="$1" rel="prettyPhoto"><img src="$1"/>';
        $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');

    thanks

    Best Regards,
    Hyunho

    neon67
    Participant

    The easiest way is to install the GD attachments plugin – and in the settings note something like a class = ”my-class” rel = ”prettyPhoto”
    In addition, your WP must have a lightbox mechanism on board – there are many lightbox plugins in the repository. This script will to command light box style when you click on the picture.

    But I went the other way – I added a class with a new relay through the filters – and the lightbox mechanism is already built into my bbp-theme. This also works.

    #218000
    chieleijt
    Participant

    Found it. Download the plugin: bbpress do shortcodes

    #217999
    chieleijt
    Participant

    But where can you enable shortcodes? I also have this problem with the polls.

    #217987
    athep
    Participant

    For anyone looking for a solution, it’s as simple as calling

          <?php
            echo '<pre>';
            print_r(bbp_get_moderators(bbp_get_forum_id()));
            echo '</pre>';
          ?>

    Or you could echo bbp_get_moderator_list(bbp_get_forum_id()); for a simple list of moderators. Remember to put it inside the loop!

    #217980
    Julia
    Participant

    I could get the code to set on the thumbnails in the topic index page using GD bbPress Attachments.

    
    function action_bbp_topic_row_actions() { 
    
        $medias = get_attached_media( 'image', bbp_get_topic_id() );
        
        foreach($medias as $media){
        the_attachment_link( $media->ID,false );
        }
    } 
    add_action( 'bbp_theme_before_topic_title', 'action_bbp_topic_row_actions', 10, 0 ); 
    
    #217979
    Julia
    Participant

    Add other method.
    I have succeeded to set the images on topic index page.
    but I have no idea to change images to thumbnails.

    Do you have any ideas for thumbnails?

     
    function action_bbp_topic_row_actions() { 
       if ( have_posts() ) while ( have_posts() ) : the_post();
      
        $medias = get_attached_media( 'image', bbp_get_topic_id() );
        foreach($medias as $media){
          the_attachment_link( $media->ID );
        }
       endwhile;
      }
    add_action( 'bbp_theme_before_topic_title', 'action_bbp_topic_row_actions', 10, 0 ); 
    
    #217974
    athep
    Participant

    Hello,

    I’m trying to get a list of the current forum’s moderators, I have this argument that filters all the users and lists me all the moderators from all the other forums.

    $args = array( 'role' => 'bbp_moderator');

    The above code lists all of the moderators from all the forums, I only want the moderators of the current forum, any parameters or snippet that could help me?

    #217973
    Julia
    Participant

    The bbress Support 7 years ago. Topic Thumbnails?

    
    add_action( 'bbp_theme_before_topic_title', 'assylumn_insert_thumbnail' );
    function assylumn_insert_thumbnail() {
    	echo('<a href="http://www.mysite.com/wp-content/uploads/2013/09/picture.jpg">') ; 
        echo('<img class="bbp-topic-thumbnail"  width="100%" style="max-width: ' . get_option('thumbnail_size_w') . 'px; max-height: ' . get_option('thumbnail_size_h'). 'px; vertical-align:middle;" src="http://www.mysite.com/wp-content/uploads/2013/09/picture.jpg"/>' .'</a>');
    	}
    

    I did not know how to get the url in each topic pictures using plugin, GD bbPress Attachments.
    Please show me other code to get the url in the topic pictures.

    #217949
    Robin W
    Moderator

    yes, strtotime(‘now’) will pick up gmt, so needs adjusting, you night want to look at

    $now = date_create( date_i18n( 'Y-m-d H:i:s' ) );

    #217947
    neon67
    Participant

    So, the final css looks like this (you must put “a”)

    #bbpress-forums .bbp-topic-freshness .dayfresh  a {
    background-color : #f4ffe8 ;
    	border: 1px dashed;
    	color: #475656;
    }

    also 86400 looks a lot – captures the 2nd day. Perhaps need to set 23 hours. But these are little things ))

    Thanks to Robin for the great code!))
    I think this is a useful find for those who visit the forum once a day and immediately see how many topics have been updated in the last day.
    Colored blocks are very noticeable – it’s better than straining and peering at the date numbers.

    #217946
    neon67
    Participant

    The class appeared in the code!
    Moment, now I will figure out why the css does not catch it… and finally give the picture the result !…

    #217945
    Robin W
    Moderator

    ok try this for topics in a forum

    add_filter ('bbp_get_topic_freshness_link' , 'rew_check_freshness2', 10 , 5 ) ;
    
    function rew_check_freshness2 ($anchor, $topic_id, $time_since, $link_url, $title) {
    	$last_active = get_post_meta( $topic_id, '_bbp_last_active_time', true );
    	$diff = strtotime('now') - strtotime($last_active) ;
    	if ($diff<86400) {
    	$anchor = '<span class="fresh">'.$anchor.'</span>' ;
    	}
    return $anchor ;	
    }
    #217944
    neon67
    Participant

    #bbp-topic-8191 > li.bbp-topic-freshness in code

    #bbpress-forums .bbp-topic-freshness a { in css

    this is a small box with a time stamp (see pic. above) white background now

    #217941
    Robin W
    Moderator

    ok, that’s where it should be, and it should work.

    where are you putting the code ?

    #217936
    Robin W
    Moderator

    ahh – think I have misunderstood now I re-read, given the post you attached to, I thought your question was regarding the freshness columm, but now I don’t know.

    my code adds a class in the freshness column

    <li class="bbp-forum-freshness">
    <span class="fresh"><a href="http://gos.rewweb.co.uk/forums/topic/eferwer/" title="EFERWER">8 hours, 14 minutes ago</a></span>

    so can you explain exactly what you want to turn green?

    #217929
    Robin W
    Moderator

    try this

    add_filter ('bbp_get_forum_freshness_link' , 'rew_check_freshness', 10 , 6 ) ;
    
    function rew_check_freshness ($anchor, $forum_id, $time_since, $link_url, $title, $active_id) {
    	$last_active = get_post_meta( $forum_id, '_bbp_last_active_time', true );
    	$diff = strtotime('now') - strtotime($last_active) ;
    	if ($diff<86400) {
    	$anchor = '<span class="fresh">'.$anchor.'</span>' ;
    	}
    return $anchor ;	
    }

    This adds an extra span class called ‘fresh’ if the last active is less than 24 hours.

    you can then style this in css eg

    .fresh {
    background-color : green ;
    }
    #217924
    Robin W
    Moderator

    the easiest was is to create a page with the same permalink as your forum slug, so in your case ‘forums’

    so create a page called ‘forums’

    in the content put the html you want and follow with the shortcode [bbp-forum-index] if you are using blocks, wordpress has a shortcode block type ‘sh’ in type and it will appear.

    and publish – check that it appears as http://mysite.com/forums

    and that should work

Viewing 25 results - 1,901 through 1,925 (of 32,458 total)
Skip to toolbar