Search Results for 'buddypress'
-
AuthorSearch Results
-
April 23, 2009 at 2:11 pm #43316
John James Jacoby
KeymasterI missed this party somehow, but wanted to offer my support.
Wherever this party moves to, I’m there.
April 23, 2009 at 1:58 pm #43315In reply to: Defualt member theme not working
chriscarter
ParticipantPugins page says I am running BuddyPress 1.0-RC2. /plugins/buddypress/bp-themes/ no longer exists and /bp-themes/buddypress-member/ is confirmed.
An edit to my initial message: I’m running trunk 1387, not 1381.
April 23, 2009 at 1:38 pm #43311In reply to: Defualt member theme not working
chriscarter
ParticipantThanks Jeff but none of that seemed to help. No error messages in the log, no other plugins running, everything is where it should be. I didn’t say before but everything was running fine when I was on an older trunk and WPMU 2.7. It was after the upgrade when the problem started. I’m running everything stock and am still getting this message:
You do not have any BuddyPress themes installed.
Please move “/wp-content/plugins/buddypress/bp-themes/” to “/wp-content/bp-themes/” and refresh this page. You can download more themes here.
April 23, 2009 at 11:50 am #43307In reply to: buddypress + p2 theme
Andy Peatling
KeymasterUse the latest trunk, I believe this was a bug I fixed.
April 23, 2009 at 11:27 am #43306Burt Adsit
ParticipantI thought about the actual utility of pasting it there. One thing it does is get me thinking about the difference between programming for wpmu and wp.
April 23, 2009 at 10:29 am #43304In reply to: buddypress + p2 theme
tomaszg
ParticipantIn user blog is OK post + comment (ex tom3.jatymy.eu). In main site (jatymy.eu) in Site Wide Activity post appears really after writing comment in user blog.
April 23, 2009 at 9:49 am #43302In reply to: buddypress + p2 theme
Paul Wong-Gibbs
KeymasterI can’t understand what you are saying. I believe p2 uses posts for each update even thought they look like comments so I think this is working correctly.
April 23, 2009 at 8:59 am #43295In reply to: Dashboard skin
takuya
Participantdashboard? wp and wpmu has the same dashboard design…
If u want social networking funtion within the dashboard, there’re wpmu plugins to enable friends and messages rather than using buddypress.
April 23, 2009 at 5:27 am #43282In reply to: Limit Blog Creation to Admins
squattingturnip
ParticipantThank you, thank you, thank you.
Your code works like a charm, and you have taught me a great deal about how BuddyPress (and WPMU) works. I really, really appreciate it.
Incidentally, the changes I made are as follows, in case your or anyone else is curious:
global $current_user;
if ( isset( $roles['administrator'] ) || isset( $roles['editor'] ) || isset( $roles['contributor'] ) || is_site_admin() )was added to the “my_can_user_create_a_blog” function. Kind of an odd set of conditions, but, well…whatever. I\’m going to do a little bit of digging around later on, and see if I can condense that down a little (initially I’d planned to have it as a sort of “if user level is great than x” thing, but my cursory examination didn’t turn that up, so this is a decent stopgap for now).
I also added an if statement that draws on the “my_can_user_create_a_blog” function for the “my_blogs_setup_nav” function, so that now everything it does is wrapped thusly:
if (my_can_user_create_a_blog()==true) {
...
}and changed “is_user_logged_in” in the “my_adminbar_blogs_menu” function to call “my_can_user_create_a_blog” instead.
Again, I can’t thank you enough. I only hope some day I can help someone out the way you’ve helped me.
April 23, 2009 at 4:51 am #43278In reply to: FAQ: How To, Code Snippets and Solutions
Burt Adsit
ParticipantLimiting the creation of blogs to certain user roles such as Site Admin
This thread describes how to modify the both the admin bar and the member theme navigation functions using bp-custom.php. No core mods needed. It can give you an idea of how to modify any bp function that responds to an action.
April 23, 2009 at 4:30 am #43277In reply to: How to: Modify the bp admin bar
Burt Adsit
Participant@Tutsie, upgrade to RC2/trunk. That feature was added some time ago.
@Hyrxx, you’d have to move the logo into the actual
<ul><li>structure of the menu itself. Right now it sits outside of that. It’s not really part of the menu as of now. I just finished doing a tutorial on altering the admin bar as part of this thread: https://buddypress.org/forums/topic.php?id=2283Believe it or not I’m getting kinda burned out on the admin bar. I know it’s one of the most visible aspects of bp. It is also one of the easiest ways to allow your users to navigate to important areas of your site. I just don’t have time to tackle that right now. I have a project I’m working on that needs attention.
April 23, 2009 at 4:04 am #43276In reply to: adding new field to group
isuru
Participantsry, this is the source code. i have mentioned the functions which i modified only.
the screen “create new group” appears with added field, the error is given when saving.
what are the other files to be modified????????
<?php
/**********************
bp-group.php
**********************/
function groups_install() {
/*some code goes here*/
$sql[] = “CREATE TABLE {$bp->groups->table_name} (
…………..
author varchar(50) NOY NULL,
………….
) {$charset_collate};”;
/*some code goes here*/
}
function groups_check_installed() {
if(is_site_admin()){
if ( !$wpdb->get_var(“SHOW TABLES LIKE ‘%” . $bp->groups->table_name . “%'”) || ( get_site_option(‘bp-groups-db-version’) < BP_GROUPS_DB_VERSION ) )
groups_install();
}
/*some code goes here*/
}
function groups_screen_group_admin_edit_details() {
/*some code goes here*/
if ( $bp->current_component == $bp->groups->slug && ‘edit-details’ == $bp->action_variables[0] ) {
if ( $bp->is_item_admin || $bp->is_item_mod ) {
if ( isset( $_POST[‘save’] ) ) {
if ( !groups_edit_base_group_details( $_POST[‘group-id’], $_POST[‘group-name’], $_POST[‘group-desc’], $_POST[‘group-news’], $_POST[‘author’], (int)$_POST[‘group-notify-members’] ) ) {
bp_core_add_message( __( ‘There was an error updating group details, please try again.’, ‘buddypress’ ), ‘error’ );
} else {
/*some code goes here*/
}
/*some code goes here*/
}
do_action( ‘groups_screen_group_admin_edit_details’, $group_obj->id );
bp_core_load_template( ‘groups/admin/edit-details’ );
}
}
}
add_action( ‘wp’, ‘groups_screen_group_admin_edit_details’, 4 );
function groups_create_group( $step, $group_id ) {
/*some code goes here*/
if ( is_numeric( $step ) && ( 1 == (int)$step || 2 == (int)$step || 3 == (int)$step || 4 == (int)$step ) ) {
if ( !$group_obj )
$group_obj = new BP_Groups_Group( $group_id );
switch ( $step ) {
case ‘1’:
if ( !check_admin_referer( ‘groups_step1_save’ ) )
return false;
if ( $_POST[‘group-name’] != ” && $_POST[‘group-desc’] != ” ) {
/*some code goes here*/
$group_obj->author = stripslashes($_POST[‘author’]);
/*some code goes here*/
if ( !$group_obj->save() )
return false;
/*some code goes here*/
}
break;
/*some code goes here*/
}
}
function groups_screen_create_group() {
/*some code goes here*/
if ( isset( $_POST[‘save’] ) || isset( $_POST[‘skip’] ) ) {
/*some code goes here*/
if ( !$group_id = groups_create_group( $create_group_step, $_SESSION[‘group_obj_id’] ) ) {
/* error message*/
} else {
/*some code goes here*/
}
/*some code goes here*/
}
/*some code goes here*/
bp_core_load_template( ‘groups/create’ );
}
function groups_edit_base_group_details( $group_id, $group_name, $group_desc, $group_news, $group_author, $notify_members ) {
/*some code goes here*/
if ( !check_admin_referer( ‘groups_edit_group_details’ ) )
return false;
if ( empty( $group_name ) || empty( $group_desc ) )
return false;
/*some code goes here*/
$group->news = $group_news;
/*some code goes here*/
if ( !$group->save() )
return false;
if ( $notify_members )
groups_notification_group_updated( $group->id );
/*some code goes here*/
}
function groups_screen_group_admin_edit_details() {
/*some code goes here*/
if ( $bp->current_component == $bp->groups->slug && ‘edit-details’ == $bp->action_variables[0] ) {
if ( $bp->is_item_admin || $bp->is_item_mod ) {
if ( isset( $_POST[‘save’] ) ) {
if ( !groups_edit_base_group_details( $_POST[‘group-id’], $_POST[‘group-name’], $_POST[‘group-desc’], $_POST[‘group-news’], $_POST[‘author’], (int)$_POST[‘group-notify-members’] ) ) {
/*error message*/
} else {
/*some code goes here*/
}
/*some code goes here*/
}
/*some code goes here*/
}
}
}
//add_action();
/**********************
bp-groups-classes.php
**********************/
class BP_Groups_Group {
/*some code goes here*/
var $news;
function populate( $get_user_dataset ) {
/*some code goes here*/
if ( $group ) {
/*some code goes here*/
$this->author = stripslashes($group->author);
/*some code goes here*/
}
}
function save() {
/*some code goes here*/
if ( $this->id ) {
$sql = $wpdb->prepare(
“UPDATE {$bp->groups->table_name} SET
author = %s,
WHERE
id = %d
“,
/*some code goes here*/
$this->author,
/*some code goes here*/
);
} else {
$sql = $wpdb->prepare(
“INSERT INTO {$bp->groups->table_name} (
news,
) VALUES (
%s
)”,
/*some code goes here*/
$this->author,
/*some code goes here*/
);
}
/*some code goes here*/
}
}
/**********************
bp-groups-filters.php
**********************/
add_filter( ‘bp_group_author’, ‘wptexturize’ );
add_filter( ‘bp_group_author’, ‘convert_smilies’ );
add_filter( ‘bp_group_author’, ‘convert_chars’ );
add_filter( ‘bp_group_author’, ‘wpautop’ );
add_filter( ‘bp_group_author’, ‘make_clickable’ );
/**********************
bp-groups-templatetags.php
**********************/
/*some code goes here*/
function bp_group_author() {
global $groups_template;
echo apply_filters( ‘bp_group_author’, stripslashes($groups_template->group->author) );
}
function bp_group_author_editable() {
global $groups_template;
echo apply_filters( ‘bp_group_author_editable’, $groups_template->group->author );
}
/*some code goes here*/
function bp_group_create_form() {
/*some code goes here*/
?>
<form action=”<?php echo $bp->displayed_user->domain . $bp->groups->slug ?>/create/step/<?php echo $create_group_step ?>” method=”post” id=”create-group-form” class=”standard-form” enctype=”multipart/form-data”>
<?php switch( $create_group_step ) {
case ‘1’: ?>
<label for=”author”>* <?php _e(‘Author’, ‘buddypress’) ?></label>
<textarea name=”author” id=”author”><?php echo ( $group_obj ) ? $group_obj->author : $_POST[‘author’]; ?>
</textarea>
<?php do_action( ‘groups_custom_group_fields_editable’ ) ?>
<p><input type=”submit” value=”<?php _e(‘Create Group and Continue’, ‘buddypress’) ?> »” id=”save” name=”save”/></p>
<?php wp_nonce_field( ‘groups_step1_save’ ) ?>
<?php break;
/*some code goes here*/
}
}
?>
April 23, 2009 at 3:54 am #43275In reply to: How to: Modify the bp admin bar
hyrxx
Participantis it possible to have the admin menu start on the buddypress image, rather than my account,
i plan to rewrite all the menu items when i redesign my site, and i want to attach a menu to the buddypress ‘home’ link
April 23, 2009 at 3:35 am #43274In reply to: Limit Blog Creation to Admins
Burt Adsit
ParticipantBack from break. Since I\’ve been creating this stuff out of thin air and it might be a good time to test this. brb.
Well, something went right today. This seems to work. I had to add a hook for the \’wp_footer\’ action that actually triggers the admin menu. The code in a copy/paste format is available here:
http://buddypress.pastebin.com/fce770ad
Copy and paste that into your bp-custom.php file. You can then alter the minimal logic in the function my_can_user_create_a_blog() to determine who and when people can see the \’create a blog\’ menu items scattered throughout bp.
Let me know how this works for you or if I’ve missed anything.
April 23, 2009 at 2:51 am #43273In reply to: Problem with News CSS
Tutsie
ParticipantI am using the orange “Download” version of BuddyPress, I tried switching back to the default theme and it didnt fix it, I deactivated the WP-Forums plugin and that fixed it……I would like to continue to use WP-Forums so why is that plugin affecting it?
April 23, 2009 at 1:38 am #43268In reply to: Still no Avatar fix?
Jeff Sayre
ParticipantDo you have any other plugins besides BuddyPress installed? Do you receive any error messages?
Have you read this post? https://buddypress.org/forums/topic.php?id=2190#post-11864
April 23, 2009 at 1:22 am #43265In reply to: Limit Blog Creation to Admins
Burt Adsit
ParticipantWe’ve unhooked the current fns and hooked up our replacement fns. So far they do exactly the same thing as the current fns. We need the ability to decide who gets to see the menu item. I choose to create yet another fn to decide yes or no on blog creation.
function my_can_user_create_a_blog(){
if (is_site_admin())
return true;
else
return false;
}
That goes in bp-custom.php also. Ya, all it does is check if the current user is the site admin. I’m not sure what you mean by only letting ‘Admins’ create blogs. There are blog admins and one site admin. Everyone with a blog gets to have the wp role ‘administrator’. Not sure what you want so i’ve wrapped the logic in a fn so you can change it to whatever you like.
Now we need to alter our new replacement fns to skip the display of the menu items if that returns false.
In our my_blogs_setup_nav() there is a line like this:
bp_core_add_subnav_item( $bp->blogs->slug, ‘create-a-blog’ __(‘Create a Blog’,
‘buddypress’), $blogs_link, ‘bp_blogs_screen_create_a_blog’ );
We need to wrap it like this:
if (my_can_user_create_a_blog()){
‘bp_core_add_subnav_item( $bp->blogs->slug, ‘create-a-blog’Create a Blog’,’buddypress’), $blogs_link, ‘bp_blogs_screen_create_a_blog’ );
}
Also the function my_adminbar_blogs_menu() has code that looks like this:
echo '<li' . $alt . '>';
echo '<a href="' . $bp->loggedin_user->domain . $bp->blogs->slug . '/create-a-blog">'
. __('Create a Blog!', 'buddypress') . '</a>';
echo '</li>';You need to wrap that the same way:
if (my_can_user_create_a_blog()){
..all that stuff..
}
April 23, 2009 at 1:17 am #43264In reply to: Defualt member theme not working
Jeff Sayre
ParticipantTo better help you, we need a few more details.
- Are there any errors in the log files? If so, what are they?
- Are you using any plugins other than BuddyPress? If so, have you tried deactivating them and seeing what happens?
- Did you make any changes to the .htaccess file? If so, what were they?
- Did you install the .htaccess file in WPMU’s root?
Here are some other things to do before replying:
- Read the first post in this thread very carefully again and make sure that you have BuddyPress installed in the proper location and the various theme files put in their proper place.
- Although not everything applies to your situation, please read this thread entirely.
April 23, 2009 at 12:53 am #43260In reply to: Still no Avatar fix?
Jeff Sayre
ParticipantWhich versions of WPMU and BuddyPress are you running?
April 23, 2009 at 12:51 am #43259In reply to: Problem with News CSS
Jeff Sayre
ParticipantI’ve looked ever so briefly at your site’s CSS files. It seems that you have customized the standard BuddyPress themes somewhat rather than creating a custom theme from scratch. So, here are some initial debugging steps and questions:
- Which version of BuddyPress are you using? The one from the large, orange “Download” button?
- Have you tried switching back to the default BuddyPress themes and see what happens?
- Have you disabled the WP-Forums plugin in WPMU backend and see if the problem goes away?
Finally, having the proper tools can help you figure out many CSS issues. I highly recommend that you use Firefox with the Firebug Add-on.
April 23, 2009 at 12:13 am #43255In reply to: Limit Blog Creation to Admins
Burt Adsit
ParticipantThe member theme Blogs > Create a Blog and the admin bar My Account > Blogs > Create a Blog both get their menu items from the bp options nav array that each component sets up when they go through their init procedure.
In the case of the blogs component it’s the fn bp_blogs_setup_nav() in /buddypress/bp-blogs.php
The other menu item is the admin bar option My Blogs > Create a Blog at the bottom of that menu. That lives in the fn function bp_adminbar_blogs_menu() in /buddypress/bp-core/bp-core-adminbar.php
Without modifying the core files we can replace both of these fns with our own since they are triggered by actions in wp.
bp_blogs_setup_nav() responds when triggered like this:
add_action( ‘wp’, ‘bp_blogs_setup_nav’, 2 );
add_action( ‘admin_menu’, ‘bp_blogs_setup_nav’, 2 );
bp_adminbar_blogs_menu() responds when triggered like this:
add_action( ‘bp_adminbar_menus’, ‘bp_adminbar_blogs_menu’, 6 );
(Saving again…)
April 23, 2009 at 12:05 am #43253In reply to: WP-Forum and BuddyPress
Tutsie
ParticipantIm trying to do the same thing…do you think you could go into a little more detail to help me out? thanks!
April 22, 2009 at 11:55 pm #43252In reply to: Limit Blog Creation to Admins
Burt Adsit
ParticipantBen, I took a look at something similar before. There were multiple requests for limiting the number of blogs a user could create. I came up with the only solution I could find at the time: https://buddypress.org/forums/topic.php?id=1328
bp relies on wpmu’s settings for blog creation. wpmu controls this in the site admin back end. Site Admin > Options > Allow New Registrations. Whatever solution to your request is has to take into that setting in wpmu. It’s basicly an on/off kinda thing. You either can or can’t. It’s not based on user role.
Disabling the registration/signup ‘gimme a blog’ option and you have people still able to create blogs after logging in. Let’s say we set that to ‘Only logged in users can create new blogs.’. It’s a start.
So, now only logged in users can create blogs. The create a blog on registration is gone. Next issue is the need to let certain roles see and use the ‘create a blog’ option.
This exists in the member theme Blogs > Create a Blog and in the admin bar under My Blogs > Create a Blog and My Account > Blogs > Create a Blog.
(Saving this while I dig thru some code…)
April 22, 2009 at 11:29 pm #43251Jeff Sayre
ParticipantBurt-
Thanks for reminding us of the buddypress.pastbin and for pasting in Andy’s WP abstraction functions. This will be handy.
April 22, 2009 at 11:18 pm #43250Burt Adsit
ParticipantI added Andy’s bp-core-wpabstraction.php file to the bp pastebin for discussion.
http://buddypress.pastebin.com/f578203cb
I suggest *not* abstracting is_site_admin() because it’s a commonly used mechanism for detecting wpmu. if (function_exists(‘is_site_admin’)) should return true on wpmu and false on wp. I know that the abstraction file is so that we don’t have to care, but….
-
AuthorSearch Results