Category Archives: Beginner’s Guide to WordPress-MU and BuddyPress

WordPress MU 2.8 Beginner’s Guide Reviews

The first set of reviews for my book, the WordPress MU 2.8 Beginner’s Guide, have started trickling in.

They’ve been mostly positive so far.  There’s been a couple of things pointed out (such as a plugin conflict that went un-noticed in testing) that I’ll raise with the publisher in case they decide to make a second edition.

I hope to work on another book for Packt in the future, so it’s great to learn what people liked, and what they didn’t.

Here’s a sampling of the reviews:

WP-Toy.com

Omninogin

The Open Sourcerer

FiddyP

Thanks to all the reviewers for taking the time to read and write about the book!

Advertisements

Social bookmarking links script

There are dozens of social bookmarking services.  If you tried to promote your site on all of them, you would probably end up spending more time on submitting pages to those sites than you would on producing new content.

Most of those sites are very sensitive to ‘spam’, and are hostile towards people who are clearly shilling or promoting their own web sites.  So, if you have a strong community already, why not encourage your users to promote your site for you, rather than doing all the submission work yourself.

One effective way to do this is to place social bookmarking links at the bottom of each article.  These links take the user to the submission page of their favourite social bookmarking site, so all they have to do is enter a quick description, and submit.

One such script is available for download here.

This script was originally designed by Hugo Haas.  I have been using it on my web sites for quite some time, simply updating the social bookmarking links as necessary.

The script is ideal for use on any web site – whether it’s powered by WordPress-MU, Joomla, e107, or any other CMS.  It’s also useful for custom coded sites.  Just extract the folders, drop the Javascript into your pages, and you’re good to go.

Hiding the WordPress-MU Dashboard

This post is intended to accompany Chapter 4 of my book, the WordPress-MU 2.7 Beginner’s Guide.

If you have a WordPress or WordPress-MU powered blog, then you’ve probably noticed the dashboard.  It’s the default ‘landing page’ when you log in to your admin panel.  The dashboard provides some useful information, such as the number of posts you’ve made, the number of comments that have been approved and the number that are awaiting moderation, and even a traffic stats graph.

However, the dashboard can take a long time to load.  This isn’t a problem for everyone – if you’re blessed with a nice fast cable or DSL connection it probably isn’t an issue for you.  But not everyone has a good connection.  I’m making this post via mobile broadband because my usual connection has failed. HSDPA isn’t reliable in this area, so I’m on 3G, and even a page as clean as Google’s is taking an irritating length of time to load.

You can remove some of the clutter from the Dashboard by using the ‘Screen Options’, but you will still land on the Dashboard page when you log in to the admin panel.dashboardPersonally, I don’t mind the dashboard on my main blogs, but I have some niche blogs on various community sites, and my favourite sites are the ones that blur the line between ‘community’ and ‘blog’.  When you go to manage your blog, you are dumped straight on to the Write Post page – after all, the chances are that’s why you’re visiting the admin panel of your blog.

Sending your users straight to the ‘Write Post’ page will most likely be saving them a click or two.  If it turns out they wanted to do something else, then it hasn’t cost them much time.

If you want to hide the dashboard, then one way to do so is to use the ‘Hide Dashboard‘ Plugin created by Bavotasan.  This plugin will allow you to hide the dashboard for users with certain user levels.

The default version of the plugin hides the dashboard for users who are not admin.  If you would like to hide the dashboard for everyone, you can do that with a simple edit:

Just open the plugin file, and remove the following lines of code:

if (current_user_can(‘level_10’)) {

return;

} else {

Also remove the closing ‘}’ above the ‘add_action’ line near the end of the plugin file.

For your convenience, you can download the edited version of the plugin here.

Editing UserThemes Revisited

This post is designed to accompany Chapter 4 of my book, the WordPress-MU 2.7 Beginner’s Guide.

Would you like to allow users to edit their themes on your WordPress-MU blog?  One of the most common requests from users on WordPress-MU sites is the ability to edit the themes that are offered.  Giving users the ability to edit the PHP files that make up a WordPress-MU theme is a little risky, but it is possible to allow users to edit CSS files, which will give them some freedom to customize their site, and is much less risky from the site owner’s point of view.

If you want to allow your users to customize their WordPress-MU themes, the first thing you need is UserThemes Revisited.  You can download the plugin here.

Before you install the plugin, I would recommend making a few changes.  In it’s unedited state, the plugin allows your users to access both PHP and CSS files.  Offering unrestricted access to PHP files means that you are risking the possibility of malicious code being ran on your server.  Let’s block PHP files from being edited:

