Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 1,901 through 1,925 (of 32,522 total)
  • Author
    Search Results
  • #218718
    Robin W
    Moderator

    try

    function rew_change_text( $translated_text, $text, $domain ) {
    	if ( $text == '<strong>Error</strong>: Your reply cannot be created at this time.') {
    	$translated_text = '<strong>Error</strong>: New moderation message';
    	}
    	return $translated_text;
    }
    
    add_filter( 'gettext', 'rew_change_text', 20, 3 );
    #218711
    purityboy83
    Participant

    Hi

    If add a link to “topic and reply”, the embed function does not work.

    ref img
    https://ibb.co/qxXG125

    site.com is an example for screenshots.
    I entered the actual URL

    error error embed
    Oops! That embed can’t be found

    ref img
    https://ibb.co/grXr9dV

    It was a site that has been without problems for months.
    I just discovered it by accident.

    The same is happening at the internal test site.

    I installed the “Health Check & Troubleshooting” plug-in from the test site
    and activated the Troubleshooting mode.

    and only 2 plugin activate
    – bbPress
    – bbPress Permalinks with ID

    The problem still occurs.
    It’s a well-used feature, site, but suddenly a problem arises and I’m confused.

    I must need to help

    wordpress 5.5.3
    PHP-7.4

    Thanks

    Best Regards,
    Hyunho

    #218693

    In reply to: a link on the picture

    Robin W
    Moderator

    Try

    add_action( 'bbp_theme_after_topic_freshness_author', 'rew_freshness_display_reply');
    function rew_freshness_display_reply ($forum_id = 0) {
    	// Verify forum and get last active meta
    	$forum_id  = bbp_get_forum_id( $forum_id );
    		$active_id = bbp_get_forum_last_active_id( $forum_id );
    		$link_url  = $title = '';
    
    		if ( empty( $active_id ) )
    			$active_id = bbp_get_forum_last_reply_id( $forum_id );
    
    		if ( empty( $active_id ) )
    			$active_id = bbp_get_forum_last_topic_id( $forum_id );
    
    		if ( bbp_is_topic( $active_id ) ) {
    			//then reset forum_id to the forum of the active topic in case it is a sub forum
    			//$forum_id = bbp_get_topic_forum_id($active_id);
    			$link_url = bbp_get_forum_last_topic_permalink( $forum_id );
    			$title    = bbp_get_forum_last_topic_title( $forum_id );
    		} elseif ( bbp_is_reply( $active_id ) ) {
    			//then reset forum_id to the forum of the active topic in case it is a sub forum
    			//$forum_id = bbp_get_reply_forum_id($active_id);
    			$link_url = bbp_get_forum_last_reply_url( $forum_id );
    			$title    = bbp_get_forum_last_reply_title( $forum_id );
    		}
    		
    		$anchor = '<a class="rew_freshness_display_image" href="' . esc_url( $link_url ) . '" title="' . esc_attr( $title ) . '"><img class="plato" style="width: 29px; height: 20px;" src="https://webershoot.com/mesimages/transplato.png">' . '</a>';
    	
    echo '<p class="platopost">'.$anchor.'</p>';
    }
    #218689

    In reply to: a link on the picture

    frenchlemans
    Participant

    Hello Robin,

    I tried to adapt the code you provided me for the same function but from forums and not topics. I tried a lot of possibilities inside but each time it brings me back to the last forum and not to the last post of each topic.
    I searched through the documentation and archives but couldn’t find anything.
    So the code used is below, it fits the image well but not the last post of the subject in which it is:

    add_action( 'bbp_theme_after_topic_freshness_author', 'rew_freshness_display_reply');
    function rew_freshness_display_reply ($forum_id = 0) {
    	// Verify forum and get last active meta
    	$forum_id  = bbp_get_forum_id( $forum_id );
    		$active_id = bbp_get_forum_last_active_id( $forum_id );
    		$link_url  = $title = '';
    
    		if ( empty( $active_id ) )
    			$active_id = bbp_get_forum_last_reply_id( $forum_id );
    
    		if ( empty( $active_id ) )
    			$active_id = bbp_get_forum_last_topic_id( $forum_id );
    
    		if ( bbp_is_topic( $active_id ) ) {
    			//then reset forum_id to the forum of the active topic in case it is a sub forum
    			$forum_id = bbp_get_topic_forum_id($active_id);
    			$link_url = bbp_get_forum_last_topic_permalink( $forum_id );
    			$title    = bbp_get_forum_last_topic_title( $forum_id );
    		} elseif ( bbp_is_reply( $active_id ) ) {
    			//then reset forum_id to the forum of the active topic in case it is a sub forum
    			$forum_id = bbp_get_reply_forum_id($active_id);
    			$link_url = bbp_get_forum_last_reply_url( $forum_id );
    			$title    = bbp_get_forum_last_reply_title( $forum_id );
    		}
    		
    		$anchor = '<a class="rew_freshness_display_image" href="' . esc_url( $link_url ) . '" title="' . esc_attr( $title ) . '"><img class="plato" style="width: 29px; height: 20px;" src="https://webershoot.com/mesimages/transplato.png">' . '</a>';
    	
    echo '<p class="platopost">'.$anchor.'</p>';
    }

    Regards.

    #218660

    In reply to: a link on the picture

    Robin W
    Moderator

    what is your existing code?

    #218637
    st11
    Participant

    It worked if I set capabilities when creating custom role.

    function add_wp_custom_roles() {
        add_role(
            "bbp_member",
            "Member",
            [
    		"read"=>true,
    
    		"spectate"=>true,
    		"participate"=>true,
    		"read_private_forums"=>true,
    		"publish_replies"=>true,
    		"edit_replies"=>true,
    	    ]);
    }
    add_action("init", "add_wp_custom_roles");
    
    #218634
    Robin W
    Moderator

    you seems to have an inline style which is overwriting any other styling eg

    style="height: auto !important;"> and <p style="height: auto !important;"

    from this code.

    <div class="bbp-reply-content" style="height: auto !important;">
    
    		
    		-ad-client="ca-pub-8895339382096709" data-adsbygoogle-status="done"><ins<p><strong>1. The Profession of Faith—The Shahada</strong></p>
    <p>&nbsp;</p>
    <p style="height: auto !important;">The Profession of Faith, the shahada, is the most fundamental expression of Islamic<br>

    It may be related to where you are importing the text from

    #218629
    Robin W
    Moderator

    the one above should work – I changed

    $forum_id = '12345'
    to
    $forum_id == '12345'

    #218626
    Robin W
    Moderator

    oops sorry should read

    $forum_id = bbp_get_topic_forum_id()
            if((!bee_catch_image() == '') && $forum_id == '12345'){

    == being compare

    #218625
    purityboy83
    Participant

    Hi @robin-w

    echo (bbp_topic_permalink().'">

    Is there a way to set forum_id here?

    Thanks for always help

    #218624
    purityboy83
    Participant

    Hi @robin-w

    You who always help are probably an angel.

    I followed your advice and modified the code
    However, thumbnails are displayed on all forums topic….

    Thanks~

    #218623
    Robin W
    Moderator

    probably

    $forum_id = bbp_get_topic_forum_id()
            if((!bee_catch_image() == '') && $forum_id = '12345'){
    #218622
    purityboy83
    Participant

    Hi

    I want the thumbnail to appear on the topic
    Search results found a plugin similar to the function I’m hoping for

    bbpress-topic-thumbnails
    https://wordpress.org/plugins/bbpress-topic-thumbnails/

    I want to add one more feature in this plugin.
    With this plugin, thumbnails of all forum topics are displayed

    I only want to use this feature for 1 specific forum
    reason for write topic is because the plugin has not been updated for a long time.

    So I ask for help here

    code is

    
    /*Hooks into the loop-topic.php output to print image*/
    add_action( 'bbp_theme_before_topic_title', 'bee_insert_thumbnail' );
    function bee_insert_thumbnail() {
    
            if((!bee_catch_image() == '')){
            echo('<a href="'); 
        echo(bbp_topic_permalink() . '"><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="' . bee_catch_image() . '"/>' .'</a>');
            }
    }
    
    /*Function that retrieves the first image associated with the topic*/
    function bee_catch_image() {
      global $post, $posts;
      $first_img = '';
      ob_start();
      ob_end_clean();
      $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
      $first_img = $matches [1] [0];
      return $first_img;
    }
    

    Anyone can help?
    Thanks

    #218620
    Robin W
    Moderator

    for ‘Follow this link to join the discussion’ – you are welcome to style it as a button if you wish

    go to

    dashbaoard>settings>discussion and change

    Follow this link to join the discussion

    to

    <div class="myButton">Follow this link to join the discussion</div>

    you can then style a button, if you don’t know how go to

    https://www.bestcssbuttongenerator.com/

    #218600
    st11
    Participant

    I am trying to create a custom role that can only reply to existing topics.

    I followed this to create new role. At first, the role did appear in dropdown list in admin edit user screen, but after saving, it went back to “— No role for these forums —”.

    I found this thread, so.. I created custom WordPress role in the same name. This made the bbPress role to be “saved” but it doesn’t seem to add capabilities. The user with this role can’t see forum or topics.

    How can I get this custom bbPress user role to have custom capability?

    WordPress 5.5, bbPress 2.6.6

    #218557
    xprojectsx
    Participant

    I know this is an old thread but it is about the most useful on this issue but unfortunately did not solve my problem. (I got zero results returned in the TMP table) I wanted to point out however in case it is useful for anyone else, that in step 3 of @giobby post above there seems to be some extraneous text in there.

    these three lines:

    wp_posts.post_excerpt, 
    pescasubac, 
    wp_posts.quea.wp_posts.post_status, 

    I believe should be:

    wp_posts.post_excerpt, 
    wp_posts.post_status, 

    pescasubac doesn’t seem to refer to anything and “wp_posts.quea” also is not a thing. All of the other fields in wp_posts are accounted for without those two items.

    #218555
    Robin W
    Moderator

    So have you got the shortcode [bbp-forum-index] in that page?

    #218554
    einar2507
    Participant

    Ok, thanks and sorry for my frustration – my bad! You write “In essence the forum root slug simply needs to match the permalink of the page where you have put the shortcode on, then it all works.”

    That is not correct. Just take a look at my page https://fakta360.no/forums/forum/folkeopproret-mot-klimahysteriet/ and then click on the breadcrumbs. At he moment the page name and forum rot do not match but it works, and only the breadcrumbs goes wrongly to the “forums” root page that dont exists. If I change the page slug to match the forum rot, then nothing displays except the text “Forums”.

    #218552
    Robin W
    Moderator

    writing threads that complain about free software offered with free support is not the way to get your problem fixed – so I deleted that one as it serves no purpose.

    In essence the forum root slug simply needs to match the permalink of the page where you have put the shortcode on, then it all works.

    #218548
    einar2507
    Participant

    I also find out that if I have the Forum page named “Forum” with slug “forum” and the Forum rot=”forums” then the shortcode works but the breadcrumbs points to the “forums” root and does therefore not display any forum. Only the text “formum” with at random link it seems to me.

    Forum

    #218547
    einar2507
    Participant

    Now I see that I get the same result when I use the shortcode or not in the https://fakta360.no/forums/ page. The shortcode [bbp-forum-index] has no effekt.

    #218541

    In reply to: List Of Shortcodes

    Robin W
    Moderator

    Is there no way I could add the profile as I did with the forum index? It was super easy just using [bbp-forum-index]

    – no, the way profiles work doesn’t easily lend to that 🙂

    1. Go to

    bbp-add-menu-profile-item

    and download the plugin to your computer – make a note of where you saved it !

    2. on your website go to dashboard>plugins>add new>upload plugin and browse to the file you downloaded in 1. above
    3. Install and Activate
    4. If you already have a page called ‘Profile’ then make sure this has the permalink ‘profile’
    5. If not then create a page called ‘Profile’ and make sure it has the permalink ‘profile’
    6. in the content of the profile page put something like

    ‘You need to be logged in to see your profile’ – you can add the bbpress login shortcode in here as well if you wish ie [bbp-login]

    The above is what will show to people who click the profile menu item who are not logged in

    Save the page and exit

    7. In Dashboard>appearance>menu’s add the profile page to the menu you want to.

    now you will have ‘Profile’ showing as the menu item, and if clicked and logged in you will go to your profile page, if not logged in, you will see the content above.

    #218537

    In reply to: List Of Shortcodes

    Robin W
    Moderator

    @flamuren great – do you want it as code to out in your child theme functions file or a baby plugin?

    #218532
    einar2507
    Participant

    Hi.
    /Forum/ or /Forums/ ???

    After installing bbpress I created a page “Forum” with the shortcode [bbp-forum-index]. I made a menu with a link to that “Forum” page. All fine and the forum index listed.

    But when I go in to a forum and the click on the breadcrumbs “Forums” to get back, I land on a blank page with the text “Forums” ???
    I have also tried to make a page Forums with shortcode [bbp-forum-index] but that does not change anything.
    I dont understand this and what I do wrong?
    Here is my two pages where first is ok, but breadcrumbs lead to second with error.

    Forum


    https://fakta360.no/forums/

    #218527

    In reply to: New posts freezing

    Robin W
    Moderator

    @mike80222 Mike – saw that thread, but buried in paid work at the mo – but what are you using to show the visual part -some code, a plugin (maybe bbp style pack) or something else?

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