Search Results for 'bbpress'
-
Search Results
-
Yeah, it’s pretty niche, but there are a lot of art teachers out on the web, and not a whole lot of places for them to converse. bbPress has allowed me to provide the hands-down best-looking and best-behaving forum for them. I’m doing my best to get the word out now. I’ve had a few bites, but it’s slow-starting. Any ideas for further promotion would be much appreciated.
Dawn Pedersen
Web and Graphic Design Teacher
Grades 9 -12
Sacramento, CA
Topic: plugin: bb-Polls
I am pleased to announce a new bbPress Polls plugin.
Your members can now add polls to their topics, or optionally you can allow *anyone* to add a poll to *any* topic, within a specified time period (hours) since the topic was started.
bb-Polls allows single answer or multiple answer polls.
No template edits of any kind.
There are no additional db tables added, it uses bbpress topicmeta only. Only one entry is created per poll, regardless of size or options (this allow very easy cleanup if desired for some reason).
This is a *very* early beta, however should be functional except for:
1. missing admin menu (coming soon – edit plugin directly)
2. missing administrative editing of existing polls.
3. missing some visual tweaks (plural case, etc.)
4. missing some more deluxe options (poll ending time, etc.)
5. missing multi-language support (coming soon)
If you can live with these limits and would like to help test and give me some useful, constructive feedback, please download:
http://ckon.wordpress.com/files/2007/08/bb-polls.txt?v010
(rename .txt to .php, install, activate, start a new test topic)
The beta is set so only moderators and above can create/see the polls. This will allow you to test without disturbing visitors.
Please note the visual styles may be WAY off for the default template or your own template. Unfortunately I am using a very customised template. You’ll probably have to edit the built in css which is kept clearly at the top. (the default styles will be fixed soon when I get a chance to do a trunk install this week)
Upcoming features include the ability to display all polls and the ability to display a poll anywhere within bbpress templates.
ps. I need to know if this works as in in the trunk version – I don’t see why it wouldn’t but you never know…
The front page topics plugin was driving me crazy because I really did want to have a different number of topics for the front page, forum pages, view pages, while leaving the posts per topic page alone and not have to hack the core.
But there is a huge flaw in the fundamental design in that if you force bbpress to see a different number of topics-per-page, it will calculate the last post page entirely wrong, based on the page IT’S ON, vs the destination page.
ie. front page set to 50 topics, posts-per-topic-page set to 25, last post is #30 on the page -> bbpress will calculate the page number for the last post as PAGE ONE off the front page, because that’s what the topic count is set to for the front page.
This got me really annoyed so I researched the heck out of it and figured out this trick – it’s nasty but works (for 8.2.1 at least).
so in config.php you’ve got
// The number of topics that show on each page.
$bb->page_topics = 20;now you can make a plugin with this, edit each page limit to your heart’s desire (anything without a $limit defined uses the config.php default)
function custom_topic_limit($limit) {
switch (bb_get_location()) :
case 'front-page': $limit=45; break;
case 'forum-page': $limit=35; break;
case 'tag-page': break;
case 'topic-page': break;
case 'feed-page': break;
case 'search-page': break;
case 'profile-page': break;
case 'favorites-page': break;
case 'view-page': $limit=50; break;
case 'stats-page': $limit=50; break;
case 'login-page': break;
default: $limit=20;
endswitch;
return $limit;
}
add_action( 'bb_get_option_page_topics', 'custom_topic_limit' );
function fix_post_link ($link,$post_id) {
remove_action( 'bb_get_option_page_topics', 'custom_topic_limit' );
$bb_post = bb_get_post( get_post_id( $post_id ) );
$page = get_page_number( $bb_post->post_position );
return get_topic_link( $bb_post->topic_id, $page ) . "#post-$bb_post->post_id";
}
add_filter( 'get_post_link','fix_post_link',10, 2);The magic is in fix_post_link where it trashes whatever incorrect calculation that “get_post_link” has now done because of custom topic limits, and relculates it after unhooking the custom_topic_limit.
No core hacks required!