Guides‎ > ‎

BuddyPress


About BuddyPress

Users can link their forum accounts with their Facebook accounts (needs a plugin).

Every post has the option to Facebook like or Twitter retweet (needs a plugin).

Users can "follow" their favorite forum users, like twitter.

Every forum is RSS enabled, which means users with RSS readers (not to mention other sites) can pull new posts automatically.

Site


Total development time: 5 hours

Used: WordPress 3.2.1 and BuddyPress 1.2.9 with Social Theme by WPMUDev

Spam

Delete users that spam. This also deletes all Groups and posts they created.

Changing their role to "Blocked" does nothing (they can still post and all their spam is still present).

Add Custom Homepage Content

BuddyPress Social: header.php

Just after
<div id="container">

Add
<?php if (is_home()) require_once '/var/www/sites/featured.tgn.tv/tgn-social/sidebar-top-html.php'; ?>

Hack to avoid markup in <title>

If using WPMUDEV Ultimate SEO and Floating Social with BuddyPress

Add to Line 131 in /wp-content/plugins/sharebox/lib/class_wdsb_public_pages.php

Just before the line
add_filter('the_content', array($this, 'inject_box_markup'), 1);

// HACK: Do not insert Floating Social markup into <title> element in the BuddyPress pages
$uri = $_SERVER['REQUEST_URI'];
if (strpos($uri, '/activity/') !== 0 && strpos($uri, '/groups/') !== 0 && strpos($uri, '/members/') !== 0 && strpos($uri, '/sites/') !== 0 && strpos($uri, '/register/') !== 0 && strpos($uri, '/activate/') !== 0)

* Replace /sites/ with /blogs/ if you use the default for multisite blogs

See

Move to a new URL


Nginx 301 redirect

server {
  server_name beta.tgn.tv;
  rewrite ^/(.*) http://tgn.tv/$1 permanent;
}

BackupBuddy plugin to move to new server

Edit bb-config.php with new database login and URI

Draw Attention to Activation Email

/wp-content/themes/bp-social/registration/register.php

Line 236

<p><?php _e( 'Account created, but it needs activation!<br/><br/><span style="font-size:large; font-weight:bold">Step 2</span> Activate your account <span style="background-color:yellow; font-weight:bold">via the email</span> we just sent you.', 'buddypress' ) ?></p>

Original

<p><?php _e( 'You have successfully created your account! To begin using this site you will need to activate your account via the email we have just sent to your address.', 'buddypress' ) ?></p>

/wp-content/themes/bp-social/registration/activate.php

Line 19

<p><?php _e( 'Welcome to TGN!<br/><br/><span style="font-size:large; font-weight:bold">Step 3</span> <a href="/wp-login.php?redirect_to=http%3A%2F%2Ftgn.tv%2Factivity%2F">Log In</a> and <span style="background-color:yellow; font-weight:bold">get social</span>!', 'buddypress' ) ?></p>

Original

<p><?php _e( 'Your account was activated successfully! You can now log in with the username and password you provided when you signed up.', 'buddypress' ) ?></p>


This did not work, following


/wp-content/plugins/buddypress/bp-languages

Line 2832

msgid "Account created, but needs activation!<br/><br/><span style="font-size:large; font-weight:bold">Step 2</span> Activate your account <span style="background-color:yellow; font-weight:bold">via the email</span> we just sent to you."

Original

msgid "You have successfully created your account! To begin using this site you will need to activate your account via the email we have just sent to your address."

Logo in Title

/wp-content/themes/bp-social/lib/templates/wp-template/top-bar.php

Line 32 (new text is bold)

<h1><a href="<?php echo site_url(); ?>"><img src="http://tgn.tv/wp-content/uploads/2011/08/tgn-logo-32x32.png" style="padding-right:4px"/><?php bloginfo('name'); ?></a></h1>

Sign-Up Only on Home Page

/wp-content/themes/bp-social/lib/templates/wp-template/top-header.php

Add as first line after <?php

if (!is_home()) return;

Cleaner UI

/wp-content/themes/bp-social/_inc/css/base.css
Line 527 Comment out this CSS

/* Commented: breaks other components that try to set their textarea width
textarea {
height: 100px;
width: 90% !important;
}
*/


Add to end of style.css (not beginning, that breaks the site UI)

/* Make home page same dimensions as other pages */

body #home-left {
    padding-right: 30px;
    width: 650px;
}

body #container #box-right {
    padding: 0;
    width: 250px;
}


/* Put links on separate line from "Welcome back, $name" */

body ul#options-nav li#li-user {
    display: block;
    margin-bottom: 4px;
    float: none;
    text-align: left;
}


/* Hide other pages to keep navigation clean */

#nav .page_item {
    display: none;
}

/* Hide boring stuff from video pages, like http://tgn.tv/dota-2-gamescom-2011-discussion/ */
div.tern_wp_youtube_video_meta_data {
    display: none;
}

/* Top bar (when signed in) is z-index:999 */
#chat-block-site {
    z-index:1000;
}

/* Clean up UI */
.post-tag {
    display: none;
}

/* Clean up UI */
body #post-entry .post,
body #post-entry .page {
    margin: 0;
}

/* Space out video pages, like http://tgn.tv/dota-2-gamescom-2011-discussion/ */
body object {
    margin: 0 0 10px 0;
}

/* Without, short Group posts indent and look like replies */
.activity-avatar {
    clear:both
}

bbPress

The "wp_bb_posts" table does not get created in BuddyPress 1.2.9!

Solution:

/wp-content/plugins/buddypress/bp-forums/bbpress/bb-admin/includes/defaults.bb-schema.php

Change ‘TYPE = MYISAM’ to ‘ENGINE = MYISAM’

See

Enable YouTube Imported Video Pages

Install Auto-post YouTube Videos plugin


Edit single.php

Change

<?php the_content();?>

To

<?php

//$i = get_post_meta($post_id,'_tern_wp_youtube_video',true);
$i = get_post_custom_values('_tern_wp_youtube_video');
if ($i)
{
echo tgn_ee_youtube_shortcode($i);
}

the_content();?>

W3 Total Cache

Disable authentication, otherwise every time XCache is cleared (like creating a new Page, happens every time a user creates a new Group) it will ask for XCache admin login

xcache.ini

add
xcache.admin.enable_auth = Off

Comments