bbPress Plugin Browser »

Forum is category (1.3)

Download

Version: 1.3

Other Versions

Last Updated: 2009-8-21

Requires bbPress Version: 0.7.2 or higher

Compatible up to: 0.9.0.2

Author Homepage »

Plugin Homepage »

Average Rating

5 stars
4 stars
3 stars
2 stars
1 star
(1)

Your Rating

Author: Nightgunner5

The forums that you specify in the forum-is-category.php file are turned into no-posts-allowed categories.

If a specified forum has a parent, the parent will also be turned into a no-posts-allowed category, whether specified or not.

Do not use this with bbPress 1.0 or higher, categories are in the core on those versions.


  1. Oops, I set it up wrong. Use version 1.1, 1.0 does nothing.

    Posted: 3 years ago #
  2. Very nice coding.
    You definitely should be writing more plugins ;-)

    (At first I thought someone was borrowing from my "Read-Only Forums" but I can see you figured out the process by yourself - well done.)

    Two problems you need to look into - I get a huge page of warnings/errors when I "un-category" a forum in the admin menu. Also when active "Add New" doesn't seem to work correctly at all.

    Posted: 3 years ago #
  3. "I get a huge page of warnings/errors when I "un-category" a forum in the admin menu."

    This will be fixed in 1.2, which should be released later today.

    "Also when active "Add New" doesn't seem to work correctly at all. "

    What version of bbPress are you on?

    Posted: 3 years ago #
  4. Using 0.9.0.2 of course. If you can't reproduce the error it may be a conflict with one of my other plugins, though not certain at this time.

    Posted: 3 years ago #
  5. "Using 0.9.0.2 of course. If you can't reproduce the error it may be a conflict with one of my other plugins, though not certain at this time. "

    I've tried making a new forum on 0.9.0.2, it worked.

    Posted: 3 years ago #
  6. No, not a new forum, sorry, bad miscommunication.
    Try using the "ADD NEW" on the front page of your site.

    Posted: 3 years ago #
  7. "No, not a new forum, sorry, bad miscommunication.
    Try using the "ADD NEW" on the front page of your site."

    I tried that just now with version 1.1 of Forum is category and version 1.2. 1.1 didn't show the form, but 1.2 showed it. It's fixed now, anyway.

    Posted: 3 years ago #
  8. Hello,
    If you want forums which are categories not to be clickable, and to be bolded (to act as real category), here's what you need to do: Open up front-page.php in your template directory for editing and:

    1) Add following code right BELOW the <?php bb_get_header(); ?>:

    <?php
    $forums_that_are_categories = bb_get_option("forum_is_category_forums");
    if (!is_array($forums_that_are_categories))
    	$forums_that_are_categories = array();
    ?>

    2) Look for <?php while ( bb_forum() ) : ?> and first <?php endwhile; ?> after it, and replace everything BETWEEN those with:

    <tr<?php bb_forum_class(); ?>>
    	<td><?php bb_forum_pad( '<div class="nest">' ); ?>
    	<?php
    	ob_start();
    	forum_id();
    	$fix_forum_id = ob_get_clean();
    	if (in_array($fix_forum_id, $forums_that_are_categories)) {
    		echo "<strong>"; forum_name(); echo "</strong>";
    	}
    	else {
    	?>
    	<a href="<?php forum_link(); ?>"><?php forum_name(); ?></a><small><?php forum_description(); ?></small>
    	<?php } ?>
    	<?php bb_forum_pad( '</div>' ); ?></td>
    	<td class="num"><?php forum_topics(); ?></td>
    	<td class="num"><?php forum_posts(); ?></td>
    </tr>

    3) Save and re-upload file.

    Hope you like it :-)

    Demo: http://www.mladenovac.in.rs/forums/

    Posted: 3 years ago #
  9. thetimediva

    Member

    I'm experiencing the same problem with the "ADD NEW" on the front page of the site not working.

    I deactivated all the plug ins to see if there was a conflict.
    I activated your plug in first and the "ADD NEW" doesn't work. It's acting like a closed forum... no form.

    I just installed bbpress today so I'm using the latest version.

    Thanks

    Posted: 3 years ago #
  10. This plugin should NOT be used with bbPress 1.0
    It's already built in on bbPress 1.0

    Posted: 3 years ago #
  11. thetimediva

    Member

    Hi _ck_

    The latest version is 0.9.0.2 which is what I installed yesterday.

    1.0 says it's a test build and unstable...

    Glad to hear they're including this option in the next version.

    Any idea when it will be ready or is it stable enough to use now?

    Thanks
    Ann

    Posted: 3 years ago #
  12. Derv86

    Member

    is there anyway to categorise forums and allowing user to comment on them???

    Posted: 3 years ago #
  13. Greg-G

    Member

    Can anyone provide me with a code snippet? Something like:
    if (the forum you are in is a category) {do something}
    I need to use it in forum.php
    Thanks!

    Posted: 2 years ago #
  14. Greg-G

    Member

    I ended up hacking something together based on @Avram's code above.

    **Unfortunately I am also having the ADD NEW bug though.**

    bbpress version: 0.9.0.4
    forum is category version: 1.2

    Posted: 2 years ago #
  15. If you replace this function it will solve the ADD NEW bug

    function forum_is_category_restrict_posting($retvalue, $capability, $args) {
    	global $forums_that_are_categories;
    	if ($capability == "write_topic" && !empty($args[1]) && in_array($args[1], $forums_that_are_categories)) {
    		return false;
    	} elseif ($capability == "move_topic" && !empty($args[2]) && in_array($args[2], $forums_that_are_categories)) {
    		return false;
    	}
    	return $retvalue;
    }
    Posted: 2 years ago #

RSS feed for this topic

Add a Comment

You must log in to post.