Search Results for 'code'
-
AuthorSearch Results
-
April 20, 2008 at 1:29 am #51585
In reply to: Full Content of Most Recent Post on Front-Page?
jenz
MemberIf I used:
<?php
$forum_id = 1;
$number_of_topics = 7;
$forum_one_topics = $bbdb->get_results("SELECT * FROM $bbdb->topics WHERE forum_id = $forum_id ORDER BY topic_id DESC LIMIT 0,$number_of_topics")
?>
<?php
foreach($forum_one_topics as $topic) : $forum_one_topic_posts = get_thread( $topic->topic_id); ?>(as see at the beginning of this topic) – how can I show the initial topic time on the front page instead of the last reply time?
April 19, 2008 at 10:57 pm #64406In reply to: How to integrate bbPress into static HTML ?
chrishajer
ParticipantI think you would probably want to edit the template files to include those blocks of code from your static page into bbPress, not the other way around. bbPress needs to do its thing, but you can edit the template files and include the sidebar and header into the bbPress pages.
April 19, 2008 at 8:08 pm #62510In reply to: Proposed method for file attachments and uploads
_ck_
Participantfel64: No, there’s been hooks for the post form for as long as I can remember.
Unfortunately that’s only for new posts. For editing existing posts there is absolutely no way to affect the template without editing it. There’s no hooks for edit_form() or any of it’s sub-functions or the template loader (the loader does the include AFTER the hook so nothing can be placed afterwards. I requested some hooks many month ago but they may have been missed (or ignored). This plugin will require (one, simple) edit of the
edit-post.phptemplate.(In theory it could be done via the bb_get_footer but that’s really messy and the footer hook is AFTER the footer has been rendered).
April 18, 2008 at 11:38 pm #64359citizenkeith
Participantglanceup: Just cut and paste it into a plugin template. Here’s what I did (apologies to _ck_ if the headers aren’t quite right):
<?php
/*
Plugin Name: Fix Number of Front Page Topics
Plugin URI: https://bbpress.org/forums/topic/how-to-restrict-number-of-latest-discussions-on-front-page
Description: Fix Number of Front Page Topics
Author: _ck_
Author URI: http://bbshowcase.org/
Version: 0.1
*/
// fix number of front page topics
function bb_custom_topic_limit($limit) {
switch (bb_get_location()) :
case 'front-page': $limit=5; break;
case 'forum-page': $limit=10; break;
case 'tag-page': break;
case 'topic-page': $limit=15; break;
case 'feed-page': break;
case 'search-page': break;
case 'profile-page': break;
case 'favorites-page': break;
case 'view-page': $limit=10; break;
case 'stats-page': break;
case 'login-page': break;
default: $limit=15;
endswitch;
return $limit;
}
add_action( 'bb_get_option_page_topics', 'bb_custom_topic_limit',200);
// required to fix for custom topic limits to calculate correct page jumps
function fix_post_link ($link,$post_id) {
global $topic;
remove_action( 'bb_get_option_page_topics', 'bb_custom_topic_limit' );
if ($topic && $topic->topic_last_post_id==$post_id) {
$topic_id=$topic->topic_id;
$page=get_page_number( $topic->topic_posts );
} else {
$bb_post = bb_get_post( get_post_id( $post_id ) );
$topic_id=$bb_post->topic_id;
$page = get_page_number( $bb_post->post_position );
}
return get_topic_link( $topic_id, $page ) . "#post-$post_id";
}
add_filter( 'get_post_link','fix_post_link',10, 2);
?>April 18, 2008 at 9:49 pm #64358glanceup
Memberck — Into what file and where do I paste that code? Thanks. PS I am using bbPress 9.0.1
April 18, 2008 at 6:51 pm #64382In reply to: slug permalinks can lead to db problems
bobbyh
MemberThanks for your thoughtful response, sam! That sounds great to me!

FYI, I also came across this query repeatedly in my slow query log:
SELECT SQL_CALC_FOUND_ROWS * FROM bb_topics WHERE topic_status = 0 AND forum_id = 1 AND topic_sticky = 0 ORDER BY topic_time DESC LIMIT 40, 20;topic_sticky isn’t indexed (in either 0.83 or 0.91, I checked both). Should it be? It’s a tinyint(1), so indexing it should cost very little while improving performance a lot, I think?
April 18, 2008 at 5:37 pm #64109In reply to: PRIORITY #1: ImageFile Attachments
gregory.dziedzic
MemberSorry to bump this thread again…
Sambauer, my post was not directed to you and I respect a lot what you are doing and your attitude on the forum. It’s the “then go for a wiki” remark that made me react.
I’m very happy and thankful that _ck_ got down to the writing of this plugin. Keep on the good works, it’s a great soft you’re all working on
April 18, 2008 at 5:05 pm #62501In reply to: Proposed method for file attachments and uploads
gregory.dziedzic
Member_ck_ you are wonderful
April 18, 2008 at 2:33 pm #62499In reply to: Proposed method for file attachments and uploads
Sam Bauers
ParticipantIt was USD$50

I say just get it up to a usable state and out the door. Then we can all work on making it better over time.
April 18, 2008 at 10:46 am #62498In reply to: Proposed method for file attachments and uploads
_ck_
ParticipantWhoa, $50 AUS? That’s like half a million US $ right now! I could buy 3, maybe even 4 gallons of gas (if I owned a car) LOL!

Seriously though, many thanks, that’s a massive donation. Now I feel guilty like I have to make this an amazing plugin. Hope I can live up to it. I should have an early alpha for review Sunday or Monday night…
April 18, 2008 at 10:09 am #64380In reply to: slug permalinks can lead to db problems
Sam Bauers
ParticipantSo how about the following?:
bb_forums-> Add a unique key toforum_slugbb_topics-> Add a unique key totopic_slugbb_users-> Already has a unique key onuser_nicenamebb_tags-> Already has a key ontagwhich should be changed to a unique keyApril 18, 2008 at 5:57 am #64276In reply to: Dropping “MultiViews” support?
phreakymonkey
Memberchrishajer: Ah, sorry. mod_rewrite
timskii: I could have sworn they had it turned off at some point, but maybe I am misremembering. The point is that hosters tend to do stuff like that (often without warning), so as robust a solution as possible would be ideal, naturally.
*I’m a designer, not a coder, so I’m mostly talking out of my ass.
April 18, 2008 at 5:28 am #55027In reply to: Is there an Approve Registration plugin?
myeggnoodles
MemberI would also be very much interested in a “approve registration” plugin. I am building a forum for in-house use only so want to make sure that only staff sign up to use our forums
April 18, 2008 at 5:18 am #3223Topic: Invision IP.Board to bbPress conversion script
in forum Requests & FeedbackBeer
MemberWould anyone be able to assist with testing a conversion script from IP.Board 2.3.4 to bbPress 0.9? I’ve started writing some code myself to handle the switch. It would be great if any other coders would be willing to assist with this too.
The way it will work currently is to generate a ‘ipb2bb.sql’ file that you can pass to mysql to upgrade the database. It will import users, categories, topics and posts. You can ask it to limit it’s import to select categories only instead of all categories.
April 17, 2008 at 8:52 pm #62495In reply to: Proposed method for file attachments and uploads
Beer
MemberWe could try to appeal to the mercy of whoever the current plug-in coders are. I’ve seen something at TextDrive where a group would donate some money into a pool for development purposes.
I think it’d be great if they added the “Ideas” feature here at bbPress like they have for WordPress also.
April 17, 2008 at 4:47 pm #64005Sam Bauers
ParticipantTry putting this in your bb-config, it should rename those bbPress cookies for you:
$bb->usercookie = 'wordpressuser';
$bb->passcookie = 'wordpresspass';.
You may also need to adjust the cookie domain and path, but try that first.
April 17, 2008 at 4:43 pm #64264In reply to: Blocking registrations by email
Sam Bauers
ParticipantAh, in that case all you need to put there is
mail.ruwithout the asterisk or leading dot.April 17, 2008 at 3:13 pm #62415In reply to: can’t access admin dashboard
devcore
MemberI installed bbPress on a directory called /discussions on the root of my hosting account, where I have also installed WordPress 2.5, everything on the installation went ok, but after all been done, the admin login to the dashboard gives me the following message:
You do not have sufficient permissions to access this page.Any solution?
April 17, 2008 at 9:31 am #64328In reply to: Duplicate Messages Tab in Private Message Plugin
_ck_
ParticipantI had the same problem with my plugins with the avatar tab too. It makes tabs duplicate.
I’ll have to lookup the workaround I did…
Okay the bug fix I had to use was to wrap the function that adds a tab and check if $self was set.
ie.
function add_tab(blah) {
global $self;
if (!self) {
// code that adds tab goes here
}
}So what you probably need to do is change this line like so:
if (!$self && bb_get_current_user_info( 'id' ) == $user_id) {April 17, 2008 at 9:18 am #60995In reply to: phpBB3.0-style theme
andersson
Participant@Beer: When/if I get the time I’ll be sure to make it public. As you know it’s quite something else to make it work generically rather than for one specific site.
Thanks for the praise though, appreciate it.
@_ck_: Thanks. Yes, I also had a good mind of making that “online” banner that phpbb uses, available per user but other things caught my attention.

Anyways, glad you both liked it.
April 17, 2008 at 7:43 am #64357_ck_
ParticipantFront page topics plugin isn’t working? Hmm. Should be.
I have a modification I’ve done somewhere…
Try this:
// fix number of front page topics
function bb_custom_topic_limit($limit) {
switch (bb_get_location()) :
case 'front-page': $limit=5; break;
case 'forum-page': $limit=10; break;
case 'tag-page': break;
case 'topic-page': $limit=15; break;
case 'feed-page': break;
case 'search-page': break;
case 'profile-page': break;
case 'favorites-page': break;
case 'view-page': $limit=10; break;
case 'stats-page': break;
case 'login-page': break;
default: $limit=15;
endswitch;
return $limit;
}
add_action( 'bb_get_option_page_topics', 'bb_custom_topic_limit',200);
// required to fix for custom topic limits to calculate correct page jumps
function fix_post_link ($link,$post_id) {
global $topic;
remove_action( 'bb_get_option_page_topics', 'bb_custom_topic_limit' );
if ($topic && $topic->topic_last_post_id==$post_id) {
$topic_id=$topic->topic_id;
$page=get_page_number( $topic->topic_posts );
} else {
$bb_post = bb_get_post( get_post_id( $post_id ) );
$topic_id=$bb_post->topic_id;
$page = get_page_number( $bb_post->post_position );
}
return get_topic_link( $topic_id, $page ) . "#post-$post_id";
}
add_filter( 'get_post_link','fix_post_link',10, 2);April 17, 2008 at 3:48 am #64374In reply to: Forum Disappeared!
bloggerdesign
MemberIs there a manual way to get someone set to KeyMaster? I registered and was user #1. There seems to be no use #0 so there is no administer for the forum. I’m totally locked out.
April 17, 2008 at 3:34 am #64373In reply to: Forum Disappeared!
bloggerdesign
MemberI found the issue. The table names were custom set to not interfear with anything that that wasn’t called out anywhere in the install process except in an advanced (hidden) area.
I’ve re-installed BBPress 4 times now and I finally go it to work, with all my old posts, but I can’t log in.
April 17, 2008 at 3:13 am #64329In reply to: key master only forum
_ck_
ParticipantThis will affect all forums:
global $bb_roles;
$bb_roles->remove_cap('member','write_topics');
$bb_roles->remove_cap('member','write_posts');You can put it into
header.phpor make a real plugin ie.members-cannot-post.php(and install into /my-plugins/)<?php
/*
Plugin Name: Members Cannot Post
*/
global $bb_roles;
$bb_roles->remove_cap('member','write_topics');
$bb_roles->remove_cap('member','write_posts');
?>I think I will make a real plugin which can control this on a per-forum basis since this seems to be a requested feature that is not too hard to handle in 0.9 Look for it in the plugin section over the next day or two.
April 17, 2008 at 3:06 am #64339In reply to: Gravatar and Karma plugin
_ck_
ParticipantI have a karma plugin in development but it is not available yet and most likely will not be until early May.
You can preview it in use at http://bbShowcase.org
The code in brackets is BBcode so you want my BBlite:
-
AuthorSearch Results