Forum Replies Created
-
Found it,
Added this code-snippet to the WP Theme functions.php file.
( make sure you check the jQuery URL version )It’s my theme and I code WordPress themes for like 5 years now but I don’t see myself as a Developer it’s more a hobby 🙂
I’m solid at HTML-CSS and can read PHP when I see it happen but I can’t write PHP it out of the box.
This error shows up when I try to hide a complete xProfile-group-ID or just an unique xProfile-field-ID from the loop.
This is what I did.
Inside: my-theme/buddypress/members/single/profile/profile-loop.php
I found the start of the loop<?php if ( bp_has_profile() ) : ?> ....My first thought was, maybe there are default options here to control the output of which ID’s will be visible so I started the search how the bp_has_profile() was build and looked into plugins/buddypress/bp-xprofile/bp-xprofile-template.php and found this at line 150:
.... $defaults = array( 'user_id' => bp_displayed_user_id(), 'profile_group_id' => false, 'hide_empty_groups' => true, 'hide_empty_fields' => $hide_empty_fields_default, 'fetch_fields' => true, 'fetch_field_data' => true, 'fetch_visibility_level' => $fetch_visibility_level_default, 'exclude_groups' => false, // Comma-separated list of profile field group IDs to exclude 'exclude_fields' => false // Comma-separated list of profile field IDs to exclude );This looks very familiar to bbPress so my first thoughts was lets try to add one of those Array’s to the loop and overwrite the default value.
Just like this.<?php if ( bp_has_profile( array ( 'exclude_groups' => 1 ) ) ) : ?> ...This works perfect, it hides all xProfile-fields from the first Base primary Tab (back-end). Just like I wanted it because I didn’t want all the fields to show up front-end, I’ve got a few xProfile-fields that I use for user-customization of the profile-page. Each user can add color-codes to change the default menu-color and add background-images to their profile-page to make each profile a little more unique.
Those field-ID’s are just urls or color-codes and don’t have to be visable to the public, thats why I try to hide them front-end.
Thanks Paul I’ll look into that.
Okay if I understand correct this Query isn’t safe and the $ID is just thrown (unprepared) in the query.
Can I do something to make it more safe or is this something that the BuddyPress Plugin Developers would have to upgrade, since the error is caused by the BP plugin.
– I’ve turned off all PHP warnings like the first paragraph says so.
Thanks guys,
There is a huge difference between the example I found on the web and the option @modemlooper gave.
My example:

@Modemlooper’s example:

Don’t know if it’s really that bad because they both load around the same time but still a lot more queries.
In the profile-loop.php ( members/single/profile )
Instead of this loop.
<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?> <?php if ( bp_field_has_data() ) : ?> <tr<?php bp_field_css_class(); ?>> <td class="label"><?php bp_the_profile_field_name(); ?></td> <td class="data"><?php bp_the_profile_field_value(); ?></td> </tr> <?php endif; ?> <?php do_action( 'bp_profile_field_item' ); ?> <?php endwhile; ?>I know, but what if I duplicated the code above for all 20 profile fields ?
– country
– about
– gender
– ageI would like to know how bad this would be for performance on the site, from my understanding it has something to do with Database Query’s ?
Trying to make a Tab view of the profile info, on the first tab I would like to show all general stuff and on the second tab I would like to show work info + social media options.

It’s still work in progress and needs a lot of tuning to be not annoying for users but you get the picture.
It’s something different then a Green or Red bullet that say’s online.Thank you so much!
This looks very good and like real clean code. 🙂
It’s very basic if I may say.
All ranks are manually controlled, so as an Admin of the site you have to add + update all ranks manually for each member ?
I can’t see why this plugin does more then a regular xProfile field that a member can’t control or update.
It’s nice when people make plugins but 5,- (premium plugin) for something like this isn’t worth they money I think. There are BuddyPress plugins like Achievements that do way more advanced and automatically stuff for Free.
Maybe you can try to add this functionality to the Achievements core, lets say people post 500 replies-/posts, they get promoted to Rank A if they reach 1000 replies-/posts they will get automatically promoted to Rank B.That would make me pay 5,- for a plugin like this.
I don’t know but maybe it has something to do with this alert at the top of the plugin page.
This plugin hasn’t been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Thanks that works beautiful just like I wanted.
? Just one question, why does it only work if you place the huge function code snippet in the loop template ( at the top ) but when you paste it inside your functions.php it doesn’t work.
There are not many sites that talk about BuddyPress or bbPress in general.
But I have used Google a lot to try and find solutions for BuddyPress customizations and this site came up pretty often.
http://premium.wpmudev.org/blog/category/buddypress/I think they talk the most about BuddyPress but still it’s not much and often it’s just information about new releases and guides on how to install something. Real ‘how to’ stuff – and getting the most out of it is very rare online.
Nope I’ve been searching for this also – none of the code snippets online work. There are 3 different code snippets and none are working at the moment for some reason.
It would be cool if we just had a simple user check within the members loop.
Example:
Check if user_is_online() return a Boolean? or –> Echo “something” if user is not online Echo “nothing or something else”;I would like to add a simple word like online or offline to a HTML class and target it by CSS while making a small ‘breathing’ animation of the gender symbol to show if a user is online or not.

Yeah, stupid of me, of course, ..thanks Shanebp.
I’ve made a Trac. to get easier customization for this ‘problem’..
It’s set for BuddyPress version 2.0
https://buddypress.trac.wordpress.org/ticket/5261Probably a typo on a HTML or PHP tag, code not being valid – missing some double quotes or having too manny of them.
Scan this page through a HTML Validator and see the result.
http://validator.w3.orgits better to use social button plugin
No it’s not..
This is a great Tutorial, thumbs up for giving this nice piece of code.
Social Media Button Plugins often stack a lot of scripting in your website. Lots of JavaScript and a other junk you’re not looking for while WordPress + BuddyPress is already pretty heavy because of all features.This Tutorial is clean and very basic, it does what most people need, just simple links from their BuddyPress profile to the users Social Media pages.
I think it’s too complex for a Plugin because this is too specific to your needs , plugins are great when they serve lots of people. But you could alter the layouts if you know how the template structure in WordPress and BuddyPress works.
Give each page it’s own custom Activity-loop template and you should be able to make whatever view you want on each page that shows an Activity.
By default each page uses only one ( the default ) activity-loop template to create the activity content. But if you like you can duplicate those files and customize them for each page. Just duplicated the needed files and rename them to something like this: activity-groups-loop.php or activity-members-loop.php than make sure at the groups page the loop to the activity doesn’t load the default activity templates but your custom ( duplicated ) files.I really love how easy this works in WordPress and BuddyPress not a lot of CMS software have this easy to use template structure and logic.
The only real problem I found with this is that the Activity-contents are made by very dynamic code – it’s very difficult to alter the items that will be shown at the page such as time, name, avatar , activity-title and the real content compared to other BuddyPress pages.
I’ve made a Trac. Ticket for BuddyPress 2.0 , so lets hope somebody very smart could change the code a bit and we can really alter our Activity contents too.
https://buddypress.trac.wordpress.org/ticket/5261Yeah mostly it’s the slug or the name of the template ( file-name.php ) inside the plugins folder.
members/single/plugins.php
” 3rd-party plugins should use this template to easily add template support to their plugins for the members component. ”
Thats the template they use for adding a component to the profile page.
Just try a few or ask the Plugin developer.
Yeah I was afraid of that too..
I think I’ve seen some Filter a few days ago to remove a menu-tab. This way you can remove lets say the activity link from popping up on the navigation menu’s.
Try Google at this: BuddyPress + remove + item + PHP_code_that_prints_the_menu()
Hahaha.. I was looking for the same thing yesterday so I made a Codex-page for this question.
You have to add that code to the config.php file.
What are you gonna do with your Groups without Activity system it’s the ‘comments’ part of a group.
Just to make sure where do you want to delete the activity from showing up.
example.org/groups/test-group/ * here */
example.org/members/profile/ * here */?
You can always remove the activity-loop from the template structure.
When BuddyPress doesn’t past the activity-loop it will not show up on your site of course.But shouldn’t een Moderator have control over comments inside the group ?
Okay he can not edit the group description or delete the group as a moderator but I think a moderator should be able to bann people, en edit comments inside the group.
Thats what moderators do, keeping an eye on things.
Right now he can edit only when bbPress is active. He can only moderate on topics and replies not in BP-groups.
Maybe if thats’ what they want – delete this moderate option IF bbPress = not_active.
Because right now you can make somebody moderator but he’s still a regular Member when you don’t use bbPress inside Groups.Don’t hold back on posting more code-snippets on here 🙂
It’s still not 100% what I was hoping for but at least I’ve removed the default ‘ XX time ago ‘ string.
I can’t believe how difficult it is to customize the Activity-stream against ofter BuddyPress functions. The Activity is BuddyPress’ backbone that connects everything together but there are barely template_tags(); available to use.
Look at this, those are 5 different activity_items who are all getting included by a single template-tag(); called bp_activity_action() how could you ever make HTML and CSS around something like this?
– User_Name
– Activity_Type
– User_Avatar_Small
– Activity_Type_Title
– Activity_Date-/Time
.
