Is there a git repository or something like this where I can checkout your importer? I have no local wordpress installation and only want to see the source code.
In general I (guess I) understood what needs to be inserted into the database comparing the pre- and post-topic-creation-dump, except the serialized array values for key “_bbp_akismet_as_submitted” in postmeta table. Are all the keys and information necessary? I don’t understand why the HOME key is needed related to an anonymous user or how I get the unique id for REDIRECT_REDIRECT_UNIQUE_ID,…
With “are they necessary” I mean, for automatically / imported entries.
Thanks and kind regards,
Dirk
ok, remove the whole line
<?php echo do_shortcode(‘[bbpress_recent_replies_by_topic show =5]’) ?>
then add this to your functions
add_action( 'bbp_template_before_forums_loop', 'call_bbpress_recent_replies_by_topic' );
function call_bbpress_recent_replies_by_topic () {
echo do_shortcode("[bbpress_recent_replies_by_topic show=5]") ;
}
This just hooks to the line after the one you’d added
<?php do_action( ‘bbp_template_before_forums_loop’ ); ?>
so saving you having to amend that template.
This works on my site.
bbpress just uses
posts
post_meta
and for its own settings
options
forums, topics and replies are all post types in wordpress.
go to
Import Forums
for more info including an example importer.
I documented my import from snitz access database when I very first started using bbpress, and you may want to read through that as well in this page
Custom Import
Hello,
I have a new bbpress site with buddypress integrated (bbpress was installed and set up first.) Admins can see all forums, Participants cannot see Hidden forums, unless it is associated with a buddypress group of which they are a member. The site is jingfangacademy.com
Fixes I have tried:
1. Deactivated all plugins one by one.
2. Tried other themes: 2013, 2015, 2016
3. Tools > Forums > ran all tools
4. Changed user role permissions with third-party plugins: User Role Editor, Members
5. WP and all plugins up to date.
I’ve added no CSS to the site. I’m a novice and I don’t own the hosting account, so I’m hoping to fix this without adding code. I’ve tried all the fixes I could find in related threads.
Thanks for any help!
I tried to do that now and update the file, but still no change.
<?php
/**
* Forums Loop
*
* @package bbPress
* @subpackage Theme
*/
?>
<?php echo do_shortcode(‘[bbpress_recent_replies_by_topic show =5]’) ?>
<?php do_action( ‘bbp_template_before_forums_loop’ ); ?>
<ul id=”forums-list-<?php bbp_forum_id(); ?>” class=”bbp-forums nk-forum”>
<?php while ( bbp_forums() ) : bbp_the_forum(); ?>
<?php bbp_get_template_part( ‘loop’, ‘single-forum’ ); ?>
<?php endwhile; ?>
<!– .forums-directory –>
<div class=”nk-gap-2″></div>
<?php do_action( ‘bbp_template_after_forums_loop’ ); ?>
@kdelsimone
If you want the link changed from the topic to the reply, I suggest copying loop-search-reply.php from /wp-content/plugins/bbpress/templates/default/bbpress to your child themes bbpress directory @ /wp-content/themes/theme-child/bbpress
From there you can edit it and change line 25 from this:
<a class="bbp-topic-permalink" href="<?php bbp_topic_permalink( bbp_get_reply_topic_id() ); ?>"><?php bbp_topic_title( bbp_get_reply_topic_id() ); ?></a></h3>
to this:
<a class="bbp-topic-permalink" href="<?php bbp_reply_url(); ?>"><?php bbp_topic_title( bbp_get_reply_topic_id() ); ?></a></h3>
not sure why, but adding show seems to fix
<?php echo do_shortcode(‘[bbpress_recent_replies_by_topic show =5]’) ?>
I’ve been thinking this over, and can’t see a simple way to achieve this.
To get something working would involve adding extra fields to a topics meta data, and then filtering the display to catch.
With the forum visible in effect the code for a forum or set of forums would need to (by default) make a topic private using an additional field, and then all the display parameters would need to hide it unless made public. That means closing every back door in search, profiles, displays, freshness all widgets and other areas so that no-one sees it unless set to public, which is one hell of a lot of work, and a large re-write of many bbpress functions.
I could modify my private groups plugin which makes forums (but not content) visible, so that certain topics are shown, but again it is a heap of code. Beyond free help I’m afraid, but if you want to look at that route contact me via my website http://www.rewweb.co.uk
Currently it looks like this:
<?php
/**
* Forums Loop
*
* @package bbPress
* @subpackage Theme
*/
?>
<?php echo do_shortcode(‘[bbpress_recent_replies_by_topic]’) ?>
<?php do_action( ‘bbp_template_before_forums_loop’ ); ?>
<ul id=”forums-list-<?php bbp_forum_id(); ?>” class=”bbp-forums nk-forum”>
<?php while ( bbp_forums() ) : bbp_the_forum(); ?>
<?php bbp_get_template_part( ‘loop’, ‘single-forum’ ); ?>
<?php endwhile; ?>
<!– .forums-directory –>
<div class=”nk-gap-2″></div>
<?php do_action( ‘bbp_template_after_forums_loop’ ); ?>`
Hi there!
I have been trying to following this guide to add a list of recent topics before the forum categories: https://www.daggerhart.com/bbpress-recent-replies-shortcode/
I have put the code in the functions.php file, and <?php echo do_shortcode(‘[bbpress_recent_replies_by_topic]’) ?> in loop-forums.php
After having done this the code isn’t visible, so I am wondering if I have made a mistake. Could anyone be so kind and shed some light on how to make this work?
My forum can be found on http://www.talanrien.com/forums
I am running WordPress 4.9.1 with Bbpress version 2.5.14
As a bonus question I was also wondering if anyone know if it’s possible to ad a shoutbox/chatbox at the bottom of the forum?
Thank you!
Best wishes,
Kasper
functions.php
add_filter( 'bbp_get_topic_freshness_link', 'rew_freshness_no_date_link' , 100, 5) ;
function rew_freshness_no_date_link($anchor, $topic_id, $time_since, $link_url, $title) {
if (!empty ($topic_id)) {
?>
<a href="<?php echo $link_url; ?>"><?php echo $title ;?></a> (<?php echo $time_since ; ?>)
<?php
}
else echo 'No topics' ;
}
It works perfectly when viewing the category page that lists all topics. When I click the topic however and view the post it displays the following in the breadcrumbs:
› Forums › General › Mobile General › hi Reply To: test (3 weeks, 2 days ago)
See how it adds the topic title with (the date) that has its link removed, to the end of the breadcrumb.
can you post the whole of your code – so I can copy/paste into my file and check what it does on mine
did you change the filter – I was calling the wrong one should be
add_filter( 'bbp_get_topic_freshness_link', 'rew_freshness_no_date_link' , 100, 5)
ok, should have tested before sending, but coded it late last night and I have been out all day !
Now had a chance to try it, and correct code is
add_filter( 'bbp_get_topic_freshness_link', 'rew_freshness_no_date_link' , 100, 5) ;
function rew_freshness_no_date_link($anchor, $topic_id, $time_since, $link_url, $title) {
if (!empty ($topic_id)) {
?>
<a href="<?php echo $link_url; ?>"><?php echo $title ;?></a> (<?php echo $time_since ; ?>)
<?php
}
else echo 'No topics' ;
}
Hello everyone. I was wondering if there is a complete list anywhere for the bbPress plugin of all the functionalities available to the end-user, a general forum user on a wordpress site using bbPress. For instance, having a list of before and after of code and examples to demonstrate what is available and how it works.
For example: the functionality of some of the quicktags is a little ambiguous in what they do. There are some code option for smileys but how many and what they are is unknown. There are options to address previous users in the forums. Ability to embed youtube by placing a link. I am not sure if this is all bbPress on the sites I use as they could be using multiple plugins but having a comprehensive list on what is available for bbPress would be quite handy. Maybe this already exists somewhere but I have not been able to find it as all advice answeres is catered towards the technical end of implementation not general users.
If I could also make a request for such a user help list to be included in the bbPress plugin in something like a drop down or expandable Help List of all available functionality for general users.
It would be great for end-users to be able to utilise this plugin to its full potential but its near impossible to know what that is without a fair bit of trial-and-error. Like I said – maybe this is listed somewhere but it would be great if it was included in the actual plugin design.
Thanks.
SORRY – just read you post again, and now I think I understand
on one site you want the code as above
on another site you just want a single post, but with title and date, but no link on the date – yes ?
if so then untested but this should be it
add_filter( 'bbp_get_forum_freshness_link', 'rew_freshness_no_date_link' , 100, 6) ;
function rew_freshness_no_date_link($anchor, $forum_id, $time_since, $link_url, $title, $active_id ) {
if (!empty ($active_id)) {
?>
<a href="<?php bbp_topic_permalink($active_id); ?>"><?php bbp_topic_title(active_id) ?></a> (<?php bbp_topic_last_active_time(active_id); ?>)
<?php
}
else echo 'No topics' ;
}
you’ve lost me now 🙂
The key line that does the reference is
<a href="<?php bbp_topic_permalink($topic); ?>"><?php bbp_topic_title($topic) ?> (<?php bbp_topic_last_active_time($topic); ?>)</a>
This translates as
<a href="[topic link]">[topic title] ([date])</a>
which makes both the topic title and the date a single clickable link and the code shows 3 of these.
I’m not really sure what you are trying to achieve – I had thought you wanted 3 clickable links on both title and date, which is what the above does.
If you don’t want the date clickable, then do
<a href="<?php bbp_topic_permalink($topic); ?>"><?php bbp_topic_title($topic) ?></a> (<?php bbp_topic_last_active_time($topic); ?>)
Thanks for the link. I will check out your plugin. It may be what I need. Though still wondering about access control.
I am mostly confused by the “FORUM ACCESS” that is described here,
https://codex.bbpress.org/step-by-step-guide-to-setting-up-a-bbpress-forum/#5-%c2%a0forum-visibility-and-access
It talks about viewing and posting permissions but doesn’t say WHERE it is. It is very frustrating.
Anybody know if these settings really exist and WHERE they are. Thanks.
When I use your code above, I get the 3 last posts without a link on the date/time.
When I am not using your 3 last posts code (different site) from above, bbpress naturally links the last post.
How would I best go about removing just the link from a single last post in that example?
I’ve figured that I could use your code as above but change to ($count == 1). I’m obviously not experienced with writing code but to me it seems an excessive way to go about it.
The topic ID is a changeable box, so lets you change the id number. Lots of code would be needed to get it to work for titles, but this code will show the topic name in the box at the bottom
add_action( 'bbp_reply_metabox', 'rew_topic_title' );
function rew_topic_title ($post_id ) {
$reply_topic_id = bbp_get_reply_topic_id( $post_id );
?>
<p>
<strong class="label"><?php esc_html_e( 'Topic Title:', 'bbpress' ); ?></strong>
<label class="screen-reader-text" for="bbp_author_id"><?php esc_html_e( 'Topic Title:', 'bbpress' ); ?></label>
<?php bbp_topic_title ($reply_topic_id) ; ?>
</p>
<?php
}
Put this in your child theme function file
Functions files and child themes – explained !
in place of your code put back the original
<?php bbp_forum_freshness_link(); ?>
and then add this to your functions file
add_filter( 'bbp_get_forum_freshness_link', 'rew_freshness_last_three' , 100, 6) ;
function rew_freshness_last_three ($anchor, $forum_id, $time_since, $link_url, $title, $active_id ) {
//set up and run a query to get a list of all topics in this forum that this user can see
// Setup possible post__not_in array
$post_stati[] = bbp_get_public_status_id();
// Super admin get whitelisted post statuses
if ( bbp_is_user_keymaster() ) {
$post_stati = array( bbp_get_public_status_id(), bbp_get_private_status_id(), bbp_get_hidden_status_id() );
// Not a keymaster, so check caps
} else {
// Check if user can read private forums
if ( current_user_can( 'read_private_forums' ) ) {
$post_stati[] = bbp_get_private_status_id();
}
// Check if user can read hidden forums
if ( current_user_can( 'read_hidden_forums' ) ) {
$post_stati[] = bbp_get_hidden_status_id();
}
}
// Parse arguments against default values
$r = array(
'post_parent' => $forum_id,
'post_type' => bbp_get_topic_post_type(),
'post_status' => implode( ',', $post_stati ),
'ignore_sticky_posts' => true,
'posts_per_page' => -1
);
// Create a new query for the topic list
$get_posts = new WP_Query();
$topics = $get_posts->query( $r ) ;
//var_dump ($topics) ;
//now run through this list and get the last active date of each topic
foreach ($topics as $topic) {
$id = $topic->ID ;
$last_active = get_post_meta( $id, '_bbp_last_active_time', true );
$curdate = strtotime($last_active);
$show[$curdate] = $id ;
}
if (!empty ($show)) {
//so now we have a list of dates with topic ids, so we need to find the latest 3
arsort($show);
$count=0 ;
foreach ($show as $topic) {
$count++ ;
?>
<a href="<?php bbp_topic_permalink($topic); ?>"><?php bbp_topic_title($topic) ?> (<?php bbp_topic_last_active_time($topic); ?>)</a>
<?php
if ($count == 3) break ;
}
}
else echo 'No topics' ;
}
It has to sort through all topics for all forums to work this out, so it may slow your forums index display and get worse as your forum content grows.
the page is a virtual page
you can make it an actual wordpress page by following
Step by step guide to setting up a bbPress forum – Part 1
Item 3 method 2
I’ve managed to find a solution, I will add styling later to both topic title and date.
<a href="<?php bbp_forum_last_reply_url(); ?>"><?php bbp_forum_last_topic_title() && bbp_forum_last_topic_title(); ?> (<?php bbp_forum_last_active_time(); ?>)</a>
I’d still love to find a way to display 3 last posts rather than just one.
Is it possible to post your final, working code used?