Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 4,176 through 4,200 (of 32,481 total)
  • Author
    Search Results
  • #194599
    alriknijdam
    Participant

    As this is still not resolved I wrote a simple script to solve this issue. For those stumbeling up on this here it is.

    $topic_id		= bbp_get_topic_id();
    $reply_id		= bbp_get_reply_id();
    $position_raw	= bbp_get_reply_position($reply_id, $topic_id);
    // Remove the comma
    $position		= str_replace(',', '', $position_raw);
    // Devide by the number of posts per page, in my case 15
    // I didn't test it but I believe you can also use: get_option( 'posts_per_page' );
    $page_raw		= ceil($position / 15 );
    if ($page_raw > 1) $page = '/page/' . $page_raw;
    else $page 		= '';
    $slug			= get_post_field('post_name', get_post($topic_id));
    // Replace YOUR_WEBSITE_URL with your own or use: bloginfo('wpurl')
    // to retrieve it, but don't forget to concenate
    $correct_link	= 'YOUR_WEBSITE_URL/forums/topic/' . $slug . $page . '/#post-' . $reply_id;

    You can probably place this inside some function but I placed it inside loop-single-reply.php and placed that inside my child-theme. In that case you also have to replace this:

    <a href="<?php echo bbp_reply_url(); ?>" class="bbp-reply-permalink">#<?php echo bbp_reply_id(); ?></a>

    with:

    <a href="<?php echo $correct_link; ?>" class="bbp-reply-permalink">#<?php echo $reply_id; ?></a>

    #194574
    eigodeasobo
    Participant

    Hi,

    I added Customfields to BBpress reply form by this code:

    //Input on BBP reply form
    function bbp_extra_reply_fields() {
    $custom = get_post_meta( bbp_get_reply_id(), 'bbp_custom', true);
    echo '<fieldset class="bbp-form bbp-form-add">';
    echo "<p><input id='bbp_reply_custom' type='text' name='bbp_custom' value='".$custom."'></p>";
    echo '</fieldset>';
    }
    add_action ( 'bbp_theme_before_reply_form_content', 'bbp_extra_reply_fields');
    
    //Register to Detabase
    add_action( 'bbp_new_reply', 'bbp_save_reply_extra_fields', 10, 1 );
    add_action( 'bbp_edit_reply', 'bbp_save_reply_extra_fields', 10, 1 );
    function bbp_save_reply_extra_fields( $reply_id ) {
    if (isset($_POST) && $_POST['bbp_custom']!='') {
    update_post_meta( $reply_id, 'bbp_custom', $_POST['bbp_custom'] );
    }
    }
    
    //Output to BBP reply
    function inputBBPreply_outputBBPreply() {
    $reply_id = bbp_get_reply_id();
    $reply_custom = get_post_meta( $reply_id, 'reply_custom', true);
    return '<div>'.$reply_custom.'</div>';
    }
    
    //Output to Buddypress activity
    function inputBBPreply_outputBPactivity() {
    //What should I write?
    }

    But this code dose not show at BuddyPress activity.

    What should I write?

    Thanks

    #194566
    wallacelin
    Participant

    Hi,

    This topic is quite old but it seems to be the only one about displaying tagged topics count. How would you implement the query to count topic tags? Is it possible to create a custom shortcode to show the tag count? Any help with this would be greatly appreciated, thanks!

    #194535
    timmoser
    Participant

    Ahoy,
    I am using

    bbPress 2.5.14-6684
    BuddyPress 3.1.0
    bbp style pack 3.9.6
    WordPress 4.9.8
    running Bento (Child) theme
    on this page bomb.bio/forum

    I am having a problem with the insert/edit image button (in the text version the img button) not working. Image links added this way do not display.
    Posting the same link without the tag automaticaly added when using this button works fine as long as they are in a new line.

    Does anyone have any idea how I can get this to work? Even removing the misleading button or changing the button functionality so it wont add the tag which seems to make the link not work would be better than the current situation.

    I can’t code. I am only able to copy paste and to some degree alter code that i am given. I do have a working child theme if that helps.

    Thank you very much!!!
    Tim

    #194520
    #194514
    Helmuts
    Participant

    another sample of the latest forums page where the above mentioned bbcodes have been used: https://www.ibf.lv/svaigakas-foruma-zinas/ (Latvian business forum)

    #194513
    Helmuts
    Participant

    A quick update – ..this topic ranks in the top positions of Google on these keywords and needs updating.

    My suggestion: set up plugin “bbPress Advanced Statistics” https://wordpress.org/plugins/bbpress-improved-statistics-users-online/

    and use the shortcode: [bbpas-activity] (you have to enable it first in settings under “extra” tab”

    Sample (latest forum posts): https://www.lustjobs.com/latest-posts-custom-forum-view/

    There are 2 bbcodes on this page:
    [bbp-topic-index]
    [bbpas-activity]

    as for the default bb code: you have to use use [bbp-stats] not [bbp-statistics]

    #194512
    eigodeasobo
    Participant

    What should I do if I do not want to allow div?

    // Div
    'div' => array(
    	'class'     => false,
    	'style'     => false,
    ),

    This is not it, right?

    #194511
    eigodeasobo
    Participant

    Hi bbpress

    I want to escape html in topic and reply output, but I want to Embede media.

    REPLACED this code which you can find inside[bbpress/templates/default/bbpress/content-single-topic-lead.php] file, opening via the editor.
    <?php bbp_topic_content(); ?>
    WITH THIS CODE

    <?php
    global $wp_embed;
    $inputTxt = bbp_get_topic_content();
    $escTxt = esc_html( $inputTxt );
    echo '<div class="test">'.$wp_embed->run_shortcode( '[embed]' . $escTxt . '[/embed]' ).'</div>';
    ?>

    But I can not it.

    How do I write it?

    #194506
    Robin W
    Moderator
    #194487
    Milan Petrovic
    Participant

    bbPress has a login and registration widget include to use in the sidebar. It also has shortcodes to embed these forms into pages, so you can use that to make your login/register page and style it using CSS.

    #194479
    Robin W
    Moderator

    you could move the plugins into the functions file if you really wanted to

    it would all look very confusing and be very difficult to maintain
    you might have to alter some code to stop conflicts
    it would have no effect on speed, a function is a function wherever it runs
    you would lose any updates for the plugins

    generally not a good idea 🙁

    #194475
    dedotombo
    Participant

    Can’t find it, maybe it’s pulled from wordpress text domain directly? Maybe code tweaks are needed to translate it separately, could be.

    #194460
    Milan Petrovic
    Participant

    You can do it with some custom code to expand list of supported tags and attributes.

    Here is the example of how to do it: https://bbhelp.club/answer/editing/how-can-i-expand-allowed-html-tags-and-attributes/220/

    puniler
    Participant

    Hi all,

    I’m trying to integrate the BuddyPress favorite (aka like system) system with BBPress.

    But I can not implement ajax and the page will be reloaded.

    How do I write it?

    ▼【functions.php】

    function my_bp_activity_is_favorite($activity_id) { 
      global $bp, $activities_template;  
      return apply_filters( 'bp_get_activity_is_favorite', in_array( $activity_id, (array)$activities_template->my_favs ) );  
    }  
    function my_bp_activity_favorite_link($activity_id) {  
      global $activities_template;  
      echo apply_filters( 'bp_get_activity_favorite_link', wp_nonce_url( site_url( BP_ACTIVITY_SLUG . '/favorite/' . $activity_id . '/' ), 'mark_favorite' ) );  
    }  
    function my_bp_activity_unfavorite_link($activity_id) { 
      global $activities_template;  
      echo apply_filters( 'bp_get_activity_unfavorite_link', wp_nonce_url( site_url( BP_ACTIVITY_SLUG . '/unfavorite/' . $activity_id . '/' ), 'unmark_favorite' ) );  
    }  

    ▼【bbPress/templates/default/bbpress/loop-single.php】

    <div id="post-<?php bbp_reply_id(); ?>" class="bbp-reply-header">
    
      <!--omission-->
    
        <div class="favorite-wrap">
            <?php $activity_id = get_post_meta( bbp_get_reply_id( $reply_id ), '_bbp_activity_id', true ); ?>  
            <?php if ( is_user_logged_in() ) : ?>  
                <?php bp_has_activities(); ?>   
                <?php if ( !my_bp_activity_is_favorite($activity_id) ) : ?>  
                    <a href="<?php my_bp_activity_favorite_link($activity_id) ?>" 
                    class="button fav bp-secondary-action bp-tooltip" data-bp-tooltip="add" aria-pressed="false">
                    <span class="bp-screen-reader-text">add</span>
                    </a> 
                <?php else : ?>  
                    <a href="<?php my_bp_activity_unfavorite_link($activity_id) ?>" 
                    class="button unfav bp-secondary-action bp-tooltip" data-bp-tooltip="remove" aria-pressed="false">
                    <span class="bp-screen-reader-text">remove</span>
                    </a>
                <?php endif; ?>  
            <?php endif;?>  
        </div>
    
      <!--omission-->
    
    </div><!-- #post-<?php bbp_reply_id(); ?> -->

    Help for figuring this one out is appreciated.
    Best regards

    #194427
    eitan1112
    Participant

    Hello everyone.
    Website: Link
    WordPress version: 4.9.8
    bbPress version: 2.5.14

    Despite reading many threads about this, I still couldn’t figure out a way to change the language of the forum to hebrew. I will work you through what I did:

    1. Download bbPress.

    2. Add all the pages (login, register etc.) to the menu. (since the website is in hebrew, you can the pages find it under the second last menu item).

    3. Download the hebrew .po and .mo files and put them in the directory /wp-content/languages/bbpress with the proper name (bbpress-he_IL.po and bbpress-he_IL.mo)

    4. Check the websites register and login pages, still in english.

    5. Edit “wp-config.php” file and added “define(‘BBLANG’, ‘bbpress_he_IL’);”.

    6. Check the websites register and login pages, still in english.

    Also things I have tried:
    – Putting the .po and .mo files under /wp-content/languages/plugins/.

    – Made sure I don’t have a translation update under “Dashboard -> Updates” in wordpress.

    Important Note:
    The hebrew is not 100% finished, but from this guide I understood that it doesn’t matter as long as I manually override it.

    So the bottom line is – I really need help figuring that out. What am I missing?
    Thanks for everyone who read and help,
    Eitan.

    #194423
    Shaktimaan
    Participant

    I am using Image Upload for BBPress on my forum. This plugin allows users to insert images in posts.

    I, forum admin as well as moderators can align images but normal users can’t.

    I think there are permission issues.

    How can i whitelist these tags class="alignright", class="alignnone", class="aligncenter", class="alignleft" for normal user?

    ginmo
    Participant

    Hi,

    I am now looking for the solution of “changing the freshness time format in Japanese”.

    I have already check the plugin “bbp tool kit” and it says on the checkbox “Shorten the display of the freshness”, it is only available in English”.

    I have also tried set the code on function.php (10. Shorten freshness wording), obviously it is only available in English too.

    It might be diffcult to understand why the freshness time format cannot change with different languages, still though, I am looking for the way to solve this matter.

    At this moment, the Freshness time format in Japanese is like…,

    A) 1 week, 9 hours ago or B) 3weeks, 4days ago

    What I would like to do is…,

    A) 7 days ago or B) 25 days ago

    simply showing the “days”. I do not need “month, week or hours”.

    Please let me know if there is a way to change the format with other languages.

    Thank you so much for your help in advance.

    #194326
    LNAngel
    Participant

    Thanks, Robin. I took a look at that plugin but didn’t see how that would impact emails. I saw “Forum Roles” and blocked users..but what do I check and where to make sure they don’t get notifications?

    I’ll check out the code as well, but plug and play is preferred.

    Thanks very much!

    #194324
    zcoin
    Participant

    Hello,

    I would like to use AdRotate Banner Manager on my bbPress site and I tried to follow the basic tutorial from here: AdRotate tutorial

    As a summary, I created a dummy page with my image and embedded link advert – so its working. However, inserting the same code into a new advert inside AdRotate Banner Manager has no effect on my page.

    I save the advert for a group and from the group setting, I selected page injection into some of the site pages. It doesn’t appear on none.

    Maybe there is a visibility issue? Or the theme DiBusiness does not support AdBanner? I disabled any add block on my site.

    Thank you for any help.

    #194323
    Robin W
    Moderator

    Thanks, I took a second look at this and I put a filter into my style pack plugin a while ago to stop blocked users getting emails as bbpress does not do this.

    If you want to do this directly, add this to your functions file

    
    function rew_fltr_get_forum_subscribers( $user_ids ) {
            if (!empty( $user_ids ) ) {
                    $new_user_ids = array();
                    foreach ($user_ids as $uid) {
                            if (bbp_get_user_role($uid) != 'bbp_blocked') {
                                    $new_user_ids[] = $uid;
                            }
                    }
                    return $new_user_ids;
            } else {
                    return $user_ids;
            } 
    }; 
    // add the filter
    
    if(!function_exists('bbptoolkit_fltr_get_forum_subscribers')){
    add_filter( 'bbp_forum_subscription_user_ids', 'rew_fltr_get_forum_subscribers', 10, 1 );
    }
    #194303
    Robin W
    Moderator
    #194264
    daron4ever
    Participant

    Hi,

    If the post is edited, the original post will be gone.
    How to keep the original post?

    For example,
    This reply was modified 1 second ago by bbpress. click to see original.

    Anyone knows the custom code for it?

    #194261

    In reply to: TinyMCE Error

    Robin W
    Moderator

    that error suggests that your theme Stockholm and file js/plugins.js is the problem.

    So it initially looks like enabling tinymce within bbpress is calling the tinymce or other code within your theme – the bbpress code you are using just turns on the wordpress function.

    to prove, try switching as a test to a default theme, such as twentyseventeen and see if the error goes away

    #194197
    Robin W
    Moderator

    you can do it by amending a template if you know how to do ftp

    create a directory on your theme called ‘bbpress’
    ie wp-content/themes/%your-theme-name%/bbpress

    where %your-theme-name% is the name of your theme

    find
    wp-content/plugins/bbpress/templates/default/bbpress/content-single-forum.php
    Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/content-single-forum.php
    bbPress will now use this template instead of the original
    and you can amend this

    so amend this template to read

    
    <?php
    
    /**
     * Single Forum Content Part
     *
     * @package bbPress
     * @subpackage Theme
     */
    
    ?>
    
    <div id="bbpress-forums">
    
    	<div id="forum-intro">
    	
    	<?php if (bbp_get_forum_title() == 'technical' ) echo 'this is some content' ; ?>
    	
    	<?php if (bbp_get_forum_title() == 'leisure' ) 	echo 'this is some different content' ; ?>
    	
    	</div>
    
    	<?php bbp_breadcrumb(); ?>
    
    	<?php bbp_forum_subscription_link(); ?>
    
    	<?php do_action( 'bbp_template_before_single_forum' ); ?>
    
    	<?php if ( post_password_required() ) : ?>
    
    		<?php bbp_get_template_part( 'form', 'protected' ); ?>
    
    	<?php else : ?>
    
    		<?php bbp_single_forum_description(); ?>
    
    		<?php if ( bbp_has_forums() ) : ?>
    
    			<?php bbp_get_template_part( 'loop', 'forums' ); ?>
    
    		<?php endif; ?>
    
    		<?php if ( !bbp_is_forum_category() && bbp_has_topics() ) : ?>
    
    			<?php bbp_get_template_part( 'pagination', 'topics'    ); ?>
    
    			<?php bbp_get_template_part( 'loop',       'topics'    ); ?>
    
    			<?php bbp_get_template_part( 'pagination', 'topics'    ); ?>
    
    			<?php bbp_get_template_part( 'form',       'topic'     ); ?>
    
    		<?php elseif ( !bbp_is_forum_category() ) : ?>
    
    			<?php bbp_get_template_part( 'feedback',   'no-topics' ); ?>
    
    			<?php bbp_get_template_part( 'form',       'topic'     ); ?>
    
    		<?php endif; ?>
    
    	<?php endif; ?>
    
    	<?php do_action( 'bbp_template_after_single_forum' ); ?>
    
    </div>

    You will see I have added lines to change the content per forum

    so the line

    <?php if (bbp_get_forum_title() == 'technical' ) echo 'this is some content' ; ?>

    says that if the forum is called ‘technical’ then write ‘this is some content’ so you simply need to change the forum name and what you want that forum content to be.

    You can add additional lines for each forum, my example has two forums ‘technical’ and ‘leisure’

Viewing 25 results - 4,176 through 4,200 (of 32,481 total)
Skip to toolbar