Posts RSS Comments RSS 58 Posts and 39 Comments till now

Archive for the 'Wordpress MU' Category

NextGen Gallery for WordpressMU - necessary modifications

Alex Rabe’s gallery plugin for Wordpress “NextGEN Gallery” is becoming almost as popular as the integration with Gallery2 and with good reason. I run the gallery 2 integration on this blog and it means keeping both systems as well as the integration up to date. IF for whatever reason you want / need all the functionality of gallery2 this is great, but otherwise NextGEN Gallery which is still in beta (i.e. pre version 1) is quickly shaping up as a good alternative.

The best thing about WPMU (for those that don’t know) is that themes and plugins written for Wordpress often require little modification to function - so without further ado…

1. Set the default file path for the plugin so that all images are stored per blog. This function is run on activation when the tables for the plugin are created.

ngginstall.php

function ngg_default_options()

Add

global $blog_id;

Edit options line as follows

$ngg_options['gallerypath'] = “wp-content/blogs.dir/” . $blog_id . “/files/”; // set default path to the gallery

2. Remove ability for user to update the above in the blog backend

settings.php

Remove “gallerypath” from the list of fields submitted to the form - or remove the input box entirely.

3. Modify the version check

nggallery.php

Simply set if (version_compare($wp_version, ‘wordpress-mu-1.2.4′, ‘>=’)) or remove the check entirely

Note

Other changes are required

  • If you want to take advantage of disk usage limits per blog and will depend on what method you are using to implement this (we’re using zspace upload quotas)
  • You’ll probably also want to hide the plugin’s server status / news display.
  • You may want to change / disable the “import image folder” function. Normally you won’t be allowing your users the upload access to need this function.
  • The default path is displayed in various pages (such as where a gallery is created) in the backend, you may want to remove this as it probably will not be relevant for your users.
  • You may need to edit / remove the permissions checking code depending on how your server is setup
  • Kevin Element left a comment below to say  “I noticed that when you log in as a user and use the “Uninstall plugin tables” under “setup” it deactivates the plugin for all users.” so that is another feature you’ll wish to look at modifying. Thanks Kevin :)

Why are you not simply releasing a version of the plugin that works with MU?

Because “works” is relative to how you intend your MU site to function and what other custom code you have installed. The above hacks are the necessary to get the plugin to work on a default MU install. Alex is planning MU support for version one of the plugin - but how best to do this is debatable especially with the addition of things like a role manager and tagging system.

The current discussion on NGGallery for WPMU is here

WPMUDev Premium - good idea?

Recently a couple of the people who run the biggest WPMU based sites out there have put together a premium member’s area for those wishing to run serious MU based sites.

Seeing as Boz and I have been recently putting together an MU site for a group of friends this is an interesting development, I can immediately see the need for this for those working singly or in small departments who don’t have the direct WPMU expertise but want to quickly reach a large user base on a stable, scalable software base. A reasonable proportion of the freely available MU plugins out there look like they may present scaling difficulties down the line - something you definitely don’t want if you’re providing a service you have to support. Hitting a wall once you’re a few thousand users in is probably extremely unpleasant as it’s harder to redevelop something that is running 24/7.

If we do get around to building another site with WPMU (I have to say I’ve enjoyed working with it) I’ll probably subscribe to this as much out of interest as out of need.

The only real downside I can see is that they may well get an influx of subscriptions from people who really want everything done for them, from consultation to installation and ongoing support which may well clog up the premium forums and their time to support on there with inappropriate questions. However the entry fee will hopefully discourage this kind of behaviour.

There may well be a snotty counter argument to doing this sort of thing off the back of GPL style software, but in all honestly, WPMU is a fair way short of what wordpress.com is so it’s difficult to make an argument whereby these people shouldn’t get rewarded for their expertise and time. Essentially I can see dev premium saving me time in working out answers other people have already arrived at and life is too short for the alternative.

Four Pre-Requisites to working with Wordpress MU

The forums over at Wordpress MU aren’t really the hand holding sort, the regulars are just too busy. However if one has done some background work first there are good solutions in the threads and the regulars are happy to assist someone who has managed to get a part of the way on their own initiative.

