Forum Replies Created
-
In reply to: Locked Out of Forum!
Change the bbpress tables prefixs to
bb_
via phpmyadmin and then fix the prefix setting in bb-config.phpIn reply to: Attachments, can they be 20-30 megs?You can adjust the settings in the plugin to any size.
With broadband today I guess that won’t be too much of a problem but remember it’s passed through a PHP session so on an extremely active site that could in theory become a problem if they were publicly available downloads (the default locks downloads to members only, which is best).
In reply to: WordPress + bbPress Integration 101ATTENTION
PHP 4 users with WP 2.5.0 + bbPress 0.9.x
There is a HUGE BUG in the way the WP 2.5.0 (not 2.5.1) handles the login cookie. You won’t have a problem with PHP 5, only PHP 4.
So with PHP 4, you MUST use WP 2.5.1 and not WP 2.5.0 (aka 2.5) with bbPress 0.9 for cookie integration. Otherwise you’ll never get it to work.
There are only THREE files you need to replace in 2.5.0 to make it into 2.5.1:
Technical reason:
function wp_hash() in WP 2.5.0 never calls hash_hmac if it doesn’t exist and just returns a plain md5 instead. This method is incompatible with bbPress 0.9 – The compatibility function in compat.php is not loaded in time.
Since bbPress-Live also does a list of forums, here’s how to do that too:
<h2>Forum List</h2>
<ul>
<?php
global $wpdb;
$query="SELECT * FROM bb_forums WHERE topics!=0 ORDER BY forum_order ASC LIMIT 10";
$results=$wpdb->get_results($query);
foreach ($results as $result) {
echo "<li><a href='/forums/forum.php?id=".$result->forum_id."'>".$result->forum_name."</a></li>";
}
?>
</ul>of course this example doesn’t take into account nested forums and will just display them flat.
And you can just keep making it fancier and fancier.
Let’s say you want to also show how many posts each topic has.
echo "<li><a href='/forums/topic.php?id=".$result->topic_id."'>".$result->topic_title."</a> (".$result->topic_posts." posts)</li>";
or how old the last reply is
echo "<li><a href='/forums/topic.php?id=".$result->topic_id."'>".$result->topic_title."</a> (".human_time_diff(strtotime($result->topic_time." GMT"))." ago)</li>";
Let’s put that all together – this should work right inside any wordpress template:
<h2>Latest Forum Discussions</h2>
<ul>
<?php
global $wpdb;
$query="SELECT * FROM bb_topics WHERE topic_status=0 ORDER BY topic_time DESC LIMIT 10";
$results=$wpdb->get_results($query);
foreach ($results as $result) {
echo "<li><a href='/forums/topic.php?id=".$result->topic_id."'>".$result->topic_title."</a></li>";
}
?>
</ul>So we have the $results, how do we make a pretty list of them, say inside of our sidebar?
We have to loop through them and print them out. This is where that list of fields inside of bb_topics comes in handy.
Here’s just a list of titles to start with:
foreach ($results as $result) {
echo "<li>".$result->topic_title."</li>";
}Of course that’s not very useful, because they aren’t clickable. To make them clickable will take a little bit more work:
foreach ($results as $result) {
echo "<li><a href='/forums/topic.php?id=".$result->topic_id."'>".$result->topic_title."</a></li>";
}That example uses quite a few shortcuts to get the job done, it hardcoded the path to your forums (change /forums/ if needed) and even if your bbPress uses pretty permalinks, it simply uses the topic id number to get there – bbPress will redirect back to permalinks. If you absolutely know you have permalinks and want to use them, you could have done something like this instead:
<a href='/forums/topic/".$result->topic_slug."'>"
Now we need to put together a correct mysql query.
Let’s try something simple.
SELECT * FROM bb_topics WHERE topic_status=0 ORDER BY topic_time DESC LIMIT 10
SELECT means “grab the following”
the asterisk means “all the fields in the table”
FROM bb_topics is kinda obvious, it’s the table we want
topic_status=0 means it’s topics not deleted
ORDER BY topic_time DESC means put the newest topics on top
LIMIT 10 means we want only the first 10
Let’s say we also wanted to exclude topics that were closed, since people can’t reply, we don’t want to tease them. In that case you would change the
WHERE topic_status=0
to
WHERE topic_status=0 AND topic_open=1
or let’s say you only wanted “stickies”
WHERE topic_status=0 AND topic_sticky!=0
Okay now to use that in WordPress we do the following:
global $wpdb;
$query="SELECT * FROM bb_topics WHERE topic_status=0 ORDER BY topic_time DESC LIMIT 10";
$results=$wpdb->get_results($query);If all goes well, WordPress will then execute the query and then fill
$results
with the answers.Now comes the output part.
Both bbPress and WordPress have a very simple way of fetching data.
WordPress uses
$wpdb
bbPress uses
$bbdb
(the db part means database, very simple)
Then there’s the good old “get_results”. They both use that.
bbpress:
$results=$bbdb->get_results("mysql query goes here");
wordpress:
$results=$wpdb->get_results("mysql query goes here");
Many times you can use the same query in either bbpress or wordpress by just changing $bbdb to $wpdb or visa-versa.
Then you have to figure out what you are asking for.
Let’s use the really simple bbPress Topics table as an example. Unless you’ve customized your install, the Topics table is probably called
bb_topics
Here are all the fields available inside of
bb_topics
.topic_id
topic_title
topic_slug
topic_poster
topic_poster_name
topic_last_poster
topic_last_poster_name
topic_start_time
topic_time
forum_id
topic_status
topic_open
topic_last_post_id
topic_sticky
topic_posts
tag_countIn reply to: Bad indication of bb_get_post_timebbPress doesn’t show actual time, but the elapsed time to prevent timezone confusion while internally tracking via gmt/utc time. If you insist on seeing accurate local time for your posts you might want to try the user timezone plugin.
https://bbpress.org/plugins/topic/user-timezones/
and
Did you already figure this out?
They look very well matched.
In reply to: Can anybody help me?Are they simply trying to make a link to their forum from their blog and just mask the url so it looks like it’s a page of WordPress?
Just install the forums in /forums/ and make a link from WordPress’s link administration.
In reply to: Redirection to new bbPress board?You shouldn’t need a RewriteCond in that case, the RewriteRule can work without it if it’s simple enough.
If you are using the .htaccess inside of the /forum/ directory though, the above examples need to be trimmed without the forum/ part.
ie.
RewriteRule ^forum/faq
should actually be
RewriteRule ^faq
Only leave the
forum/
part in there if you are using the .htaccess in the parent (webroot) folder.In reply to: To bbPress or to WordPressWordPress is good for a few authors <-> many commenters, with high quality authors.
bbPress is good for many authors <-> many commenters.
If you want *everyone* to have their own blogs then you want wpmu.
If you want your own social network then you probably want to wait a tiny bit longer for buddypress.
In reply to: Locked Out of Forum!To get bbPress you work you might be able to go into
bb_config.php
and edit this line$bb_table_prefix = 'bb_';
and make it say
$bb_table_prefix = '';
(that’s just two single quotes together with no space)
Not sure if it would work and it’s bad idea to keep running like that.
Using phpMyAdmin, you could try to rename all the tables to bb_users, bb_usermeta, etc.
But do you see your WordPress tables? You have a bigger problem is there’s wp_users and wp_usermeta and then you don’t see topics forums posts tables.
You may have installed bbpress into a new database instead of the old wp database?
Copy all the names of the tables in the left hand site of phpmyadmin here so we can see better what’s wrong.
In reply to: Plugins LocationsbbPress attempted to correct where it could some of the naming and placement issues for files and functions that persisted in WordPress because of legacy reasons. In that way and a few others it’s design is subtly superior to WordPress.
In reply to: getting the forum picked up by googleMaps like that should never be done in real-time while the user waits but behind the scenes with a cron.
On very active sites though, I’ve never found the need for a map. Google seems to find EVERYTHING.
I think maps just make webmasters of smaller sites feel better (and give SEO’s something to charge for).
That’s really interesting and definitely would be really annoying.
There’s never been an official mechanism to change slugs in bbPress but it should not touch them during upgrades.
I have to assume there was a bug in 0.8.3 where it would create bad or invalid slugs and that was some kind of attempt to fix the issue in the newer 0.9 code.
Be sure to note this in TRAC, otherwise it might not be seen by the developers.
In reply to: Plugins LocationsThe core developers absolutely refuse to ship bbPress with pre-made
/my-plugins
and/my-templates
directory for reasons I cannot fathom. It’s very weird, especially since documentation to create it is very sparse and they will still work if you put items incorrectly into thebb-
directories.In reply to: Helping bbPress.orgKeep in mind I’m an independent plugin developer and not directly associated with bbPress.org or Automattic.com
I just moderate here to help out. bbPress.org is part of Automattic.com and doesn’t actually need donations of money, Sam and Michael are paid employees.
But code contributions are tremendously appreciated. A quality bug report or code contribution on http://trac.bbpress.org goes a long way to helping bbPress.
(If you’d like to donate to me specifically for my plugin development, you can help me towards a replacement monitor here.)
In reply to: Will pay for porting of WP themeThere is someone now doing bbPress themes on a professional level to match WordPress themes so maybe ask them too:
(per bbpress.org “rules” I am now closing this thread)
In reply to: Feeling DumbYup, follow hostpanic or the instructions here:
In reply to: Replies order in AlphaI vaguely remember there is an undocumented switch in bbPress to reverse the order if I am not mistaken.
Otherwise, try this:
https://bbpress.org/forums/topic/reverse-the-display-of-the-messages#post-6525
In reply to: Adjust Size of Hot TagsTechnically tag_heat_map has been depricated in 1.0a2 and should use bb_tag_heat_map instead but I believe the problem would persist since a wrapper is used.
Try one last shot with this:
<?php bb_tag_heat_map(array( 'smallest' => 10, 'largest' => 30, 'unit' => 'px', 'limit' => 40 )); ?>
In reply to: Adjust Size of Hot TagsTry passing it as an array to get around the bug:
<?php tag_heat_map(array( 'smallest' => 10, 'largest' => 30, 'unit' => 'px', 'limit' => 40 )); ?>