Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 7,001 through 7,025 (of 32,508 total)
  • Author
    Search Results
  • #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

    #171190
    Robin W
    Moderator
    #171168
    Pascal Casier
    Moderator

    Hi,

    Check out the bbpress shortcuts on https://codex.bbpress.org/features/shortcodes/
    Under the ‘Topics’ header you will probably find what you need.

    Pascal.

    #171167
    Robin W
    Moderator
    #171160
    Andrew Tibbetts
    Participant

    Ooops.
    I have been jumping back and forth testing forum home and topics as they both don’t work and I copied the wrong line I was using.
    So, correction:

    …when i put echo is_singular( bbp_get_topic_post_type() ) ? 'yes' : 'no'; exit; on line 255 of bbpress/includes/common/template.php inside bbp_is_single_topic(), I get a white page that says “no”.

    I get the same “no” doing the forum check in the forum function while on the forum page.

    #171159
    Stephen Edgar
    Keymaster

    Your checking for is_singular() on the forum post type rather than the topic post type above in your code above.

    #171157
    Andrew Tibbetts
    Participant

    Thanks, Stephen.
    Ok, so, Query Monitor is telling me that topic pages are returning true on a bunch of is_s:

    is_page()
    is_singular()
    is_bbpress()
    bbp_is_single_topic()
    is_buddypress()
    bp_is_group()
    bp_is_group_forum_topic()
    bp_is_group_single()
    bp_is_groups_component()
    bp_is_single_item()

    But, when i put echo is_singular( bbp_get_forum_post_type() ) ? 'yes' : 'no'; exit; on line 255 of bbpress/includes/common/template.php inside bbp_is_single_topic(), I get a white page that says “no”.

    #171151
    Stephen Edgar
    Keymaster

    @andrewgtibbetts can you install the following two plugins and take another look?

    https://wordpress.org/plugins/query-monitor/
    https://wordpress.org/plugins/query-monitor-bbpress-buddypress-conditionals/

    Here’s what I see, is_single(), is_singular() and bbp_is_single_topic() all return true

    BbPress Topic JS

    #171150
    Stephen Edgar
    Keymaster

    @ dots Nice size forum, heres a few things that I hope will help:

    Firstly, can you try by using bbPress 2.6-alpha, you can find it here https://bbpress.org/download/

    1) Sometimes scripts are automatically stopped and script not start automatically.

    Sometimes things timeout, a workaround for this is to open another tab in your browser to example.com/wp-admin and refresh it occasionally

    2) Currently, lots of data is still pending to import in BBPress but the script is not running and in tools bottom section I can see only “Starting Conversion” and loader.

    This is similar to 1), by refreshing you should in another browser tab this should keep that issue at bay, this particular issue is usually when PHP drops the MySQL connection and needs refreshing to update the connection between WordPress and the database.

    3) I have noticed in the tool having the duplication issue you can see above in Xenforo only 83,813 topics but BBPress tool imported 83,867 records. So 54 records are duplicates. so this issue resolved using BBPress repair forum tabs?

    It could be duplicates, though I’ve only ever tested 3 or 4 Xenforo forums with bbPress, potentially using the repair tools might fix this though without some more information here it will be hard to take a guess. If you can supply a copy of a couple of duplicates I can take a closer look as to the reason why.

    4) BBPress import tool taking random data from the Xenforo database. I have noticed when I have started the script first the users come from the Xenforo. But unfortunately, the users are skipped and the tool has started to import the topic. So, I am a bit confused here BBpress import tool can complete import all the users, topic, forums, and replies successfully? you can see above my total Xenforo user is 1,59,679 and BBPress tool has imported only 94,600. and the now script has started to import replies.

    Again, it should do all of this correctly, though testing with bbPress 2.6-alpha per above will hopefully fix many, or most of the issues you are having, can you try using 2.6-alpha and let me know how that goes for you please 🙂

    Also a couple more tips in our docs:

    Import Troubleshooting

    mauryg
    Participant

    @membershipsite101
    Don’t know if we are talking about the same problem. It seems like your site is using a different HEADER template for the Welcome page. Also noted that the Welcome page is a subpage of the HELP page, not of the FORUMS page. Are you using bbpress shortcodes for this? You might want to check the bbpress settings page and see if the slugs are set correctly.
    But anyway, I looked at your site and I noticed that the bbpress.css file was being loaded from the bbpress plugin directory, not from the theme directory.
    Did you in fact copy the template.php file you want to use into the theme directory and rename it bbpress.php? I also strongly suggest copying the bbpress.css file into the theme directory as well so you can make changes to the bbpress styling easily.
    Hope this helps.
    Maury

    #171131
    dot
    Participant

    When BBPress is turned off, the error stops. When it is turned back on, the error starts again.

    Also, the BBPress rewrite rules, especially the root rewrite stub, are the only place in the entire code base that I can find the rewrite rule RegEx fragment.

    #171126
    Pelowtz
    Participant

    I am having the same problem as @aaronos.

    The bbPress page with the shortcode has the URL /forums, with the page title of “Forum”
    The forum root slug is set to “forum” in the forum settings
    The single forum slugs is set to “forums”
    The yoast SEO breadcrumb I am using shows home>forum on the forum index page (/forums)
    When I click into a topic the URL changes to /forum/forums/[FORUM TITLE]
    On the /forum/forums URLS the Yoast breadcrumb changes to “/forums” but it actually links to “/forum”

    NOTE: /forum is a page that does not technically exist (i.e. I did not create a page with this URL) yet some random topics show up on this page.

    I have tried every iteration of changing the UTL of the index page, the page name, and the two settings in bbPress with no success.

    I have to set the forum index URL to /forums for my forum index page to look properly, but essentially whenever I navigate to any post or topic the breadcrumb breaks.

    Thanks for any guidance and advice.

    http://vapementors.com/forums/

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