Sep
09
2008
Over the weekend I took some friends to Wembury as they were down visiting, I’d not been before but I’d heard it was a nice spot so gave me a great oportunity to head over there to have a look around. Here’s a selection of the pictures I took using a Canon 400D, Sigma 17-70mm and a Gorrila-pod (a great piece of kit) where required.
Aug
21
2008
I’ve been working with Ajax recently, I’ve been particularly impressed with how potentially powerful Ajax is. Having a good knowledge of PHP and HTML myself has helped when it came to learning this amalgamation of technologies. If you’re not aware what Ajax is, It stands for Asynchronous JavaScript And XML (eXtensible Markup Language).
A good introduction to it can be found on Harry Maugans in tutorial AJAX Made Easy, in addition to that the SAMS Teach Yourself in 10 Minutes have got a great little book on Ajax which explains it all really well from beginner to intermediate.
Back to the point in hand, I wanted an animated gif to display while I was collecting data from the server. That is precisely what I got when I came upon the Ajax Loading gif Generator. You can customise the gifs produced from the type of animation to the fore and background colours - A great little tool!

Jul
23
2008
I’ve used mod_rewrite quite a lot with Code Igniter and I’ve experienced issues getting it working to remove the index.php from the url on different servers before but this was another issue again. Here’s my resolution and some of my previous resolutions:
Here’s the contents of the .htaccess for Heart Internet to remove index.php:
RewriteEngine On
RewriteCond $1 !^(index\.php|css|img|js|robots\.txt) [NC]
RewriteRule ^(.+)$ index.php?/$1 [L]
SetEnv DEFAULT_PHP_VERSION 5
The SetEnv DEFAULT_PHP_VERSION 5 tells Heart to use PHP 5.
If you have any directories or specific files (like robots.txt) you need to access for css, JavaScript etc, they will need to be put them in the RewriteCond separated by a pipe (|).
In addition, I prefer working with short open tags for writing PHP. You need a file called php5.ini containing:
short_open_tag = On
For my XAMPP development I use the following code in my .htaccess:
RewriteEngine on
RewriteCond $1 !^(index\.php|css|img|js) [NC]
RewriteRule ^(.*)$ /index.php/$1 [L]
For other servers I’ve needed the following:
Options +FollowSymLinks
RewriteEngine on
RewriteCond $1 !^(index\.php|css|img|js|robots\.txt) [NC]
RewriteRule ^(.*)$ index.php/$1 [L]
The subtle differences (that make a huge difference between it working and not working) that may have not been noticed are all located around /index.php?/$1.
I hope this of some use.
Jul
16
2008
This is a great (and powerful) JavaScript that you can plug in to your site for CMS purposes to make HTML or BBCode easily edited - well that’s what I use it for. TinyMCE is a super customisable WYSIWYG (What You See Is What You Get) that ranges from being very basic (for my purposes) to very advanced, you can even skin it if you so desire.
It’s extremly easy to integrate in to your site and is widely used in various applications such as: Wordpress, PHP-Nuke, Joomla and Expression Engine to name a few. A full list can be found here.
Just download it from the TinyMCE download page. Copy the jscripts folder to the root of your htdocs directory.
Then put the following code in between your page tags:
Simple Editor:
<script src="../jscripts/tiny_mce/tiny_mce.js" type="text/javascript"></script> <script type="text/javascript"><!--
tinyMCE.init({
mode : "textareas",
theme : "simple"
});
// --></script>
Now for any <textarea> it will be replaced with the TinyMCE editor functions, the code:
<textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">
<p>
<img src="media/logo.jpg" alt=" " hspace="5" vspace="5" width="250" height="48" align="right" /> TinyMCE is a platform independent web based Javascript HTML <strong>WYSIWYG</strong> editor control released as Open Source under LGPL by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances. TinyMCE is very easy to integrate into other Content Management Systems.</p>
<p>We recommend <a href="http://www.getfirefox.com" target="_blank">Firefox</a> and <a href="http://www.google.com" target="_blank">Google</a>
</p>
</textarea>
Would be displayed like:

The fully featured is extremely comprehensive and looks like:

In my application I replaced the “../” for the JavaScript location to a global variable that returns the base path for my site rather than it being a relative path.
I also customised my copy to to only show the buttons I required and I had the button bar at the top, the great thing about this plugin is that you can get it to automatically produce BBCode which is useful if you’ve got a user facing platform.
To find out about how to customise TinyMCE check this out.
Jul
03
2008
This is the best generic social bookmarking button you could ever wish for to have on your website. The best part about it is that it’s completely free! It’s a one button solution for your visitors to bookmark your site on to the likes of Facebook, Digg, Del.icio.us, MySpace, etc.

It’s really easy to add to your existing site, all you need to do is go to AddThis Button Select page and choose the type of button you wish to add (Bookmark/Share or Feed) and then select the most desirable button you wish to be placed on your site and then copy the code it generates in to your site. Easy!


Well, if you’re using WordPress, it’s even easier… You can just download the AddThis plugin from WordPress AddThis plugins page and activate the plugin in your WordPress admin area, simple!
So if you’re looking for a great, free and easy solution for your visitors to subscribe to your feeds or bookmark pages on your site then look no further.
Enjoy!