<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SoddenGecko.Com &#187; Code</title>
	<atom:link href="http://www.soddengecko.com/topics/code/feed" rel="self" type="application/rss+xml" />
	<link>http://www.soddengecko.com</link>
	<description>&#34;I do not fear computers. I fear the lack of them&#34; - Isaac Asimov</description>
	<lastBuildDate>Sat, 26 Jun 2010 23:45:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>HOW TO: Move Ubuntu Home folder to another drive</title>
		<link>http://www.soddengecko.com/tech/linux-unix/2010/how-to-move-ubuntu-home-folder-to-another-drive</link>
		<comments>http://www.soddengecko.com/tech/linux-unix/2010/how-to-move-ubuntu-home-folder-to-another-drive#comments</comments>
		<pubDate>Sun, 07 Feb 2010 19:31:30 +0000</pubDate>
		<dc:creator>Soddengecko</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[system backup]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.soddengecko.com/02/2010/how-to-move-ubuntu-home-folder-to-another-drive/</guid>
		<description><![CDATA[Having the &#8220;/home&#8221; directory tree on it&#8217;s own partition has several advantages, the biggest perhaps being that you can reinstall the OS (or even a different distro of Linux) without losing all your data. You can do this by keeping the /home partition unchanged and reinstalling the OS which goes in the &#8220;/&#8221; (root) directory, [...]]]></description>
			<content:encoded><![CDATA[<p>Having the &#8220;/home&#8221; directory tree on it&#8217;s own partition has several advantages, the biggest perhaps being that you can reinstall the OS (or even a different distro of Linux) without losing all your data. You can do this by keeping the /home partition unchanged and reinstalling the OS which goes in the &#8220;/&#8221; (root) directory, which can be on a seperate partition.</p> <p>But you, like me, did not know this when you first installed Ubuntu, and have not created a new partition for &#8220;/home&#8221; when you first installed Ubuntu. Despair not, it is really simple to move &#8220;/home&#8221; to its own partition.</p> <p>First, create a partition of sufficient size for your &#8220;/home&#8221; directory. You may have to use that new hard drive, or adjust/resize the existing partition on your current hard-drive to do this. Let me skip those details.</p> <p>Next, create and mount the new partition: <br/>$mkdir /mnt/newhome <br/>$sudo mount -t ext3 /dev/hda5 /mnt/newhome</p> <p>(You have to change the &#8220;hda5? in the above to the correct partition label for the new partition. Also, the above assumes that the new partition you created is formatted as an ext3 partition. Change the &#8220;ext3? to whatever filesystem the drive is formatted to.)</p> <p>Now, Copy files over: <br/>Since the &#8220;/home&#8221; directory will have hardlinks, softlinks, files and nested directories, a regular copy (cp) may not do the job completely. Therefore, we use something we learn from the Debian archiving guide: <br/>$cd /home/ <br/>$find . -depth -print0 | cpio -null -sparse -pvd /mnt/newhome/</p> <p>Make sure everything copied over correctly. You might have to do some tweaking and honing to make sure you get it all right, just in case.</p> <p>Next, unmount the new partition: <br/>$sudo umount /mnt/newhome</p> <p>Make way for the new &#8220;home&#8221; <br/>$sudo mv /home /old_home</p> <p>Since we moved /home to /old_home, there is no longer a /home directory. So first we should recreate a new /home by: <br/>sudo mkdir /home</p> <p>Mount the new home: <br/>$sudo mount /dev/hda5 /home</p> <p>(Again, you have to change &#8220;hda5? to whatever the new partition&#8217;s label is.)</p> <p>Verify that everything works right.</p> <p>Now, you have to tell Ubuntu to mount your new home when you boot. Add a line to the &#8220;/etc/fstab&#8221; file that looks like the following:</p> <p>/dev/hda5 /home ext3 nodev,nosuid 0 2</p> <p>(Here, change the partition label &#8220;hda5? to the label of the new partition, and you may have to change &#8220;ext3? to whatever filesystem you chose for your new &#8220;home&#8221;)</p> <p>Once all this is done, and everything works fine, you can delete the &#8220;/old_home&#8221; directory by using: <br/>$sudo rm -r /old_home</p> <p>Or you can keep the old one as a backup</p>]]></content:encoded>
			<wfw:commentRss>http://www.soddengecko.com/tech/linux-unix/2010/how-to-move-ubuntu-home-folder-to-another-drive/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOW TO: Random password generator on Ubuntu and other Linux systems</title>
		<link>http://www.soddengecko.com/all/2010/how-to-random-password-generator-on-ubuntu-and-other-linux-systems</link>
		<comments>http://www.soddengecko.com/all/2010/how-to-random-password-generator-on-ubuntu-and-other-linux-systems#comments</comments>
		<pubDate>Sun, 07 Feb 2010 19:25:00 +0000</pubDate>
		<dc:creator>Soddengecko</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[system backup]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.soddengecko.com/02/2010/how-to-random-password-generator-on-ubuntu-and-other-linux-systems/</guid>
		<description><![CDATA[Recently I had need to generate random passwords. I did not want to make a script for it and I certainly did not want any applications to do the tasks. Here is the command line argument for such a task: &#60;/dev/urandom tr -dc A-Za-z0-9_ &#124; head -c8 Note that the &#8216;tr&#8217; strips out everything except [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had need to generate random passwords. I did not want to make a script for it and I certainly did not want any applications to do the tasks. Here is the command line argument for such a task:</p> <p><br/>&lt;/dev/urandom tr -dc A-Za-z0-9_ | head -c8</p> <p><br/>Note that the &#8216;tr&#8217; strips out everything except characters in the ranges (alphanumeric, mixed case and underscores). This is a nice approach as piping to head means the minimum number of bytes required to generate a password of appropriate length are taken from /dev/urandom vs other methods which take more than you should need but still have a chance of not having obtained enough random data to generate a password of the required length. You can change the parameter to head to get passwords of any length. <br/></p> <p>NOTE: I have only run this command on Ubuntu, its possible it works on other Linux systems but I have not checked.</p>]]></content:encoded>
			<wfw:commentRss>http://www.soddengecko.com/all/2010/how-to-random-password-generator-on-ubuntu-and-other-linux-systems/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOW TO: Perform system backup in Ubuntu &#8211; Part 2 &#8211; Restore</title>
		<link>http://www.soddengecko.com/all/2010/how-to-perform-system-backup-on-ubuntu-part-2-restore</link>
		<comments>http://www.soddengecko.com/all/2010/how-to-perform-system-backup-on-ubuntu-part-2-restore#comments</comments>
		<pubDate>Sun, 07 Feb 2010 19:20:43 +0000</pubDate>
		<dc:creator>Soddengecko</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[system backup]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.soddengecko.com/02/2010/how-to-perform-system-backup-on-ubuntu-part-2-restore/</guid>
		<description><![CDATA[The restore will need to be perfomred as root tar xvpzf filename.tgz -C / the mkdir options are mandatory, and you will notice that they are the directories that are excluded from the backup. this is fine, but the folders do need to be replaced BEFORE YOU DO ANYTHING AFTER THE RESTORE mkdir proc mkdir [...]]]></description>
			<content:encoded><![CDATA[<p>The restore will need to be perfomred as root</p> <p>tar xvpzf filename.tgz -C /</p> <p>the mkdir options are mandatory, and you will notice that they are the directories that are excluded from the backup. this is fine, but the folders do need to be replaced BEFORE YOU DO ANYTHING AFTER THE RESTORE</p> <p>mkdir proc <br/>mkdir lost+found <br/>mkdir mnt <br/>mkdir sys <br/>mkdir media <br/>mkdir cdrom <br/>mkdir home</p> <p>now reboot</p> <p>everything should now be cushdy</p>]]></content:encoded>
			<wfw:commentRss>http://www.soddengecko.com/all/2010/how-to-perform-system-backup-on-ubuntu-part-2-restore/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOW TO: Perform system backup in Ubuntu &#8211; Part 1 &#8211; Backup</title>
		<link>http://www.soddengecko.com/all/2010/how-to-perform-system-backup-in-ubuntu</link>
		<comments>http://www.soddengecko.com/all/2010/how-to-perform-system-backup-in-ubuntu#comments</comments>
		<pubDate>Sun, 07 Feb 2010 19:18:23 +0000</pubDate>
		<dc:creator>Soddengecko</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[system backup]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.soddengecko.com/02/2010/how-to-perform-system-backup-in-ubuntu/</guid>
		<description><![CDATA[I had a few issues with my Ubuntu system after installing KDE4. I don&#8217;t think KDE4 caused the issue, but a combination of the software I use and the things I do was causing me login issues and X session headaches. I would have programs close immediately after opening, which I could only solve with [...]]]></description>
			<content:encoded><![CDATA[<p>I had a few issues with my Ubuntu system after installing KDE4. I don&#8217;t think KDE4 caused the issue, but a combination of the software I use and the things I do was causing me login issues and X session headaches. I would have programs close immediately after opening, which I could only solve with a reboot. Files were locked, preventing me from running applications like the Terminal and a few other apps. System updates would fail for an unknown reason.</p> <p>I had to rebuild the system. I saved off all my personal data and reinstalled everything.</p> <p>Once I was back at my desktop, after configuring my dual screen setup on an Nvidia card and getting my email and browser back the way I like them I decided it was time to make some changes.</p> <p>The /home folder needed to be moved from the OS drive, (that&#8217;s the next post) and I needed a way to back everything up, and I mean everything. Because of the way Linux structures its OS it is geniusly easy to backup the system. You cannot do this on windows without expensive software to ghost the drive.</p> <p>What we are going to do here is use TAR to compress and zip up the entire root structure, with a few exclusions.</p> <p>NOTE <br/>I run the command as sudo from my own account. I am pretty sure it would be benneficial to quit all X sessions and drop to the command prompt rather than run from a live session. I have no evidence to suggest that doing this from the desktop will cause any problems. If you have a suggestion on this please comment below.</p> <p>I will show you how I backed up my root directory and then I will supply a generic command that will suffice for most people. My command is slightly different as I moved my /home folder onto a seperate hard drive. I will cover my reasoning for this in my next post.</p> <p>This is the command I use to backup my OS</p> <p>sudo tar cvpzf /media/500/000_Backups/System/system_backup-$(date +%d-%m-%Y).tgz &#8211;exclude=/proc &#8211;exclude=lost+found &#8211;exclude=/mnt &#8211;exclude=/media &#8211;exclude=/cdrom &#8211;exclude=/home &#8211;exclude=/old_home /</p> <p>As you can see I have excluded the /home directory in my backups as it is on a seperate partition. Now, lets break this down into its component parts so you can better understand how this works.</p> <p>&#8220;tar&#8221; is obvious. this is the application we will be using to create the archived backup. Make sure you have tar installed. It should be by default but just incase you will need to run this command in the Terminal</p> <p>sudo apt-get install tar</p> <p>or, click &lt;a href=&#8221;apt:tar&#8221;&gt;here&lt;/a&gt;</p> <p>the tar parameters &#8220;cvpzf&#8221; are as follows. <br/>c &#8211; this tells tar that we are creating an archive <br/>v &#8211; verbose mode, this command outputs each file being archived into the terminal window <br/>p &#8211; retain all file permissions as is <br/>z &#8211; compress as gzip &#8211; use j for bzip2 but make sure you change the file extension to tar.bz2 <br/>f &#8211; filename follows this parameter.</p> <p>system_backup-$(date +%d-%m-%Y).tgz &#8211; this is the filename followed by the date of the day the backup is made, in the format dd/mm/yyyy</p> <p>I chose to date it as I will have incremental backups running via cron. This is a little out of the scope of this post, but happy to help those if you post a comment and ask.</p> <p>&#8211;exclude=/ &#8211; we are going to exclude some folders that are not required in the backup. proc, lost+found and cdrom are not required in the backup, and if you do not want to backup any drives, dvds or cdroms that are mounted inside mnt or media, make sure you exclude those as well or the backup could become extremely large.</p> <p>/ &#8211; this is the folder we are backing up. and as we are backing up the whole system we need to backup from the root directory which is /</p> <p>Now we have our backup command explained you are ready to get down to running your own. Obvioulsy please dont use the one above as it is for my machine, below is the generic code that should suffice 99% of people.</p> <p>NOTE <br/>please change the &#8220;pathtofolder&#8221; to a location you would like to save the file once it is completed. <br/>this will take a while once you execute the command, so don&#8217;t be tempted to cancel the operation.</p> <p>sudo tar cvpzf /pathtofolder/system_backup-$(date +%d-%m-%Y).tgz &#8211;exclude=/proc &#8211;exclude=lost+found &#8211;exclude=/mnt &#8211;exclude=/media &#8211;exclude=/cdrom /</p> <p>Now that you have your backup, you are going to need to restore it someday. Below are simple instructions on how to extract and restore your data</p> <p>sudo tar xvpzf system_backup-dd-mm-yyy.tgz -C /</p> <p>the mkdir options below are mandatory, and you will notice that they are the directories that are excluded from the backup. this is fine, but the folders do need to be replaced BEFORE YOU DO ANYTHING AFTER THE RESTORE</p> <p>mkdir proc <br/>mkdir lost+found <br/>mkdir mnt <br/>mkdir media <br/>mkdir cdrom</p> <p>Now reboot your PC and your data will be restored. This includes all applications, mail and broswer settings, everything, except the folders you did not backup. <br/></p>]]></content:encoded>
			<wfw:commentRss>http://www.soddengecko.com/all/2010/how-to-perform-system-backup-in-ubuntu/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SBS 2003: Mapping network drives for users at logon</title>
		<link>http://www.soddengecko.com/code/2010/sbs-2003-mapping-network-drives-for-users-at-logon</link>
		<comments>http://www.soddengecko.com/code/2010/sbs-2003-mapping-network-drives-for-users-at-logon#comments</comments>
		<pubDate>Sun, 07 Feb 2010 19:07:38 +0000</pubDate>
		<dc:creator>Soddengecko</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[map network drives]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[SBS 2003]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.soddengecko.com/02/2010/sbs-2003-mapping-network-drives-for-users-at-logon/</guid>
		<description><![CDATA[Some time ago I installed an SBS 2003 server to act as Domain Controller/Exchange server/File and Print Server etc. The main aim was to centralise all the different locations of my data and printing needs into one manageable system. Although I am more than capable of mapping a drive manually and navigating to shared folders, [...]]]></description>
			<content:encoded><![CDATA[<p>Some time ago I installed an SBS 2003 server to act as Domain Controller/Exchange server/File and Print Server etc. The main aim was to centralise all the different locations of my data and printing needs into one manageable system. Although I am more than capable of mapping a drive manually and navigating to shared folders, I wanted a solution that did it all when I log onto my computers at home. Here is brief overview of what logon scripts do and how to get them working for you.</p> <p>Everytime a user logs onto a windows domain a batch file is run from the NETLOGON folder on the domain controller, in this case, Windows Small Business Server 2003. The primary function of this file is to install any application that has been pushed to the client workstations. I wanted to amend this so that printers and shares were automatically allocated depending on the user who logs in.</p> <p>For this example our server is called SBS, the user will be &#8220;ANother&#8221; and the folder we want to share is &#8220;Applications&#8221;. The first thing you need to do is find the logon script: it will be located here &#8211; &#8220;C:\WINDOWS\SYSVOL\sysvol\&lt;domain name&gt;\scripts\SBS_LOGIN_SCRIPT.bat&#8221;</p> <p>The logon script will contain the line needed to add applications to users computers instead of manually installing them. For the sake of my setup I deleted this line as I do not need it but the line looks like this: &#8220;<span style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium Tahoma, Arial, Helvetica; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"><span style="FONT-SIZE: 12px" class="Apple-style-span"><a href="C:\sbs\clients\setup\setup.exe">\\sbs\clients\setup\setup.exe</a> /s sbs</span></span>&#8220;. Please leave this line in if you plan to deploy software to workstations from the server.</p> <p>Open up the SBS_LOGIN_SCRIPT.bat file (right click and select &#8220;edit&#8221;). What we are going to do is create a shortcut in this file to a file that matches the username of the logged on user. So add this line to the login script batch file, save it and close it. &#8220;<a href="C:\sbs\netlogon\%username%.bat">\\sbs\netlogon\%username%.bat</a>&#8220;</p> <p>What this line does is look within the scripts folder for any batch files matching the username of the logged on user. So if Tom was to log on with his name &#8220;another&#8221; the login script will look for another.bat.</p> <p>Now we can create out user files so we can map drives and printers specifically for them. I will cover printers in another post. Create a new file in the scripts folder and call it &#8220;another.bat&#8221; and open this up ready to edit. We need to add the applications share to Toms logon script.</p> <p>In Toms file add the line: NET USE F <a href="C:\sbs\applications">\\sbs\applications</a></p> <p>Save and close this file.</p> <p>Now whenever Tom logs onto his computer the applications share will automatically be added as a network drive. All he has to do is go to &#8220;My Computer&#8221; and it will be listed for him to access. Of course we can go further than this and add shortcuts to the desktop and other mapped drives as well as printers and installs. I will not cover those here but check back for my update on adding default printers to a users account.</p> <p>Everytime you add a new user to your domain, don&#8217;t forget to add a new batch file for that user and add in all the drives you want to map for them.</p> <p>If you have any questions, comments and any other info just let me know.</p>]]></content:encoded>
			<wfw:commentRss>http://www.soddengecko.com/code/2010/sbs-2003-mapping-network-drives-for-users-at-logon/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Customising Firefox 3</title>
		<link>http://www.soddengecko.com/all/2008/customising-firefox-3</link>
		<comments>http://www.soddengecko.com/all/2008/customising-firefox-3#comments</comments>
		<pubDate>Tue, 13 May 2008 19:14:53 +0000</pubDate>
		<dc:creator>Soddengecko</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.soddengecko.com/?p=162</guid>
		<description><![CDATA[If, like me you have recently upgraded to Firefox 3 and you have spent years using Tabbed Browser Preferences to manage your tabs position in the window, colour, order etc etc, then you, like me, are quite disappointed with the lack of configuration the tab bar has within Firefox 3. Developer Comments: This extension is [...]]]></description>
			<content:encoded><![CDATA[<p>If, like me you have recently upgraded to Firefox 3 and you have spent years using Tabbed Browser Preferences to manage your tabs position in the window, colour, order etc etc, then you, like me, are quite disappointed with the lack of configuration the tab bar has within Firefox 3.</p>

<blockquote>
<small>Developer Comments:</small>
This extension is an enhancement for the basic tab controls provided in Firefox 1.0. It replaces the existing user interface with a new, more visible user interface, and also includes UI for other hidden features that are part of the browser, as well as features provided explicitly by the extension.</blockquote>

<p>Tabbrowser Prefs is not currently available for Firefox 3 on Windows or Linux, which left me feeling frustrated. I would love to have felt annoyed, but can you really be annoyed when the info to build your very own plugin is out there?</p>

<p>I decided I had to do something. I had to have my tab bar on the bottom of the window at least. So, I went off and researched it.</p>

<p>After about 5 minutes I found out that the main interface to Firefox is controlled entirely by CSS. This is perfect. I located the CSS style sheet, googl&#8217;d some more and found the CSS variables needed to modify the interface settings. So now I am going to share it with everyone of you.</p>

<div class="postalert">
<p>Ubuntu Hardy Heron Version</p>
</div>

<p>Open up nautilus and show hidden files. then navigate to:</p>

<ol class="code">
<li class="t0">/home/.mozilla/firefox/your.profile/chrome</li>
</ol>

<p>By default userChrome.css fie does not exist, so you need to create it before you can start adding your preferences. There&#8217;s actually an example file that exists by default, called userChrome-example.css. You can just rename that file by removing the -example part. Then open this file in leaf/mouse pad or any other text editor and add the following code and save it.</ol>

<ol class="code">
<li class="t0">/* Display the tabbar at the bottom */
#content > tabbox { -moz-box-direction: reverse; }</li>
</ol>

<div class="postalert">
<p>Windows XP/Vista Versions</p>
</div>

<p>Open up My Computer or File Explorer and show hidden files. then navigate to:</p>

<ol class="code">
<li class="t0">C:\Documents andSettings\[UserName]\ApplicationData\Mozilla\Firefox\Profiles\your.proifile\chrome</li>
</ol>

<p>By default userChrome.css fie does not exist, so you need to create it before you can start adding your preferences. There&#8217;s actually an example file that exists by default, called userChrome-example.css. You can just rename that file by removing the -example part. Then open this file in notepad or any other text editor and add the following code and save it.</p>

<ol class="code">
<li class="t0">/* Display the tabbar at the bottom */
#content > tabbox { -moz-box-direction: reverse; }</li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://www.soddengecko.com/all/2008/customising-firefox-3/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP code to check server status</title>
		<link>http://www.soddengecko.com/code/2006/php-code-to-check-server-status</link>
		<comments>http://www.soddengecko.com/code/2006/php-code-to-check-server-status#comments</comments>
		<pubDate>Tue, 03 Oct 2006 11:36:22 +0000</pubDate>
		<dc:creator>Soddengecko</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.soddengecko.com/?p=129</guid>
		<description><![CDATA[Borntwisted came up with a wonderful idea to check that his free host was running without having to visit the a page or check the ftp. He wrote a short piece of HTML that would pull an image off his website, if the server failed to respond the ALT tage would display OFFLINE. I like [...]]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" href="http://www.borntwisted.com/">Borntwisted</a> came up with a wonderful idea to check that his free host was running without having to visit the a page or check the ftp.</p>

<p>He wrote a short piece of HTML that would pull an image off his website, if the server failed to respond the ALT tage would display OFFLINE.</p>

<p>I like to code things in php so I decided to take this a step further and not actually use any images, thus saving on bandwidth on my server everytime the page loads.</p>

<p>The full code is at the bottom of this post but I am going to break it down and try to explain how each section works.</p>

<p>First of all we need to connect to the server and check to see if a file exists. This file can be anything you like, I chose to use an image called online.gif.</p>

<p>I declared a variable call $url which holds the data needed to connect to the server. <a href="http://uk2.php.net/function.fopen" target="_blank">@fopen</a> is the php command to connect to the server and open the chosen file. The reason the @ symbol is used is to supress the error that will be returned when the file cannot be found.</p>

<p>Using "r" tells the command we want to open the file in read only mode.</p>

<div class="igBar"><span id="lphp-8"><a href="#" onclick="javascript:showCodeTxt('php-8'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">PHP:</span><br /><div id="php-8">
<div class="php"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$url</span> = @<a href="http://www.php.net/fopen"><span style="color:#000066;">fopen</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"http://path_to_server/online.gif"</span>, <span style="color:#FF0000;">"r"</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div></li></ol></div>
</div></div><br />

<p>Now we use a simple ifelse statment to output the correct part of the formula.
The first part of the formula as below asks if the condition is true (if file exists) and will output the command below it. </p>
<div class="igBar"><span id="lphp-9"><a href="#" onclick="javascript:showCodeTxt('php-9'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">PHP:</span><br /><div id="php-9">
<div class="php"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$url</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> </div></li></ol></div>
</div></div><br />


<p>Before the command is outputted we have to close the connection to the file for security purposes. <a href="http://uk.php.net/fclose" target="_blank">fclose</a> closes the connection to the server which is defined again by our variable $url.</p>
<div class="igBar"><span id="lphp-10"><a href="#" onclick="javascript:showCodeTxt('php-10'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">PHP:</span><br /><div id="php-10">
<div class="php"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/fclose"><span style="color:#000066;">fclose</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$url</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div></li></ol></div>
</div></div><br />

<p>Now we can output the following command if the file is found on the server. Basically this is the TRUE part of the conditional statement. We now ECHO a line of code to the browser which will be converted into HTML and displayed as what you will see. Do not worry about the div's and classes, that is just CSS styling for the page I have this code on.</p>
<div class="igBar"><span id="lphp-11"><a href="#" onclick="javascript:showCodeTxt('php-11'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">PHP:</span><br /><div id="php-11">
<div class="php"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"&lt;div class='holder'&gt;&lt;div class='name'&gt;SG Status:&lt;/div&gt; &lt;divclass='online'&gt;&lt;/div&gt;&lt;/div&gt;"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div></li></ol></div>
</div></div><br />

<p>The following code is the FALSE part of the staement, which is outputted if the above connection cannot find the file. It has similar styling to the above command but this time you will notice that the div class is set to "offline". This is so a different colour is displayed.</p>
<div class="igBar"><span id="lphp-12"><a href="#" onclick="javascript:showCodeTxt('php-12'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">PHP:</span><br /><div id="php-12">
<div class="php"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">else</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"&lt;div class='holder'&gt;&lt;div class='name'&gt;SG Status:&lt;/div&gt; &lt;div class='offline'&gt;&lt;/div&gt;&lt;/div&gt;"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div></li></ol></div>
</div></div><br />

<p>That's all there is to it. The code is simple and works well. If you use this code you may notice that when the file is removed by yourself the script doe snot update, this is simply because of the server it is on. Sometimes servers take a few minutes to update. </p>

<p>The code as a whole is listed below and I have also added the CSS that I have used. Modify to your needs.</p>

<div class="igBar"><span id="lphp-13"><a href="#" onclick="javascript:showCodeTxt('php-13'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">PHP:</span><br /><div id="php-13">
<div class="php"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?</span> </div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$url</span> = @<a href="http://www.php.net/fopen"><span style="color:#000066;">fopen</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"http://path_to_server/online.gif"</span>, <span style="color:#FF0000;">"r"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$url</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/fclose"><span style="color:#000066;">fclose</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$url</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"&lt;div class='holder'&gt;&lt;div class='name'&gt;SG Status:&lt;/div&gt; &lt;div class='online'&gt;&lt;/div&gt;&lt;/div&gt;"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#616100;">else</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"&lt;div class='holder'&gt;&lt;div class='name'&gt;SG Status:&lt;/div&gt; &lt;div class='offline'&gt;&lt;/div&gt;&lt;/div&gt;"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div></li></ol></div>
</div></div><br />


<div class="igBar"><span id="lcss-14"><a href="#" onclick="javascript:showCodeTxt('css-14'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">CSS:</span><br /><div id="css-14">
<div class="css"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">.holder<span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">width</span>:80px;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">margin-left</span>:5px;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">.name<span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">float</span>:<span style="color: #000000; font-weight: bold;">left</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">.online<span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">text-align</span>:<span style="color: #993333;">center</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">width</span>:8px;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">height</span>:8px;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">padding</span>:2px;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">background</span>:#75f475;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">float</span>:<span style="color: #000000; font-weight: bold;">right</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">border<span style="color: #3333ff;">:1px </span>solid #000;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">margin-bottom</span>:2px;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">.offline<span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">text-align</span>:<span style="color: #993333;">center</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">width</span>:8px;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">height</span>:8px;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">padding</span>:2px;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">background</span>:#ef2424;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">float</span>:<span style="color: #000000; font-weight: bold;">right</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">border<span style="color: #3333ff;">:1px </span>solid #000;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">margin-bottom</span>:2px;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div></li></ol></div>
</div></div><br />]]></content:encoded>
			<wfw:commentRss>http://www.soddengecko.com/code/2006/php-code-to-check-server-status/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic Menus for WordPress</title>
		<link>http://www.soddengecko.com/code/2006/dynamic-menus-for-wordpress</link>
		<comments>http://www.soddengecko.com/code/2006/dynamic-menus-for-wordpress#comments</comments>
		<pubDate>Wed, 26 Apr 2006 23:03:11 +0000</pubDate>
		<dc:creator>Soddengecko</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.soddengecko.com/?p=78</guid>
		<description><![CDATA[The standard WordPress navigation menu is limited in that it does not show sub menus. it will list every single page on your website in one long list in the navigation section. For larger sites this can become troublsome. Who wants 50 links running down the side of the page just for the content. It [...]]]></description>
			<content:encoded><![CDATA[<p>The standard WordPress navigation menu is limited in that it does not show sub menus. it will list every single page on your website in one long list in the navigation section.</p>

<p>For larger sites this can become troublsome. Who wants 50 links running down the side of the page just for the content. It can also be very confusing to site visitors. </p>

<p>I decided I needed a simple script to display the sub menu only when the parent page was clicked, - a working example of this is on the right hand side of this page - so I wrote a little script to do this, and in the spirit of open source, here is the <a href="http://www.soddengecko.com/?page_id=83">turorial </a>so that you can make it yourself.</p>]]></content:encoded>
			<wfw:commentRss>http://www.soddengecko.com/code/2006/dynamic-menus-for-wordpress/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Styling individual comments for WordPress</title>
		<link>http://www.soddengecko.com/code/2006/styling-individual-comments</link>
		<comments>http://www.soddengecko.com/code/2006/styling-individual-comments#comments</comments>
		<pubDate>Thu, 20 Apr 2006 02:02:36 +0000</pubDate>
		<dc:creator>Soddengecko</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.soddengecko.com/2006/04/20/styling-individual-comments/</guid>
		<description><![CDATA[I wanted a little script that would allow me to have specific styles for individual comments depending on the authour. I had a look around for WordPress plugins and other info, but could not find anything that actually worked. So I wrote my own little switch statment to sort it all out. PLAIN TEXTPHP: &#60;?php [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted a little script that would allow me to have specific styles for individual comments depending on the authour.</p>

<p>I had a look around for WordPress plugins and other info, but could not find anything that actually worked.</p>

<p>So I wrote my own little switch statment to sort it all out.</p>

<div class="igBar"><span id="lphp-21"><a href="#" onclick="javascript:showCodeTxt('php-21'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">PHP:</span><br /><div id="php-21">
<div class="php"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> </div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">switch</span> <span style="color:#006600; font-weight:bold;">&#40;</span>comment_author_email<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">case</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$comment</span>-&gt;<span style="color:#006600;">comment_author_email</span> == <span style="color:#FF0000;">'friend@friend.com'</span><span style="color:#006600; font-weight:bold;">&#41;</span>:</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#0000FF;">$style</span> = <span style="color:#FF0000;">'&lt;div class=&quot;friendcomment&quot;&gt;'</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#616100;">break</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#616100;">case</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$comment</span>-&gt;<span style="color:#006600;">comment_author_email</span> == <span style="color:#FF0000;">'you@you.com'</span><span style="color:#006600; font-weight:bold;">&#41;</span>:</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#0000FF;">$style</span> = <span style="color:#FF0000;">'&lt;div class=&quot;authorcomment&quot;&gt;'</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#616100;">break</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#000000; font-weight:bold;">default</span>:</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$style</span> = <span style="color:#FF0000;">'&lt;div class=&quot;defaultcomment&quot;&gt;'</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#616100;">break</span>;<span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#000000; font-weight:bold;">?&gt;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$style</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span> </div></li></ol></div>
</div></div><br />

<p>This involves modifying the comments.php file in your theme folder.</p>

<p>Find:</p>
<div class="igBar"><span id="lphp-22"><a href="#" onclick="javascript:showCodeTxt('php-22'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">PHP:</span><br /><div id="php-22">
<div class="php"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;cite&gt;&lt;?php comment_author_link<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> ?&gt;&lt;/cite&gt; </div></li></ol></div>
</div></div><br />

<p>And add this code above that line: Make sure you put the correct email addresses in.</p>
<div class="igBar"><span id="lphp-23"><a href="#" onclick="javascript:showCodeTxt('php-23'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">PHP:</span><br /><div id="php-23">
<div class="php"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> </div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">switch</span> <span style="color:#006600; font-weight:bold;">&#40;</span>comment_author_email<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">case</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$comment</span>-&gt;<span style="color:#006600;">comment_author_email</span> == <span style="color:#FF0000;">'friend@friend.com'</span><span style="color:#006600; font-weight:bold;">&#41;</span>:</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#0000FF;">$style</span> = <span style="color:#FF0000;">'&lt;div class=&quot;friendcomment&quot;&gt;'</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#616100;">break</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#616100;">case</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$comment</span>-&gt;<span style="color:#006600;">comment_author_email</span> == <span style="color:#FF0000;">'you@you.com'</span><span style="color:#006600; font-weight:bold;">&#41;</span>:</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#0000FF;">$style</span> = <span style="color:#FF0000;">'&lt;div class=&quot;authorcomment&quot;&gt;'</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#616100;">break</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#000000; font-weight:bold;">default</span>:</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$style</span> = <span style="color:#FF0000;">'&lt;div class=&quot;defaultcomment&quot;&gt;'</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#616100;">break</span>;<span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#000000; font-weight:bold;">?&gt;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$style</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span> </div></li></ol></div>
</div></div><br />

<p>Now find:</p>

<div class="igBar"><span id="lphp-24"><a href="#" onclick="javascript:showCodeTxt('php-24'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">PHP:</span><br /><div id="php-24">
<div class="php"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> comment_text<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#000000; font-weight:bold;">?&gt;</span> </div></li></ol></div>
</div></div><br />

<p>Add the following on the line below:</p>
<div class="igBar"><span id="lcss-25"><a href="#" onclick="javascript:showCodeTxt('css-25'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">CSS:</span><br /><div id="css-25">
<div class="css"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/div&gt; </div></li></ol></div>
</div></div><br />

<p>That's it for the comments.php file.
Now open your style sheet, usually called style.css and add the following rules to the end of your style sheet, modify to yoru own needs.</p>

<div class="igBar"><span id="lcss-26"><a href="#" onclick="javascript:showCodeTxt('css-26'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">CSS:</span><br /><div id="css-26">
<div class="css"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #6666ff;">.authorcomment </span><span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">background</span>: #ffffcc;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">padding</span>:10px;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">border<span style="color: #3333ff;">:2px </span>solid #000;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">color</span>:#333;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">min-<span style="color: #000000; font-weight: bold;">height</span>:90px;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #6666ff;">.friendcomment </span><span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">background</span>: #fff;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">padding</span>:10px;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">border<span style="color: #3333ff;">:2px </span>solid #000;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">color</span>:#333;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">min-<span style="color: #000000; font-weight: bold;">height</span>:90px;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #6666ff;">.defaultcomment </span><span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">background</span>: #eee;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">padding</span>:10px;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">border<span style="color: #3333ff;">:2px </span>solid #000;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">color</span>:#333;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">min-<span style="color: #000000; font-weight: bold;">height</span>:90px;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div></li></ol></div>
</div></div><br />

<p>Thats everything. Save and upload your files and see for yourself.</p>]]></content:encoded>
			<wfw:commentRss>http://www.soddengecko.com/code/2006/styling-individual-comments/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New WordPress Theme and Mod available</title>
		<link>http://www.soddengecko.com/code/2006/morning-theme</link>
		<comments>http://www.soddengecko.com/code/2006/morning-theme#comments</comments>
		<pubDate>Mon, 10 Apr 2006 17:01:15 +0000</pubDate>
		<dc:creator>Soddengecko</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Downloads]]></category>

		<guid isPermaLink="false">http://www.soddengecko.com/2006/04/10/morning-theme/</guid>
		<description><![CDATA[Morning Theme Quite aptly named, since it was very early in the morning that I created this WordPress has hundreds of themes out there for you to choose from. I know there to be at least 700 as I search through a huge list looking for something that would suit my needs. Each to there [...]]]></description>
			<content:encoded><![CDATA[<div class="thumbnail"><a href="http://soddengecko.com/miscellaneous/downloads/"><img class="middleimgr" src="http://soddengecko.com/images/screenshot_morning.png" alt="Morning Theme" /></a></div>

<h1>Morning Theme</h1>

<p>Quite aptly named, since it was very early in the morning that I created this <img src='http://www.soddengecko.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>

<p>WordPress has hundreds of themes out there for you to choose from. I know there to be at least 700 as I search through a huge list looking for something that would suit my needs.</p>

<p>Each to there own though, because I couldnt find one remotely close to what I wanted. So, after 2 hours I had my first layout up and running. Since then I have been tinkering with the style and finally made this. </p>

<p>It is by no means the last style I will create, but for now it is here to stay.</p>

<p>You can find this Theme in the downloads section under WordPress Themes and Mods. But, if your too lazy to click through to there, you can just click <a href="http://soddengecko.com/miscellaneous/downloads/">here</a></p>

<h1>Festive Images</h1>

<p>On that same page you will find the Festive Images mod. You can also see it running at the top of this site. Just wait till Easter. It allows you to have a certain image show up on a certain day. Ideal for having your Cristmas logo displayed over Cristmas, and you will not have to remember to upload it and edit the file.</p>

<p>Once you have added your dates to the script, and told it where to find each new image. just save it, upload it and your done.</p>

<p>Automation at its best.</p>]]></content:encoded>
			<wfw:commentRss>http://www.soddengecko.com/code/2006/morning-theme/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Good Shades, Bad Colours</title>
		<link>http://www.soddengecko.com/code/2006/good-shades-bad-colours</link>
		<comments>http://www.soddengecko.com/code/2006/good-shades-bad-colours#comments</comments>
		<pubDate>Wed, 05 Apr 2006 03:52:00 +0000</pubDate>
		<dc:creator>BornTwisted</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://www.soddengecko.com/2006/04/05/good-shades-bad-colours/</guid>
		<description><![CDATA[In a chat with SoddenGecko i thought up this method for changing a sites colours when you have the shades right, but not quite the right colours. I'm too lazy to type it into a colour tutorial at the moment so heres the pasted chat message: "if your thinking yea it blends well but i [...]]]></description>
			<content:encoded><![CDATA[<p>In a chat with SoddenGecko i thought up this method for changing a sites colours when you have the shades right, but not quite the right colours. I'm too lazy to type it into a colour tutorial at the moment so heres the pasted chat message:</p>

<p>"if your thinking yea it blends well but i didn't want a tan site, then take a screenshot, take that into photoshop, then open the hue and saturation window and change the colour till you like it, then sample the colours and replace them in css, voila"</p>]]></content:encoded>
			<wfw:commentRss>http://www.soddengecko.com/code/2006/good-shades-bad-colours/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
