June 10th, 2010
i’ve been building a custom wordpress theme for a client and as part of the CMS requirments they wanted to have a slideshow gallery for their projects.
i’ve used the smooth slider plugin which takes the first image in every post added to it and displays it as a gallery, i’ve then called the gallery from the sidebar…
the only problem was that when you were viewing the page relating to a specific gallery item (project) there was no way of controlling what image was shown on the gallery
but i added this nice little bit of code inside “the loop”, which test to see if the content has an image in it and then displays it in the sidebar (rather than the main content) and if it doesnt have an image displays the scrolling gallery.
$first_img = ”;
ob_start();
ob_end_clean();
$output = preg_match_all(‘/<img.+src=[\'"]([^\'"]+)[\'"].*>/i’, $post->post_content, $matches);
$first_img = $matches [1] [0];
$first_img = ”;
ob_start();
ob_end_clean();
$output = preg_match_all(‘/<img.+src=[\'"]([^\'"]+)[\'"].*>/i’, $post->post_content, $matches);
$first_img = $matches [1] [0];
so all images within the_content() are stored in the array and can then be passed to some jquery image rotators.
Posted in Uncategorized | No Comments »
February 9th, 2010
having an absolute nightmare trying to get php 5.2 upgraded from 5.1.6 on fedora core 6…
think i might just have to take the whole server down and re-image it with ubuntu 8.04 but will have to read up about installing Plesk remotely as not sure if 1and1 will help me with that…
Posted in Uncategorized | No Comments »
February 9th, 2010
getting really bored of using wordpress as a cms… don’t get me wrong, I still like it as a blogging platform and as a quick fix solution for throwing websites up very quickly, but think i need something else to get my teeth into.
i’ve been putting a few test sites together with drupal, and i think its quite good… i must admit i’ve been scared to get into it, but now i’m paddling in the shallow end it doesn’t seem as scary as i thought it was… i wouldn’t use it for just a blogging site though… its got so much more to it… but i am in the process of developing a site for the Scottish Soulful Weekender and am going to jump in with drupal on that site… wish me luck
visited aleks krotoski’s blog page after watching her bbc2 docu and saw she is using a ruby based blog platform called thoth, which looks quite nice… and very fast, but don’t know that much about ruby so wondering if i should investigate more?
Posted in Uncategorized | No Comments »
December 15th, 2009
I’m currently developing a new site for aoklearning and have chosen to use wordpress… (I know, I know, it will be restricting but my thinking behind it is to make it so easy to use that the directors and other staff will be able to update it themselves without having to ask me everytime a new course or new project is created…)
Found this plugin… http://www.wp-eventscalendar.com/ and I am currently in the process of adding some extra fields to the administration side of it, like price, canceled, fully booked, etc… Once I’m happy with how it works I’ll put up some code snippets here… stay tuned…
Posted in Uncategorized | No Comments »
December 2nd, 2009
A server that I am helping with, hosted by UKWSD has been subject to a heavy load recently…
They inform us that it was caused by a Yahoo bot constantly crawling the site and causing the overload. You would think a company such as Yahoo would have a more graceful bot routine? Will investigate more…
Posted in Uncategorized | No Comments »
November 23rd, 2009
Been using CakePhp for a new project… really good so far, will probably make another post on it when I’ve figured it out a bit more.
Posted in Uncategorized | No Comments »
October 8th, 2009
A smallish site I look after recently had a database corruption, which resulted in all the wordpress pages and posts being wiped as I had to re-install wordpress. Fortunately I could recover the html files, themes, etc… and thought that I would have to trawl through all my old emails with the client to rebuild the content… I thought wrong…
A quick google using the “site:www.example.com” showed all of the pages from the site, then clicking the “Cached” link in google showed the entire page as it was a month ago! Excellent! Google saved me a lot of time, but I’ll be putting a more robust backup strategy in place!
Posted in Uncategorized | No Comments »
September 30th, 2009
Supposedly google wave beta users can now send out invitations… If so I better start dishing them out!
[update]… got it! ithinkitsnice.com was the first to ask for one, so have 7 more left…
Posted in Uncategorized | No Comments »
September 26th, 2009
Someone at work who recently made the switch to the mac asked me to install some network managment scripts on her mac. When she was on the pc I had an .hta application that called ran various .vbs and .bat scripts to switch machines on/off and to copy sets of files on tot the desktops so I’ve got to re-do them for the mac, shouldn’t be too hard, eh?
This is my first bash at using automator but it was very simple. I’ve created an app that accepts folder or files droped on it and copies it to all the machines, just by showing selecting where they are from finder… how easy was that?
Tried to do the same to delete the files, but “computer says no…”, so back to a bit of bash scripting, shouldn’t be too difficult.
Also got to find a WOL (Wake on Lan) binary for mac… found this [http://www.coriolis.ch/en/wakeup/] but cant find a CLI version for bash.
Posted in work | No Comments »
September 21st, 2009
Just sent out 2200 emails to users on a mailing list we had and got about 300 bounces.
Think I might allocate some time to write an email verification plugin for phplist, whereby you select a list and it’ll run through every email address and it will firstly check the format using a regex then use getmxrr() to check if an MX record for that domain exists.
Also, it might be possible using an fsockopen() on port 25 to see if the user exists on that server?
Will use these links below to try and get something running for PHPList.
http://www.webdigi.co.uk/blog/wp-content/uploads/2009/01/smtpvalidateclassphp.txt
http://www.devshed.com/c/a/PHP/Email-Address-Verification-with-PHP/5/
Posted in Uncategorized | No Comments »