Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 7,001 through 7,025 (of 32,519 total)
  • Author
    Search Results
  • #171379
    Indrekkor
    Participant

    Trying to display fewer replies for mobile users.

    Before getting to the mobile users ran into a problem that the following filter:

    
    function mobile_replies() {
    $args['posts_per_page'] = 10;
    return $args;
    }
    
    add_filter('bbp_before_has_replies_parse_args', 'mobile_replies', 10, 1 ); 

    Works, but, it does not change pagination values in the view loop-single-topic.php problem is with the function bbp_topic_pagination()

    For whatever reason it is not affected by filters.

    In addition changing the rendering type to “list” with this function affects everything else, but not the pagination show in single forum view.

    function bbpress_custom_pagination( $args ) {
    
    	$args['type'] = 'list';
    	$args['prev_text'] = '«';
    	$args['next_text'] = '»';
    
    	return $args;
    
    }
    add_filter( 'bbp_topic_pagination', 'bbpress_custom_pagination' );
    add_filter( 'bbp_forum_pagination', 'bbpress_custom_pagination' );
    add_filter( 'bbp_replies_pagination', 'bbpress_custom_pagination' );
    
    

    Any thoughts?

    Probably adding filters to wrong functions

    #171373
    mgsolidus
    Participant

    Update: creating a page with the [bbp-forum-index] shortcode works, no idea why it’s broken on the default forum root.

    #171368
    TKServer
    Participant

    Wow I can’t believe it but I figured this out.

    Basically I wrote a function that looks for a result to the bbpress function bbp_reply_id();

    IF there’s a result, then replaced my $item_id (the actual post id such as $post->ID) with the id of the reply.

    That did the trick. One problem though is that the bbpress bbp_reply_id(); function echoes the number, so I had to clean the echo off like this:

    ob_start();
      $result = bbp_reply_id();
      ob_end_clean();
    #171360
    TKServer
    Participant

    I decided to program my own Like/Dislike plugin so I could customize it and tweak it for my exact needs. It’s working great in my custom threaded forum view for bbpress here:

    Ute Fan Board

    By using the hook bbp_theme_after_reply_admin_links I’m able to get the like buttons to show up in the bbpress topics and replies, but they’re all the parent topic. See photo below.

    bbpress like button

    Here’s one of my hooks:

    //adds the like buttons right of the time on forum posts in bbpress
    function tk_after_bbpress_content() {
         $custom_content_after_forum_title = tk_like_buttons();
        echo $custom_content_after_forum_title;
    }
    add_action( 'bbp_theme_after_reply_admin_links', 'tk_after_bbpress_content' );

    Hoping perhaps @robkk or @casiepa have some ideas? I can’t get the post id into the plugin for replies. Thanks!

    #171356
    Pascal Casier
    Moderator

    Hi,

    Check out ‘Peter’s Login Redirect plugin’.

    I saw somebody also using this (but did not test myself):

    function login_redirect( $redirect_to, $request, $user ){
        return home_url('forums');
    }
    add_filter( 'login_redirect', 'login_redirect', 10, 3 );

    Pascal.

    #171349
    peter-hamilton
    Participant

    Is this BBPress though, I see xenoforo code only

    #171347
    phudack7
    Participant

    Thanks Pascal. Both of these worked great. One last question, I have a login page that’s separate from the forum page. Do you have a code I can put in my functions file that will redirect a user to the forum page once they have logged in?

    Thanks so much

    #171346

    In reply to: Forum Page not created

    Robin W
    Moderator

    sorry someone has edited that page and made it less helpful.

    Try

    Now we have some forums, we need to have somewhere to display them.
    There are two ways to do this. Most themes support method 1, and this can (can not will) produce tighter theme integration on style [Note this was true for v 2.2 not sure if it still is !]. However Method 2 allows you to have some introductory words. Your choice…!
    Method 1
    This requires a couple of checks first
    a. In Dashboard>settings>forums look for what is set in the forum root under the forum root slug heading. The default is ‘forums’ but you can set this to anything
    b. In Dashboard>settings>permalinks check that the common settings check is set to ‘postname’ If it isn’t and you don’t want to change it, then use method 2.
    Now just create a wordpress page that has the heading that was found in a. above eg if the root slug is ‘forums’ create a page with the title ‘forums’, and save.
    Once the permalink has been created, you can rename the page to whatever you wish eg ‘mysite forums’ (as the permalink will stay the same, and it is this permalink that bbpress looks for)
    Save this page, add it to a menu if you are using custom menus, or decide its order if you have automatic menus. Then publish it to your site.
    Job done!
    Method 2
    If either your theme doesn’t work with method 1, you don’t want permalinks with postname, or you want to use some introductory text (eg “welcome to our forums…”, then method 2 is for you.
    In dashboard>pages
    go to add new page
    Call this ‘Forums’ or whatever you want your menu item to be.
    Then in the content section, you may want to have some introductory words “welcome to the forum” etc. then add the following bbpress shortcode
    [bbp-forum-index]
    Save this page, add it to a menu if you are using custom menus, or decide its order if you have automatic menus. Then publish it to your site.
    You will now have a forum page, and a forum to display.

    #171343

    In reply to: Forum Page not created

    Robin W
    Moderator
    #171334
    drew345
    Participant

    I installed bbPress and am following the “creating content” instructions from this webpage:

    Creating Content


    I created a forum using the instructions under “Creating a Forum”. The forum (called “Purchasing”) shows up under (Forums: All Forums) in my control panel.
    The instructions say that my forum will be created at:
    http://yourdomain.com/forums/forum/yourforumname

    But when I look at my wordpress pages in the control panel, there is no page for “forum” or any subforum created yet.

    How do I actually put the forum as a “forum” page in my website? Even though I create forums, there is no forum page created. Do I have to create that top level “forum” page manually using an “add page” from my dashboard?
    Thanks,

    #171323
    Robin W
    Moderator

    Quickest way is to hide it using css

    so in your style.css add

    .bbp-pagination-count {
       display: none;
    }
    

    https://codex.bbpress.org/functions-files-and-child-themes-explained/

    #171316
    Robin W
    Moderator

    If you made different versions of this function, you could test which url you are on and do the appropriate one?

    eg

    function change_root_english ( $args = array() ) {..the code in here with English words....}
    
    function change_root_danish ( $args = array() ) {..the code in here with Danish words....}
    

    then

    if [site is English one]  {
    add_filter ('bbp_get_breadcrumb', 'change_root_english') ;
    }
    if [site is Danish one] {
    add_filter ('bbp_get_breadcrumb', 'change_root_danish') ;
    }
    

    I’m sure some googling would produce a test for which site you are on to go in the [].

    #171304
    The_Desperate
    Participant

    Hey guys,

    First of all, thank you so much for making this very cool forum plugin for everyone to use!
    I do one question, and I’ve just spent a few hours studying the archives and looking for answers, but the thing is… I haven’t really understood any of them. I don’t know anything about child themes, I have no idea how to look for specific codes, although of course I am able to implement changes to a code once I’ve found it. I’ve tried looking for a plug-in for changing the font size, but failed.
    Now, my question would be: Is it possible for somebody who knows close to nothing about the matter to actually do it? I’m running version 2.5.8. My WordPress version is 4.4.2.

    My forum URL is http://lutrinians.com/forums/

    All I can see under Plugins > Editor is:

    Plugin Files

    bbpress/bbpress.php
    bbpress/license.txt
    bbpress/languages/index.php
    bbpress/index.php
    bbpress/includes/index.php
    bbpress/humans.txt
    bbpress/templates/index.php
    bbpress/readme.txt

    Also, I am not using any programmes to edit the codes, just doing it in the browser.

    Many thanks in advance!

    #171278
    Pascal Casier
    Moderator

    1) Activity stream
    I suppose you talk about the BuddyPress activity stream here ?
    If so, maybe this code could get you started (found it on the BuddyPress forum). It will block ALL new topics/replies, so if you tune that to your private forums, it could be what you are looking for.

    // Filter bbPress from updating activity stream
    function imath_activity_dont_save( $activity_object ) {
    $exclude = array( 'bbp_topic_create', 'bbp_reply_create');
    // if the activity type is empty, it stops BuddyPress BP_Activity_Activity::save() function
    if( in_array( $activity_object->type, $exclude ) )
    $activity_object->type = false;
    }
    add_action('bp_activity_before_save', 'imath_activity_dont_save', 10, 1 );

    2) To limit access to /forums, create a page with the slug /forums and add in that page what you want (a bbPress shortcode or just text). The creation of this page will prevent the standard forum index page to come up. Of course using any ‘members’ plugin, you could then e.g. make sure only admins could access.

    Pascal.

    #171275
    Pascal Casier
    Moderator

    Different options then. You could try the below code in your 404.php file:

    <?php $actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
    
    	$actual_link = explode('/',$actual_link);
    	if($actual_link[3]=="forums") { ?>
    	<h2 class="article-title"><?php _e( 'This forum is private. Please login to access this forum' ); ?></h2>
    	<?php } else {?>
    <img src="<?php echo get_template_directory_uri();?>/assets/images/404_image.png"><br>

    Hope it helps…
    Pascal.

    #171264
    terranova23
    Participant

    Thanks for your reply, Pascal.

    In that case, that plugin is probably not going to help us anyway. So never mind the shortcode error.

    Our problem is still with the bbPress activity stream, we are hoping to limit its contents to only should be visible to members of a particular group. We are using MemberMouse and the bbPress MemberMouse extension to limit users access to only the forums they are taking a class for, but they are seeing activity from other forums in the feed.

    Also, we would like to limit access to this default bbPress page to be private for admins only, if at all possible: http://www.themysticdreamacademy.com/forums/

    Hope someone can help us with one or both of these issues.

    Thanks,
    Rory

    #171250
    terranova23
    Participant

    Hi there,

    I’m helping a client resolve an issue with their bbPress Activity Stream. Their website has many online classes that are kept separate from each other, and their wish is to have the Activity Stream only show activity that is relevant to the forum a user has access to, and keep info from other forums private (they are using MemberMouse to restrict access). I did some research on here and on Google and found several threads that talked about similar issues, but wasn’t able to find any solutions.

    The site uses the latest version of WP (4.4.2) and bbPress (2.5.8) and is located at http://www.themysticdreamacademy.com/

    I thought the bbPress Activity Stream Shortcode Plugin would do the job, so I installed that and did a quick test, but I’m getting this error: Fatal error: Call to undefined function bp_has_activities() in /home/myst1cadm1n/public_html/wp-content/plugins/bp-activity-shortcode/bp-activity-as-shortcode.php on line 102

    If that issue could be resolved, we may be all set since we can set up shortcodes to display different streams for different forums. Otherwise, we’d like to know if there’s a way to limit the Activity Stream to only show content the user has access to.

    Finally, my client is also concerned about the default forums page, which shows a listing of recent topics from all forums and is visible to anyone who finds it: http://www.themysticdreamacademy.com/forums/ Users who aren’t logged in aren’t able to click any of the links, but they are still concerned about privacy. Is it possible to make this page private so only logged-in admins can see it? Or can it be removed somehow?

    Thanks for your time,
    Rory

    #171249
    Pascal Casier
    Moderator

    Hi,

    To fix when the user logs out, you could use this code. Add it into your functions.php and change $url to whatever you want as page.

    function casiepa_logout ($redirect_to) {
    	$url='/forums/' ;
    	$redirect_to = '<a href="' . wp_logout_url( $url ) . '" class="button logout-link">' . esc_html__( 'Log Out', 'bbpress' ) . '</a>' ;
    	return $redirect_to ;
    	}
    	
    add_filter ('bbp_get_logout_link', 'casiepa_logout') ;

    Pascal.

    #171247
    #171239
    Pascal Casier
    Moderator

    You use v3.8.7 ? Please notify the creators of the Avada theme because it’s a bug on there side.

    In Avada/includes/class-layout-bbpress.php, change line 84 as follows:

    Original:
    <div class="bbp-reply-post-date"><?php bbp_topic_post_date( bbp_get_topic_id() ); ?></div>

    Modified:
    <div class="bbp-reply-post-date"><?php bbp_reply_post_date( bbp_get_reply_id() ); ?></div>

    Pascal.

    #171232
    Pascal Casier
    Moderator

    Copy the file ‘/wp-content/plugins/bbpress/templates/default/bbpress/feedback-no-forums.php’ to a child theme and then modify the file to what you want to obtain.

    Pascal.

    #171228
    boionfire81
    Participant

    Yeah, I still don’t know what I’m doing wrong.

    Changed line 44 like the step-by step guide said to remove the (#,#) after the forum names, but they are still there.

    Step-By-Step Guide

    Robin W
    Moderator

    ok, @membershipsite101

    This old link talks about using templates

    https://optimizepress.zendesk.com/hc/en-us/community/posts/200815558-OptimizePress-2-bbPress-Total-Mess-Let-s-get-this-fixed-now-

    and suggests putting

    if (is_bbpress()) { include 'bbpress.php'; exit; }
    

    on top of index.php (for the forum-index) and single.php (for the topics) and then style the bbpress.php in the /themes/optimizePressTheme/ /themes/1/ (or whatever OP2 blog-theme you’re using) to your liking.

    If you’re a bit techy, might be worth looking at.

    #171208
    Stephen Edgar
    Keymaster

    Using your code I get a blank white page with yes

    Also to note, the screenshot I posted above of Chrome inspector includes at the bottom that topic.js?ver=2.5.8-5815 has correctly loaded.

    Are you sure you haven’t got any other plugins or code stashed in a functions.php or hacks elsewhere that may be causing your issues?

    mauryg
    Participant

    @membershipsite101
    Using the index shortcode on the ‘forum’ page is perfectly normal. If you leave the /forum page blank then you can choose whether to show the forums index or the topics index on the bbpress settings page.
    As I noted before the URL of the Welcome page says it is a subpage of the ‘Help’ page (http://membershipsite101.com/help/welcome). So I would expect it to use the template of the /help page, not the one of the /forum page. Do you perhaps have a page titled ‘Welcome’? Try hovering over the forum title on the /forum page and see what the link says. If the forum root is ‘discussion’ then the /welcome page should be either /discussion/welcome or /forum/discussion/welcome.
    I think you need to review your bbpress settings again. Look at my page http://spaug.net/forums.
    I use the bbpress default settings as follows:
    Forum root slug: forums
    Forum slug: forum
    Topic slug: topic
    And I check the ‘Forum Prefix’ box as recommended.
    Then my URLs are as follows:
    Root page: sitename/forums
    Individual forum page: sitename/forums/forum/forum-name
    Individual topic page: sitename/forums/topic/topic-title
    I suggest that you try changing the forum root slug to ‘forum’ or ‘forums’
    Finally, unless you are very adept at CSS modifications, I recommend the ‘bbp style pack’ plugin. It allows you to modify colors, fonts, font size, etc easily.
    Remember, whatever optimizepress theme template.php you want to use for the forums page (right sidebar, no sidebar, etc) make a second copy of it IN THE SAME FOLDER and rename it bbpress.php. That way bbpress will always use that template. I also make a copy of the bbpress.css file from plugin folder (\wp-content\plugins\bbpress\templates\default\css\bbpress.css) and put it in the theme folder. That way you can use the WordPress Editor (Appearance>Editor) to make changes.
    I just did a quick Google search on ‘Optimizepress and bbPress’ and it looks like there is a lot of incompatibility. I also noted that Optimizepress was discontinuing their support forum in favor of their ‘customer happiness team’. My condolences
    Having fun yet?

    Maury
    Maury

Viewing 25 results - 7,001 through 7,025 (of 32,519 total)
Skip to toolbar