Forum Replies Created
-
Have done this with all accounts and still no joy.
Any ideas?
*bump*
Great tip dude, many thanks. Wasn’t sure what I was looking for in reply here, but this will do perfectly.
Better than manually looking into the resources of a page lol.
*bump
Oh I don’t know of this, you’d have to query Gravatar and find out if they allow for you to query the original. Surely it can be done.
Apologies for mis-interpreting here.
Hi man, yeah pretty much. You’ll connect the dots in the back-end and the previously discussed functionality will be applied on the front.
Does seem fairly bespoke though, and wouldn’t necessarily define this as “much needed” as the information can always be captured later.
All depends on the audience though, also…. if you need to capture specific information from others and don’t care how they use the site afterwards then you could use a Gravity Form.
Is this for a WordPress blog comment or a BuddyPress activity comment / group comment / status update / anything BuddyPress?
If WordPress query the codex for params https://codex.wordpress.org/Function_Reference/get_avatar
`<?php
echo get_avatar
(
‘user-id-which-you-can-find-in-users-table-or-user-email’,
‘size-in-numeric-form’,
‘path-to-avatar-if-none-supplied-will-use-mystery-man,
‘alt-text-for-image-goes-between’
);
?>`If it’s BuddyPress and you are using outside a loop then there are also parameters you can pass. However documentation here is a little sparser than the WordPress Codex.
I honestly couldn’t from the top of my head, nor can i afford you the luxury of time at this minute. Sorry man, someone else will help you.
Simple:Press I used to love that platform, it’s such a mature forum and does so much stuff. The admin can be very heavy though and is completely not connected with BuddyPress.
If you are going to use BuddyPress you should consider the BBPress forums now, it’s at a very good stage.
@serdox hehe you can enable threaded comments, there is a guide within the codex.
Favs are much the same as the example @kalengi has given if you look into bp-activity-functions.php you should be able to figure it out.
Also, your theme is a premium theme that advertises BP support. Surely you should be looking at the Author for support?
@kalengi awesome dude, thanks for helping.
“
If it is an activity template you are looking for the avatar, that should be the one.
Thinking something like this.
Still struggling to see how it would work for more than the 1st stage / 1st option directing to the xProfile Group associated with that.
Although that might be my lack of understanding the possible direction a user may take when building out their registration fields.
This interface might confuse users, Google + / Groups / BuddyPress / ahhh head aches.
Will probably opt in for a simple drop down on either side.
Hey @bojan85
Guess there is a small need for a plugin like this.
I’m trying to visualise how you would configure a plugin to meet the requirements you need and also any others like @davidveldt
Possible scenarios?
Multiple routes for registration depending on which items were selected at the “required” stage.
If this was to come “out the box” with BuddyPress, how would you expect to set this registration up within wp-admin / bp-admin?
@kalengi do you have a donate link? sorry it’s not more but i got 10 bucks here with your name on it lol.
If you are using SEO as a metric against using an entirely dynamic system like BuddyPress i suggest you re-consider that metric.
However the issue you have in regards to the 404 is a known issue and the code above will fix activity stream commenting. @kalengi submitted this fix for a “without javascript use case”.
To fix commenting running with the above example do the following. (Just re-iterating @kalengi here)
In the folder /wp-content/themes/your-theme/activity/
Create the file reply.php
`<?php
global $bp;if(!is_user_logged_in()) :
bp_core_add_message( __(‘You must be logged in to post a comment’, ‘buddypress’ ), ‘error’);
else :
if(!check_admin_referer(‘new_activity_comment’, ‘_wpnonce_new_activity_comment’)) :
bp_core_add_message(__(‘There was an error posting that reply, please try again.’, ‘buddypress’ ), ‘error’);
else :
// This line should match up with your form field names in entry.php
$activity_id = apply_filters(‘bp_activity_post_comment_activity_id’, _POST);
// This line should match up with your form field names in entry.php
$content = apply_filters(‘bp_activity_post_comment_content’, _POST);$comment_id = bp_activity_new_comment(array(
‘content’ => $content,
‘activity_id’ => $activity_id,
‘parent_id’ => $parent_id));if(empty($content)) :
bp_core_add_message(__(‘Please add a comment.’, ‘buddypress’ ), ‘error’);
bp_core_redirect(wp_get_referer() . ‘#ac-form-‘ . $activity_id);
endif;if(empty($comment_id)) :
bp_core_add_message(__(‘There was an error posting that reply, please try again.’, ‘buddypress’ ), ‘error’);
bp_core_redirect(wp_get_referer() . ‘#ac-form-‘ . $activity_id);
else :
bp_core_add_message(__(‘Comment posted successfully’, ‘buddypress’));
bp_core_redirect(wp_get_referer() . ‘#ac-form-‘ . $activity_id);
endif;endif;
endif;`
Within that file you should have code that resembles the following. (If you don’t know how to alter accordingly, you need to further assistance.
/wp-content/themes/your-theme/activity/reply.php
Then in /wp-content/themes/your-theme/functions.php
Add this code.
`function bp_activity_action_add_activity_comment()
{
global $bp;// Not viewing activity or action is not delete
if(!bp_is_activity_component() || !bp_is_current_action(‘reply’)) :
return false;
endif;locate_template(array(‘activity/reply.php’), true);
bp_core_redirect(wp_get_referer());
}
add_action(‘bp_actions’, ‘bp_activity_action_add_activity_comment’);`If you then want to add AJAX to this code you could use jQuery and listen for the form submission, onClick or onSubmit.
You could then run the jQuery AJAX method with GET as the type and the data would be the form fields from the form submitted.
jQuery will then return for you the return values within reply.php
Short of writing it specifically for you, that’s what you need.
Also the consideration you took here to discovering the issue with _POST was fantastic.
Well deserved.
Dude, thank you thank you! This is ace.
Followed your train of thought to the actions and methods involved. Applied the filters as advised in core.
`global $bp;
if(!is_user_logged_in()) :
bp_core_add_message( __(‘You must be logged in to post a comment’, ‘buddypress’ ), ‘error’);
else :
if(!check_admin_referer(‘new_activity_comment’, ‘_wpnonce_new_activity_comment’)) :
bp_core_add_message(__(‘There was an error posting that reply, please try again.’, ‘buddypress’ ), ‘error’);
else :
$activity_id = apply_filters(‘bp_activity_post_comment_activity_id’, _POST);
$content = apply_filters(‘bp_activity_post_comment_content’, _POST);$comment_id = bp_activity_new_comment(array(
‘content’ => $content,
‘activity_id’ => $activity_id,
‘parent_id’ => $parent_id));if(empty($content)) :
bp_core_add_message(__(‘Please add a comment.’, ‘buddypress’ ), ‘error’);
bp_core_redirect(wp_get_referer() . ‘#ac-form-‘ . $activity_id);
endif;if(empty($comment_id)) :
bp_core_add_message(__(‘There was an error posting that reply, please try again.’, ‘buddypress’ ), ‘error’);
bp_core_redirect(wp_get_referer() . ‘#ac-form-‘ . $activity_id);
else :
bp_core_add_message(__(‘Comment posted successfully’, ‘buddypress’));
bp_core_redirect(wp_get_referer() . ‘#ac-form-‘ . $activity_id);
endif;endif;
endif;`
As this is a theme edit and not core, decided to change the syntax style also. Probably grind against those who work with themes but wouldn’t say my style is ugly.
Thanks a lot man, this is really good.
Can I buy you a beer?
@davidveldt now this is a considered post https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/activity-stream-commenting/?topic_page=2&num=15#post-121548
Thanks @kalengi have to go to the job centre, will let you know how this works out later today.
Many many thanks!
Bermuda? lol
Little bump here fyi
Thanks for the contribution.
Much like anything in life depending on what you are doing you consume accordingly.
I’m loving BP right now, and usually now whenever I study it tends to be all about BP.
Similarly, last year… work required CodeIgniter, so it was all about that.
Year before WP, so it was all about that.
Guess you like communities now so… it’s all about BuddyPress baby!
How much do you like Cigars? @FuriousCigars lol
Ah not sure man.
@kalengi – Hello, this is a child theme so the file structure adheres to anything in bp-default.
So… accessing the stream via the url .site.com/activity
using the file
theme/activity/index.php
Calling the loop from index.php
theme/activity/activity-loop.php
Calling an entry from within the loop
theme/activity/entry.php
Omitting header.php the full loop looks like this.
`
<form action="” method=”post”>
`
That’s being sent to the 404.
@allwest – I think this is a known issue, it’s listed over in Trac https://buddypress.trac.wordpress.org/ticket/3705
`
If you could stub out the functionality of the plugin I’d be happy to consider it
