mrhoratio (@mrhoratio)

Forum Replies Created

Viewing 20 replies - 26 through 45 (of 45 total)
  • I did some digging, and although I have not found a solution. I believe the conflict with mod_rewrite and bbPress is that bbPress is using the header() function to send raw HTTP headers to the client. I notice that two files contain header() functions that send a “Location:” header to the browser:

    • bb-load.php

    • pluggable.php

    These seem to be forcing bbPress to redirect the URLs, even after a mod_rewrite rule executes.

    I’m a total php novice, so I’m not really sure how to fix this.

    I just found a blog post about this, where the author has made the code into a plugin. It’s available for download here:

    How to remove forum and topic keyword from bbpress url

    The author lists two minor issues here, which hopefully someone here can suggest a fix for:

    • The Link to BBpress admin board link does not work from main site. It redirects to home page. You will need to manually type the link to go inside.

    • In case you type something which does not exists as http://sitename.com/<bbpress-directory>/sdaksda it returns http://sitename.com/<bbpress-directory&gt:// . An extra slash.

    Chris, you have a point. However the URL structure of forums and topics always begin with “forum” or “topic”. As in:

    http://www.example.com/bbpress/forum/pets-discussions/

    http://www.example.com/bbpress/topic/my-sweet-dog

    So it would seem that it should be possible to remove the “bbpress” from the URL without interfering with a WordPress installation.

    Having said that, I think the solution proposed in the thread I referred to in my last post (https://bbpress.org/forums/topic/nicer-slug-url-rewrite-plugin-done) is a much more elegant solution for shortening the bbPress URLs.

    Just found an earlier thread which hits on a similar problem with shortening the bbPress URL:

    nicer slug url rewrite plugin (done!)

    In the thread’s example. In shows you how to shorten a url like:

    http://www.example.com/bbpress/forum/pets-discussions/topic/my-sweet-dog

    to:

    http://www.example.com/bbpress/pets-discussions/my-sweet-dog

    Now, if it could also be shortened to:

    http://www.example.com/pets-discussions/my-sweet-dog

    That would be even better.

    Hi Bobby, yes I added those lines to the .htaccess file as well. It didn’t seem to fix the problem. So I tried adding it to rewrite-rules.php also.

    Hey bobby, here it is here:

    http://www.lifeclever.com/forums/

    Hi bobby, I tried out your hack in bbPress 0.9, and it doesn’t seem to work. Here’s what I did:

    I have my bbPress directory installed in a directory called “forums” in the root web directory. So the URL to access the forums’ home page is:

    http://www.example.com/forums

    and accessing a forum titled “test forum” is at this URL:

    http://www.example.com/forums/forum/test-forum

    a topic titled “test topic” is at this URL:

    http://www.example.com/forums/topic/test-forum

    I implemented your hack, and changed “forum” to “board” in the template-functions.php. I copied the rewrite rules from rewrite-rules.php and placed them into .htaccess file in the root web directory. I also added the two lines of code you suggested in that file:

    RewriteRule ^board/(.+)/page/([0-9]+)$ /forum.php?id=$1&page=$2 [L,QSA]
    RewriteRule ^board/(.+)/?$ /forum.php?id=$1 [L,QSA]

    I also tried adding this to the rewrite-rules.php:

    RewriteRule ^board/([^/]+)/page/([0-9]+)/?$ <?php bb_option( 'path' ); ?>topic.php?id=$1&page=$2 [L,QSA]
    RewriteRule ^board/([^/]+)/?$ <?php bb_option( 'path' ); ?>topic.php?id=$1 [L,QSA]

    When I go to this URL:

    http://www.example.com/board/test-forum

    I get a 404 error.

    However, when I go to this url:

    http://www.example.com/forums/forum/test-forum/

    It redirects and changes the URL in the address bar in the browser window changes:

    http://www.example.com/forums/board/test-forum/

    That also brings up a 404 page.

    Also, when I go this URL:

    http://www.example.com/topic/test-topic

    The URL works, but it redirects and changes the URL in the address bar in the browser window changes to:

    http://www.example.com/forums/topic/test-forum

    I am a little perplexed as to what is going on.

    Hey bobby, just curious. Why did you have to change the second “forum” to “board”? Is there anyway to just leave it as “forum”?

    Hey, I’m trying to figure this out also. Anyone figured out a way to remove the first “forum” in http://www.example.com/forum/forum/forum-name. So that the URL is shorter? I tried doing it with mod_rewrite, but having some issues with bbPress automatically redirecting.

    I did some more digging, and it looks a way to do is to not use BB_query at all, but to use $bbdb->get_results instead:

    $startdate=”20070602103049″;

    $enddate=”20080212090232″;

    $topics = $bbdb->get_results(“SELECT * FROM $bbdb->topics WHERE topic_start_time BETWEEN $startdate AND $enddate ORDER BY topic_start_time DESC”);

    I just did some fiddling in the bbPress functions.php file located in the bb-includes directory. I may have found a possible fix:

    On line 167, look for this code:

    $q = 0;

    Then delete or comment out everything except for the semicolon at the end:

    ;

    This seems to make topics that are stuck to the front page appear in the forum as well.

    Warning: I’m not well-versed in php, so I’m not sure if this will break anything in bbPress. If there’s a more elegent solution, please post it.

    In reply to: Categories in 0.901?

    I just did some fiddling in the bbPress functions.php file located in the bb-includes directory. I may have found a possible fix:

    On line 167, look for this code:

    $q['sticky'] = 0;

    Then delete or comment out everything except for the semicolon at the end:

    ;

    This seems to make topics that are stuck to the front page appear in the forum as well.

    Warning: I’m not well-versed in php, so I’m not sure if this will break anything in bbPress. If there’s a more elegent solution, please post it.

    In reply to: Categories in 0.901?

    Ah, it looks like there is another thread about this problem:

    Stick to front removes topic from forum?

    However, there’s not solution yet. Strange.

    In reply to: Categories in 0.901?

    Hey bobbyh. Is it possible to have it both on the “front” and within the topic as well?

    In reply to: Categories in 0.901?

    Hey bobby, thanks! I didn’t notice the “Stick topic (to front)” link before.

    However, there is a bug. If you click the “to front” link, the topic appears as a Sticky on the Latest Discussions list, but it disappears from the forum it was originally assigned. Seems like it should show up in both places. I did a test where I made a forum with one post in it. I made it Sticky on the front page. On the front page of bbPress, it shows the number of topics as “1” in that forum. However when you forum title, it doesn’t display any topic. Instead it takes you to a New Topic form.

    In reply to: Categories in 0.901?

    I agree. It’d be great to have categories, or at least the ability to allow moderators to assign editor “tags” to topics which only moderators can edit. For example, you could assign a topic the tag or category named “Front Page”. That way, you can create a bbPress template/theme that shows the Editor’s Picks.

    Hey CK, I’m very much interested in this plugin. Also, it’d be great if you can get it to work with WordPress. So, that you can have the ability to promote a forum topic to a show up in a WordPress loop.

    Hey bobby, thanks for the links to RSS aggregator plugin. The only problem I see is synchronizing the feed. For example, if you edit the post in bbPress, will it automatically update it in the WordPress loop also? Or will you have to manuallly edit it in WordPress also. I will have to investigate and see.

    Now that I think about it, is there a way to do this by pulling the RSS free from bbPress into WordPress? What do you think?

    Hey bobby, thanks. This is close to what I want to do, but I’d like to be able to combine select forum posts and blog posts into a single list. Maybe there’s way to modify the plugin to do so?

Viewing 20 replies - 26 through 45 (of 45 total)