I think should do it, it’s based off code here: https://bbpress.org/forums/topic/open-links-in-new-window
Change the values of $forums to the forum IDs of those you wish to restrict (it’ll only work on direct parent forums, not grandparents or categories, I don’t want to include walker code unless people need it).
Tested on 1.0.2 trunk, so I’m not 100% sure it’ll run on 0.9, sorry.
<?php
/*
Plugin Name: Remove Links (conditional)
Description: Removes links for non-registered users. Based on <a href="http://ckon.wordpress.com/2007/07/12/bbpress-plugin-bb-tweaks/">bb tweaks</a>.
Plugin URI: https://bbpress.org/forums/topic/hide-links
Version: 0.01
*/
function bb_strip_links( $text ) {
global $topic;
$forums = array(
1,
2,
3,
);
if ( !in_array( $topic->forum_id, $forums ) )
return $text;
if ( !bb_current_user_can( 'write_post' ) )
$text = preg_replace('|<a (.+?)>(.+?)</a>|i', 'Login or register to download', $text);
return $text;
}
add_filter('post_text', 'bb_strip_links');
?>
@Hanratty: hiding links using CSS visibility will still leave the link URLs in the code, which isn’t too desirable for some
No, the theme you see here now http://www.kirpi.it/r/topic/evita is the standard Kakumei, just the way it comes out of the install. Not even the slightest edit to it.
Instead, I have some plugin enabled.
<?php bb_new_topic_link(); ?>
the code to add new.
The first one I know is in front-page.php
you have
<?php if ( $forums ) : ?>
then the Latest Discussion
then Forum
<?php endif; // bb_forums() ?>
Then Views
and the part you’re missing
<?php else : // $forums ?>
<div class="bbcrumb"><a href="<?php bb_uri(); ?>"><?php bb_option('name'); ?></a> » <?php _e('Add New Topic'); ?></div>
<?php post_form(); endif; // $forums ?>
@All
There does appear to be an option that everyone is overlooking … and that’s Output Caching.
We’ve talked about memcache, optcode caching and mysql query caching … but truly the most effective is simply perform Output Caching for non-logged in users.
In case someone is not aware, Output Caching is saving to disk the generated HTML. That way, instead of memcache where you have to make a call to the memcache server, or in mysql you’re still making the database call or in optcode caching, it’s simply pre-compliling the PHP … Output Caching is by far the fastest because it essentially just serving up pre-generated HTML straight from disk.
Interesting. There actually IS an RSS built into your user ID: https://bbpress.org/forums/rss/profile/otto42
But it’s used for your favorites so not so much. You can see all your posts in your profile (recent posts) so in theory this should be ‘exportable’ to RSS.
The rss.php file has this:
// Get latest posts by default
case 'all-posts':
default:
if ( !$posts = bb_get_latest_posts( 35 ) )
die();
$title = esc_html( sprintf( __( '%1$s » Recent Posts' ), bb_get_option( 'name' ) ) );
$link = bb_get_uri();
$link_self = bb_get_posts_rss_link();
break;
Which I think you could toss an extra if if ( $user->ID == bb_get_current_user_info( 'id' ) )
but that would only punt out a list of the current user’s posts, and not be a way to see anyones. The structure is there, though.
_ck_ posted a fix here that you can make to your template:
https://bbpress.org/forums/topic/navigation-not-working-only-for-page-1
I installed her “topics per page” plugin, which fixed it nicely as well (and gave more functionality to boot).
The navigation bar on the front page is not working, I have updated to the latest trunk and they are still not working.
Is there any way to fix for this. Any help will be much appreciated.
In theory it should be also possible to allow users to move their own topics if placed in the wrong category:
(untested, should allow a user to move only their own topics within the same time period they can typically edit a topic, ie. 1 hour default)
function move_own_topic($retvalue, $capability, $args) {
if ($capability=="move_topic") {return bb_current_user_can( 'edit_topic', $args[1]);}
return $retvalue;
}
add_filter('bb_current_user_can', 'move_own_topic',10,3);
Ok, I managed to do it : )
I installed a plugin (“Topics Per Page (0.0.7)”) for reducing the number of the latest discussions’ posts and I changed in my template, in the front-page.php file, the order in the of the two tables (latest discussions and forums).
Finally was easier than I thought : )
Hi,
I ve just installed a bbpress forum and successfully moved the posts from an old forum that we had.
However, I would like to change a bit the appearance of the forum.
I’d like to reduce the number of the posts in the latest discussions around to 10 posts and i would also like
move the latest discussions in the bottom, under the Forum part.
Could you give me any tips how I could make that.
Thank you in advance,
Dinos
It is SO sad that bbpress isn’t a one-click install plugin for WordPress. I want a forum that clicks into my main CMS quickly, that automatically reports latest posts to the *website homepage*, that automatically integrates user permissions etc, and that works with similar User Control Panel and information for all areas of the CMS.
I want a blog that can automatically send posts/articles to the forum (the way bbsyn USED TO before support for it was dropped) where the comments can enjoy the full power of a forum.
And I want it all in a few clicks.
Only Joomla seems to do that with it’s 2 highly supported “fully loaded” forums. (Forums that have all the options already in them, and that don’t need basic things like email-notification added on.)
Not with the latest version of bbPress. bbSync used to do this for the older versions but it became problematic to use after a while.
It is the latest version for both of them …
When I have memcache enabled on my local server, bbPress loads an average of 20ms faster (a lot for local execution in my opinion), although I haven’t put anything together to test this yet. Memcache works well simply because hard drives are generally slower than RAM.
NightGunner5: I’ll test that when I get a chance, thanks!
FinalWebsites: The plugin calls the image a certain name. If the user is “admin” the admin’s avatar will be “avatar.jpg” but could also be “avatar.gif” etc. This code hopefully will reduce the code.
Thanks again!
<?php echo('<img src="/forums/avatars/' . basename( current( glob( BB_PATH . 'avatars/' . $current_user->user_login . '.*' ) ) ) . '" />'); ?>
(Untested, but it should work.)
You don’t need to use all the php tags and how do you test if the image exists?
CK Said:
On a single computer system with a fast mysql server and fast disk cache, this typically is not a big problem. As a site has to scale this does become a problem because there is only one mysql source and everything has to be fetched from it.
Interestingly we’re running a WP install with two load balanced app servers and two DB servers… our host has the MySQL tuned up so well that we’re seeing absolutely no advantage when we installed memcached as an object cache. The lesson is: don’t assume, test. Check your queries AND page gen time, then install your proposed enhancements (APC, memcached, whatever) and check your queries and page gen time again… seeing an improvement? Keep the changes, otherwise drop them.
Mad Rivers website claims this canoe will carry 1000lbs or 454kgs. Somehow I don’t think I would like to be paddling the Adventure 16 with that kind of load either. I gather from the few comments so far no one seems overly excited about this boat.
I probably should have mentioned that I have a Mad River 14TT which my friends can borrow for a test paddle but we are still curious about the Adventure 16.
Thanks for the comments so far.
Regards..
Steve…
I’m just wondering where it is heading? How do all the requests from users get priority? Do we need to vote on directions, or is there a top-down vision from Automattic? How seriously is a “Portal” approach with WP being considered? (Like SMF & TinyPortal, with latest posts showing on the front page of a WP blog, tighter integration, etc)?
is there a blog I should be reading for the future of BBpress? Cheers.
I only know how to do it in the forum view, for the latest post author (in every topic)… but I dont know how to make it work for single posts inside the topics…
Latest poster in a topic, points to profile:
<a href="<?php user_profile_link($topic->topic_last_poster) ?>"><?php topic_last_poster(); ?></a>
Come on, there must be a way to link each post author name (inside a topic) to their profile….
I noticed there was not really a Dutch translation around, so I put something together. It can be found here: http://basszje.vrijwazig.org/wp-content/dev/bbpress102_nl_latest.zip
If anybody makes improvements I’d like some feedback ( see readme ) so we can keep the best version together!
Just got the trunk, still no joy with the front page pagination issue.
Also, is there any SQL commands to update, because the trunking broke the recount feature in the admin panel.
Hi,
I am not a bbPress forum owner. I am a member user. For a while I was able to post to that forum. I had uploaded my avatar and all was fine. Then about a month ago I noticed that my posts weren’t showing. I could see them when I was logged in. But when I wasn’t logged in, my posts were not displayed. I could tell that no one else was seeing them since a post asking folks to respond did not see any action.
I’ve tested this on multiple computers, on multiple networks and on multiple browsers. I’ve also tested by creating a new account. Same problem every time.
I have also noticed that when I am logged in and try to change my Avatar, I get the bbPress notice saying that I “don’t have permission to upload an avatar for this user”.
I have emailed the owners of the forum to no avail. So I am now turning to you all for help. Any idea on what I can do to be able to post again?
Thanks!
I have 1.0.2 and it works fine. Try disabling except that one and start testing and seeing which one conflicts.