Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 4,451 through 4,475 (of 32,481 total)
  • Author
    Search Results
  • #190403
    .:DDoS:.
    Participant

    @robin-w Yes! Just point me where and what file it is and where to insert codes. I’ll try my best. I hope it’s in Child Theme files so that it will not mess during update. Thank you!

    #190377
    Gomle
    Participant

    First of all, a big thank you to all contributors for this extremely nice forumsoftware. I’ve been on several over the years, and BBPress is a great one – out of the box!

    I also have a question about the bubble notification. I am not much of a coder, but I can understand some.

    So what I want is that when someone replies to a post in a topic you either started or have ticked the box “subscribe to” – I would like this to show up as a notification in buddypress, and not only by e-mail.

    I don’t think my theme handles this, although it’s ready for buddypress, so I think I have to make something out of it myself.

    Any suggestions on where I might look for an answer, or maybe there is already a plugin for it that you know of?

    #190373
    Robin W
    Moderator

    Much of this is written so that I can come back to it in future, so bear with me!!

    IF YOU JUST WANT THE ANSWER – IGNORE THIS SECTION

    bbp_reply_url() calls bbp_get_reply_url.

    This function does maths by dividing the reply position by the number of replies per page in /includes/replies/template on line 487

    $reply_page = ceil( (int) bbp_get_reply_position( $reply_id, $topic_id ) / (int) bbp_get_replies_per_page() );

    bbp_get_reply_position gets the menu order in line 1742

    $reply_position = get_post_field( 'menu_order', $reply_id );

    Now I’m not sure if this reply position is comma separated, or if it is blank, then the rest of this function is adding a comma. The remainder of then function calls bbp_get_reply_position_raw which is in /includes/replies/functions

    this calls bbp_get_topic_reply_count, and in this function I think we have the issue.

    The function is in /includes/topics/template but in includes/core/filters.php

    we have a hook in line 177 which has

    add_filter( 'bbp_get_topic_reply_count', 'bbp_number_format', 10 );

    ‘bbp_number_format’ by default pouts the 000’s comma separator in.

    so if we remove this filter it should work.

    END OF…..IF YOU JUST WANT THE ANSWER – IGNORE THIS SECTION

    So try this in your functions file

    add_action('plugins_loaded', 'rew_fix_reply_numbers');
    
    function rew_fix_reply_numbers () {
    	remove_filter( 'bbp_get_topic_reply_count',    'bbp_number_format', 10 );
    	add_filter( 'bbp_get_topic_reply_count',    'rew_number_format', 10 );
    }
    
    function rew_number_format( $number = 0, $decimals = false, $dec_point = '.', $thousands_sep = '' ) {
    
    	// If empty, set $number to (int) 0
    	if ( ! is_numeric( $number ) )
    		$number = 0;
    
    	return apply_filters( 'rew_number_format', number_format( $number, $decimals, $dec_point, $thousands_sep ), $number, $decimals, $dec_point, $thousands_sep );
    }

    Let me know either way if this works !!

    #190366
    Mal
    Participant

    When I create in /wp-content/themes/my-theme/bbpress/loop-topics.php then I can overwrite the default BBPress template this way.

    But creating /wp-content/themes/my-theme/bbpress/loop-topics-[FORUM_ID_HERE].php doesn’t use this template for that category ID which seems to be against https://developer.wordpress.org/themes/basics/template-hierarchy/ and https://codex.bbpress.org/themes/theme-compatibility/template-hierarchy-in-detail/

    Is there a way to create a separate page template per forum ID without using conditional tags in loop-topics.php?

    #190363
    alriknijdam
    Participant

    Hi there,

    I’m trying to write a script for displaying the recently active topics in general, and active topics since last visit for users. However, I’m running into a problem with bbp_reply_url();

    It works fine for most topics, but we also got some rather large topics. For those the url is not generated correct: It misses the /page/1234/ part, e.g:
    /forums/topic/kleine-vario-vragen-topic/#post-669703 is wrong.
    It should be /forums/topic/kleine-vario-vragen-topic/page/259/#post-669703

    The same thing happens when I click the reply ID in the reply header, it also generates an url without the /page/1234/ part.

    For those urls missing the /page/1234/ part they redirect me to the first page of the topic, instead of the last page & reply. Can anyone help me solve this?

    Best regards,

    #190355
    jyotixxx
    Participant

    The solution is quite simple. You have to just know where to add the code.

    To get the social login at the bottom of forum home, one need to add it to the bottom of content-archive-forum.php
    If u wish to show it under a single forum, then the template is content-single-forum.php
    If u wish to show it under all topic then it is bottom of content-single-topic.php

    #190342
    alriknijdam
    Participant

    Hi there,

    I’m expiriecing a minor template issue within BBpress.
    When I try to move or split a post the form is not showing as supposed to, for example:
    form not showing as supposed to
    It doesn’t matter if I make the screen big or small.
    <div class="inside-article"> has a width of 864px.

    It’s not a big issue as this function is only available for moderators, but still.

    Best regards,
    Alrik

    #190301
    Robin W
    Moderator

    you will also need to change the fonts as it is currently black, so also add these

    .wp-embed {
    	color: #fff !important;
    }

    and

    .wp-embed-heading a {
    	color: #fff !important;
    }
    #190300
    Robin W
    Moderator

    Easiest way is to change the display using css. Add these to your theme custom css

    remove logo by

    .wp-embed-footer {
    	display: none !important;
    }

    and change the background via

    .wp-embed {
    	background: #000 !important;
    }
    #190258
    Robin W
    Moderator

    the no follow is added at output, not on saving.

    so we need to see if the topic/reply is written by an admin or editor and then remove the filter that does the no-follow

    This coded is untested, but should work

    
    add_filter ('bbp_get_topic_content' , 'follow_topic_if_admin' , 10 , 2) ;
    
    function follow_topic_if_admin ($content, $topic_id) {
    	$user_id = bbp_get_topic_author_id( $topic_id ) ;
    	$user_meta=get_userdata($user_id);
    	$user_roles=$user_meta->roles;
    	$allowed_roles = array('editor', 'administrator');
    	if( array_intersect($allowed_roles, $user_roles ) ) { 
    		remove_filter( 'bbp_get_topic_content', 'bbp_rel_nofollow',   50   );
    	}
    return apply_filters( 'follow_topic_if_admin', $content, $topic_id );
    }
    
    add_filter ('bbp_get_reply_content' , 'follow_reply_if_admin' , 10 , 2) ;
    
    function follow_reply_if_admin ($content, $reply_id) {
    	$user_id = bbp_get_reply_author_id( $reply_id ) ;
    	$user_meta=get_userdata($user_id);
    	$user_roles=$user_meta->roles;
    	$allowed_roles = array('editor', 'administrator');
    	if( array_intersect($allowed_roles, $user_roles ) ) { 
    		remove_filter( 'bbp_get_reply_content', 'bbp_rel_nofollow',   50   );
    	}
    return apply_filters( 'follow_reply_if_admin', $content, $reply_id );
    }

    Add this to your functions file.

    Let me know if it works

    #190251

    In reply to: Importing data via sql

    Stephen Edgar
    Keymaster

    Sorry for the late reply Dirk, could you post your “custom” importer code to https://gist.github.com/ and I’ll take a look ๐Ÿ™‚

    kat45
    Participant

    Hi,
    A couple of questions related to link redirection and pagination:

    1. We’ve managed to implement threaded replies with paging with the help of this tutorial:
    https://wpup.co/bbpress-threaded-nested-replies-with-paging/
    but we’re still having problems with the links under recent comments and freshness, which won’t forward you to the correct page but to the first page of the topic. Any help on how to fix this?

    2. How can we include page numbers also on top of the topic page (currently page numbers are at the bottom of the page)? Tried to follow the suggestion at the tutorial site: “copy the code from Step 6 and paste it anywhere on top of where the the topic listing code starts” but it didn’t work.

    3. How can we include navigation (page numbers) on the forum’s topic page, next to the topic names?

    Our website
    We’re using WP v. 4.9.4, theme Himalayas (1.1.1) and bbPress v. 2.5.14.

    Any help would be greatly appreciated! ๐Ÿ™‚

    #190232
    Martin J
    Participant

    Actually…. the solution above wasn’t going to work because if breadcrumbs are enabled and someone clicks on the “Forum Home”, we lose all the effort. However, I finally found the conditional statement that works.

    This is only part of my code, but you can get the idea…I originally had this:

    
    // For Jetpack Portfolio heading
    elseif (is_post_type_archive()) :
    echo '<h1 id="bts-page-title">' . __( 'WordPress Themes', 'bts' ) . '</h1>';
    
    // For bbpress forum heading
    elseif (is_bbpress('forum')) :
    echo '<h1 id="bts-page-title">' . __( 'Support Forum', 'bts' ) . '</h1>';

    However, when I did this, it worked:

    // For bbpress forum heading
    elseif (is_bbpress('forum') || is_post_type_archive('forum') ) :
    echo '<h1 id="bts-page-title">' . __( 'Support Forum', 'bts' ) . '</h1>';
    
    // For Jetpack Portfolio heading
    elseif (is_post_type_archive()) :
    echo '<h1 id="bts-page-title">' . __( 'WordPress Themes', 'bts' ) . '</h1>';

    Now what is interesting, is that if I have the bbpress conditional “after” the Jetpack portfolio one, it would not work and the bbpress heading would be “WordPress Themes”. However, I had this sudden thought that perhaps there is a priority happening here, so I moved the bbpress conditional “before” the Jetpack one, and sure enough it works. The bbpress heading is “Support Forum” and the Jetpack portfolio is “WordPress Themes”.

    Something about the sequence caused an issue…what and why I do not know.

    #190229
    Martin J
    Participant

    Ah….found a fix for the above/last reply. I added the id of the page, so now the custom-bbpress.css only loads for bbpress and that page.

    if (is_bbpress() || is_page( 209 ) ) :

    #190228
    Martin J
    Participant

    Update: I had this in my functions:

    if ( is_bbpress()) {
    ….etc.

    But adding:

    is_page()

    Means that the custom-bbpress.css is going to load on all “pages”. A temporary solution, but not really the right solution.

    #190224
    bunse2011
    Participant

    I am using divi theme, I want to remove the default sidebar in forums page, so I create a new page name “forums”, and add some module and bbpress shortcode in it, but the forums page always look the same with default.

    site link

    #190223
    nitehawk
    Participant

    Robin–thanks for the encouragement! muchly needed, I have been fighting with this forum section of my webpage, steady, for several weeks-literally..
    I went back at it again today, re- did all my forums, cause I had somehow ( don’t know how it happened) deleted my page that held the forums.( but not the forums themselves) Because it was all scrambled I deleted everything and started over. I got almost everything in place, but now have ran into a new “snag” Don’t know what I am doing wrong…:-(
    I made a new forum PAGE to hold all the forums in , and put the short code [bbp-forum-index] โ€“ in the main content section like I did before, only this time when I go to “visit site” the “holding page”won’t put my forums inside the page..
    when I click on the menu bar to go to the forums this comes up–

    Index of /forum
    Parent Directory
    cache/
    Apache Server at theamericanquarterhorse.com Port 80

    I can manually type in after the URL /forums
    and the forums will come up manually..
    Also, in the main sections that shows all the forums and topics for some reason 2 of them say there is 0 topics in them and that is not the case, I put several topics in the forums, an it shows on the backside there is a topic in there, but not on the topside…
    Appreciate any advice
    thanks!!

    Oh yes about the pigs–here in my area the favorite is Landrace X Yorkshire. The local 4-H kids seem to do well with that cross. there is a few Berkshires around the country too..

    #190221
    pixelnated
    Participant

    Since I was helping a friend convert a phpbb2 board to phpbb3 I thought I’d take the time to also import the forums into bbpress (my preference).
    I initially tried the import but could not get it to work and after looking on the forums saw that I was not alone.
    To get the import to work I had to remap some fields in the phpbb conversion script and comment out some obsolete ones (took about 30 minutes.

    If anyone needs to get your PHPBB3 users and forums converted in BBPress you can replace the phpBB.php file in wp-content\plugins\bbpress\includes\admin\converters to match the following updated code: https://gist.github.com/pixelnated/a7a9c41154cf64696ddd1c2e4f4327ed

    #190205
    Robin W
    Moderator

    simplest way would be to

    create a page with a permalink of ‘forums’ (assuming that is what your forums are called in dashboard>settings>forums>forum root slug>forum root)

    but with a title of whatever you want the forum page to be called

    and just put this shortcode in it

    [bbp-forum-index]

    That should work

    #190198

    In reply to: Visual pbs ?

    Robin W
    Moderator

    From @matevoun

    Then, now :

    1/ I think this is because i’ve installed bbPress Enable TinyMCE Visual Tab plugin, but i need this for uploading new media… ๐Ÿ™

    2/ Yes, tell me what can i do… ๐Ÿ™‚

    3/ Done ! Thank you ! I’ve installed your plugin. ๐Ÿ˜‰

    4/ I think this is a too little for texte + avatar.

    How can i do now ?

    Hope to read you soon…

    1. As a test deactivate that plugin and see if it works without. If so re-enable and contact that plugins author

    2. for the forum list

    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/loop-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/loop-single-forum.php
    bbPress will now use this template instead of the original
    and you can amend this

    so change line 68
    <span class="bbp-topic-freshness-author"><?php bbp_author_link( array( 'post_id' => bbp_get_forum_last_active_id(), 'size' => 14 ) ); ?></span>

    amend 14 to whatever size you want

    3. glad you like it

    4. without knowing exactly what you want, I cannot suggest css changes – I suspect we will not fix this one

    #190193
    TiiuK
    Participant

    Wait … I forgot I didn’t install the 2.6 Beta of bbPress again. I now did and the conversion started, but it didn’t work out, here’s the log:

    Import Finished
    
    17: No threaded replies to import
    
    16: No anonymous reply authors to import
    
    WordPress-Datenbank-Fehler: [Unknown column 'posts.post_text' in 'field list']
    SELECT convert(posts.post_id USING "utf8mb4") AS post_id,convert(topics.topic_id USING "utf8mb4") AS topic_id,convert(posts.forum_id USING "utf8mb4") AS forum_id,convert(posts.topic_id USING "utf8mb4") AS topic_id,convert(posts.poster_ip USING "utf8mb4") AS poster_ip,convert(posts.poster_id USING "utf8mb4") AS poster_id,convert(posts.post_username USING "utf8mb4") AS post_username,convert(posts.post_text USING "utf8mb4") AS post_text,convert(posts.post_time USING "utf8mb4") AS post_time FROM forum_posts AS posts LEFT JOIN forum_topics AS topics USING (topic_id) WHERE posts.post_id != topics.topic_first_post_id LIMIT 0, 100
    15: No replies to import
    
    14: No favorites to import
    
    13: No topic subscriptions to import
    
    12: No topic tags to import
    
    11: No closed topics to close
    
    10: Keine Super-Stickies zum Anheften vorhanden
    
    9: Keine Stickies zum Anheften
    
    8: No anonymous topic authors to import
    
    WordPress-Datenbank-Fehler: [Unknown column 'topics.topic_posts_approved' in 'field list']
    SELECT convert(topics.topic_id USING "utf8mb4") AS topic_id,convert(topics.topic_posts_approved USING "utf8mb4") AS topic_posts_approved,convert(topics.forum_id USING "utf8mb4") AS forum_id,convert(topics.topic_poster USING "utf8mb4") AS topic_poster,convert(topics.topic_first_poster_name USING "utf8mb4") AS topic_first_poster_name,convert(posts.poster_ip USING "utf8mb4") AS poster_ip,convert(posts.post_text USING "utf8mb4") AS post_text,convert(topics.topic_title USING "utf8mb4") AS topic_title,convert(topics.topic_status USING "utf8mb4") AS topic_status,convert(topics.topic_type USING "utf8mb4") AS topic_type,convert(topics.topic_time USING "utf8mb4") AS topic_time,convert(topics.topic_last_post_time USING "utf8mb4") AS topic_last_post_time FROM forum_topics AS topics INNER JOIN forum_posts AS posts USING (topic_id) WHERE posts.post_id = topics.topic_first_post_id LIMIT 0, 100
    7: No topics to import
    
    6: No forum subscriptions to import
    
    5: No forum parents to import
    
    WordPress-Datenbank-Fehler: [Unknown column 'forums.parent_id' in 'field list']
    SELECT convert(forums.forum_id USING "utf8mb4") AS forum_id,convert(forums.parent_id USING "utf8mb4") AS parent_id,convert(forums.forum_topics_approved USING "utf8mb4") AS forum_topics_approved,convert(forums.forum_posts_approved USING "utf8mb4") AS forum_posts_approved,convert(forums.forum_name USING "utf8mb4") AS forum_name,convert(forums.forum_desc USING "utf8mb4") AS forum_desc,convert(forums.left_id USING "utf8mb4") AS left_id,convert(forums.forum_type USING "utf8mb4") AS forum_type,convert(forums.forum_status USING "utf8mb4") AS forum_status FROM forum_forums AS forums LIMIT 0, 100
    4: No forums to import
    
    3: Skipping password clean-up
    
    2: Skipping user clean-up
    
    WordPress-Datenbank-Fehler: [Specified key was too long; max key length is 1000 bytes]
    CREATE TABLE oahfp_bbp_converter_translator ( meta_id mediumint(8) unsigned not null auto_increment, value_type varchar(25) null, value_id bigint(20) unsigned not null default '0', meta_key varchar(191) null, meta_value varchar(191) null, PRIMARY KEY (meta_id), KEY value_id (value_id), KEY meta_join (meta_key(191), meta_value(191)) ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci
    1: Recreating sync-table
    
    Continuing Import
    
    Previously stopped at step 1 of 17
    

    I appreciate any help!

    #190189
    Martin J
    Participant

    Hopefully I got the right forum here.

    I want to add a heading when on the “forums” archive home page of the bbpress forum. Right now I have this for jetpack’s portfolio…note this is just a snippet of my code:

    if (is_post_type_archive()) :
    echo '<h1 id="bts-page-title">' . __( 'WordPress Themes', 'bts' ) . '</h1>';

    …but the bbpress forum header area is loading that title as well. I’ve tried so many variations and conditionals, none work. I did manage to get the “forum” titles to show for individual forums with:

    elseif (is_bbpress('forum') ) :
    echo '<h1 id="bts-page-title">' . __( 'Support Forum', 'bts' ) . '</h1>';

    But does anyone have an idea how to get the conditional to show a custom header title for the bbpress home page?

    #190183
    urphy73
    Participant

    Hello
    If want to use that for only 1 forum where exactly di I have to put the ID in this code ?
    Thanks a lot

    #190178
    Stephen Edgar
    Keymaster

    Here’s the exact change in that code that was added for the next bbPress release

    https://bbpress.trac.wordpress.org/changeset/6129/

    #190136
    sasenzon
    Participant

    Hello. I just started using a new forum with my bbpress.
    bbpress โ€“ 2.5 14-6684
    wp 4.9.4
    The site is members.institutechiro.com

    A user just forwarded me his email and it is full of code. Example.
    <p class=”p1″><span class=”s1″>Great first week content.</span></p>
    <p class=”p1″><span class=”s1″>I was interested to know that an intellectual generation has 33 integers; making me a 4th gen chiro.</span></p>

    please help.
    Thanks.
    Simon

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