A lot of people however seem to approach MU without the pre-requisite skills suggested in the software’s readme (i.e being able to cope with server level software as opposed to a single cms / wordpress install).

For this reason I’d consider the four points below fairly essential if you want to work with MU (even if you have a technical background).

1. Use self hosted wordpress for at least six months - by “use” I mean creating a site installation you’re happy with and blogging to it regularly. Install via FTP or shell rather than fantastico or equivalent and install any security updates as soon as you can.

2. Be comfortable installing and fixing small issues with widgets, plugins and themes - be comfortable reading through the code and following the logic into the database if something isn’t working as expected. The wpmu forums are an invaluable resource but will often only point you in the right direction with a code snippet, you’ll have to apply the solution or follow the logic through so it fits to your site.

3. Ideally have written some plugins / widgets / themes for WP yourself - I hadn’t before starting to work with MU and I really wish I had as there is the added complexity of considering the multi user element when working with MU.

4. Be able to manage the necessities on a dedicated server or VPS  - If you need to hire hardening or optimisation experts or have the budget to pay for management, fine. My own WPMU site is currently sitting on a shared host and will hopefully be fine there - once ready to deploy a site that will be for the wider public rather than just friends from reading the MU forum it appears that this is the ONLY reliable way to go. My experience at a shared hosting company completely backs this up - as a general rule users aren’t allowed to install server level software themselves as it puts far too much of a drain on the shared resources.

Limiting disk space usage in Wordpress MU

MU allows you to limit the amount of disk quota the blogs can use out of the box. However many site admins may want to be able to change this value per blog and for this an extra plugin is needed.

The plugin that seems to do the job is z-space (WPMUDev page) by Dylan Reeve, based on earlier work by some other developers with which it is backwards compatible. It’s an MU plugin meaning it is auto executed for every blog rather than appearing in the normal plugin dialog. The plugin adds a nice readout to the dashboard giving an indication of space used. It appears to have been fixed by another developer for WPMU 1.2.1 according to the WMPUDev page.

When testing, a word of warning. Make sure you’re doing so as a user rather than the site admin, or the quotas won’t necessarily take effect.

The one drawback to the plugin I can see is that if you upload a file that takes you over the limit, this will be stored even if it takes you significantly over the assigned quota, this also makes the status bar look a bit odd. It would be nice perhaps to be able to disable this or have a maximum threshold over quota that is allowed. Further uploads will be prevented once over quota (the file will not be saved after it has been uploaded). It would be good if the upload button was disabled if the blog was over quota.

It looks like Dylan is also working on a Premium blogs plugin which despite being in the early stages looks really promising. I can personally envisage wanting to have different levels of premium blogs with different levels of disk space / plugins etc.

Wordpress MU First Impressions

I’m currently fiddling around with Lyceum and Wordpress MU in an attempt to decide which is most suitable for a little community site I want to get going.

Installing MU is as simple as uploading the file base to the web root (or other location of your choice) and then  visiting the site. Pop in your database details and off you go. You must choose at installation time whether to use subdomains or directories for your site - the language implies this cannot be changed later.

Cosmetically, MU looks an awful lot like Wordpress (yes I know it IS Wordpress but I’m sure you know what I mean!) both on the front page and in the admin area, whereas Lyceum has a customised front page and admin area.  Given that you’ll probably customise a fair bit this doesn’t matter overmuch, but there is a certain logic to the MU setup of having the admin bits and bobs within a tab in the familiar Wordpress admin area.

Whereas at the Lyceum site I found things easy to locate at a glance the MU site doesn’t seem to link very visibly to  http://wpmudev.org/ which seems to be quite an indispensable resource for plugins and themes, even if a lot of contributors seem to have difficulty updating their contribution pages with the new releases. After ten minutes of browsing I’d already added the per user upload quota plugin which is an absolute must have for my site. I’m sure there is a good reason there isn’t a flipping great link on the main site of course :) The site may even have been superseded for all I know.

It’s going to be quite interesting working out which of the systems will do what I want with the least work - a hard bit is definitely going to be deciding which database setup is better. I’ll blog along as I come up against interesting differences and issues.