Archives
Blogroll
Sites I've Worked With
-
Recent Comments
Anton on Slow Windows 7 Install –… shaw on Slow Windows 7 Install –… bp52 on Great BuddyPress Network … Brad on Slow Windows 7 Install –… Duffy on Using VSFTPD With PAM Networked Blogs
Blog: Lesley's Tech Blog Topics:tech, programming, geek -
Top Posts
- Slow Windows 7 Install - Expanding Windows Files
- Solution for Android Emulator Starts But App Doesn't Run
- Using VSFTPD With PAM
- Testing Citadel server
- Rapid game development with PyGame
- Review: Blender 3D - Architecture, Buildings and Scenery
- TortoiseSVN 1.7 Beginner's Guide Due This Month!
- Blender for Game Developers
Monthly Archives: September 2009
Love This Site Awards :: Myth Games – DivineCaroline
“One of my sites has been nominated for a DivineCaroline ‘Love This Site’ award! If you’d like to show your support for the site, please vote
Creating an account only takes a moment, and I’d be extremely grateful.”
No pressure or anything, but I think this site deserves to win a Love! This Site Award from DivineCaroline, so please, vote soon! You can also still nominate your favorite sites.
Posted in Uncategorized
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.
Once they’ve made a copy of a theme, they can edit the CSS files using the theme editor.
For your convenience, you can download the edited versions of the core files here.
Posted in Beginner's Guide to WordPress-MU and BuddyPress
Tagged book, user themes, WordPress-MU
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
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!

