My idea of putting a donate button on web pages that users arrive at after coming from Google or other search engines is now online. The process wasn't simple as there doesn't seem to be a plugin for Movabletype to include this sort of information. The steps I took are in the extended entry.
Recently in PHP Category
I didn't realise that after I moved servers with my new host, the path to imagemagic changed - this meant I wasn't able to upload any pictures to the gallery. It's fixed now by setting the path to /usr/bin instead of /usr/x11/bin
Coppermine 1.4.2 is out now so I spent most of Thanksgiving Morning playing with it. There was a bug in the keyword search facility which I worked around and coded a method of sizing keywords depending on how many times they occur in the database ala flickr. I posted about my new search page in the forums and have posted the code for someone else to tidy up and improve as I'm not a good mysql php coppermine programmer. I'm pleased with the results though.
I went round a friends house on Tuesday night to teach them how to manage the church's website which runs under Mambo (which I'm starting to regret installing!). Unfortunately this person only has mac's in the house and doesn't really know much about the technical side of a mac apart from using word, email and graphical/music packages. He wanted to install a copy of mambo onto his own mac so he could play without distrupting the live server. However mambo needs mysql, php and apache installed. Thankfully apache was already configured but php wasn't working - it was just displaying the files as text files. However when I searched for httpd.conf it didn't come back with any details - instead I had to open terminal, change to a directory in /etc and then vi the file - only to find it was readonly, owned by root and when I asked for the root password I was met with a blank stare. I then used netinfo (i think) to remove the asterix in the passwd file for root, changed the password, logged in, edited the httpd.conf and hey presto - php was working. Undo the root passwd setups and then onto mambo installation.
This worked ok until we got to the sql installation as although mysql was installed, we couldn't find a frontend to configure the databases and couldn't find anything in google...I thought Mac interfaces were meant to be really helpful and friendly? This one certainly wasn't.
Anyway, we carried on with testing on the "live" site and discovered that we needed a way of uploading files, specifically mp3 files, to the mambo server but you can only seem to do this if you are the administrator of the server. Not much use for giving users the ability to upload certain files and pictures.
The next solution was to use ftp, so does anyone know a good, easy to use (gui), free, mac ftp client?
Alternatively anyone got any alternatives to running a cms website that allows registered users to upload files (like a blog). I might just start again with an installation of Wordpress - might be easier.
I'm trying to work out how to include a RSS feed into an index page of one of my blogs and came across Learning Movable Type: Simple RSS Customizations. Although it has not yet provided me with an answer, it has provided me with some more reading to do on other rss matters.
rssparsers might be handy for doing work outside of MT but the best source I found so far was mt-rssfeed plugin but I have not got that working yet. But it's late and I need to go to bed so I will try again another night.
A bit of hunting and editing and I managed to change the "Powered by Coppermine" logo in my gallery to point to the new Coppermine location. The forums won't tell you how to do it because otherwise some people would probably remove the logo completely.
Mark has a page about shortening urls but with a domain like absoblogginlutely.net its likely to increase the length of the resulting url!
Its taken me all weekend, but I have now edited my 404 page. I'm not that slow a coder - the time has included a very slow download and reinstallation of Foxserv after I broke my apache's httpd.conf file when fiddling with it to get a custom 404 page on the laptop installation that I am testing with.
Now my 404 page does not send me a notification email if someone is using a hacking script to scan for formmail and ends up at my 404 page. Its been quite a good exercise in coding as I've used server variables to obtain the requested web page and the refererring page, Regular expressions to check that its not some variant of formmail and a couple of if statements to do the logic. This is the best way to learn php with a (small) project to do something useful on the website.
Having access to a customised 404 page means I've been able to set up notification when someone goes to a missing page on my site and I can then correct the links. Its a practise thats worked well and I now get very few error messages coming in. However I am getting several links for various incarnations of formmail.cgi, formmail.php, and formmail.pl all in different locations such as /cgi-bin, / etc. All of them have had the referral page forged so it looks like its my site that has led them to this page (presumably because thats one of the first restrictions someone will use to lock down their mailing routine). I now have to do some more php work with those regex expressions learnt yesterday to not email me if someone requests a formmail page of whatever description. Ideally I'd want to put them in my .htaccess file programatically too so they wouldnt be able to get any more pages (or make them refer to a tarpit of some kind)
My email page now has a form to send mail from the web server to me or a spam protected email address you can enter into your mail client to email me. Hopefully that will enable people to mail me without a mail client on their pc and at the same time stop spammers retrieving my email address. If I start getting lamers spamming the form then I'll have to reconsider.
I coded my first real application in php over the weekend. It's a changing 404 page that has different pics and semi-witty comments to go with them. It uses an array to hold the details of which pictures to show, the comments and style sheet information. This is then picked up with a random number and then exploded out into the relevant parts of a template 404 page. I'm not linking to it from here as that would inundate me with emails everytime someone visited the link. Instead you'll have to work out how to see it yourself. (I only email on a bad referring page NOT on a page that has been "guessed" by someone.
I installed the version of PHPTriad that came on this months .net magazine. This is a full version (by the looks of it) of software that includes PHP, MySql, PHPAdmin and Apache to run it all on. From one .exe file its possible to set up a complete php development environment. Sounds great? I then went to the PHPTriad website which mentions they are now part of Sockitt. This costs 19.99 dollars to download but does include more uptodate versions of all the applications. Seeing as though all these applications are meant to be free that seems a bit steep. I'm sure that I've seen another version of this application somewhere else on the internet....
Update The application setting is called Lamp for Linux, Apache, MySQL,PHP so I guess I want WAMP
Update2 There's a whole load of these things at HotScripts Installation Kits
I've modified my 404 page now so that if you reach it by typing in a random url it doesn't send a message, but will display an error message on the screen. If this page is reached from a referring page, then an email is sent to my webmaster account informing me of the problem. Hopefully this means I can fix my broken links, but also stops me getting loads of error messages when I can't tell where they are coming from. The php tutorial was pretty useful in confirming the syntax of the php commands that I needed to use.
I've discovered the joys of the .htaccess file! As I moved across the asp files to this server, based on php, all the asp pages no longer exist. Using the .htaccess I can set up a permanent redirection to the equivalent .php file. All i've got to work out is how to use wild cards so I could redirect *.asp to *.php....
In the meantime you can check that the original email address page works.
Update .asp to .php works by adding the line
RedirectMatch (.*).asp$ http://absoblogginlutely.net$1.php
and I've also sorted out MTblogs to redirect the .html files to .php ones using
RedirectMatch (.+)blogarchive/(.+).html http://absoblogginlutely.net$1blogarchive/$2.php