Open up /wp-admin/theme-editor.php – under the line that begins with $parent_file,  insert the following code:

if((get_option(‘ut_use_user_theme’) != 1) || (get_option(‘ut_enabled’) != 1))

{

wp_die(‘Either you have not been granted permission from the site administrator to access the theme editor OR you do not have a usertheme as your active theme, theme editor will die while a system theme is active.’);

}

ds_redirect_theme_editor();

Look for this line:

$allowed_files = array_merge($themes[$theme][‘Stylesheet Files’], $themes[$theme][‘Template Files’]);

Comment it out, and insert this below:

array_merge($themes[$theme][‘Stylesheet Files’],$themes[$theme][‘Stylesheet Files’]);

Next, open the file /wp-admin/includes/mu.php and comment out this line:

unset( $submenu[‘themes.php’][10] );

Now it’s safe to upload and install the UserThemes Revisited Plugin.  Your users should see a screen like this one, which allows them to create their own copy of a theme they want to edit.6545_04_utruser1

Once they’ve made a copy of a theme, they can edit the CSS files using the theme editor.

6545_04_utruser2

For your convenience, you can download the edited versions of the core files here.


Simple Stats – Visitors Online

This post is designed to accompany Chapter 3 of my book, the WordPress-MU 2.7 Beginner’s Guide.

Would you like to show some simple stats in the sidebar of your WordPress-MU site?  Something like the stats in the screenshot below?

Visitor Stats

Visitor Stats

WordPress-MU makes it easy to pull information about the number of blogs and users that your site has, and display that information on the page, just use something similar to the following code.

<li id="Stats">
<h2>Site Stats</h2>
<ul>
<li><?php
$stats = get_sitestats();
echo "MYSITE.com currently has
<b>".$stats[ 'blogs' ]."
</b> blogs and
<b>".$stats[ 'users' ]."
</b> users."; ?></li>
</ul>

The above code will display the number of blogs that have been registered, and the number of user accounts that have been created.

If you’d like to show the number of visitors currently online, there are a number of ways you can do this.  The easiest is to use a simple visitor tracking script that will keep a count of recently active sessions.

Download this Simple visitor tracking script (right click and save as, then re-name the file to vonline.php).  This is a slightly edited version of a script that I’ve been using on my sites for a couple of years.  I did not write it, if anyone recognizes it, please let me know in the comments so I can give credit to the original author.

Upload the vonline.php file to your site (for simplicity, let’s pretend you put it in the same folder as your sidebar.php file – if you put it somewhere more central, then you will need to change the path used in the include statement to reflect that).

Then add the following line to the code listed above (place it just before the </ul> tag).

<li><?php include('vonline.php') ?></li>

Congratulations, now you have some visitor stats on your WordPress-MU blog home page!

Great BuddyPress Network Example

I’ve been doing some random surfing, looking for some inspiration for my book on WordPress-MU and Buddypress, and I found a very well designed social network for real estate people, WannaNetwork.

The site looks professional, is cleanly laid out, and manages to escape the ‘Just another WordPress site’ look which devalues so many other sites out there.  Not that there’s anything wrong with WordPress – it’s a great blogging solution, but I always cringe when it’s obvious that bigger sites are using it.  Seriously, it doesn’t take much to tweak the layout to make it your own, and you don’t have to sacrifice usability in the process.

If you’re after some ideas for what a BuddyPress network could look like, and some of the features it can offer, WannaNetwork is a very good starting point in my opinion.

List of Free Email Addresses to Ban

If you are suffering from a lot of spam registrations on your blog, or even just people creating multiple accounts in order to troll, then you may find it helpful to block registrations coming from free email addresses.

This may cost you some real registrations from people who either do not have, or choose not to use, an ISP email address, or an email address from their own domain.  It is up to each individual webmaster to decide if the possible lost registrations is made up for by the reduction in spam and fake registrations.

It is worth remembering that MSN and Yahoo email addresses are given out by some ISPs.    People who have premium email accounts with one of those domains attached to them may feel annoyed when they see they cannot register on your site.  For this reason, it’s worth explaining to new users why you have decided to ban certain email addresses, and perhaps offering an alternative signup method.

If you do decide to block free email addresses, then this list of free email domains is a very good starting point.  This is an old list that was posted by Welo on the VBulletin.com forums.   The domains have been checked to see which ones are still current, but new ones have not been added.

The list is a good starting point, and can be added to if you get new spam registrations from other domains.  Combined with other spam fighting techniques – such as blocking bots in your .htaccess file, you should find that your WordPress-MU blogging community becomes a clean, spam free place for your users to hang out.