I spent so long trawling google for an answer to this question, so i am sharing what i came up with. It might not be beautiful code (i patched it together from a number of sources), but it works for me.
Basically, i have a list of forums on my forum home page. I just wanted to show the latest post within each forum as a teaser below the forum description – not just the title, but the excerpt, too. I can’t believe there’s nothing out there explaining how to do this. It seems like a pretty obvious format for the forum index.
The following snippet will output the latest reply, with post title and post link below the forum description. If there are no replies, it will output the latest topic instead.
function jag_add_last_reply() { {
$jag_last_reply_id = bbp_get_forum_last_reply_id();
$jag_last_topic_id = bbp_get_forum_last_topic_id();
$new_args = array(
'post_type'=> 'reply',
'p' => $jag_last_reply_id
);
$other_args = array(
'post_type'=> 'topic',
'p' => $jag_last_topic_id
);
$nest_query = new WP_Query( $new_args );
$another_nest_query = new WP_Query( $other_args );
if ( $nest_query->have_posts() ) : while ( $nest_query->have_posts() ) : $nest_query->the_post();
$this_post_id=$post->ID;
$this_post_title= get_the_title();
$this_post_content= get_the_excerpt();
$this_post_permalink= get_permalink(); ?>
<a href="<?php echo $this_post_permalink; ?>"><h1><?php echo $this_post_title; ?></h1></a>
<div class="the_content"><?php echo $this_post_content; ?></div>
<?php endwhile;
elseif ( $another_nest_query->have_posts() ) : while ( $another_nest_query->have_posts() ) : $another_nest_query->the_post();
$this_post_id=$post->ID;
$this_post_title= get_the_title();
$this_post_content= get_the_content();
$this_post_permalink= get_permalink(); ?>
<a href="<?php echo $this_post_permalink; ?>"><h1><?php echo $this_post_title; ?></h1></a>
<div class="the_content"><?php echo $this_post_content; ?></div>
<?php endwhile;
endif;
}}
// Hook into action
add_action('bbp_theme_after_forum_description','jag_add_last_reply');
Just put this in your theme’s functions.php and it should do the trick. Haven’t figured out how to spit out multiple posts and replies for each forum yet, but this is all i needed. Good luck.
ok, can you look at
Codex
getting started part 1, and see if anything in there helps
Come back
Anonymous User 7823331Inactive
Hello. I do not want to bother you with basics, however I tied Slovak and French translation and non of them worked.
I did everything according http://codex.bbpress.org/bbpress-in-your-language/ and no translation appears.
I downloaded translation files (po and mo) from http://translate.wordpress.org/projects/bbpress/2.5.x (bbpress-2.5.x-sk.mo, bbpress-2.5.x-sk.po), I moved the files to /wp-content/languages/bbpress/ and rename it to bbpress-sk-SK.mo and bbpress-sk-SK.po (I also tried names bbpress-sk.mo and bbpress-sk.po).
What I did wrong?
I use WP 3.5.1. with bbpress 2.5.3. I use also polylang module. All translation Slovak, France … works just the translation of bbpress do not.
Just to identify the problem I tried to install your module to WP 3.8 clear installation (with out polyalang) and same result, that translation do not appears.
I believe that it works, since you jut few people ha problem wit translation (http://bbpress.org/forums/search/translation/) but I did everything according manual and it does not work for me.
Thank you.
Dear Stephen great work! 😉
I think the last “basic” information for this great converter is “User status”
we can find it in a snitz table named FORUM_MEMBERS => M_STATUS
M_STATUS field have’s two value: 1=unlocked | 0=locked
NB: also when a user was removed / delete, will stay in the DB, with this two condition:
M_STATUS => 0
M_NAME => n/a
Hey Guys!
I am new to using BBpress. I have been learning a little bit each day and you guys rock!
My theme is DIVI from elegant themes.
Here is the start of my open forum:
http://blankstageproductions.com/forums/forum/bsp/
When I went to see how the forum looked on my smartphone it looked odd. All the words are bunched up on the RIGHT side of the screen making it difficult to read. Is there a plugin or some CSS coded I can drop in? I have done several searches but may not be looking in the right place for this.
For CSS I have learned to drop in code using the ePanel in the theme. I found a thread here with code, copied it in and the code took pretty well. I still have so much to learn in terms of CSS and how to change it but figure as long as the ePanel works I should be good.
dear Stephen don’t be angry …english is not my language
Do not worry about that, I understand you fine 🙂
Edit: Your MySQL is Excellent 😉
Forums and Topic status = Done (F_TOPICS & F_COUNT)
Forum Topics and Replies Counts = Done (T_REPLIES)
Last Reply Date = Done (T_LAST_POST)
Due to limitations with the importer configuration we can’t include the FORUM_TOTALS or FORUM_CATEGORY tables. You will need to manually reassign your your forum categories after importing, usually there is only a small number of these so this shouldn’t be much of an issue. The ‘Total’ Counts’ are also not actually needed, we do this slightly different and are recalculated by bbPress after the import has finished with the ‘Repair Tools’.
Edit: After the import has finished we actually recount all the ‘counts’ so these are not very important to the import, they kind of just help a few things on the way.
To know which Forum or Topic are open and permit to receive new Topic reply, we need this fields
Forum area
FORUM_FORUM => F_STATUS 1=open | 0=close
Single Topic
FORUM_TOPICS => T_STATUS 1=open | 0=close
===========
To know the categories we need to query the table FORUM_CATEGORYwhere we have
CAT_ID Unique ID used to join in FORUM_FORUM => CAT_ID table
CAT_NAME as is …the name
CAT_STATUS need a mention this field, Category locked = 0 | Category Open = 1
Ex of query select for all category and related forum
SELECT FORUM_CATEGORY.CAT_ID, FORUM_CATEGORY.CAT_NAME, FORUM_FORUM.FORUM_ID, FORUM_FORUM.F_SUBJECT
FROM FORUM_CATEGORY LEFT OUTER JOIN
FORUM_FORUM ON FORUM_CATEGORY.CAT_ID = FORUM_FORUM.CAT_ID
GROUP BY FORUM_CATEGORY.CAT_ID, FORUM_CATEGORY.CAT_NAME, FORUM_FORUM.FORUM_ID, FORUM_FORUM.F_SUBJECT
===========
dear Stephen don’t be angry …english is not my language 😛
..however…
FORUM_FORUM => F_TOPICS
This information is refer to all topics (Only Topic) in specific forum ex: “Forum_name => Total Number of topic”
FORUM_FORUM => F_COUNT
This information is refer of all replies (Only Reply) in specific forum ex: “Forum_name => Total Number of replis”
I think a sum of this two information give us a total like here, ex: “Troubleshooting => 30,051”
================
In this Table FORUM_TOTALS, Snitz save information of whole BB, a sum of all replies and all topics
FORUM_TOTALS => T_COUNT whole topic
FORUM_TOTALS => P_COUNT whole replies
================
About FORUM_TOPICS => T_REPLIES
is this field Snitz save number of replies relate to single topic ex this one:
“Documented import from snitz access database” > “18 replies”
================
with minor importance, also stored in this table FORUM_TOPICS we have
T_LAST_POST_AUTHOR ID value of last member have posted reply
ex: Last reply from: Stephen Edgar
T_LAST_POST data value of last reply added (same format yyyymmddhhmmss)
ex: Last activity: 5 hours, 57 minutes ago
T_LAST_POST_REPLY_ID ID value of last reply added actually used for link in email (?)
ex: Post Link: https://bbpress.org/forums/topic/documented-import-from-snitz-access-database/#post-146492
no plugin, but this page shows how to add them using code
(I haven’t quite finished it, but it should work!)
Custom Capabilities
OK, try this instead, put this code in the bbpress.php file instead:
<?php
/**
* bbPress wrapper template.
*/
get_header(); ?>
<?php while( have_posts() ): the_post(); ?>
<?php the_content(); ?>
<?php endwhile; ?>
<?php get_footer(); ?>
Ah…. I know why, apologies for saying not cool 😉
Make a copy of your page.php file and save it as bbpress.php in your themes folder (you can use page-sidebar.php if you prefer) and then bbPress will ‘wrap’ all of it’s pages in that template for you.
There are actually a couple more fields that can be added that I just realized are not in the Example.php file (which I will add)
Forum type – Is this a forum or category?
// Forum type (Category = 0 or Forum = 1, Stored in postmeta)
$this->field_map[] = array(
'from_tablename' => 'forums_table',
'from_fieldname' => 'the_forum_type',
'to_type' => 'forum',
'to_fieldname' => '_bbp_forum_type',
'callback_method' => 'callback_forum_type'
);
Forum status, can new topics be created in the forum?
// Forum status (Unlocked = 0 or Locked = 1, Stored in postmeta)
$this->field_map[] = array(
'from_tablename' => 'forums_table',
'from_fieldname' => 'the_forum_status',
'to_type' => 'forum',
'to_fieldname' => '_bbp_status',
'callback_method' => 'callback_forum_status'
);
Topic status – Can new replies be created for this topic?
// Topic status (Open or Closed)
$this->field_map[] = array(
'from_tablename' => 'topics_table',
'from_fieldname' => 'the_topic_status',
'to_type' => 'topic',
'to_fieldname' => 'post_status',
'callback_method' => 'callback_topic_status'
);
Firstly I only included the fields Robin had supplied, I do not have a copy of Snitz to test either. So I commented out but didn’t remove any of the code so that it would stand out and you could update any of these as needed which you have done.
The forum ‘counts’ I think you may have incorrect in your post above:
* _bbp_topic_count – The number of topics that are ‘publicly’ visible
* _bbp_reply_count – The number of replies that are ‘publicly’ visible
* _bbp_total_topic_count – The total number of topics (includes topics that are are unapproved or hidden)
* _bbp_total_reply_count – The total number of replies (includes replies that are are unapproved or hidden)
A clearer explanation of each of these would be helpful and also are each of these fields in the FORUM_FORUM database table:
* F_TOPICS
* F_COUNT
* T_COUNT
* P_COUNT
The topic ‘counts’ is the same:
* _bbp_reply_count – The number of replies that are ‘publicly’ visible
* _bbp_total_reply_count – The total number of replies (includes replies that are are unapproved or hidden)
A clearer explanation of T_REPLIES would be helpful and is this fields in the FORUM_TOPICS database table?
Whilst you answer those I’ll add Topic Author IP, Stickies and Member Status 🙂
I forgot this, I’m migrating from Snitz Forums 2000 Version 3.4.06 🙂
Can find this information on Table: FORUM_CONFIG_NEW
Here is our ‘Official’ stance on the ‘Unread’ feature/functionality:
https://bbpress.trac.wordpress.org/ticket/1937
The primary issue is performance, we have not seen a plugin that will work well for larger sites, if we implement this as a feature it must work for everyone who uses bbPress.
I just updated the list of ‘Unread’ type plugins I know of here:
Feature Plugins Tracking
Member status
1 = Active
0 = No Active
// User status.
$this->field_map[] = array(
'from_tablename' => 'FORUM_MEMBERS',
'from_fieldname' => 'M_STATUS',
'to_type' => 'user',
'to_fieldname' => 'user_status'
);
Stiky Status
1 = Stycky
0 = No Sticky
// Sticky status (Stored in postmeta))
$this->field_map[] = array(
'from_tablename' => 'FORUM_TOPICS',
'from_fieldname' => 'T_STICKY',
'to_type' => 'topic',
'to_fieldname' => '_bbp_old_sticky_status',
'callback_method' => 'callback_sticky_status'
);
really many thanks for your help….
On first look I see comments block of topic and reply count not supported in snitz… but is a mistake….. (is it ?)
// Forum topic count (Stored in postmeta)
$this->field_map[] = array(
'from_tablename' => 'FORUM_FORUM',
'from_fieldname' => 'F_TOPICS',
'to_type' => 'forum',
'to_fieldname' => '_bbp_topic_count'
);
// Forum reply count (Stored in postmeta)
$this->field_map[] = array(
'from_tablename' => 'FORUM_FORUM',
'from_fieldname' => 'F_COUNT',
'to_type' => 'forum',
'to_fieldname' => '_bbp_reply_count'
);
// Forum total topic count (Stored in postmeta)
$this->field_map[] = array(
'from_tablename' => 'FORUM_TOTALS',
'from_fieldname' => 'T_COUNT',
'to_type' => 'forum',
'to_fieldname' => '_bbp_total_topic_count'
);
// Forum total reply count (Stored in postmeta)
$this->field_map[] = array(
'from_tablename' => 'FORUM_TOTALS',
'from_fieldname' => 'P_COUNT',
'to_type' => 'forum',
'to_fieldname' => '_bbp_total_reply_count'
);
And I’m Not sure what the difference is from this two information….. but there is a total replies per topic
// Topic reply count (Stored in postmeta)
$this->field_map[] = array(
'from_tablename' => 'FORUM_TOPICS',
'from_fieldname' => 'T_REPLIES',
'to_type' => 'topic',
'to_fieldname' => '_bbp_reply_count',
'callback_method' => 'callback_topic_reply_count'
);
// Topic total reply count (Stored in postmeta)
$this->field_map[] = array(
'from_tablename' => 'FORUM_TOPICS',
'from_fieldname' => 'T_REPLIES',
'to_type' => 'topic',
'to_fieldname' => '_bbp_total_reply_count',
'callback_method' => 'callback_topic_reply_count'
);
There is also this 🙂
// Topic author ip (Stored in postmeta)
$this->field_map[] = array(
'from_tablename' => 'FORUM_TOPICS',
'from_fieldname' => 'T_IP',
'to_type' => 'topic',
'to_fieldname' => '_bbp_author_ip'
);
This one is for replies
FORUM_REPLY > R_IP
tnks
J
1) An easy WYSIWYG editor in bbpress for normal users(frontend).
You can enable the TinyMCE Visual Editor with instructions shown here:
Enable Visual Editor
2) With an image “upload” feature, but is not working like an attachment like “GD bbPress Attachments”.
I’m only aware of the “GD bbPress Attachments” plugin that offers this for bbPress, you should be asking in their support forums for any issues relating to why this plugin doesn’t work for you.
3) All the uploaded images will be separated by folder(user name or individual name for an user).
bbPress does NOT support attachments or media uploads ‘out of the box’
I would also suggest you also contact the “GD bbPress Attachments” support forum to request any enhancements you would like to see in the plugin.
Set WP_DEBUG to false define('WP_DEBUG', false); in your wp-config.php file, this is a known issue.
More info on this:
https://bbpress.trac.wordpress.org/ticket/2309 https://core.trac.wordpress.org/ticket/24169
If you only have a few forums you could design a page with each forum title and below each forum title use the following shortcode [bbp-single-forum id=$forum_id]
e.g.
My Forums Page
My First Forum
[bbp-single-forum id=123]
My Second Forum
[bbp-single-forum id=456]
My Third Forum
[bbp-single-forum id=789]
bbPress doesn’t actually support the use of signatures ‘out of the box’.
What we can do though is still import that data and store it in the wp_usermeta table, then if you do add a plugin that supports signatures in bbPress you can then copy that data (Using phpMyAdmin for example) from your imported database to however that plugin supports signatures.
Simply add this field map:
// User Signature (Stored in usermeta)
$this->field_map[] = array(
'from_tablename' => 'FORUM_MEMBERS',
'from_fieldname' => 'M_SIG',
'to_type' => 'user',
'to_fieldname' => '_bbp_snitz_user_sig'
);
Thus once you (if you do) add a plugin to support signatures to can then query against the _bbp_snitz_user_sig field directly with MySQL and update your user profile fields.
I just added the above to the Gist also, you can see the changes via the ‘revisions’ link.
Ok STEPHEN, tomorrow I’ll try to config a new SNITZ.PHP with all information and run it!
(hope will be my friend hihihihi)
Actually the only doubt is where store the signature, Snitz stored in
FORUM_MEMBERS > M_SIG
And ….I think can be more helpful indicate which fieldname are required in bbp …may be ther is but I didn’t find it
Tnks
Bye J
And just because I could and it was quick and easy, here is a copy of the Snitz.php based on the latest Example.php with Robin’s fields mappings.
https://gist.github.com/ntwb/2f057071dd05f9758570
You can also compare the revisions (Seeing the changes made from the source Example.php)
https://gist.github.com/ntwb/2f057071dd05f9758570/revisions
One more thing, when making a custom importer always base it of the Example.php importer, I keep that updated with examples and any other changes I make for bbPress.
The latest (updated 3 days ago) is here:
https://bbpress.trac.wordpress.org/browser/trunk/src/includes/admin/converters/Example.php
As Robin points out, you just delete/remove the sections or fields that are not applicable to your import e.g. ‘tags’ or if your database doesn’t include the ‘counts’ for topics in forums then remove that part in the forum section.