March 16th, 2009
Just setup a PHP/MySQL development server on my Vista-based laptop.
Here is a good rundown of setting up a VAMP (Vista, Apache, MySQL, PHP) server from Devshed:
Creating a VAMP
The other thing to know, which this article skipped, is that you should run your text editor as administrator when editing the config files. If you don’t do this you won’t be editing the correct file (only your Users version of it which isn’t actually used by the system).
Posted in mysql, php, tip | No Comments »
February 26th, 2009
Here is a example of how to use the Find command to find PHP files changed in a servers home directory in the last day …
find /home -mtime -1 -name *.php
Pretty easy to modify this to give a different time period, search a different path, or find different kinds of files.
Posted in tip | No Comments »
February 16th, 2009
Fresh off my news reader, from Bryan Eisenberg of FutureNow, is a great collection of links and resources for setting up and making the most of Google Analytics.
The Missing Google Analytics Manual
Bryan is probably the most influential expert on Conversion Rate Marketing.
A great resource.
Posted in tip | No Comments »
January 30th, 2009
Just came across a couple of great PHP-related articles.
50 Extremely Useful PHP Tools
It is a great list of PHP tools including: Debugging tools, Testing and Optimization Tools, Documentation Tools, Security Tools, Image Manipulation and Graphs, PHP Code Beautifiers, Version-Control Systems, PHP Online Tools and Resources, PHP Development Frameworks, IDEs and Editors, Firefox Add-Ons, and a bunch of useful useful extensions, utilities and classes.
10 Principles of the PHP Masters
Definitely worth a read for anyone doing PHP development regardless of the level. Here is the list
- Use PHP Only When You Need it - Rasmus Lerdorf
- Use Many Tables With PHP and MYSQL for Scalability - Matt Mullenweg
- Never, ever trust your users - Dave Child
- Invest in PHP Caching - Ben Balbo
- Speed up PHP Development with an IDE, Templates and Snippets - Chad Kieffer
- Make Better Use of PHP’s Filter Functions - Joey Sochacki
- Use a PHP Framework - Josh Sharp
- Don’t use a PHP Framework - Rasmus Lerdorf
- Use Batch Processing - Jack D. Herrington
- Turn on Error Reporting Immediately - David Cummings
I especially liked the discussion of 7 and 8.
Posted in php | No Comments »
January 30th, 2009
Read this ebook from Sitepoint in full: The Principles Of Beautiful Web Design
This covers layout and composition, color, texture, typography, and imagery in web design.
Posted in design | No Comments »
January 29th, 2009
I recently had to migrate blog posts in a Nucleus CMS-based blog to a Wordpress blog. Nothing against Nucleus which served a purpose for a long time and is still a really powerful piece of software. The migration is more to do with my experience working with Wordpres now than the quality of Nucleus. Anyway … I did a quick hunt for ways to migrate, which included some random code that referenced old versions of Nucleus and WP. I didn’t even bother with this. There is a much faster way.
The easy (and fast) solution proved to be modifying the Nucleus RSS feed so that it exports all the blog posts in full. These can then be imported into Wordpress.
Steps in brief (this might be different depending on your Nucleus version):
- Edit the skin for xmlrss2 in Nucleus. Find this (or similar) <%blog(xmlrss2,10)%> and change it to <%blog(xmlrss2,1000)%> where the second number is larger than the number of posts in your blog.
- Edit the template for xmlrss2 in Nucleus. It will probably look something like this:
<item><title><%syndicate_title%></title>
<link><%blogurl%>index.php?itemid=<%itemid%></link>
<description><%syndicate_description%></description>
<category><%category%></category>
<pubDate><%date(rfc822)%></pubDate>
</item>
Change it to:
<item>
<title><%syndicate_title%></title>
<link><%blogurl%>index.php?itemid=<%itemid%></link>
<content:encoded><![CDATA[<%body%>
]]></content:encoded>
<category><%category%></category>
<pubDate><%date(rfc822)%></pubDate>
</item>
- Open the Nucleus RSS feed in a browser (it should be really long and include the content of all your blog posts). Save the source (nucleusexport.xml for example).
- Reset the changes to the Nucleus templates and skins above so your feed is back to normal.
- Import the RSS feed into your Wordpress site (this used to be under the Manage tab, it is under Tools now).
Note: this won’t migrate comments and maybe other stuff that is important to you. This is purely the post content.
Posted in tip, wordpress | No Comments »
January 29th, 2009
Had a bit of a break from posting while I have been travelling with work. Back now and so should be posting a bit more regularly.
Found this great presentation today on Slideshare by Manuel Lemos of PHPClasses.org:
“Sending E-mail that reaches the destination using PHP”.
It provides a basic overview of email protocols and systems and covers best practices to ensure email gets through, including specific reference to PHP classes he wrote. The MIME Email Message Sending PHP Class is really useful.
Posted in best practice, coding, email, php | No Comments »
November 26th, 2008
A few years ago I started using Clickatell as a way to send SMS messages from different applications I built. Getting a message to notify you of particular events (”you received an order”, “something isn’t working right”) allows you to respond in a timely manner.
I have one web-based application that monitors various websites I work on and I get a downtime notification via SMS any time a site is down. I have also integrated SMS with osCommerce to send order notifications including the contents of the order. This is great for monitoring a low volume sideline store. There are lots of applications for this of course.
I have used Aleksandar Markovic’s Clickatell SMS API for a number of years. It supports CURL and fopen for the HTTP request and is very easy to integrate into your application.
Posted in coding, php, tip | No Comments »
November 25th, 2008
I noticed that the GZIP compression option was no longer there in Wordpress after version 2.5. This is recommended to be performed by the server now using mod_deflate.
If you don’t have access to mod_deflate, i.e. if you are on a uncooperative shared host, you can use this method using .htaccess …
Speed Up Your Blog Using ZLIB
If that doesn’t work you may be on a phpSuExec server. Create a file called php.ini in the root of your Wordpress install with the following contents …
zlib.output_compression = On
You can test here:
http://www.gidnetwork.com/tools/gzip-test.php
Posted in php, tip, wordpress | No Comments »
September 19th, 2008
Posted in ajax, javascript, tip | No Comments »