Skip to:
Content
Pages
Categories
Search
Top
Bottom

Possible to make certian forums not appear in latest discussion?

  • Hello there,

    I am starting to create a community using bbpress, so far I am getting most of the features I want besides a few that I am having difficulties grasping. One of these problems is I want to make a sandbox forum for testing and so forth, I want it to be open so all users have access to it however I do not want any of the posts appearing into the “latest discussions” as they are for testing purposes only.

    forums:

    http://voices.snailface.com/

    I am running 1.0.2

    Cheers,

Viewing 24 replies - 1 through 24 (of 24 total)

  • chrishajer
    Participant

    @chrishajer

    It works but it keeps bringing up this error (which is diffent the solution suggested in the post, which does not solve the issue in 1.0.2 apparently).

    The error when just using the plugin:

    Warning: Cannot modify header information – headers already sent by (output started at /home/whey/public_html/voices/my-plugins/exclude-forum.php:13) in /public_html/voices/bb-includes/functions.bb-pluggable.php on line 232

    The error when using the plugin and amending the function bb_latest_topics_pages() in functions.bb-template.php:

    Parse error: syntax error, unexpected T_STRING in /public_html/voices/bb-includes/functions.bb-template.php on line 666

    Any ideas?

    Cheers!


    chrishajer
    Participant

    @chrishajer

    Can you post the full code of exclude-forum.php please? If it’s too long, use something like pastebin rather than posting here.

    http://pastebin.com/

    If you post here, be sure to wrap code in backticks `, usually above the tab key on a US keyboard.

    <?php

    /*

    Plugin Name: exclude

    */

    function filter_front_page_topics($where){

    $exclude_forums=array (“13″,”19”); // enable this to manually specify specific forums by id #

    // $forums = get_forums(); foreach ($forums as $forum) {if ($forum->forum_parent) {$exclude_forums[]=$forum->forum_id;}} // exclude ALL sub-forums

    if ( is_front() ) {foreach($exclude_forums as $forum) { $where.=” AND forum_id != “.$forum.” “; }}

    return $where;

    }

    add_filter( ‘get_latest_topics_where’, ‘filter_front_page_topics’);

    add_filter( ‘get_latest_posts_where’, ‘filter_front_page_topics’);

    ?>


    chrishajer
    Participant

    @chrishajer

    I couldn’t even activate that; I got an error on bb-includes/functions.bb-meta.php line 708 and 709.

    That’s not related to your problem though. Sorry I can’t try this out for you.

    I’m running 1.0.1.

    Update: Just upgraded to 1.0.2 and tried again. Same errors. Those are just about cookies though. Not sure what’s going on there.


    chrishajer
    Participant

    @chrishajer

    Actually, trying in another browser, I am able to exclude some forums by adding them to the array there.

    Do you have other plugins installed that might be in conflict?

    (Guess I should turn off PHP warnings, eh?)

    The plugin works except whenever you post you get that “headers already sent by (output started at /home/whey/public_html/voices/my-plugins/exclude-forum.php:13) in /public_html/voices/bb-includes/functions.bb-pluggable.php on line 232” error. It still posts but it would be in the way seems in affects every post (thread and reply). Trying to figure away around it but I am not the best at PHP

    You have a space or a line return around your code tags.


    chrishajer
    Participant

    @chrishajer

    Does the error message you are seeing say “Warning:” at the beginning of it?

    Yes it states:

    Warning: Cannot modify header information – headers already sent by (output started at /public_html/voices/my-plugins/exclude-forum.php:13) in /public_html/voices/bb-includes/functions.bb-pluggable.php on line 232

    That is with or without any other plugin installed.


    chrishajer
    Participant

    @chrishajer

    I have the same problem in one browser, no problem in another browser (I had the warnings showing in Firefox but not in IE.) If it’s just a warning and it works, maybe you just need to not display warnings to visitors?

    How can I do that?


    chrishajer
    Participant

    @chrishajer

    Here’s one way:

    http://perishablepress.com/press/2008/01/14/advanced-php-error-handling-via-htaccess/

    I’m assuming you’re on shared hosting. If you have more control over the server, there are better ways to do it than with an override in .htaccess.

    Got full access to the server. What is the best means of doing this but only affecting only this site? The plugin makes an error for any change not just posts (ie any kind of update) gives a similar warning.

    Okay I added Htaccess and now the error does not appear however when i post it does not forward me back to the forum is just gets stuck on a white screen on the bb-post.php screen….


    chrishajer
    Participant

    @chrishajer

    Are you using permalinks? Did you already have an .htaccess and add the error handling lines to it?


    chrishajer
    Participant

    @chrishajer

    If you have full access to the server, it’s good practice to log PHP errors and warnings rather than display them to the browser. That’s done in php.ini.

    Even with all those things changed the plugin does no redirect or allow you to logout so I guess something is messing up with the forwarding?


    chrishajer
    Participant

    @chrishajer

    What is the plugin supposed to do with regard to those things? I thought the plugin just excluded replies from certain forums from the list of latest discussions. I didn’t know it was related to redirection or forwarding.

    I have no idea, it is quite confusing to me seems it screws up any kind of forward (even those that have nothing to do with posting, plugin deactivate, edit/change appearance, logout, etc).

    Might it have somthing to do with this part of the plugin:

    { $where.=” AND forum_id != “.$forum.” “; }}

    return $where;

    because it does not seem to be working, does this need to be changed to something else in order to function in 1.0.2?

    You can see for yourself what happens by registering:

    http://voices.snailface.com/register.php

    Starting to bug me a bit, nothing I try solves the issue.

    The Warning message is because forwards depend on sending headers. Different headers are sent automatically however if there’s any text returned by a PHP file that’s loaded, which is a common problem created by whitespace around the <?php ?> tags. If text headers are sent, you can’t send a redirect header, thus the warning and the breaking of redirects.

    so is there any way to stop a forum from reaching the latest discussion without any problems?

    Take out the whitespace from the plugin PHP file(s), and try again?

    still the same verdict… gah

Viewing 24 replies - 1 through 24 (of 24 total)
  • You must be logged in to reply to this topic.
Skip to toolbar