@sambauers – but we’re used to WordPress where they’re pretty easy to change in the admin.
We aren’t including Snoopy, only WP_Http (which is only around 24k of code if you discount the comments)
The cron job is triggered by pageviews and then only if there are jobs to run.
So on a visit to the site, the cron job list is checked (just an option in the meta table) then if there is something there to do, bbPress sends an HTTP request to itself, which the user doesn’t need to wait for.
@hempsworth
You need to add the same SALT and KEY settings in bbPress config file…
define('BB_AUTH_KEY', '');
define('BB_AUTH_SALT', '');
define('BB_SECURE_AUTH_KEY', '');
define('BB_SECURE_AUTH_SALT', '');
define('BB_LOGGED_IN_KEY', '');
define('BB_LOGGED_IN_SALT', '');
.
Of course you need to actually set values in them to match your WPMU install.
@chrishajer
They are called permalinks for a reason
The blog says, “To enable cron I’ve included the very new WP_Http class in BackPress.” This class is documented here: https://codex.wordpress.org/Version_2.7#HTTP_API which I read as providing exactly what you suggested – URL fetching to do a pseudo multi-task.
Oh hang on, that’s not right either. Use add_filter(). Try this:
function my_title( $title ) {
return 'PHP Scripts Development Forum';
}
add_filter('bb_get_title', 'my_title');
The second parameter in apply_filters() needs to be a function that returns the text to be displayed in the title. Eg:
function my_title( $title ) {
return 'PHP Scripts Development Forum';
}
apply_filters('bb_get_title', 'my_title');
Hey,
I’ve recently begun to play with bbpress in conjunction with wordpress.
I’ve figured out how to include an RSS feed of a bbpress post & author to display as “author on “title of the post”” by using the following code:
<?php include_once(ABSPATH . WPINC . ‘/rss.php’); wp_rss(‘http://example.com/bbforum/rss.php’, 5); ?>
Does anyone know how to include an excerpt of the post, time and change the formatting.
Basically I’m aiming for the feed to create something like this….
…Alternativly, is there an easier way to include or embed bbpress or any other forum into wordpress?
Any advice is very much appreciated
I’m trying to integrate WPMU 2.6.1 and bbPress 1.0 alpha, and I’m having some troubles. Here’s how the installation process went for me:
Database details were fine.
The bbPress salt etc details were left blank as this is usually added later in the WordPress integration area.
In the integration area I inserted the WPMU address into the two URL textfields. For the keys I used the following from the wp-config.php file in my WPMU root:
WordPress "auth" cookie key -> AUTH_KEY
WordPress "auth" cookie salt -> SECRET_SALT
WordPress "secure auth" cookie key -> SECURE_AUTH_KEY
WordPress "secure auth" cookie salt -> SECURE_AUTH_SALT
WordPress "logged in" cookie key -> LOGGED_IN_KEY
WordPress "logged in" cookie salt -> LOGGED_IN_SALT
I then selected ‘Add user database integration settings’ and left WP_ as the prefix.
This went through fine.
In the Site Settings area I added the site name and URL, but something struck me right here – it was asking for ‘key master’ account details, previously this has already been the site admin for the WordPress install.
I added the username of the admin user, ‘admin, and that failed saying the account already existed. I tried the install again, and changed the ‘key master’ to another username, and this time it failed but said ‘The key master could not be created. You may need to replace bbPress with a fresh copy and start again.’
Am I doing something wrong, or is this a bbPress issue?
I’m guessing WordPress and WordPress MU integration is planned for the final 1.0 release?
Thanks,
Alex
my problem is already here
little help please :p
Hi,
i have a problem with this plugin: http://bbpress.org/plugins/topic/bb-smilies/
i don’t see the smilies’s toolbar on edit-post pages
(but it’s works great with a new topic or new post for example)
why?
byeee.
Off the top of my head this looks like a very bad idea performance-wise:
AND NOT p.topic_id IN (SELECT t.topic_id FROM bb_topics
AS t WHERE t.topic_status <> '0')
Though mysql may optimize it on the fly. Technically there could be thousands of deleted topics on an active site which makes quite a few items to search for (though in your case, there are NO deleted topics, yet, so this won’t be problem early on). However I think topic_status has an index? If not, it’s even worse.
Alternatively you could “over-search” the results (ie. ask for 100 instead of 30) and reverse the check of the 100 topic_id’s to make sure topic_status=0.
Since you’d end up using two queries, you could merge the two needs, to check titles AND to check topic status for the previously returned list of posts.
You’re dead right about pagination becoming insanely complicated in this case. This could be solved by limiting result lengths to just 100 items max, and then use my “over-query” idea to ask for 200 just incase it hits alot of deletions.
Full text search is of course still quicker and getting rid of the GROUP BY helps even further. 66% quicker in my case. I’m going to use the following query as my search.
SELECT p . * , MATCH (p.post_text) AGAINST ('test') AS
search_score FROM bb_posts AS p WHERE MATCH
(p.post_text) AGAINST ('test') AND p.post_status = '0'
AND NOT p.topic_id IN (SELECT t.topic_id FROM bb_topics
AS t WHERE t.topic_status <> '0') ORDER BY search_score
DESC LIMIT 30;
The downside is that it doesn’t include topic titles in the search. You can solve this adding this search to a temporary table, running another search on topic_title, and merging the two tables together. You need quite a bit of PHP code to manage this (particularly getting the NEXT buttons to work correctly), but it’s quite possible.
@sambauers: Let me just give you a couple of observations. Firstly, regarding the first search performed.
SELECT p.*, 0 AS search_score, MAX(post_time) AS post_time FROM bb_posts AS p JOIN bb_topics as t ON ( t.topic_id = p.topic_id ) WHERE p.post_text LIKE '%test%' AND p.post_status = '0' AND t.topic_status = '0' GROUP BY t.topic_id ORDER BY p.post_time DESC LIMIT 5;
The first thing that can be done here is remove the join and replace it with a sub-query. This way the sub-query can be cached, and speed is much improved. Here’s the idential query without the join:
SELECT p.*, 0 AS search_score, MAX(post_time) AS post_time FROM bb_posts AS p WHERE p.post_text LIKE '%test%' AND p.post_status = '0' AND NOT p.topic_id IN (SELECT t.topic_id FROM bb_topics AS t WHERE t.topic_status <> '0') GROUP BY p.topic_id ORDER BY p.post_time DESC LIMIT 5
That cuts execution time by 55% on my setup. If you have lots of deleted topics this might not apply, but if you have a huge database you ought to be cleaning the deletes out of it regularly anyway.
_ck_ is also right that ordering by post_id is quicker than by post_time. 17% quicker in my case.
Hi,
I’m busy with some plugin that will do some SEO tasks for bbpress.
On thing seem to be harder than I thought. I would like to write new page titles in some circumstances. The next “filter” code doesn’t work:
remove_filter('bb_get_header', 'bb_get_title');
apply_filters('bb_get_title', 'PHP Scripts Development Forum');
which function is called before I need to use the remove filter funtion? (the guy from the WP SEO plugin is using some str_replace function, very strange)
Thanks
I apologise – was writing it from memory and in a rush!
(excuses excuses
)
I personally needed to use href to append more to the end.
I’ve just noticed that the post prior to mine is months old anyway, I guess he figured it out in the end!
no, bb_get_profile_link does not self echo but it does return a full formed url apparently, so I was half wrong to use it inside of a href.
The direct link is via get_user_profile_link( $id )
byles, your code is wrong in that it doesn’t need an echo
<?php bb_profile_link('link text here'); ?>
bb_get_profile_link does self echo, so you could try:
<a href="<?php echo user_profile_link(bb_get_current_user_info('id')); ?>/">
…or if you don’t want to use it amongst another href, just use:
<?php echo bb_profile_link('link text here'); ?>
i figured out the problem!!
I just had a bunch of repeated text that did a great job of looking like it should have been there.
thanks!
Well, just to tell anyone who – in the future – might be stuck on the same or a similar problem.
I went with the following workaround:
Find a hook (action/filter) that gets called early in the process like bb_location.
Define a filter function for it.
In that function, add the following peace of code.
global $bb_locale;
$bb_locale->datetime_formatstring = __(‘j M, Y’);
Obviously, you can call your time format something else.
Not the prettiest of solutions, but it works and I get to keep my bb_press installation free of code that I’ll surely forget to update.
There is a bug in the older template you are using.
Find these line in your header.php in your template folder:
<?php bb_enqueue_script('topic'); bb_head(); ?>
<?php endif; ?>
and change it to this:
<?php bb_enqueue_script('topic'); ?>
<?php endif; ?>
<?php bb_head(); ?>
Hi I do have a version working(I downgraded bbpress to the last version bbsync worked because I was tired of using a alpha version of bbpress) it’s completely new code, but it’s very basic on the feature set and a bit hacked together, as I could never get the bbpress functions to work in a wordpress plugin.
I’m at a public library at the moment so I don’t have the code with me but I can work on the code a little bit when I get home.
Also please note, this was just made for me and I probably have different needs to what you needed, for example I wanted all wordpress posts to make a new topic so there isn’t options on a per post basis to post to a forum. Also comments don’t replicate between bbpress and wordpress(I was just going to disable commenting and make all users use the topic) but depending on how much time I have tonight I might add this functionality as I don’t see the difficulty in it.
Also F.Y.I. if anyone is interested I do it the úber ghetto way and manually manipulate the database and don’t go through any of the wordpress or bbpress functions so use at your own risk, but I haven’t run into any problems on my test site.
Maybe it’s accidentally eating the comments? I can’t remember.
Also, hey, look at that – september has almost rolled through and it’s still very, very broken.
Maybe Benzilla can help you? In any case, the basic ideas are pretty obvious in bbsync; just create meta-entries for each sync’d item on both sides, so you can use them in functions to make links and the like. Comments -> posts just uses a standard comments hook and the bb api to create a post. If I were trying to fix this I’d probably go back to basics and work it again from there, using the old (bad) code as a reference only; that could be the approach to take with this.
I have uploaded this plugin to the Plugin Repository.
I found some problems in the earlier version, but it now works 
https://bbpress.org/plugins/topic/user-photo-for-bbpress/