Search Results for 'code'
-
Search Results
-
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…I am having trouble importing from SimplePress to bbpress. I’m not sure what the table prefix is supposed to be. I tried wp_ and that didn’t import anything. I tried wp_sf (I think that is the beginning of tables for SimplePress but get this error
Repair any missing information: Continue
WordPress database error: [Specified key was too long; max key length is 1000 bytes]
CREATE TABLE wpzu_bbp_converter_translator ( meta_id mediumint(8) unsigned not null auto_increment, value_type varchar(25) null, value_id bigint(20) unsigned not null default ‘0’, meta_key varchar(255) null, meta_value varchar(255) null, PRIMARY KEY (meta_id), KEY value_id (value_id), KEY meta_join (meta_key(191), meta_value(191)) ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci;Is there anything I can do to get this import done?
Hello:
I have created a log in page but I tested it myself and I logged out. But though I set up the recommended bbPress code for log in, there is no option to log in. When I logged out, I still got this message: “You are already logged in.”
I can’t create a registration form, in spite of creating one with the recommended bbPress shortcode.
Without being able to log in our log out, or register, I can’t invite anyone to my forum.
Sigh.
In the forum settings, it gives the option “Forum root should show” with the choices of “Forum Index” or “topics By Freshness”. How can I have the root show both – the listing of forums, and below it the latest topics?
I know there is a shortcode [bbp-topic-index] which will show the latest topics, but I don’t know where I can put that to have it show on the forum root.
Thanks