Search Results for 'buddypress'
-
AuthorSearch Results
-
August 18, 2015 at 10:09 pm #243364
danbp
ParticipantReaders, see also this plugin used to hide XProfile Field groups from different user types based on the user’s role.
https://github.com/tannerm/buddypress-conditional-field-groupsAugust 18, 2015 at 7:45 pm #243361In reply to: Photo upload
djsteveb
Participant@ricsca2 – you are wise to be weary of plugins that are not in the wp-repo – but I think for the wrong reason. I am more concerned that plugins have not had the extra security checks that are run through the official repo. However I have seen more useful plugins for BP outside of the official repo – like the updated one for affecting the activity stream blocking – only on github, ones that get good support on wpmudev, etc.
I want to have faith in the ‘media press’ mentioned above, and I bet many are using it successfully – so it’s worth a try for a short term solution.
You concern about “extensions unofficial because if the developer ceases to update them” – should go beyond things in or not in the wp dot org repo – and it is a valid concern given the history of WP / BP and plugins in general – especially in regard to photo uploads / handling.
Back in the day it was “bp-album” – in the repo – worked. Support ceased – abandoned. Updates to wp / bp broke it.
Rtmedia came in (and for a very short while there was actually an importer / exported from bp-album to rtmedia!) – things have changed – rtmedia is likely the most used plugin for BP – and now they have made it an over-bloated POS (IMHO) – and now when things break they only offer support for paid / premium addons.
(begging for media export options here: https://buddypress.org/support/topic/rtmedia-export-script-attachments-api/
Now there are some other options – still no way to export the data. There are some things being worked on – but nothing definitive. Some great foundations being laid (bpattachments now a (not yet used) thing) –
This is why I have asked time and time again for picture / media handling to be added to BP core –
most recently a year and half ago (https://buddypress.org/support/topic/photos-albums-media-please/ ) – plus in the buddypress surveys.
so future updates will consider breaking this very important piece of live social networks.However for now we are stuck with not knowing if things are going to work now, or next update. Just like we have been for years..
August 18, 2015 at 4:47 pm #243352danbp
ParticipantYou’re declaring 3 arguments, but only one is given if you are testing this localy.
Possible local scenarion you used:
– you create a new user
– you login as admin and activate the pending user. You get 3 warnings. Logout.
– login as new user.
– you see the messageRemove $key & $user and redo the same and all went fine.
Usefunction send_msg_to_new_member( $user_id )and change 3 to 1.
Add also a conditional check to test if the messages component is active. (see link blow).Not tested yet on live site.
This was originally published by @henrywright here:
https://buddypress.org/support/topic/deliver-custom-message-via-buddypress-to-new-users/#post-229688August 18, 2015 at 4:15 pm #243350In reply to: Set page template for BuddyPress Registration.
danbp
ParticipantBP’s registration template is in: https://buddypress.trac.wordpress.org/browser/tags/2.3.2/src/bp-templates/bp-legacy/buddypress/members/register.php
Copy it to your child-theme, /your-theme/buddypress/members/register.php, and make your change in that copy.
In some case, you could also use bp_get_template_part filter.
August 18, 2015 at 3:38 pm #243348In reply to: Override Login Form (bp-core-widgets.php)
danbp
Participant@dineshravajani07, searching this forum for “login widget” have brought many answers.
August 18, 2015 at 3:28 pm #243346In reply to: Making display textfield empty
danbp
ParticipantHi @david-ar,
if you expect for help, give detais related to BuddyPress, not FB. Which option are you talking about?
https://buddypress.org/support/topic/when-asking-for-support-2/August 18, 2015 at 10:59 am #243337In reply to: how to check if the length of field is too long?
Henry Wright
ModeratorYes, I think you can. Try this:
function my_username_validation() { if ( strlen( $_POST['signup_username'] ) > 16 ) { global $bp; $bp->signup->errors['signup_username'] = __( 'Put your error message here.', 'buddypress' ); } } add_action( 'bp_signup_validate', 'my_username_validation' );August 18, 2015 at 9:29 am #243328In reply to: Photo upload
danbp
Participantif the developer ceases to update them This problem is the same for official or unofficial plugins.
Brajesh is a long year and well knowed buddypress plugin developper, you can trust his awesome work !
https://profiles.wordpress.org/sbrajesh#content-pluginsAugust 18, 2015 at 9:15 am #243323In reply to: Need urgent help with BP notifications
danbp
ParticipantI am writing all these code in bp-functions.php in my bududdypress folder within my theme folder. (this may be my problem).
Yeah, it is probably the problem. Custom functions for BP can/should be added to bp-custom.php, which should sit in wp-content/plugins/bp-custom.php, not in your child theme buddypress folder.
Or into functions.php of your child-theme.
bp-custom.php explained on Codex.
August 18, 2015 at 9:08 am #243322In reply to: how to check if the length of field is too long?
danbp
ParticipantHere an example for profile field lenght with some comments.
function bpfr_custom_textfield_length() { //Check if user is logged in & if xprofile component is activated if ( is_user_logged_in() && bp_is_active( 'xprofile' ) ) : $my_custom_textfield = bp_get_member_profile_data( 'field=Brief Biography&user_id='.bp_get_member_user_id() ); /* * The length = number of characters, not words. * Set the number of caracters to show. * The 3 dots are the appended text ending the excerpt. * Don't remove the quotes if you change this * BuddyPress 2.1 will add new class and id for custom fields. * The span can be omited to style this part. See ticket #5741 */ if ( strlen($my_custom_textfield) > 20) : //adjust to your need $my_custom_textfield = substr($my_custom_textfield, 20).'...'; //adjust to your need endif; // uncomment the following line to get a span around the displayed field content // echo '<span class="short-custom">'. $my_custom_textfield; .'</span>'; // comment the following line if you use the span echo $my_custom_textfield; endif; // is_user_logged_in } add_action( 'bp_directory_members_item', 'bpfr_custom_textfield_length' );Ticket #5741
August 18, 2015 at 9:01 am #243321In reply to: Need urgent help with BP notifications
chicho1969
Participantokay, This is almost done, but is really rare, not everything works as it should.
First of all, this is not a pluggin, I am writing all these code in bp-functions.php in my bududdypress folder within my theme folder. (this may be my problem).
Step by step:
1st Problem setup globals is not working as it espected:define( 'BP_NOTIFIER_CELBIRTHDAY_SLUG', 'celbirthday_notifier' ); function celbirthday_notifier_setup_globals () { global $bp, $wpdb; $bp = buddypress(); $bp->celbirthday_notifier = new stdClass(); $bp->celbirthday_notifier->id = 'celbirthday_notifier'; //I asume others are not going to use this is $bp->celbirthday_notifier->slug = BP_NOTIFIER_CELBIRTHDAY_SLUG; $bp->celbirthday_notifier->notification_callback = 'celbirthday_notifier_format_notifications'; //show the notification $bp->active_components[$bp->celbirthday_notifier->id] = $bp->celbirthday_notifier->id; do_action( 'bp_setup_globals' ); }This function is not doing nothing unless I call it directly:
celbirthday_notifier_setup_globals ();
I Know this is not the proper way, but it is the only way I found to make it run.
Does anyone know why it does not work properly?Continue with the notification:
//Format notifications function celbirthday_notifier_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) { if ( 'new_birthday' === $action ) { if ( (int) $total_items > 1 ) { if ( 'string' === $format ) { $famoso_name = get_the_title( $secondary_item_id ); return apply_filters( 'celebrities_multiple_verifications_notification','Say Happybirthday to '.$famoso_name); } } else { if ( 'string' === $format ) { //falta definir $famoso_link y mas $famoso_name = get_the_title( $secondary_item_id ); return apply_filters( 'celebrities_single_verifications_notification','Say Happybirthday to '.$famoso_name); // $return = apply_filters( $filter, '<a href="' . esc_url( $famoso_link ) . '" title="birthday anounce">' . esc_html( $text ) . '</a>', (int) $total_items, $text, $famoso_link ); // $message = apply_filters( 'bp_activity_at_message_notification_message', $message, $poster_name, $content, $message_link, $settings_link ); } } } do_action( 'celbirthday_notifier_format_notifications', $action, $item_id, $secondary_item_id, $total_items ); return false; }ok, this format function is working right, although I have to do some more work. After it, I have two more functions (mark and delete notifications) wich are also working fine.
//mark notification function celebrities_mark_screen_notifications() { global $bp; bp_notifications_mark_notifications_by_item_id( $bp->loggedin_user->id, $bp->celbirthday_notifier->id, 'new_birthday', $secondary_item_id = false, $is_new='0'); } add_action( 'bp_notifications_screen', 'celebrities_mark_screen_notifications' );and…
function celbirthday_notifier_remove_screen_notifications() { global $bp; bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->profile->slug, 'new_birthday' ); } add_action( 'bp_notifications_screen', 'celbirthday_notifier_remove_screen_notifications' ); add_action( 'xprofile_screen_display_profile', 'celbirthday_notifier_remove_screen_notifications' );As I say, this works fine, but a I am not sure if I need the second “add_action” (xprofile screen).
And finally, to add notification I use this code (which is not working)://Adding notification function buddypress_celebrities_add_notification() { if ( bp_is_active( 'notifications' ) ) { $fecha_act = date("Y-m-d"); $res_birth = $wpdb->get_results( "SELECT wp_best_favs.user_id, wp_postmeta.post_id FROM wp_best_favs LEFT JOIN wp_postmeta ON ( wp_postmeta.post_id = wp_best_favs.celeb_ID ) WHERE ( wp_postmeta.meta_key = 'fecha_na') AND (DAY( <code>wp_postmeta</code>.<code>meta_value</code> ) = DAY( '$fecha_act' )) AND (MONTH( <code>wp_postmeta</code>.<code>meta_value</code> ) = MONTH( '$fecha_act' )) "); $res_birth = array_filter($res_birth); $matriz = objectToArray($res_birth); //I use this function to convert objet array to simple array if(count($matriz)==0) { // está vacío } else { global $wpdb; $bp = buddypress(); $current_time = bp_core_current_time(); foreach ($matriz as $v1) { $famoso_id = $v1[post_id]; $receiver_user_id = $v1[user_id]; $args = array( 'user_id' => $receiver_user_id, 'item_id' => $famoso_id, 'secondary_item_id' => $famoso_id, 'component_name' => $bp->celbirthday_notifier->slug, 'component_action' => 'new_birthday', 'date_notified' => $current_time, 'is_new' => 1, ); bp_notifications_add_notification( $args ); } } } } do_action( 'bp_init', 'buddypress_celebrities_add_notification' );So this is my bigger problem:
Add notifications (function buddypress_celebrities_add_notification()) is not working.
I am pretty sure this is because I am not hooking properly, but I tried so many hooks and none of it did work.
I Know the code is fine because if I comment the two first lines and the two last lines (so I run the code not as a function) the notifications are being added to database.Anyone can help me, to find a proper hook, or just pointing me in the right direction.
Thanks in advance.August 18, 2015 at 8:57 am #243319In reply to: [Resolved] Warning: strstr(): Empty needle in
danbp
ParticipantHi @ramuzic,
read the related ticket for more explanation from here:
https://buddypress.org/support/topic/warning-strstr-empty-needle/#post-239979If the error is still in after changing to one of twenty theme, it’s possible you use a cache plugin containing some old files or your browser history is…very old. Clear it !
August 18, 2015 at 7:15 am #243313In reply to: restrict friend requests
Henry Wright
ModeratorHave you tried the BuddyPress Limit Friendship plugin?
August 17, 2015 at 11:56 pm #243306In reply to: Private Message Pagination
Henry Wright
Moderator@danbp I needed your answer 1 year 6 months ago 🙂
August 17, 2015 at 7:51 pm #243300In reply to: Private Message Pagination
danbp
Participantper_page option is availble for the message loop, like inbox (which is default), sentbox and notices where all received message are stored. This option let you paginat the result.
Now, the case of a long conversation. This start in the inbox, where you found it at page 1 or 12…
You click on the message and you see the content. This page is not concerned by the loop containing your per_page option. You can control that in the url.If you read the code in the file i indicated you previously, you’ll see that there is no pagination system in it.
Message option can be set in bp-templates\bp-legacy\buddypress\members\single\messages\message-loop.php
You need to copy this file into your child-theme first so you won’t loose your modification at next update. See codex if you need more infos about theming.
August 17, 2015 at 7:37 pm #243299danbp
ParticipantA username is not a real name and wordpress use only username, email and password (the only real security point) to allow access.
And the default behavior of WordPress is to set the nicename equal to the username. So, where is the security issue ?If you’re affraid by the Name field coming with BuddyPress during registration, rename it to Pseudonyme and you’re done. The field must contain a value, which can be first name, last name or whatever. The value is mandatory, not the name as name… ch1n3s3b0y is certainly not your name !
You’re asking to replace the username by a another value collected with the same register form. Do you think that such other field has less importance in regard of security ? Why would the username be critical and the custom field not ?
You can even disallow dashboard access to your subscriber, so they never can change anything outside of what is on hand on front-end profile management.
Please read here to calm you down (hopefully) 🙂
August 17, 2015 at 7:36 pm #243298In reply to: i want to, nobody can not change own gender.
Kailan Wyatt
ParticipantYou can try this plugin by BuddyDev
August 17, 2015 at 7:14 pm #243297In reply to: Private Message Pagination
RecAgenda
ParticipantSo then, if I can get some clarification, what’s it talking about on this page with:
per_page optional
The number of messages to display on a page before they are paginated to the next page.- Default value: 10
If that’s as obvious as I think it is, then where I can find that in my files?
August 17, 2015 at 3:27 pm #243292maelga
Participant+1
I only found this old thread but with broken links unfortunately: https://buddypress.org/support/topic/member-profile-url-with-user-id-instead-of-username/
So any input would be appreciated.
August 17, 2015 at 3:22 pm #243291In reply to: [Resolved] Problem with duplicate content
Splendorito
ParticipantHi Henry,
I was able to fix this. It was in w3tc, I had combined certain files, and forgot to set up templates for buddypress.min.js in the minify options, the thing is that it started in the latest version of BP, before I never had any troubles with it.
August 17, 2015 at 10:20 am #243282In reply to: Private Message Pagination
danbp
ParticipantHi @recagenda,
you can’t enable this, because it doesn’t exist. I could be wrong, but so far i know, private conversation are not paginable.
Reference file is bp-templates\bp-legacy\buddypress\members\single\messages\single.php
https://buddypress.org/support/topic/pagination-private-message-thread/ – @henrywright
August 16, 2015 at 3:39 am #243253In reply to: Group Widget Link Target
danbp
ParticipantReference file: buddypress\bp-groups\bp-groups-widgets.php
To make your own version of the widget: https://codex.wordpress.org/Widgets_API
HTML definition
target="_blank"Or maybe this plugin ?
https://wordpress.org/plugins/bp-extend-widgets/August 16, 2015 at 3:13 am #243249In reply to: My accaunt in menu or header
danbp
ParticipantHowdy [username] is part of WordPress Toolbar. When BP is activated, it add a sub-menu to this menu.
If you want it elswhere, it’s not really possible as the BP part of it was written to go to the admin_bar only.
To get a similar menu, you simply add buddypress menu to your theme main menu (explained on above codex link). But this menu will be static and you cant get same details.
Another solution is to recode that menu, so you can add it with a filter function to wp_nav_menu, which handles the main menu or the header menu.
To do this, you can use a new Walker Class extention or the existing filter. Possibly also some other ways to do this, but i don’t know them.
To remove the Howdy menu and the attached BuddyPress Profile sub menu from the Toolbar, you can use this snippet (in functions.php or bp-custom.php):
function bpfr_remove_my_account_menu() { global $wp_admin_bar; $wp_admin_bar->remove_menu('my-account'); } add_action( 'wp_before_admin_bar_render', 'bpfr_remove_my_account_menu' );Codex References
https://codex.wordpress.org/Function_Reference/wp_nav_menu
https://codex.wordpress.org/Navigation_MenusAugust 15, 2015 at 11:51 pm #243239djsteveb
ParticipantI would GUESS that you could edit that plugin to add in the code as mentioned above https://buddypress.org/support/topic/how-users-can-link-to-their-profile/
Or ask the plugin author for clarification.
I stopped using that plugin when they added the extra security stuff for strong passwords that broke things for me.. however the plugin’s support page is pretty active, and given that he/she has options for redirecting users after login based on role – there may be an easy way to add such functionality to the plugin by asking the plugin author.
There is a bit of info with some of the functions here ->https://codex.buddypress.org/themes/members-navigation-menus/
I see others are asking about bp xprofile fields and such within the them my login support forum,
( wordpress.org/support/plugin/theme-my-login )
so hopefully this plugin author will add more and more BP options – I enjoyed using that plugin some time ago – hope it continues to mature.August 15, 2015 at 11:43 pm #243238In reply to: My accaunt in menu or header
-
AuthorSearch Results