Forum Replies Created
-
Hi @henrywright,
I’m using “Buddypress Upload Avatar Ajax” (Version 1.0.1) and Buddypress (Version 4.1.0).
Since upload avatar plugin was not updated I’m experiencing the same problem as @chavodbharat has mentioned – I’m getting “There was a problem cropping your avatar, please try uploading it again” error.I tried what he has suggested (edit directly wp-content\plugins\buddypress\bp-core\classes\class-bp-attachment-avatar.php) and I also tried your snippet, but I’m still getting the same problem.
Does something changed in latests Buddypress versions?
Does anybody could help, to give me an idea where to start to write my custom code? How I can check if the message was answered or no?
@henrywright I just tested activity by changing the places where I’m using
bp_get_activity_user_id()
function, it did not gave me any effect.
I think it’s not that kind a problem.I have found this, looks like it’s a filter. Maybe there is another way to declare it
$profile_video_id = bp_get_activity_user_id();
I tried to echo, it’s showing right ID’s as I have it right now.
Thank you @henrywright ! Button in messages start working when I use the function in a single message thread. My mistake was that I was using it before it.
Thank you for your answers! Looks like that I did not describe clear what is my problem, because what I tried from you suggestions it did not work.
There is the code that I’m using to generate “Give a point” button”
function one_star_points() { if ( ! function_exists( 'mycred' ) ) return; $current_id = get_current_user_id(); $profile_id = bp_displayed_user_id(); if ( $current_id == $profile_id ) return; echo '<div class="award-star-rating-img">'; echo do_shortcode( '[mycred_send to="' . $profile_id . '" amount="1" ref="tip" log="Tipping"]Give a point[/mycred_send]' ); echo '</div>'; } add_action( 'one_star_points_button', 'one_star_points' );
To give points in user profile I used
$profile_id = bp_displayed_user_id();
To give points in forum I used$profile_user_id = bbp_get_reply_author_id();
But i bumped into a problem when I want to give points to user in activity stream. I placed the button near every activity stream entry, so the user could give a point if the like what other user posted in activity stream. I used this code
$profile_video_id = bp_get_activity_user_id();
There is no error or warning, but it’s not working, not giving points.Also I would like to give a point if I like private message answer that other user send me. I used this
$profile_message_id = bp_get_the_thread_message_sender_id() ;
, but it says that “Missing the recipient for this shortcode.”.Looks like that in the last two cases (activity stream and messages) something is wrong with indicating user id.
Any recommendations on this? I have tried many functions, but still can’t grab user ID in those last two..@henrywright thank you for you answer! Actually I couldn’t find anything that is related to what I’m willing to do.
I’m wondering is there is a way to check if messages has any answers and if no, then send a reminder to an email.
I believe it’s possible to make via custom function, but I have no idea how and where to start writing it.Actually I found my answer in this topic https://wordpress.org/support/topic/php-if-statement-help?replies=3
Could somebody help with this?
This line should look like this. [] caused problem user at registration, so I removed it
$args['headers'] = 'Bcc: <admin@yoursite.com>';
This works just perfect, thank you! 🙂
@brgweb I tried the code you send me, but that’s what I got.
When I use this code, then in database in type column words ‘video_library_category’ is saved.function ajax_update_activity_contents () { $bpfb_code = $activity = ''; $aid = 0; $video_library_category = $_POST['industries_subcategories']; $codec = new BpfbCodec; if (@$_POST['data']['bpfb_video_url']) { $bpfb_code = $codec->create_video_tag($_POST['data']['bpfb_video_url']); $type = 'video_library_category';
But when I use this code $type = $video_library_category than video upload is not working at all. I paste url, press preview, save, page reloads and nothing happens, nothing is saved. Any ideas with this how can I save subcategorie?
function ajax_update_activity_contents () { $bpfb_code = $activity = ''; $aid = 0; $video_library_category = $_POST['industries_subcategories']; $codec = new BpfbCodec; if (@$_POST['data']['bpfb_video_url']) { $bpfb_code = $codec->create_video_tag($_POST['data']['bpfb_video_url']); $type = $video_library_category;
@brgweb In plugins/buddypress-activity-plus/js/bpfb_interface.js in line ~49-50 I’m passing categories drop down form
$('.bpfb_preview_container').empty().html(data); $('.bpfb_action_container').html(' <div id="category"> <select name="video_category"><option value="category1">Category1</option>........
In line ~435
$(document).on('click', '#bpfb_submit', function () { var params = _bpfbActiveHandler.get(); var group_id = $('#whats-new-post-in').length ? $('#whats-new-post-in').val() : 0; var category = $('#category').val(); var subcategory = $('#subcategory').val(); $.post(ajaxurl, { "action": "bpfb_update_activity_contents", "data": params, "content": $text.val(), "group_id": group_id, "category": category, "subcategory": subcategory
And then in plugins/buddypress-activity-plus/lib/class_bpfb_binder.php in line ~328
$query='UPDATE wp_bp_activity SET video_category="'. $_POST['category'].'", video_subcategory="'. $_POST['subcategory'].'" WHERE id=' . $aid; $dummy=mysql_query($query);
I’ll try with the code you provide to see if it’s working.
@brgweb thank you for your help! I tried your code, but I think it’s not what I need. Code adds a filter, but in my case when uploading video the user should choose one of the 12 categories and each of that category has ~20-30 subcategories… It a select dropdown to choose category at first and then subcategory.
So at the end of the day I need about 200-300 filters. Is it possible to do that with the snippet you send me?
@brgweb did you try to change the number of how many activities you could show ‘per_page’ to a very big number? Then ‘Load more’ button should not appear if the number is not reached.
Thank you for your answer @shanebp !
Now I’m little bit lost when should I use bp_activity_add function? The moment the user adds youtube URL and selects category the code should be something like this?if ($_POST['select_name'] === 'category_name') { $activity_id = bp_activity_add( $args ); }
Anybody?