Search Results for 'group_id'
-
AuthorSearch Results
-
October 20, 2010 at 12:29 am #95658
In reply to: I cannot post forum topics?
Leigh Anne DuChene
Membernothing at all with the meta_key “forum_id”
here is what is listed in the wp_bp_groups_groupmeta:
id group_id meta_key meta_value
1 1 last_activity 2010-10-19 00:41:18
2 1 total_member_count 2
3 2 last_activity 2010-10-19 01:24:57
4 2 total_member_count 1
5 3 last_activity 2010-10-19 17:30:04
6 3 total_member_count 1October 19, 2010 at 11:31 pm #95656Josh McKenney
Participantwell, I had to do some hacking in when and how it would reset the cookies… from this:
`
/* If no current step is set, reset everything so we can start a fresh group creation */
if ( !$bp->groups->current_create_step = $bp->action_variables[1] ) {unset( $bp->groups->current_create_step );
unset( $bp->groups->completed_create_steps );
setcookie( ‘bp_new_group_id’, false, time() – 1000, COOKIEPATH );
setcookie( ‘bp_completed_create_steps’, false, time() – 1000, COOKIEPATH );
$reset_steps = true;
bp_core_redirect( $bp->root_domain . ‘/’ . $bp->groups->slug . ‘/create/step/’ . array_shift( array_keys( $bp->groups->group_creation_steps ) ) . ‘/’ );
}/* If this is a creation step that is not recognized, just redirect them back to the first screen */
if ( $bp->action_variables[1] && !$bp->groups->group_creation_steps[$bp->action_variables[1]] ) {
bp_core_add_message( __(‘There was an error saving group details. Please try again.’, ‘buddypress’), ‘error’ );
bp_core_redirect( $bp->root_domain . ‘/’ . $bp->groups->slug . ‘/create/’ );
}/* Fetch the currently completed steps variable */
if ( isset( $_COOKIE ) && !$reset_steps ) {
$bp->groups->completed_create_steps = unserialize( stripslashes( $_COOKIE ) );
}/* Set the ID of the new group, if it has already been created in a previous step */
if ( isset( $_COOKIE ) ) {
$bp->groups->new_group_id = $_COOKIE;
$bp->groups->current_group = new BP_Groups_Group( $bp->groups->new_group_id );
}
`
to:
`
/* If no current step is set, reset everything so we can start a fresh group creation */
if ( !$bp->groups->current_create_step = $bp->action_variables[1] ) {unset( $bp->groups->current_create_step );
unset( $bp->groups->completed_create_steps );
//setcookie( ‘bp_new_group_id’, false, time() – 1000, COOKIEPATH );
//setcookie( ‘bp_completed_create_steps’, false, time() – 1000, COOKIEPATH );
$reset_steps = true;
bp_core_redirect( $bp->root_domain . ‘/’ . $bp->groups->slug . ‘/create/step/’ . array_shift( array_keys( $bp->groups->group_creation_steps ) ) . ‘/’ );
} else {
/* Set the ID of the new group, if it has already been created in a previous step */
if ( isset( $_COOKIE ) ) {
$bp->groups->new_group_id = $_COOKIE;
$bp->groups->current_group = new BP_Groups_Group( $bp->groups->new_group_id );
}
}/* If this is a creation step that is not recognized, just redirect them back to the first screen */
if ( $bp->action_variables[1] && !$bp->groups->group_creation_steps[$bp->action_variables[1]] ) {
bp_core_add_message( __(‘There was an error saving group details. Please try again.’, ‘buddypress’), ‘error’ );
bp_core_redirect( $bp->root_domain . ‘/’ . $bp->groups->slug . ‘/create/’ );
}/* Fetch the currently completed steps variable */
if ( isset( $_COOKIE ) && !$reset_steps ) {
$bp->groups->completed_create_steps = unserialize( stripslashes( $_COOKIE ) );
}
`inside bp_groups.php inside buddypress plugin. Finally works for me…
Notice I completely removed the need to set the cookie with a past date (deleting it) and instead just check for an existing cookie AFTER the first step.
October 19, 2010 at 11:23 pm #95651Josh McKenney
Participantsomewhere in between group-details and group-settings `bp_new_group_id` cookie is getting wiped out… can’t figure out why yet…
October 19, 2010 at 11:00 pm #95648Josh McKenney
Participantbp_is_group_creation_step() is failing. inside there if ( !bp_are_previous_group_creation_steps_complete( $step_slug ) ) is failing… inside there, return bp_is_group_creation_step_complete( $previous_steps ); is failing… inside there if ( !$bp->groups->completed_create_steps ) is failing… Which means that step two is not storing that it has been created…
bp_groups.php in buddypress plugin is not keeping $bp->groups->new_group_id between the group-details step and the group-settings step. Group settings step is supposed to update the group that was created in the group-details step. See line 1096:
`if ( !$bp->groups->new_group_id = groups_create_group( array( ‘group_id’ => $bp->groups->new_group_id, ‘status’ => $group_status, ‘enable_forum’ => $group_enable_forum ) ) )`But it’s creating a new one because it didn’t have the id (thus the duplicate empty database entry). Now looking into why the new_group_id isn’t carrying over. I verified it’s being set and shows right after the first save…
October 16, 2010 at 3:21 pm #95332In reply to: Multiple registration pages
Hugo Ashmore
ParticipantYou just need to replicate the whole section after the `if(function_exists(‘bp_has_profile’)) :` but pass the parameter for the group required i.e ‘profile_group_id=2’
I’ll warn you in advance the trick is going to be working through the mire of if/elses there’s a mess of them, tha whole page should have could have been written better!
There’s a plugin to deal with the links in profiles, look through the plugin list .
October 15, 2010 at 2:50 pm #95255In reply to: Multiple registration pages
Rose Taylor
ParticipantThanks for the help. I understand how to create additional groups and fields. In there it says only fields added to the base group or ID=1 will be displayed on the registration page. Looking at Dorothy’s page it looks like she has multiple groups in there. I wanted to do the same. I don’t see a way of creating a group under that base group.
I could create all of the fields under the base group but this will cause display issues under the profile. I want certain info to display in a certain order (company and contact information). Code in register.php only calls one group. Not proficient in php enough to change it to call one or more by ID. Obviously the base group is 1. Can change this to any other but need to add multiple. i.e. group 1 and 3. Any ideas would help me a lot.
<?php if ( function_exists( 'bp_has_profile' ) ) : if ( bp_has_profile( 'profile_group_id=1' ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?
missing closing at the end i know
Do you know also why all of the information in a profile display as a link? Please see http://marketplace.questus5.com for more information. Thanks in advance for any help.October 13, 2010 at 10:31 am #95039James
Participantthnaks @boonebgorges ,
somehow first place where I get mistake is your mentioned `if` before `bp_has_profile`
taking all together I got this code for profile-loop.php :`
<?php
$field_id = xprofile_get_field_id_from_name( ‘Account Type’ );
$field = xprofile_get_field( $field_id );
$value = $field->data->value;if ( bp_the_profile_group_name() == ‘Account Type’ && $value == ‘Selection 1’ ) {
(if ( bp_has_profile( ‘profile_group_id=1,4’ ) ) ?><div class="bp-widget “>
<tr>
}
`
does this code make any sense for anyone?
Am I correct, that even if I will get this code to work, it still returns only one selection of radio button?thank you!
October 12, 2010 at 8:47 pm #94983Boone Gorges
KeymasterA couple things –
– You need an `if` before `bp_has_profile`, eg `( if ( bp_has_profile( ‘profile_group_id=1,3,4’ ) ) ) :`
– You’ll need to close the ifs and whiles; before the final `}` put `endwhile; endif;`
– You need to actually display some content after bp_the_profile_group();. Look at the xprofile templates (bp-themes/bp-default/profile…) to get a sense of the template tags you’ll use inside of the loop to display content.October 12, 2010 at 8:18 pm #94981James
Participant`<?php
$field_id = xprofile_get_field_id_from_name( ‘Type’ );
$field = xprofile_get_field( $field_id );
$value = $field->data->value;if ( bp_the_profile_group_name() == ‘Type’ && $value == ‘114’ ) {
( bp_has_profile( ‘profile_group_id=1,3,4′ ) ) : while ( bp_profile_groups() ) : bp_the_profile_group();
}
?>`Full code, which should be placed in profile-loop.php,
Did I understand correctly, what @boonebgorges tried to explain?
@hnla please, take a look on this.thank you guys!
October 6, 2010 at 6:40 pm #94388Anonymous User 96400
InactiveHad a quick look through your group extension and I saw a couple things. You shouldn’t call $bp->groups->new_group_id on the edit screen functions, cause it only exists when you create a group. That basically means that your edit_screen_save function uses $group_id and that variable hasn’t been declared, so it’s empty. Use $bp->groups->current_group->id and your group meta’ll get saved as expected.
September 28, 2010 at 6:18 am #93620In reply to: Is there a bp function to add a user to a group?
Paul Wong-Gibbs
Keymaster`
$group = new BP_Groups_Group( $group_id );
groups_invite_user( array( ‘user_id’ => $user_id, ‘group_id’ => $group_id, ‘inviter_id’ => $group->creator_id, ‘is_confirmed’ => $is_confirmed ) );
groups_send_invites( $group->creator_id, $group_id );
`September 21, 2010 at 2:49 pm #93027In reply to: Displaying Categories in Groups
phos flip
ParticipantDon’t know if this is any use to anyone and no doubt there are far better ways of doing it but just in case it is of use….
I’ve created (hacked really) a plugin made up of 3 files, one of which is useless for now but at a future point I’d like to play around with it.
bp-group-catdisp.php
`<?php
/*
Plugin Name: Display Categories
Plugin URI:
Description: Displays a blog category in groups
Author: Mas
Version: 0.1
License: GNU General Public License 2.0 (GPL) http://www.gnu.org/licenses/gpl.html
Site Wide Only: true
*/
if ( !defined( ‘BP_GROUP_CATDISP’ ) )
define ( ‘BP_GROUP_CATDISP’, ‘programme’ );function bp_group_catdisp_init() {
bp_group_catdisp_wrapper();
}if ( defined( ‘BP_VERSION’ ) )
bp_group_catdisp_wrapper();
else
add_action( ‘bp_init’, ‘bp_group_catdisp_init’ );
//above links to admin screen in backend
require(dirname(__FILE__) . “/bp-group-catdisp-admin.php”);// group options
function bp_group_catdisp_wrapper() {
class bp_group_catdisp extends BP_Group_Extension {
var $visibility = ‘private’;var $enable_create_step = false;
var $enable_edit_item = false;
var $has_caps = false;function bp_group_catdisp () {
global $groups_template;// group title
$this->name = __( ‘Programme’, ‘programe’ );
$this->slug = BP_GROUP_CATDISP;
$this->nav_item_position = 12;
$this->create_step_position = 12;// group ID for displaying category within
global $bp;$group_array = array( 17,11 );
if ( in_array( $bp->groups->current_group->id, $group_array) )
//group ID to display in array. Note can reverse this code ie. set it not to display in listed groups by placing !in_array( $bp etc.{
$this->enable_nav_item = true;
} else {
$this->enable_nav_item = false;
}}
function display () {
global $bp, $groups_template;include(“bp-group-catdisp-edit.php”);
//bit above links to file that prints to tab
}
}
bp_register_group_extension( ‘bp_group_catdisp’ );
}?>
`bp-group-catdisp-edit.php
`
<a href="” rel=”bookmark” title=”Permanent Link to “>
Sorry, no posts matched your criteria.
`
bp-group-catdisp-admin.php
`<?php
function group_catdisp_add_admin_menu() {
add_submenu_page( ‘bp-general-settings’, __( ‘Group Categories’, ‘bp_group_catdisp’ ), __( ‘Disp Cats’, ‘bp_group_catdisp’ ), ‘manage_options’, __FILE__, ‘group_catdisp_plugin_options’ );
}
add_action(‘admin_menu’, ‘group_catdisp_add_admin_menu’, 15);function group_catdisp_plugin_options() {
if (!current_user_can(‘manage_options’)) {
wp_die( __(‘You do not have sufficient permissions to access this page.’) );
}
$updated = false;
//above this is php for creating admin page and below is printed onto admin page?>
<?php
if ( !$options = get_option( ‘bp_gm_settings’ ) )
$per_page = 10;
else
$per_page = $options;$args = array( ‘type’ => ‘alphabetical’, ‘per_page’ => $per_page );
if ( $_GET == ‘name’ )
$args = ‘alphabetical’;
else if ( $_GET == ‘group_id’ )
$args = ‘newest’;
else if ( $_GET == ‘popular’ )
$args = ‘popular’;if ( $_GET )
$args = $_GET;
else
$args = 1;if( bp_has_groups( $args ) ) :
global $groups_template;
?>Category <?php
if ( !$group )
$group =& $groups_template->group;
?>Categories You don’t have any groups to manage.
<?php
}
?>
`The first two hard code a group by ID and display a selected wordpress category within that group. The last file is the useless one. I’d started hacking from one of @boonebgorges plugins with the idea of creating an admin screen from which groups could be linked to blog categories.
I’ve run out of time for now to play with that further and so for now am just going to duplicate the first two files for another couple of groups which will work for my purposes.
September 20, 2010 at 5:31 pm #92937Boone Gorges
KeymasterTry this:
`$group = new BP_Groups_Group( $group_id );`$group will then be an object containing the group name and a few other pieces of info. You’ll need to use bp_core_fetch_avatar() to get the avatar.
September 12, 2010 at 1:59 am #92200Pisanojm
Participant@nuprn1 @mercime @boonebgorges
Thank you for leading me to the code to get to this… I basically just did a super-slight mod of Rich’s code. Here is what I used and I put it in the the bp-custom.php file in the plugins directory:
`<? function my_group_loop_activity_item() {
global $bp, $activities_template;
if ( !bp_is_active( ‘activity’ ) )
return;
if ( !bp_group_is_visible() )
return;
$show_hidden = false;
/* Group filtering */
$object = $bp->groups->id;
$primary_id = bp_get_group_id();
if ( ‘public’ != $bp->groups->current_group->status && groups_is_user_member( $bp->loggedin_user->id, bp_get_group_id() ) )
$show_hidden = true;
/* Note: any params used for filtering can be a single value, or multiple values comma separated. */
$defaults = array(
‘display_comments’ => false, // false for none, stream/threaded – show comments in the stream or threaded under items
‘sort’ => ‘DESC’, // sort DESC or ASC
‘page’ => 1, // which page to load
‘per_page’ => false, // number of items per page
‘max’ => 1, // max number to return
‘include’ => false, // pass an activity_id or string of ID’s comma separated
‘show_hidden’ => $show_hidden, // Show activity items that are hidden site-wide?
/* Filtering */
‘object’ => $object, // object to filter on e.g. groups, profile, status, friends
‘primary_id’ => $primary_id, // object ID to filter on e.g. a group_id or forum_id or blog_id etc.
‘action’ => ‘new_forum_topic’, // action to filter on e.g. activity_update, new_forum_post, profile_updated
‘secondary_id’ => false, // secondary object ID to filter on e.g. a post_id
/* Searching */
‘search_terms’ => false // specify terms to search on
);
$r = wp_parse_args( $args, $defaults );
extract( $r );$filter = array( ‘user_id’ => false, ‘object’ => $object, ‘action’ => $action, ‘primary_id’ => $primary_id, ‘secondary_id’ => $secondary_id );
$activities_template = new BP_Activity_Template( $page, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments, $show_hidden );
while ( bp_activities() ) : bp_the_activity(); ?>
<div class="item-descb" id="activity-“>
Latest Topic Activity in the Group:
<a href="”>
<?php endwhile;
}
add_action( ‘bp_directory_groups_item’, ‘my_group_loop_activity_item’ );
?>`I also added this to the default.css to give me a little more control of the output (changed the div in the original to match below):
` ul.item-list li div.item-descb {
margin: 10px 0 0 64px;
font-size: 11px;
color: #888;
width: 85%;
}
`THANKS AGAIN! Here is a pict completed:
http://mustech.net/holder/grouptopic2.jpgSeptember 2, 2010 at 11:37 am #91315In reply to: Groups Posts and Disable Avatars
Boone Gorges
KeymasterThe most straightforward way is to hook a custom function to `comment_post` and `edit_comment`. The function would look something like this (mainly copied-and-pasted from bp-blogs.php, `bp_blogs_record_comment()` ):
`
function boone_record_blog_comment_to_group( $comment_id, $is_approved = true ) {$action = ‘something’; // here’s where you’ll put together the action, something like ‘[Group member] commented on [blog post]’, with the appropriate links;
$content = ‘something’; // Get the comment content from the $comment_id passed into the function
$primary_link = ‘something’; // Get the comment permalink from the $comment_id
$blog_id = ‘something’; // You’ll have to get the blog id either from $current_blog or from the comment metadata
groups_record_activity( array(
‘action’ => $action,
‘content’ => $content,
‘type’ => ‘new_blog_comment’,
‘item_id’ => $bp->groups->new_group_id,
‘secondary_item_id’ => $blog_id
) );}
add_action( ‘comment_post’, ‘boone_record_blog_comment_to_group’, 10, 2 );
add_action( ‘edit_comment’, ‘boone_record_blog_comment_to_group’, 10 );
`You’ll have to do the grunt work of figuring out how best to populate those variables at the beginning of the function, but this is a step in the right direction.
August 30, 2010 at 4:53 pm #90979In reply to: Limit New Topics
rich! @ etiviti
Participantsure but you will need to modify a few theme files and wrap the post forms with a check
theme files contain the “Post a New Topic:” forms
groups/single/forum.php
forums/index.phpthen some check like so
`if ( !bp_is_group() || ( bp_is_group() && ( is_site_admin() || groups_is_user_admin( bp_loggedin_user_id(), bp_get_group_id() ) || groups_is_user_mod( bp_loggedin_user_id(), bp_get_group_id() ) ) ) )`August 30, 2010 at 2:10 pm #90958In reply to: bp_group_is_moderator
rich! @ etiviti
Participantyou mean `bp_group_is_mod()` ?
also
`groups_is_user_mod( $user_id, $group_id )`
`groups_is_user_admin( $user_id, $group_id )`August 30, 2010 at 10:30 am #90939In reply to: Help with custom Group extension SQL
Anonymous User 96400
InactiveMIght sound like a no-brainer, but have you declared the globals?
`global $wpdb, $bp;`You also have FROM twice in your query.
Also, I don’t see why you’d need the inner join. All you need to do is this:
`$result = $wpdb->get_results( $wpdb->prepare( “SELECT group_id, meta_value FROM {$bp->groups->table_name_groupmeta} WHERE meta_value = ‘United States’ AND meta_key = ‘state’ GROUP BY meta_value” ) );`Haven’t actually tried the above query, but should be alright.
August 29, 2010 at 6:53 pm #90850In reply to: Show: By Latest Post | By Group
Boone Gorges
KeymasterHere’s the short version.
In [theme]/forums/index.php, do a conditional check for $bp->current_action == ‘grouped’. (Depending on the URL structure of your site, you might have to use $bp->action_variables[0].) In other words, the ‘grouped’ code should only be displayed if ( $bp->current_action == ‘grouped’ ).
Then do a bp_has_groups loop for all the groups you want to appear. If that’s all your groups, you can just do bp_has_groups(). If you only want to do a certain number of groups, like on this site, do bp_has_groups( ‘include=4,5,6’ ) where 4, 5, 6 are groups that you want to include in the ‘grouped’ view.
Then, inside the `while ( bp_groups() ) : bp_the_group()` loop, do a normal forums loop. Something like
`if ( bp_has_forum_topics( ‘forum_id=’ . groups_get_groupmeta( bp_get_group_id(), ‘forum_id’ ) ) )`
plus whatever arguments for max number, etc you want.August 28, 2010 at 8:16 pm #90750In reply to: aggregate activity stream from public groups
Roger Coathup
Participant@psycolor: public group activities (e.g. joining a group, creating a group, posting updates) should appear in the standard activity stream. Which activities are not showing for you?
To hide private group activity from the activity stream – follow the instructions I gave for excluding blogs in this thread: https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/need-exclude-parameter-for-bp_has_activities/
Check whether the activity item action is group related, then use the primary id of the item to get the group_id, and then check whether it is one of your private groups.
As per my comment on blogs, you can do this for all activity loops by using the filter, or on a loop by loop basis.
August 27, 2010 at 11:35 am #90555In reply to: Is it possible to have two post forms in one page?
jimhellas
MemberI think I solved it!!! Here’s how, in case anybody else wants to do something similar:
Step 1: edit “wp-content/plugins/buddypress/bp-themes/bp-default/_inc/global.js”
Step 2: Go to line #35 (/* New posts */) and simply copy and paste the the new posts section right after it (line #102)
Step 3: Change every single value that refers to ids of the original form (e.g. change #aw-whats-new-submit to #mini-aw-whats-new-submit)
Step 4: Go to the mini-post code on your template and replace the ids. Obviously you have to use the same ids as the ones you created on Step 3
To make a long story long, here’s my code:
global.js
/* MINI-POST */
/* New posts */
jq(“input#mini-aw-whats-new-submit”).click( function() {
var button = jq(this);
var form = button.parent().parent().parent().parent();form.children().each( function() {
if ( jq.nodeName(this, “textarea”) || jq.nodeName(this, “input”) )
jq(this).attr( ‘disabled’, ‘disabled’ );
});jq( ‘form#’ + form.attr(‘id’) + ‘ span.ajax-loader’ ).show();
/* Remove any errors */
jq(‘div.error’).remove();
button.attr(‘disabled’,’disabled’);/* Default POST values */
var object = ”;
var item_id = jq(“#mini-whats-new-post-in”).val();
var content = jq(“textarea#mini-whats-new”).val();/* Set object for non-profile posts */
if ( item_id > 0 ) {
object = jq(“#mini-whats-new-post-object”).val();
}jq.post( ajaxurl, {
action: ‘post_update’,
‘cookie’: encodeURIComponent(document.cookie),
‘_wpnonce_post_update’: jq(“input#_wpnonce_post_update”).val(),
‘content’: content,
‘object’: object,
‘item_id’: item_id
},
function(response)
{
jq( ‘form#’ + form.attr(‘id’) + ‘ span.ajax-loader’ ).hide();form.children().each( function() {
if ( jq.nodeName(this, “textarea”) || jq.nodeName(this, “input”) )
jq(this).attr( ‘disabled’, ” );
});/* Check for errors and append if found. */
if ( response[0] + response[1] == ‘-1’ ) {
form.prepend( response.substr( 2, response.length ) );
jq( ‘form#’ + form.attr(‘id’) + ‘ div.error’).hide().fadeIn( 200 );
button.attr(“disabled”, ”);
} else {
if ( 0 == jq(“ul.activity-list”).length ) {
jq(“div.error”).slideUp(100).remove();
jq(“div#message”).slideUp(100).remove();
jq(“div.activity”).append( ‘- ‘ );
}jq(“ul.activity-list”).prepend(response);
jq(“ul.activity-list li:first”).addClass(‘new-update’);
jq(“li.new-update”).hide().slideDown( 300 );
jq(“li.new-update”).removeClass( ‘new-update’ );
jq(“textarea#mini-whats-new”).val(”);/* Re-enable the submit button after 8 seconds. */
setTimeout( function() { button.attr(“disabled”, ”); }, 8000 );
}
});return false;
});
/* MINI-POST */and the form for the new “mini-post-form”
<form action=”<?php bp_activity_post_form_action() ?>” method=”post” id=”mini-whats-new-form” name=”mini-whats-new-form”><?php do_action( ‘bp_before_activity_post_form’ ) ?><textarea name=”mini-whats-new” onFocus=”this.value=”; this.onfocus=null;” id=”mini-whats-new” rows=”2″ cols=”40″>Got something to share?</textarea><div id=”whats-new-submit”><span></span><input type=”submit” name=”mini-aw-whats-new-submit” id=”mini-aw-whats-new-submit” value=”<?php _e( ‘Post’, ‘buddypress’ ) ?>” /></div><div id=”whats-new-post-in-box”><?php _e( ‘Post in’, ‘buddypress’ ) ?>:<select id=”mini-whats-new-post-in” name=”mini-whats-new-post-in”><option selected=”selected” value=”0″><?php _e( ‘My Profile’, ‘buddypress’ ) ?></option><?php if ( bp_has_groups( ‘user_id=’ . bp_loggedin_user_id() . ‘&type=alphabetical&max=100&per_page=100&populate_extras=0’ ) ) : while ( bp_groups() ) : bp_the_group(); ?><option value=”<?php bp_group_id() ?>”><?php bp_group_name() ?></option><?php endwhile; endif; ?></select></div><input type=”hidden” id=”mini-whats-new-post-object” name=”mini-whats-new-post-object” value=”groups” /><?php do_action( ‘bp_activity_post_form_options’ ) ?><?php wp_nonce_field( ‘post_update’, ‘_wpnonce_post_update’ ); ?><?php do_action( ‘bp_after_activity_post_form’ ) ?></form><!– #mini-whats-new-form –><form action=”<?php bp_activity_post_form_action() ?>” method=”post” id=”mini-whats-new-form” name=”mini-whats-new-form”>
<?php do_action( ‘bp_before_activity_post_form’ ) ?>
<textarea name=”mini-whats-new” onFocus=”this.value=”; this.onfocus=null;” id=”mini-whats-new” rows=”2″ cols=”40″>Got something to share?</textarea> <div id=”whats-new-submit”> <span></span> <input type=”submit” name=”mini-aw-whats-new-submit” id=”mini-aw-whats-new-submit” value=”<?php _e( ‘Post’, ‘buddypress’ ) ?>” /> </div>
<div id=”whats-new-post-in-box”> <?php _e( ‘Post in’, ‘buddypress’ ) ?>:
<select id=”mini-whats-new-post-in” name=”mini-whats-new-post-in”> <option selected=”selected” value=”0″><?php _e( ‘My Profile’, ‘buddypress’ ) ?></option>
<?php if ( bp_has_groups( ‘user_id=’ . bp_loggedin_user_id() . ‘&type=alphabetical&max=100&per_page=100&populate_extras=0’ ) ) : while ( bp_groups() ) : bp_the_group(); ?> <option value=”<?php bp_group_id() ?>”><?php bp_group_name() ?></option> <?php endwhile; endif; ?> </select> </div> <input type=”hidden” id=”mini-whats-new-post-object” name=”mini-whats-new-post-object” value=”groups” /><?php do_action( ‘bp_activity_post_form_options’ ) ?>
<?php wp_nonce_field( ‘post_update’, ‘_wpnonce_post_update’ ); ?> <?php do_action( ‘bp_after_activity_post_form’ ) ?>
</form><!– #mini-whats-new-form –>August 25, 2010 at 3:19 pm #90340jvoss
ParticipantSuccess! It turns out I was much closer than I thought. I had done some extensive rearranging and adding of divs to the editfield divs, and didn’t have the do_action( ‘bp_custom_profile_edit_fields’ ) in the correct place. I also used some code from @sbrajesh that he posted at http://bpdev.pastebin.com/RLreXE7X that was intended for displaying all profile fields on the profile page.
To see (and understand) what I was trying to do, you can see it at http://phrstudents.org/register/. For anyone interested in the complete code for my registration page, with all the appropriate php tags, I’ve posted it at http://pastebin.com/XA0Uii3A. Because of the multiple loops and divs I added for styling, it’s pretty long.
Essentially, for each profile field group I want to display I start each loop with:
php if ( function_exists( ‘bp_has_profile’ ) ) : if ( bp_has_profile( ‘profile_group_id=1’ ) ) : while ( bp_profile_groups() ) : bp_the_profile_group();I change “( ‘profile_group_id=1’ )” to “( ‘profile_group_id=3’ )” or “( ‘profile_group_id=4’ )”, etc.
I end each loop with:
php endwhile;
php $fields_ids[]= bp_get_the_profile_group_field_ids();
php endwhile; endif; endif;
input type=”hidden” name=”signup_profile_field_ids” id=”signup_profile_field_ids” value=”php echo implode(“,”,$fields_ids); “And somehow, it all works!
August 15, 2010 at 10:20 am #89155In reply to: only for logged in members
Roger Coathup
ParticipantYou could look at using functions like:
groups_is_user_member( $user_id, $group_id )
To test if the user is in a specific group, and only show the page if they are in the appropriate group. This is defined in bp-groups.php.bp_is_member()
To simply check whether the current user is a member (and logged in). This is defined in bp-core-templatetags.phpThere is also a group blogs plugin: https://buddypress.org/community/groups/bp-groupblog/
I don’t know if this can be adapted to implement the private pages for your group members.
Cheers, Roger
August 4, 2010 at 9:13 pm #88023yunus
ParticipantGlad i could help

@guigoz: all of the following support multiple arguments (this is right out of the bp-activity.php – line 577)
* ‘user_id’ => false, // user_id to filter on
* ‘object’ => false, // object to filter on e.g. groups, profile, status, friends
* ‘action’ => false, // action to filter on e.g. activity_update, profile_updated
* ‘primary_id’ => false, // object ID to filter on e.g. a group_id or forum_id or blog_id etc.
* ‘secondary_id’ => false, // secondary object ID to filter on e.g. a post_idJuly 31, 2010 at 11:35 am #87581rich! @ etiviti
Participantbp_forums_get_forum_topicpost_count( $forum_id ), where forum_id is groups_get_groupmeta( $bp->groups->current_group->id, ‘forum_id’ );
depends on the group_id – if you are within the group context then $bp->groups->current_group->id
-
AuthorSearch Results