Forum Replies Created
-
wpmu 2.7.1
subdomain install
i started with this version of wpmu
wpmu seems to work fine now and before, it just slowed down extremally without visible reason (previous server was faster but stats shows that this one should be more then enough)
buddypress 1.0
upgraded from some beta version (rc2?)
many plugins but as I said it shouldn’t be a problem because before moving it wasn’t
i use customized theme, but again – it’s the same ad before moving to new server
i’m running bbpress (1.06),
errors – many slow queries connected with firestats, tdomf, getting wp_options table and so on
Hm, you’re right, buddypress-member is old name of member theme, istn’t it? I found call to that place in my error log, probably I left it somewhere in my layout modification.
P.S. – me, me! please publish it somewhere..
Hi, I firstly wanted to make such a integration, but then i found wordpress wiki plugin and it, both with role menagement plugin, makes possible to set some category as wiki-category, editable to all registered users, and to show revision list after article. What can give me mediawiki to install it?
http://wspinacze.pl/forum/ – I followed all your instruction and wordpress and buddypress are loaded (there is user avatar visible for logged in user) but there is no admin bar. any suggestions?
there is already topic about it, https://buddypress.org/forums/topic.php?id=2552#post-13973 , hopefully somebody will help me to put it all toegether…
it seems that there is problem with storing of user activity, any help with coding or testing?
To divide groups: suppose that similiar:
-…
– change in bp-groups.php groups_Setup_globals function:
<br />
$bp->groups->table_name = $wpdb->base_prefix . BP_ROOT_BLOG . '_' . 'bp_groups';<br />
$bp->groups->table_name_members = $wpdb->base_prefix . BP_ROOT_BLOG . '_' . 'bp_groups_members';<br />
$bp->groups->table_name_groupmeta = $wpdb->base_prefix . BP_ROOT_BLOG . '_' . 'bp_groups_groupmeta';<br />(not checked)
Making bp-messages and bp-xprofile sites-ready should be similiar but in my case i will let them be global.
To divide blogs:
– described above change to bp-core
– change in bp-blogs.php bp_blogs_setup_globals function:
$bp->blogs->table_name = $wpdb->base_prefix . BP_ROOT_BLOG . '_' . 'bp_user_blogs';
$bp->blogs->table_name_blog_posts = $wpdb->base_prefix . BP_ROOT_BLOG . '_' . 'bp_user_blogs_posts';
$bp->blogs->table_name_blog_comments = $wpdb->base_prefix . BP_ROOT_BLOG . '_' . 'bp_user_blogs_comments';
$bp->blogs->table_name_blogmeta = $wpdb->base_prefix . BP_ROOT_BLOG . '_' . 'bp_user_blogs_blogmeta';
How to separate activity for each site:
– similiar change to bp-core.php as above
– change in bp-activity.php function bp_activity_setup_globals()
$bp->activity->table_name_user_activity = $wpdb->base_prefix . BP_ROOT_BLOG . '_' . 'bp_activity_user_activity';
$bp->activity->table_name_user_activity_cached = $wpdb->base_prefix . BP_ROOT_BLOG . '_' . 'bp_activity_user_activity_cached';
$bp->activity->table_name_sitewide = $wpdb->base_prefix . BP_ROOT_BLOG . '_' . 'bp_activity_sitewide';
-i don’t know why, but there was also necessary to comment this lines in bp-activity-classes.php function save() (what, as i suppose, may cause some problems):
//if ( !$this->item_id || !$this->user_id || $this->is_private || !$this->component_name )
//return false;
My problem during last installation with bbpress alpha 6 and buddypress 1 was that all users in bbpress were set to ‘inactive’ and only bbress admin could post on bbpress via buddypress group forum – so it’s another thing to check out if you run into problems with integration…
avatars – maybe it would be enough to point on route to another via htaccess?
really noone interested in multi-site possibilities?
I’m afraid that many things i changed could be written much more simplier using build in wpmu and buddypress functions so if anybody see such a situation, please write about it here.
I think i finished enabling buddypress sitewide with same data for each site. Last changes i made were made in core files – can i move them somehow outside to leave core files as they are?
Change to bp-core.php enabling buddypress dirs on additional sites:
line 16:
if ( !defined( 'BP_ROOT_BLOG' ) ) {
global $current_blog,$wpdb;
$blog_url = get_blog_option($current_blog->blog_id, 'siteurl' );
$blog_url_pieces = explode("/", $blog_url);
$blog_url_pieces = explode(".", $blog_url_pieces[2]);
if (isset($blog_url_pieces[2]) && $blog_url_pieces[2]!'')
$blog_url = $blog_url_pieces[1].'.'.$blog_url_pieces[2];
else
$blog_url = $blog_url_pieces[0].'.'.$blog_url_pieces[1];
$query = "SELECT * FROM {$wpdb->blogs} WHERE domain='".$blog_url."'";
$blog = $wpdb->get_row($query);
define( 'BP_ROOT_BLOG', $blog->blog_id );
}
Change to bp-core-avatars.php solving issue with wrong avatars urls:
In function bp_core_render_avatar_cropper()
$src = str_replace( array(ABSPATH), get_blog_option( 1, 'siteurl' ).'/', $new );
In function bp_core_get_avatar()
$url =get_blog_option(1, 'siteurl' ) . '/' . $avatar_file;
Not yet. To do that we’ll need to save also in buddypress tables id of assigned site, or – probably easier to accomplish – create different instances of buddypress with all tables for each site.
Till now i found out that manipulating with define( ‘BP_ROOT_BLOG’, $blog_id ); (line 16,bp-core) i can make social part avaiable from each site. the problem is that avatars on other sites disappeared and – of course – i’m afraid about google and duplicated content issue.
My goal is to have on ‘global’ buddypress instance and ‘local’ buddypress instances for each site. The only thing i’m afraid about is number of tables and queries to load each site on such a configuration…
Ops – part to site_id should be as follows:
function my_bp_adminbar_authors_menu() {
global $current_blog,$wpdb;
$blog_url = get_blog_option($current_blog->blog_id, 'siteurl' );
$blog_url_pieces = explode("/", $blog_url);
$blog_url = $blog_url_pieces[2];
$site_id = $wpdb->get_var( "SELECT COUNT(*) FROM wp_site WHERE domain='".$blog_url."'");
Updated bp_adminbar_authors_menu to hide authors on additional main sites
//HOOKS FOR TOP MENU - AUTHORS
remove_action( 'bp_adminbar_menus', 'bp_adminbar_authors_menu', 12 );
add_action( 'bp_adminbar_menus', 'my_bp_adminbar_authors_menu', 12 );
// **** "Blog Authors" Menu (visible when not logged in) ********
function my_bp_adminbar_authors_menu() {
global $current_blog,$wpdb;
$site_id = $wpdb->get_var( "SELECT COUNT(*) FROM wp_site WHERE id=".$current_blog->blog_id);
//$numrows = $wpdb->num_rows($site_id);
if ( $site_id!'1' ) {
$authors = get_users_of_blog();
if ( is_array( $authors ) ) {
/* This is a blog, render a menu with links to all authors */
echo '<li id="bp-adminbar-authors-menu" class="'.$site_id.'"><a href="/">';
_e('Blog Authors', 'buddypress');
echo '</a>';
echo '<ul class="author-list">';
foreach( $authors as $author ) {
$author = new BP_Core_User( $author->user_id );
echo '<li>';
echo '<a href="' . $author->user_url . '">';
echo $author->avatar_mini;
echo ' ' . $author->fullname;
echo '<span class="activity">' . $author->last_active . '</span>';
echo '</a>';
echo '<div class="admin-bar-clear"></div>';
echo '</li>';
}
echo '</ul>';
echo '</li>';
}
}
}Just in case anybody get into the same trouble – i didn’t managed to get to know why secondary_item_id is now unused, but i wrote my own function to overwrite this behaviour
//HOOKS FOR BP_BLOGS TO SAVE AS SECONDARY ITEM ID BLOG ID
function my_bp_blogs_record_post( $post_id, $blog_id = false, $user_id = false ) {
global $bp, $wpdb;
$post_id = (int)$post_id;
$post = get_post($post_id);
if ( !$user_id )
$user_id = (int)$post->post_author;
if ( !$blog_id )
$blog_id = (int)$wpdb->blogid;
/* This is to stop infinate loops with Donncha’s sitewide tags plugin */
if ( (int)get_site_option(‘tags_blog_id’) == (int)$blog_id )
return false;
/* Don’t record this if it’s not a post */
if ( $post->post_type != ‘post’ )
return false;
if ( !$is_recorded = BP_Blogs_Post::is_recorded( $post_id, $blog_id, $user_id ) ) {
if ( ‘publish’ == $post->post_status && ” == $post->post_password ) {
$recorded_post = new BP_Blogs_Post;
$recorded_post->user_id = $user_id;
$recorded_post->blog_id = $blog_id;
$recorded_post->post_id = $post_id;
$recorded_post->date_created = strtotime( $post->post_date );
$recorded_post_id = $recorded_post->save();
bp_blogs_update_blogmeta( $recorded_post->blog_id, ‘last_activity’, time() );
bp_blogs_record_activity( array( ‘item_id’ => $recorded_post->id, ‘secondary_item_id’ => $blog_id, ‘component_name’ => ‘blogs’, ‘component_action’ => ‘new_blog_post’, ‘is_private’ => bp_blogs_is_blog_hidden( $recorded_post->blog_id ), ‘user_id’ => $recorded_post->user_id, ‘recorded_time’ => strtotime( $post->post_date ) ) );
}
} else {
$existing_post = new BP_Blogs_Post( null, $blog_id, $post_id );
/**
* Delete the recorded post if:
* – The status is no longer “published”
* – The post is password protected
*/
if ( ‘publish’ != $post->post_status || ” != $post->post_password )
bp_blogs_remove_post( $post_id, $blog_id );
// Check to see if the post author has changed.
if ( (int)$existing_post->user_id != (int)$post->post_author ) {
// Delete the existing recorded post
bp_blogs_remove_post( $post_id, $blog_id );
// Re-record the post with the new author.
bp_blogs_record_post( $post_id );
}
$recorded_post = $existing_post;
/* Delete and re-add the activity stream item to reflect potential content changes. */
bp_blogs_delete_activity( array( ‘item_id’ => $recorded_post->id, ‘secondary_item_id’ => $blog_id, ‘component_name’ => ‘blogs’, ‘component_action’ => ‘new_blog_post’, ‘user_id’ => $recorded_post->user_id ) );
bp_blogs_record_activity( array( ‘item_id’ => $recorded_post->id, ‘secondary_item_id’ => $blog_id, ‘component_name’ => ‘blogs’, ‘component_action’ => ‘new_blog_post’, ‘is_private’ => bp_blogs_is_blog_hidden( $recorded_post->blog_id ), ‘user_id’ => $recorded_post->user_id, ‘recorded_time’ => strtotime( $post->post_date ) ) );
}
do_action( ‘bp_blogs_new_blog_post’, $recorded_post, $is_private, $is_recorded );
}
remove_action( ‘publish_post’, ‘bp_blogs_record_post’ );
remove_action( ‘edit_post’, ‘bp_blogs_record_post’ );
add_action( ‘publish_post’, ‘my_bp_blogs_record_post’ );
add_action( ‘edit_post’, ‘my_bp_blogs_record_post’ );
http://wspinacze.pl and http://climbers-blog.org –
– to enable registration of blogs on both domain i moved back to wp-signup.php due to redirection issues (in fact register works only on first domain – same with blogs, members. groups)
– buddypress part is only avaiable on wspinacze.pl domain – do you have any idea to show it on both domains? if yes – what about different language on each domain?
– i\’m not sure if that is really what i want to do – but does anybody have an idea how to separate buddypress part for each domain? in fact that would mean that only users are same across all domains.
– there was a problem with logging to second domain through adminbar (it always uses first domain) – my solution was to do:
remove_action( \’bp_adminbar_menus\’, \’bp_adminbar_login_menu\’, 2 );
add_action( \’bp_adminbar_menus\’, \’my_bp_adminbar_login_menu\’, 2 );
where my_… is function with proper url
any suggestions?
sql queries – because I wanted to use this script outside of buddypress installation.
taxonomy tables – as I said I need to get tags of newest posts sitewide.
As I see I can use bp_has_activities() to get recent posts without sql queries, but what about tags of those articles?
http://wspinacze.pl/ – Climbers for Climbers, website aimed to join polish climbers community
in my case forums stopped to work because of… password set up in .htaccess file. after deleting it everything is as it should be.