Forum Replies Created
-
@danbp – well spotted! Thanks, no more php errors showing and it’s working perfectly.
Cheers, j
uh oh – just logged a php error for the new code. The error reported was this:
PHP Parse error: syntax error, unexpected ‘endif’ (T_ENDIF) in /home/mysite/public_html/wp-content/themes/child-theme/buddypress/activity/index.php on line 34
But when I look at this file I’m pretty sure it’s the same as what you posted =
<?php if ( is_user_logged_in() && is_super_admin() ) ?> <?php bp_get_template_part( 'activity/post-form' ); ?> <?php endif; ?>
and line 34 is:
<?php endif; ?>
which I’m pretty sure I didn’t change!Can anyone spot what the problem is here?
Many thanks, j
@danbp – Just had another chance of reviewing this and finally the penny’s dropped! So I now totally understand what you’re doing and where the code goes and it works as expected! (as I’m sure you knew it would…)
Though one of the issues before, rather embarrassingly, was that after migrating my site and retesting with the original theme I’d then forgotten to change it back to my child theme – so all my edits weren’t taking effect – duh!
So now it works AND it has the correct code in.
many thanks for your time again, j@earl_d I actually wanted all my members to be auto added to all 3 of my groups so I didn’t have to look into that option. I’m a real newbie with php so I’m afraid I can’t help you with this – sorry π
But maybe @modemlooper could as he provided the original code?… Good Luck! j@earl_D – I’ve been using this code for a year now and it works instantly.
However I’ve just found an option to add to groups automatically via my membership plugin (s2member framework) by adding some extra code/php file. And as my registration form is the membership form (and is fully integrated with BP) I’m trying this one too.
Here’s the info about it in the s2member knowledge base: http://s2member.com/kb-article/how-can-i-automatically-add-a-user-to-a-buddypress-group/
So my question now is: which is the better way to do this? Via the bp-custom.php or via the s2member s2-bp-groups.php method?
Maybe someone very up on code/BP/site load order would be able to advise?
Cheers – and good luck earl_d!
OK, I’m a php newbie and so am guessing here and have tried 3 ways to remove the form from the swa:
1. commenting out all of the ‘do action’ code as above = no change, form still shows
2. removed the ‘activity/post-form’ from the code and left the rest as is = no change, form still shows!
3. removed all the conditional php bit within the <?php if ….. to … <?php endif; ?> = still no change and the form is still there but the rest of the site activity wasn’t!So I’m afraid I’ll need an idiots explanation of how to remove it in each of these forms. If you have the time (and patience) for this that’d be great π
@danbp – really appreciate you getting back to me on this!
So is it correct to remove/comment out the whole of this call for this template as i don’t want it for anyone on the swa or the profile activity? Like this…
– ie.remove all of this for the swa index.php:
do_action( 'bp_before_directory_activity_content' ); ?> <?php if ( is_user_logged_in() ) : ?> <?php bp_get_template_part( 'activity/post-form' ); ?> <?php endif; ?> <?php
– and remove all of this in the member profile activity.php:
do_action( 'bp_before_member_activity_post_form' ); ?> <?php if ( is_user_logged_in() && bp_is_my_profile() && ( !bp_current_action() || bp_is_current_action( 'just-me' ) ) ) bp_get_template_part( 'activity/post-form' ); /** * Fires after the display of the member activity post form. * * @since 1.2.0 */ do_action( 'bp_after_member_activity_post_form' );
Many thanks.
ps: it appears that all of the What’s New forms now have a different role: [role=complimentary] where before it was role=main.
So not sure if it is now even possible to remove the What’s New? form from the site-wide activity stream and the member’s activity stream yet KEEP it in the GROUPS activity?If I can’t do this, then is there a way to remove the profile option in the ‘what’s new post in’ box, in the site-wide activity?
Many thanks.
Hi, @sjjenkins – please can you post details of what you did (and where!) to get this to work? I did have something working,but now it isn’t – not sure why!
Cheers,Thanks so much for posting this info! I’d just found that my previous work-around wasn’t working anymore, but your code above works a treat.
For anyone else looking to do this, just add it into your bp-custom.php file in the plugins folder (NOT the buddypress folder, but in the root of the plugins folder).
Much appreciated πHi again – @danbp, this code doesn’t seem to be working anymore, so the ‘What’s New?’ box is now showing again. I’ve downloaded new copies of the files you said to edit and removed the same lines of code but no change.
Can you confirm which lines of code to remove please? ….to remove whatβs new form from the activity page, but let it live for groups.
Many thanks.OK, sorry I couldn’t help. In fact I resolved my problem by sticking with the BP default/usual setting of enabling friends and everything works as expected now. maybe you have something turned off in the BP settings? Beyond that suggestion you’ll need someone with much more experience of BP than me I’m afraid – good luck!
OK, after some help from the theme team we’ve worked out what’s happening:
1. message sends OK if only use the username but NO @ sign!
2. the send to box doesn’t auto=popu;late because i have ‘allow friends’ disabled
3. error still occurs if you just use the name (not username)So it looks my problem is related to not allowing friends rather than anything else. I’ll start a new thread to see if there’s a workaround for this so it still allows to send by member’s name and if it can still auto-populate.
Hope this helps a bit @rebekahmeuir?
Update; have just tested it with default 2015 theme and all plugins deactivated except for BP and still the same error. I have no idea why this should suddenly happen as i didn’t update BP, only theme and some plugins.
The other thing I noticed was that when you enetr the @username or the members name it doesn’t auto-populate, or throw up the correct one to add – so this functionality seems to have stopped, which maybe why it doesn’t send???
Any ideas would be appreciated.
I know this is a VERY old thread but it’s exactly the same problem: https://buddypress.org/support/topic/error-composing-messages/ – may be helpful if you’re well versed in BP?
@rebekahmeuir – this has just started happening to me too. All plugins, BP and themes up to date (with theme that’s specifically designed to work with BP).
On tesing the messaging works if you send it to a member by clicking on the ‘send private message’ in the All members section, but NOT when you compose a message in your own p[rofile section – with subjest line completed, and tested using the memebers’ Name and username. It shows an error message that the message can’t be sent.
Anyone else experiencing this?
I’ll check with other plugins and the theme and will update here if I find anything, but any info would be really useful!
Cheers.
No, that code didn’t work either – but this does:
.group-button .leave-group { display:none !important; }
and this removed the container it was in so you don’t get left with a 26px gap:
.buddypress div#item-header div#item-header-content #item-buttons { height: 0px; }
Not perfect or the correct php way but it is a solution for those that can’t make the first one here work.
Cheers.
Brilliant! It worked a treat, and I used the ‘user_register’ as suggested. So for anyone else looking for this solution, this is the code i used to turn some on and some off by default on new user registration:
add_action( 'user_register', 'bpdev_set_email_notifications_preference'); function bpdev_set_email_notifications_preference( $user_id ) { //I am putting some notifications to no by default and the common ones to yes to enable it. //ref. https://bp-tricks.com/snippets/changing-default-buddypress-notifications-settings and BP forum $settings_keys = array( 'notification_activity_new_mention' => 'yes', 'notification_activity_new_reply' => 'yes', 'notification_friends_friendship_request' => 'no', 'notification_friends_friendship_accepted' => 'no', 'notification_groups_invite' => 'no', 'notification_groups_group_updated' => 'no', 'notification_groups_admin_promotion' => 'no', 'notification_groups_membership_request' => 'no', 'notification_messages_new_message' => 'yes', ); foreach( $settings_keys as $setting => $preference ) { bp_update_user_meta( $user_id, $setting, $preference ); } }
and this went in my child theme functions.php file.
Hooray! Thanks so much again – it will make a big different to our users experience.
Cheers πThanks so much @danbp for the in depth tutorial – it does mean that I will start to learn a bit more about how it all works! And to @shanebp for the link and the advice… I will reread it and work through it all over the next few days, test and get back with the working formula (I hope), ready for others to use.
Cheers.Ok I’ve searched the BP codex, all the BP forum again and the i/net and basically got nowhere. I’ve tried a few more times and new (test) members are still having email notification ON by default, so it’s definitely not working.
I’ve tracked down 2 files that seem to be involved in this and they are:-
buddypress/bp-notifications/bp-notifications-functions.php
buddypress/bp-activity/bp-activity-notifications.phpPlease can someone help me here? From searching it’s obviously a common request – but no answer anywhere!
Waiting hopefully…
Hi,
I’m after the same thing – see my post ( https://buddypress.org/support/topic/turn-off-email-notifictions-in-functions-php/#post-237213 ) which has some sode suggestions from a previous thread. Unfortunately I could get it to work yet – maybe you could try it?
It’s a popular request, but no answer easily found – pity!Does anyone know how to do this? @nd1 can you share your solution?
Cheers.Ok, I know it’s not the correct php way, but in lieu of any other option I’ve found how to remove showing it with css – posted in BuddyBoss here: http://www.buddyboss.com/support-forums/topic/1st-month-feedback-mobileresponsive-theme/ and I put this code…
#buddypress #admins-list div.action a, #buddypress #mods-list div.action a, #buddypress #members-list div.action a, #buddypress #groups-list div.action a, #buddypress #friend-list div.action a{display:none;}
in my child theme style.css file.
Hope it helps other who are stuck too πNope, not the right solution for me. Any other code you can think of?
Many thanks.I think this is just what I need too – but will it work for public groups, though in a members only site?
I’ve set BP so that only admins can create new groups, I only have 3 groups, and have added the code to automatically join all new members to all groups (which seems to be working well) – found here: https://buddypress.org/support/topic/how-to-add-new-members-to-groups-automatically/
By the way @danbp or @whoaloic can you confirm that I would copy the file bp-groups-template.php and put it in my child theme\buddypress\bp-groups\bp-groups-template.php and then edit line 2747?
Many thanks.