Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 7,801 through 7,825 (of 32,570 total)
  • Author
    Search Results
  • #167086
    Robkk
    Moderator

    It is just a conflicting piece of javascript somewhere in the file. If they already have a fix somewhere in that file for comment threading then something similar may need to be done to bbPress reply threading since both their scripts are very similar.

    Try this custom php code snippet. Place it in your child themes functions.php file or in a functionality plugin.

    add_action( 'wp_print_scripts', 'rkk_reply_threading_divi' );
    
    function rkk_reply_threading_divi() {
    
        if( function_exists( 'is_bbpress' ) && bbp_is_single_topic() && bbp_thread_replies() ) {
            wp_dequeue_script( 'divi-custom-script' );
        }
    }
    #167072
    nikhilnaik
    Participant

    Hello all,

    I wanted to seek help in modifying the following piece of code. I have a site with buddypress groups inside which I have bbpress forums for the respective groups. I want the users of the group to be automatically subscribed to the forums within that group. I tried the following code:

    add_filter( 'bbp_get_user_subscribe_link', 'invert_get_user_subscribe_link', 10, 4 ); //invert forum subscription
    add_filter( 'bbp_is_user_subscribed_to_forum', 'invert_is_user_subscribed_to_forum', 10, 4 ); //invert forum subscription
    add_filter( 'bbp_get_forum_subscribers', 'invert_get_forum_subscribers' ); //invert forum subscription
    add_filter( 'bbp_is_user_subscribed', 'invert_is_user_subscribed', 10, 4 ); //invert forum subscription
    
    function invert_is_user_subscribed($retval, $user_id, $object_id, $subscribed_ids) {
    	if (get_post_type( $object_id ) == bbp_get_forum_post_type())
    		return !$retval;
    	else	
    		return $retval;
    }
    
    function strContains($needle, $haystack) {
    	if (strpos($haystack, $needle) !== false) {
    		return true;
    	} else {
    		return false;
    	}
    }
    
    function invert_get_user_subscribe_link ($html, $r, $user_id, $topic_id) {
    	if (strContains( "bbp_unsubscribe", $html )) {
    		$html = str_replace("bbp_unsubscribe", "bbp_subscribe", $html);
    	} else {
    		$html = str_replace("bbp_subscribe", "bbp_unsubscribe", $html);
    	}
    	return $html;
    }
    
    function invert_get_forum_subscribers( $users ) {
    	$args = array('fields' => 'id');
    	$all_users = get_users($args);
    	$send_to_users    = array_diff($all_users, $users);
    	return $send_to_users;
    }
    
    function invert_is_user_subscribed_to_forum( $retval, $user_id, $forum_id, $subscribed_ids ) {
    	return !$retval;
    }
    

    But there is a problem. Using the following code leads to the user getting subscribed to all the forums of all the groups (even those which they aren’t a part of). I just want them to be automatically subscribed to those forum topics created inside the group which they are a part of. Kindly help me in getting this right.

    Thanks!

    #167062
    wpfundi
    Participant

    WP version: 4.3.1 multisite
    BuddyPress version: 2.3.3
    bbPress version: 2.5.8

    I have been trying to migrate BuddyPress legacy forums to bbPress following the instructions on this link https://codex.buddypress.org/getting-started/guides/migrating-from-old-forums-to-bbpress-2/

    But the migration/import is not going well, after the process:

    1) Topics are missing
    2) Replies are missing

    And during the process I can see “No topics to convert”, No replies to convert.

    When I check the database I can see wp_bb_topics etc.

    What am I doing wrong?

    Thank you in advance.

    #167059
    nikhilnaik
    Participant

    @casiepa, thanks for your response. I tried this:

    function user_subscriptions_count( $user_id = 1) {	
    	$forum_count = count(bbp_get_user_subscribed_forum_ids($user_id));	
    	echo  $forum_count;
    }

    but didn’t seem to work, could you assist in getting it right?

    #167054

    In reply to: Sidebar Help

    wesphily
    Participant

    This is the response I got from Nimva:

    Your code source and current page template might be generated using BBPress templates not by Nimva page templates. Try to edit that Forums page and see if it is possible change the current page template to Default page template under Page Attributes -> Templates. See if that does anything

    I think what they are asking me to do is create a page and put the forum index shortcode in it. Then they want me to try to adjust the page template to see if a sidebar shows up. This might work, but it would only work for the main index page. I don’t think this would work for every category/topic/ect.. unless I create shortcode pages for all of them.

    Can you all please advise?

    #167040
    thrivehau
    Participant

    I’m trying to follow https://codex.bbpress.org/step-by-step-guide-to-setting-up-a-bbpress-forum/ step 6, and every time I make a “forums page” the permalink becomes “forums-2” and I can’t edit it to just “forums”, like there’s already a link with that “forums” even though I don’t have a “forums” page already.

    When I delete the forums-related pages, the mydomain.com/forums is still there.

    I tried the method 2 from the codex, but I do not like it as the Home > forums is there and when I click on forums, it takes me to a blank page.

    How do I fix this permalink issue?

    #167038
    nikhilnaik
    Participant

    Hello All,

    I am using a buddypress+bbpress intergrated site, hence the bbpress profiles are disabled. Only buddypress profiles are made visible because of which I can’t figure out which user is subscribed to which forum. Is there a function or a shortcode using which I can display on the user dashboard the topics/forums he is subscribed to?

    Thanks.

    #167036
    Robkk
    Moderator

    Hi Rob, it is my theme’s style sheet with changed colour code and it’s not styling.

    Did you try adding !important to see if that would work??

    The index was fine – I assume because I filled in description and it’s filled out. Specific board indexes don’t fill to 100% nor do thread pages without much written in the posts.

    Yes. Sorry my mistake. It might be that bbPress is inheriting different templates for archive and single pages. Try to check that by installing the What the File plugin and see what template is being inherited from the forum archive and single topic pages and see if it is different.

    #167035

    In reply to: Sidebar Help

    Robkk
    Moderator

    Do you want full width forums and just the sidebar placed under the forums??

    If you do remove this part of the CSS code.

    .bbpress .sidebar {
      width: 0;
      display: none;
    }

    i can tell you are also using a full width template from your theme, and of course that will hide the sidebar.

    #167033
    Robkk
    Moderator

    Right after this in the code.

    <?php echo do_shortcode("[bbp-login]"); ?>

    Just add any additional forms you want using similar code like this. Or just add any html links to the pages.

    <?php echo do_shortcode("[bbp-register]"); ?>

    If you need to style them better add a custom class around them.

    #167032
    mica123
    Participant

    Thank you so much both of you – that’s very helpful indeed. I will now have to try and position it on one line. I hope I’ll manage it although it is not easy at all – @dannyfoo you seem to have managed it. Is there any way to add Register and Lost password to the code? Many thanks – I was getting really desperate.

    #167031
    Robkk
    Moderator

    It is in loop-single-topic.php and loop-single-forum.php.

    In the files you will see something similar to this. In this example I am editing the loop-single-topic.php file.

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

    Change it to something like this. You see I just added the extra attribute. 'type' => 'avatar'

    <span class="bbp-topic-freshness-author">
    	<?php bbp_author_link( array( 
                    'post_id' => bbp_get_topic_last_active_id(), 
                    'size' => 14 , 
                    'type' => 'avatar'
                    ) );
           ?>
    </span>

    bbp_author_link

    #167030
    Robkk
    Moderator

    You can create a bbpress.php file in your theme to avoid issues like that.

    Getting Started in Modifying the Main bbPress Template

    #167029
    Robkk
    Moderator

    Place something like this in content-forum-archive.php if you copied it into your child theme to display the login form above the forum archive. You can also place it above single forums by adding this exact code into content-single-forum.php and for topics in content-single-topic.php.

    <?php if ( !is_user_logged_in() ) : ?>
    
        <div class="bbp-forum-login-form">
            <?php echo do_shortcode("[bbp-login]"); ?>
        </div>
    
    <?php endif; ?>
    #167028

    In reply to: Sidebar Help

    wesphily
    Participant

    Robkk,

    Thanks for that. It fixed the space issue. Now I have to figure out how to get a sidebar working.
    I have been trying to do this by going to the page labelled “forums” that has the index shortcode in it and then adding a sidebar that I have created. I then added widgets to that sidebar. I have also tried content aware and bbpress wp tweak. I still can’t get a sidebar to show on the bbpress page. I can get it to show on any other page.

    #167027
    Danny
    Participant

    @mica123 Placing the login form above on the main Forums page created in your WordPress is easy.

    1. Edit your WP page containing [bbp-forum-index]
    2. Include [bbp-login] above that line
    3. Update the page

    And the login form will show above your forum index.

    I’ve not fully experimented placing the login above all the forum pages. Though I think it’s very much possible, and the answer may lie in other forum topics.

    What I could share though is I tried adding <?php echo do_shortcode("[bbp-login]"); ?> to loop-forums.php and loop-topics.php but it didn’t work.

    What happened was the list of forums and topics disappeared.

    I hope this was helpful.

    #167021
    aaron2310
    Participant

    Place the CSS code I gave you your child themes stylesheet or in a separate custom css plugin.

    Hi Rob, it is my theme’s style sheet with changed colour code and it’s not styling.

    The /forums page looks fine now, now it is only the single forums pages. Clear any cache to see if that could fix anything.

    The index was fine – I assume because I filled in description and it’s filled out. Specific board indexes don’t fill to 100% nor do thread pages without much written in the posts.

    #167019
    project_subdomain
    Participant

    I’d like to display the count of all existing replies for one topic like
    “Topic name One (56)”
    where 56 is the amount of replies.

    Is bbp_forum_reply_count() correct for this?

    How could I get the count to a specific menu which had been created through the backend’s design->menu,
    when the menu ID is 2 and the menu item ID of Topic name One is 11 and of Topic name Two is 22?

    Many thanks for any help!

    #167014
    Robkk
    Moderator

    Did you try some troubleshooting first? Check to see if it works fine in a default theme. If it still does not work in a default theme, try to see if a plugin could be causing the issue also by doing the listed steps for troubleshooting a plugin issue.

    Plugin/Theme updates could cause an issue to pop up without it previously being there before.

    Troubleshooting

    #167013
    Robkk
    Moderator

    The enable tinymce visual tab plugin just uses the exact same code in here.

    Enable Visual Editor

    I do not think cache could cause an issue like this.

    It is something that slipped my mind, but it is most likely that paragraph tags are considered restricted HTML for some reason.

    Use and edit this function in the plugin below to your liking.

    https://gist.github.com/ntwb/7797990

    You will most likely need to add this to make it work for participants.

    //paragraph
    'p'          => array(
    	'class'    => true,
    ),

    Admins/Keymasters can post unrestricted HTML because they have the capability to do so.

    #167012
    Robkk
    Moderator

    The only table I think bbPress creates is the one for importing forums/keeping extra imported forum data. Most of the data bbPress has are stored in WordPress tables, but all that data should be gone if you ran the reset forums tools(well except the forum roles).

    Stored Database Data

    If you are looking to delete users you can go into Users > All Users in the WordPress backend and then start bulk deleting users.

    #167007
    Bet Hannon
    Participant

    Yep, while it doesn’t do it when I post, it does print the <p> tags for at least some users–and that part is weird. It looks like this:

    <p>I completely support a focus on...

    I have the plugin “bbPress Enable TinyMCE Visual Tab” running. I haven’t been able to test yet, but the client really does need that full visual editor for their users, so I hope it’s not that.

    I did double-check the plain text filter. Maybe there was a caching issue with respect to the filter? I emptied all the caches just to be sure.

    #167002
    Robkk
    Moderator

    Nevermind I think you have to update to 4x, the other importer is for a much older version of vBull.

    Make sure to have a backup saved before doing an import. You may try doing a backup on a test server also.

    https://codex.bbpress.org/import-forums/vbulletin

    Import Forums

    Import Troubleshooting

    #167000
    Robkk
    Moderator

    The links are like this because that is how it is in your theme.

    You can try this custom css to remove the underline. Place the custom css in your child themes custom css or anywhere else you can place custom css like a plugin or theme.

    .bbpress .post-content a {
        text-decoration: none !important;
    }
Viewing 25 results - 7,801 through 7,825 (of 32,570 total)
Skip to toolbar