Search Results for 'code'
-
Search Results
-
Topic: Problem with shortcodes
Am using:
Twentythirteen wordpress theme
bbPress – Version 2.5.12
With bbPress I have created a number of forums
But – when I put the following short code into a page:
[bbp-forum-index]it shows nothing …
Please – what am I doing wrong?
Topic: an easy New Topic button
Hi all,
I added an easy New Topic button (after reading a lot of other possible solutions):

Add to your loop-topics.php template (before the actual loop):
<?php if (!is_user_logged_in() ) :?> <?php else : ?> <div class="new-topic"> <input type="submit" name="submit" value="New Topic" onclick="location.href='#new-post';"> </div> <?php endif; ?>Add some css for styling when needed:
.new-topic { position: relative; z-index:1; float: right; }Regards,
Marc
Hi all,
I’m trying to integrate the BuddyPress favorite (aka like system) system with BBPress.
On my site: http://www.starry-night.nl I use the BuddyPress Activity page as homepage, this means that forum topics and replies are
shown on the activity wall, and can be liked.
For easy navigation I made a custom “comment” button which links to the BBPress topic or reply. BBPress activity items (topics or replies)
can be liked.Going to a forum topic of replies of course doesn’t show any likes in the BBPress topic and replies.

Integrating the BuddyPress favorite system with BBPress is at least in my mind the cleanest way and from a functionality point of view, the way
to go.On the BuddyPress forum I found the following code (below) which implements the BuddyPress favorite button in blogpost (and this works), so a rewrite
should be possible to make this work for BBPress.In single.php for blogpost and in the future in the loop-single-reply.php for BBPress.
<?php echo get_fav_or_unfav_button_for_post( $post ); ?>In function.php:
/ Buddypress favorites function get_fav_or_unfav_button_for_post( $post ) { global $bp, $activities_template; // user is not logged ? Show nothing. if ( ! is_user_logged_in() ) { return ''; } $activity_id = bp_activity_get_activity_id( array( 'user_id' => $post->post_author, 'type' => 'new_blog_post', 'component' => 'blogs', 'item_id' => 1, 'secondary_item_id' => $post->ID ) ); if ( ! $activity_id ) { return ''; } bp_has_activities(); // update $activities_template of user's fav $old_value = false; if ( isset( $activities_template->activity->id ) ) { $old_value = $activities_template->activity->id; $activities_template->activity->id = $activity_id; } else { $activities_template->activity = (object) array( 'id' => $activity_id ); } // building the template $code = ''; $code .= '<div class="activity-meta">'."\n"; if ( ! bp_get_activity_is_favorite() ) { // if not favorited, add a fav button $code .= ' <a href="'.bp_get_activity_favorite_link( ).'" class="button fav bp-secondary-action" title="'.__( 'Like', 'buddypress' ).'">'.__( 'Like', 'buddyboss' ).'</a>'."\n"; } else { // if already favorited, a button to unfav $code .= ' <a href="'.bp_get_activity_unfavorite_link( ).'" class="button unfav bp-secondary-action" title="'.__( 'Unlike', 'buddypress' ).'">'.__( 'Unlike', 'buddyboss' ).'</a>'."\n"; // bonus button to show user's all favs $code .= ' <a href="'.bp_loggedin_user_domain() . 'activity/favorites/" class="button unfav bp-secondary-action">'.__( 'My Likes', 'buddyboss' ).'</a>'."\n"; } // closing .activity-meta $code .= '</div>'."\n"; if ( false !== $old_value ) { $activities_template->activity->id = $old_value; } else { $activities_template->activity = null; } return $code; }I’m having problems with rewriting the array for bbpress:
$activity_id = bp_activity_get_activity_id( array( 'user_id' => $post->post_author, 'type' => 'new_blog_post', 'component' => 'blogs', 'item_id' => 1, 'secondary_item_id' => $post->ID ) );Help for figuring this one out is appreciated.
Best regards,
Marc
I’d like to display a list of the last 5 topics the logged in user has contributed to, either by starting the topic, or replying to it.
This is to go on a summary page for the user, so can either be shortcode or by creating a tepmplate.
Any ideas would be appreciated.
Dear Friends,
I’m using WP 4.7 and bbPress 2.5.12. I’m using the importer under Tools->Forums->Import forums to import a MyBB Forum (version 1.6), with 4000 topics, 50.000 messages, and 3000 users.
The performance is Ok, it takes two hours more or less. The problem, is that at certain point, the message Conversion complete is displayed, and certainly, the users / topics count is the right one. And then, without my interaction, it starts again.
I’m not sure if this “second pass” is the normal procedure, or it is an error.
Any help would be very appreciate.
That’s the output of my last attempt
Calculating forum hierarchy (0 - 999)Converting forums (0 - 999)Delete users WordPress default passwords (5000 - 5999)Delete users WordPress default passwords (4000 - 4999)Delete users WordPress default passwords (3000 - 3999)Delete users WordPress default passwords (2000 - 2999)Delete users WordPress default passwords (1000 - 1999)Delete users WordPress default passwords (0 - 999)Converting users (2000 - 2999)Converting users (1000 - 1999)Converting users (0 - 999)<strong>Conversion Complete</strong>No reply_to parents to convertConverting replies (3000 - 3999)Converting replies (2000 - 2999)Converting replies (1000 - 1999)Converting replies (0 - 999)No tags to convertNo super stickies to stickCalculating topic stickies (0 - 999)Converting topics (51000 - 51999)Converting topics (50000 - 50999)Converting topics (49000 - 49999)Converting topics (48000 - 48999)Converting topics (47000 - 47999)Converting topics (46000 - 46999)Converting topics (45000 - 45999)Converting topics (44000 - 44999)Converting topics (43000 - 43999)Converting topics (42000 - 42999)Converting topics (41000 - 41999)Converting topics (40000 - 40999)Converting topics (39000 - 39999)Converting topics (38000 - 38999)Converting topics (37000 - 37999)Converting topics (36000 - 36999)Converting topics (35000 - 35999)Converting topics (34000 - 34999)Converting topics (33000 - 33999)Converting topics (32000 - 32999)Converting topics (31000 - 31999)Converting topics (30000 - 30999)Converting topics (29000 - 29999)Converting topics (28000 - 28999)Converting topics (27000 - 27999)Converting topics (26000 - 26999)Converting topics (25000 - 25999)Converting topics (24000 - 24999)Converting topics (23000 - 23999)Converting topics (22000 - 22999)Converting topics (21000 - 21999)Converting topics (20000 - 20999)Converting topics (19000 - 19999)Converting topics (18000 - 18999)Converting topics (17000 - 17999)Converting topics (16000 - 16999)Converting topics (15000 - 15999)Converting topics (14000 - 14999)Converting topics (13000 - 13999)Converting topics (12000 - 12999)Converting topics (11000 - 11999)Converting topics (10000 - 10999)Converting topics (9000 - 9999)Converting topics (8000 - 8999)Converting topics (7000 - 7999)Converting topics (6000 - 6999)Converting topics (5000 - 5999)Converting topics (4000 - 4999)Converting topics (3000 - 3999)Converting topics (2000 - 2999)Converting topics (1000 - 1999)Converting topics (0 - 999)Calculating forum hierarchy (0 - 999)Converting forums (0 - 999)Delete users WordPress default passwords (2000 - 2999)Delete users WordPress default passwords (1000 - 1999)Delete users WordPress default passwords (0 - 999)Converting users (2000 - 2999)Converting users (1000 - 1999)Converting users (0 - 999)Starting ConversionI’m trying to make my own nested threaded replies. Right now all the replies appear in my page, but there’s no organization to them. Is the $args method the way to go or do I need to make my own custom sql statement? I’ve got all the data in the args below, but the sort isn’t nested. Not sure how do do that.
$args = array( 'post_type' => 'reply', // custom post type 'posts_per_page' => '50', 'orderby' => 'post_parent', 'post_parent' => $topic_id, 'meta_query' => array( 'relation' => 'OR', array( 'key'=> $topic_id, ), array( 'key'=>'_bbp_reply_to', 'compare' => 'NOT EXISTS' ), array( 'key'=>'_bbp_reply_to', 'compare' => 'EXISTS', ), ), 'orderby' => 'meta_value_num', 'order' => 'ASC', ); //global $wpdb; $loopReply = new WP_Query($args);Hi,
WP 4.7, latest BBpress. I have a multisite: swissinformatic.org, magazine.swissinformatics.org, [other stuff]swissinformatics.org. My mail server is @swissinformatics.org and the plugin picks up$_SERVER['SERVER_NAME']to create the no reply address.
COULD YOU HELP US with a setting box to supersede this value?
Meanwhile I replaced it with my site name in the functions.php code, but mind the next plugin update!
$sitename = strtolower( ‘swissinformatics.org );
Always beware of “Educated guess’ I’m not going to buy a mail server for each subdomain and with the present security of providers,…
I also created a no reply alias of my administrative e-mail address.
Everything is fine nowSubscriptions ***********************************************************/
/**
* Get the “Do Not Reply” email address to use when sending subscription emails.
*
* We make some educated guesses here based on the home URL. Filters are
* available to customize this address further. In the future, we may consider
* usingadmin_emailinstead, though this is not normally publicized.
*
* We use$_SERVER['SERVER_NAME']here to mimic similar functionality in
* WordPress core. Previously, we usedget_home_url()to use already validated
* user input, but it was causing issues in some installations.
*
* @since bbPress (r5409)
*
* @see wp_mail
* @see wp_notify_postauthor
* @link https://bbpress.trac.wordpress.org/ticket/2618
*
* @return string
*/
function bbp_get_do_not_reply_address() {
$sitename = strtolower( $_SERVER[‘SERVER_NAME’] );
if ( substr( $sitename, 0, 4 ) === ‘www.’ ) {
$sitename = substr( $sitename, 4 );
}
return apply_filters( ‘bbp_get_do_not_reply_address’, ‘noreply@’ . $sitename );Hi guys, I will just say first that I do not know much about coding.
I just installed bbpress and now i have this error come up in my wordpress dashboard
Warning: preg_match(): Unknown modifier ‘0’ in /home2/eli/public_html/juniortactician.com/wp-includes/class-wp.php on line 231
Warning: preg_match(): Unknown modifier ‘0’ in /home2/eli/public_html/juniortactician.com/wp-includes/class-wp.php on line 232
the code on those lines are as follows:
if ( preg_match(“#^$match#”, $request_match, $matches) ||
preg_match(“#^$match#”, urldecode($request_match), $matches) ) {what does this mean and how can I get rid of it?
Thanks in advance.
Topic: Paging on custom short code
Hi I am using a custom short code to show about 10 latest replies on my reply dash board.
I get shortcode from this link by applying this code : http://www.daggerhart.com/bbpress-recent-replies-shortcode/what I want is to add paging (nav) at the bottom to show more then 10 replies on other pages. please suggest solutions.
Hello,
I have used Image Upload for BBPress to upload and attach image to forum.
my problem is image is not responsive. It will just shrink its width. I tried playing with firbug and remove image attributes and set max-width to 100%.
It works… Now my problem is which file to edit and how. Im not a coder. I just learned css and have little understanding on php…