In reply to a message about the avatar/file upload problem I put on the BuddyPress forum it was suggested I contact my ISP about the problem. This I did immediately and got an email within the hour. I had to run a script on-line (by filling out a form) to ”install php as a cgi module” and then go to the 34SP (my web hosting service) to “activate the ticket”to give me permissions to the requisite folders and files. In addition I had to paste 3 lines of code into the .htaccess file in the document root folder. A short while later I received an email saying all had been done and, on testing, avatars and files upload fine! I’ll reinstall Elgg and see if this has fixed the similar problem I had with it.
Category wordpress
WPMU + BuddyPress install (avatar and file upload problem)
Having come to a full stop on the Elgg installation until I can track down information on my avatar and file upload problem, I thought I would continue exploring WPMU. As we now have a successful BuddyPress installation at work now I have decided to copy what our tech team and users are doing there and add BuddyPress to http://terrywassall.org/blogs and take advantage of expertise and information they are gaining. The installation went fine and nothing reeally to report. I basically followed the instructions at http://wpmu.org/beginners-guide-to-buddypress/. I also activated the bbPress installation for forums. Every thing went well until I tried to upload a new avatar, for the admin account and for a user. In both cases I got the message:
Upload Failed! Error was: Unable to create directory /var/www/vhosts/terrywassall.org/httpdocs/blogs/wp-content/blogs.dir/1/files/avatars/3. Is its parent directory writable by the server?
I tried creating the directory path manually on the server and gave everything in the path 777 permissions and I did manage to upload a new avatar for the user but when tried to do it for admin I got a message saying the file could not be uploaded. I have reset all the default avatars and deleted the folders I created manually so back to square one for the moment. I had to make a copy of the blogs.dir folder as I couldn’t open it or change permissions – it belongs to apache it seems. I renamed the original and have now reinstated that so it is exactly like the original installation again.
In addition, probably the same problem, on trying to upload a pdf file (a permitted file type for uploading) it looked as if it was uploading with a percentage cout down but then failed with the message:
Unable to create directory /var/www/vhosts/terrywassall.org/httpdocs/blogs/wp-content/blogs.dir/1/files. Is its parent directory writable by the server?
Commenting on draft posts in WordPress
I’ve been trying to work out the best way for contributors to be able to post to our Public Sociology blog so that the public cannot see them but other logged in users can both read and comment as part of the editorial process. I found that posting as draft was no good as you could not add comments in preview. Preview is the only way of viewing a draft post. If you add comments and save the screen goes blank and the comment is not saved.
So at the moment the procedure I have recommended is to post as private. Commenting is then possible in the normal way and editorial comments will be deleted before a post is made public.
However, I then discovered this method of making draft posts commentable:
http://wordpress.org/support/topic/296618 (many thanks to jberculo for posting this)
It involves changing a line in the wp-comments-post.php file.
do_action(‘comment_on_draft’, $comment_post_ID);
is changed to:
do_action(‘pre_comment_on_post’, $comment_post_ID);
and the following
exit;
is removed
I have tried this in the wp-comments-post.php for Public Sociology and it works fine. Comments can be added to draft posts. I copied the original wp-comments-post.php as wp-comments-post-original.php before making any changes.
The problem with this is that it is a hack and would have to be repeated if wp-comments-post.php is replaced during an upgrade. Is there a better way of doing this, a plugin perhaps?
Tarski theme and custom header problem
As mentionned in the previous post I spent some time editing the home.php file of the default theme of the WPMU installation but in the end decided to change the theme to Tarski for the main blog. This looks very nice. It hasn’t got the display of recently updated blogs but this is not an issue for the moment and I assume I would be able to achieve this with a plugin of some sort.
One of the Tarski options is to upload a custom header image. However, despite increasing file permissions to the apparently problematic directories, as identified in the error message below, I could not upload an image.
Unable to create directory …………../wp-content/blogs.dir/1/files. Is its parent directory writable by the server?
I noticed that under Tarski options there is displayed a number of alternative headers pre-installed. I located the folder these were stored in and uploaded my custom header there using ftp. It was not listed and available for selection until I had also created and uploaded a 150×150 thumbnail for it with the required file name. Once this was done I could select the required custom header image and all was well. Perhaps uploading an individual custom header files using the custom header option doesn’t work with the theme in a WPMU installation. I have tried to do this with a test blog and it doesn’t work there either. If I can’t get this to work then users will only be able to use header iamges I have uploaded to the theme header folder.
Editing the WPMU default home page
I have spent some time playing with the home page of the default WPMU theme. It is a file called home.php in the themes/home/ folder. I made a copy of the original home.php which I renamed home-original.php just in case I messed up. The default home page displays recently updated blogs and an invitation to create a new blog, an option I have turned off. My edited version just removes the spurious text and links. Still looks pretty ordinary so will change it for one of the other themes I have now uploaded.
Recommended themes for WPMU
The default home page on installing WPMU is a little plain and one of the first things one might think about is changing to another more attractive theme. Apart from this it would be good to offer a reasonable range of themes to users for their own blogs. However, it seems not all WP themes work successfully with WPMU so it is essential to test them before activating them for other users. This is a short list of themes I have come across so far looking through the WPMU chapters in the book WordPress for Dummies, the WPMU Tutorials site, and WPMU.org.
http://cutline.tubetorial.com/
http://www.darrenhoyt.com/2007/08/05/wordpress-magazine-theme-released/
http://www.smashingmagazine.com/2008/10/20/cellar-heat-a-free-wordpress-theme/
http://wordpress.org/extend/themes/doc
http://wordpress.org/extend/themes/emptiness
We are currently playing with a WPMU+BuddyPress installation and I have discovered a theme that emulates to some extent the Ning community platform. This would be fantastic but it looks like it’s a paid for theme.
WPMU as a WCMS
I’m slowly getting my head around WPMU. It looks like the original installation is a blog, of course, a sort of mother blog. In fact it is likely that WPMU could be used as a WCMS just like the ordinary WP with the option of not using the blog facility at all, or subordinating it to another page, and having a series of static pages with one of them as the home page. If this was installed in the web site root then a series of client blogs could be set up as pseudo subdomains. So, for instance, a WPMU web site could have a url like terrywassall.org with a blog and static pages but, as it is a WPMU installation lots of other blogs could created like user1.terrywassall.org and user2.terrywassall.org. I assume that WPMU woudl make just as good a WCMS as WP. Of course this would not be worth doing unless a number of client blogs were needed as well.
WPMU – why register as a user only?
Up to now I assumed the only reason for registering a new account in WP without starting your own blog was so you can be a joint author for someone else’s. Playing about with my own WPMU installation reveals another possibility. If you register a new account as part of creating a new blog your blog name (the bit that ends up as part of the url) and your username will be the same. So if you create a new blog called testblog for instance and register as a new user your username will be testblog as well. However, once you have registered as a user you can create more new blogs and log into them with the same username and password (assuming the admin options allow this).
If, on registering a new account, you choose the create a user name only option and then log in to create a new blog you have bypassed the necessity of creating a blog with the same name as your username. Creating a new blog as an already registered user gives you frre choice of a blog name without it becoming a user name.
Once you have created more than your initial blog you have the option of changing the designation of your primary blog, by default the first blog you create. I assume if you do this it is possible to delete your original blog if you wish as your username is independent of any particular blog.
Creating additional blogs in WPMU
I created the first new blog in my WPMU installation by turning on the option to allow user and blog creation. I then logged off and went through the procedure for a visitor to create a blog. This worked fine. I then turned the option for creating additional blogs and users off.
The next step was to try creating a new blog manually as admin. I created a new blog and entered the same email as the first additional blog so that a new user would not be created. If I had entered an email address that was not already in the database apparently a new user would be created (presumably with the blog name – the bit that forms part of the blog url – as a user-name) and an activation email would be sent to that email address.
When I viewed the new blog I got the ‘not found’ page. When I logged out as admin and back in with the user-name and password of the new blog’s user I had the same problem. The new blog was listed under ‘My blogs’ but wouldn’t open. I logged back in as admin and deleted the new blog, went to the options page and turned on the option to allow user and blog creation. I then manually created a new blog and this time it worked fine. The lesson seems to be that the create blog option needs to be set to on for admin to manually create a new blog. If this is correct it is a bit of a pain as, if public blog creation is to be disallowed then the option will have to be turned on and off every time admin wants to create a new blog manually.
WPMU Installation: Round 3
Day 2(6/11/09 17.13): Failure! Tried to create a new blog called testblog and expected to get a url
terrywassall.org/blogs/testblog/. However the email sent to me with the activation link took me to testblog.terrywassall.org/blogs/ and when I clicked on it I got the Not found: The requested document was not found on this server page. Did I forget to choose the sub-directory option when I installed? I guess I’ll have to try again. Blast!
However, reported problem to Twitter and Andrea came up trumps again! Her reply said “make sure VHOST in config file is set to no.” I remebered this is a line in the wp-config.php file that I had inspected yesterday to see what the installation script had produced. However, I was not able to edit it. The file was associated with a group and user called ‘apache’. Not sure what this means, but it certainly isn’t me. In the file VHOST was set to yes so needed changing. I got round this by copying wp-config.phpto another file with another name and editing it. I then renamed the original uneditable wp-config.php to something else (I was a bit surprised it let me do this) and renamed the edited copy to wp-config.php. I have no idea if this will have any unanticipated consequences. However, I created another new blog, testblog2, and the url returned to me in the email was terrywassall.org/blogs/testblog2/. When I clicked on the activation link all went well and when the following email arrived with a password I could log into the new blog. Fantastic!
I would like to thank Andrea for her generous help via Twitter. Two absolutely key pieces of information she shared with me undoubtedly saved me a lot of time and trouble. Next time I’m in your vicinity Andrea expect flowers, chocolates and one of my best jokes!