Create a functions.php file in your theme folder, and write this in it:
<?php
function get_post_teaser($chars = 200){
global $bbdb;
$topic_id_ft = get_topic_id(); //topic id for getting text of first post of the topic
$first_post = (int) $bbdb->get_var("SELECT post_id FROM $bbdb->posts WHERE topic_id = $topic_id_ft ORDER BY post_id ASC LIMIT 1");
$content = substr(strip_tags(strip_shortcodes(get_post_text($first_post))),0, $chars); //gets the first 200 chars of the post
return $content;
}
?>
Then at the front page, put this where you need to display the post text (it should be inside the loop):
<?php echo get_post_teaser(200); ?>
You can change that 200 to anything, any number of letters you want. Default is 200.
I think, this should work.
crackpixels,
In bbPress Comments are generally called Posts.
I think the Posts column is set up by default.
In the Latest Discussions table, look for this cell: <th><?php _e(‘Posts’); ?></th>, which is the title of the column, and this:<td class=”num”><?php topic_posts(); ?></td>, which is the content of the comuns, displaying the number of Posts (Comments).
If the comment counts are off, try running a recount?
Also… try activating the default Kakumei theme and see if the post form appears (and the freshness works properly). If so, the issue may be with your theme…
First try switching your theme to the alternate and back again.
If that does nothing, temporarily deactivate any plugin you may be using and see if that does it.
Oh wait, you’ve been hacking at your theme.
<div id="discussions" align="left">
There’s no way that’s the default, you must have edited that.
Replace the theme files from the original.
So far it only looks like you edited front-page.php, so try replacing it with this in bb-templates/kakumei
http://svn.automattic.com/bbpress/trunk/bb-templates/kakumei/front-page.php
I noticed many of the old constants are not defined anymore by default.
A few plugins, definitely not all just a few, may be fixed somewhat by adding this to bb-config.php
define('BB_LOAD_DEPRECATED',true);
That 1col_fixed theme only has front-page.php, header.php, footer.php, and a few other miscellaenous files.
If bbPress can’t find a particular template file, it will pull the ones from the default theme, Kakumei (stored in /bb-templates/kakumei )
More here: https://bbpress.org/documentation/themes/
I would copy the missing files from kakumei over to your 1col_fixed theme, and then you can edit them right there. Good luck!
I’m trying to integrate bbpress into a custom WP theme I’ve made myself. I downloaded a theme that seemed perfect for me to start from, essentially a sandbox-esque theme. I got it from here (scroll down to 1col_fixed, there’s really no working direct link). I edited some files (header.php, footer.php, and front-page.php) and got EXACTLY the look I wanted. It looks fantastic with my site.
However as soon as I stray off the main page, it starts looking hairy. There are NO files to edit so that I can change the forum list view, the topic view, or any other page. The readme file says the following:
bbPress themes can be kept mean and lean. bbPress will pick up any missing mandatory
template files from the default template. Use this to keep your themes simple.
Yes, well, what if I need to customize THEM? Where do I get these files to edit them? Or would it, after all, be easier to start from a different theme?
Thanks… the sooner someone can get back to me on this, the better; I’m kind of on a tight schedule!
You can use CyrNickName plugin (it’s fine with 1.01). I use it for UTF8 usernames. It’s PITA that bbPress does not support it by default.
I’ve just notice that is no .htaccess by default in the forum directory – Should there be?
Check out https://bbpress.org/documentation/themes/
Basically you’ll make a new theme, but bbPress acts like a child theme, in that if you don’t specify something, it uses the default from the Kakumei templates. Once you get in there, it starts to make sense and feel elegant.
In any case I think it would be wrong to pimp Gravatar in the actual default theme.
I wouldn’t call it “pimping Gravatar”, but “helping bbPress forum users”.
bbPress is pimping Gravatar already by including it in the core software. Adding information about a core service in the theme seems reasonable to me. Themes are there to be edited. If someone doesn’t want to “pimp gravatar” they can easily remove it.
Actually, it’d almost be nice to be able to tie Gravatar into your board so that when someone goes to change their avatar, it backends the whole deal to Gravatar. Imagine: Changing your gravatar from any enabled site, without having to login. And being able to pick which gravatar for which site…
There was a discussion about this over at WPTavern.com recently. It would be terrific if someone built that functionality. It doesn’t seem to be a particularly trivial task though unfortunately.
You can make a directory called my-plugins (and might as well make my-templates at the same time) and then upload them with your FTP program. Some FTP programs will allow you to create a new directory on the remote host by right clicking, as well. If you have shell access to the host, you can make directories there as well (but I suspect you don’t based on your questions.) And, 1.0 comes with those directories by default now.
In any case, glad you got it sorted. These instructions are for anyone else who might need help.
I don’t think the issue is connected with modrewrite. I also tried turning just every possible plugin off, using default theme… and the pagination is still off. Please could someone help? Maybe I could use a different function?
Well the other issues don’t really have error messages. One is reputation plugin didn’t work at all. Couldn’t add or subtract points from the user also wanted to change so that points were not added for merely making a posting. In regards to avatars some seem to work and not others. Others have a little ? by the name so its like an image was selected but no image displays. What we want is either a selected image or the default image that is used in this forum.
The site in question is CanadianRugby.ca
Cheers
You can change that in post.php file of your theme. If you don’t have it then copy the file of default theme in your present theme and edit it as per your need.
Ashfame,
Thanks for replying. Here’s some more details that might resolve the problem after reading your tutorial.
I have WordPress and bbPress installed on separate databases. I know bbPress is connecting to the WP user tables because when I add a user I see it added on the bbPress side.
I did not change the default table prefixs for WordPress or bbPress per your tutorial.
On the bbPress WordPress Integration page I have all the fields filled out except the following:
– secure auth cookie salt
– WP MU Primary blog ID
– User database “user” table
– User database “user meta” table
Let me know if think the above items maybe the cause. Thanks.
yes, I did. and I checked again with the new default template, still not working. so it can’t be really a theme issue, or?
edit: yes, my theme is in the my-templates folder (now)
You also need to change bb-admin/includes/defaults.bb-htaccess.php appropiately and regenerate permalinks.
Hey there,
Currently running 0.9.4 of BBPress and the installation was from several months ago before the new update. However I would like to avoid having to update BBpress to the new version as mine is linked with Word Press. Would there be an issue if I upgraded BBPress with WP linked with it, without updating Word Press?
Anyway, the forum was originally a different forum and alot of users lost their original usernames and it defaulted to their original username. The users want to be able to change their usernames back to what they were before without loosing all the posts linked to them. So is the only way to do that to upgrade BBPress? or go in manually and change it in the database?? There are alot of users that need their names changed.
Thanks,
Adam
I’ve noticed that when I’m commenting on bbpress.org, there’s also a “tags” field.
Does that allow me to tag the topic itself? Or just my individual post? Or maybe the goal is to encourage commenters to help tag the topic?
Wondering if this is a new option or if it’s always been there but just off by default (it doesn’t show up on my 0.9 installs). I worry that it would be slightly confusing for new users… but thought I’d check what everyone else thought!
Curiously if I write the code in “functions.php” that break my login/logout/edit profile page and display a blank page. I have moved the code in “my-plugins” and no issue now.
Thank you for your information and your patience _ck_, I will try to solve my last problem by my self.
Edit: solved with :
foreach ($results as $result){$list.=" ".bb_get_avatar($result->ID, 20, $default)."<a href='".bb_get_option('uri')."profile/".$result->user_login."'>".$result->user_login." </a>";}
Which version of bbPress are you using?
If you have phpMyAdmin access, then open the usermeta table (should be bb_capabilities if you are not using shared user tables and should be wp_capabilities if you are using shared tables) and change the value of bb_capabilities to a:1:{s:9:"keymaster";b:1;} for your user.
Hope that helps.
P.S. – Change the default table prefixes as your case may be.
Hi,
I want to add a link to the profile page:
foreach ($results as $result){$list.=" <li class='list_b'>".bb_get_avatar($result->ID, 25, $default)."<a href='" .$result->user_profile_link. "'>".$result->user_login."</a></li> ";}
I tried .$result->user_profile_link., but it doesn’t work, any idea ?
Thank’s _CK_ !!
But, your code doesn’t seem to work in bbPress 1.0 (I tried to add it in functions.php or directly in topic.php).
However I have no problem if I add your code in bbPress 9.0 theme.
I want to add ” <?php echo bb_get_avatar( $poster_id->ID, $size , $default); ?> ” in your code, but I can not ?