<?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>Jon Moore</title>
	<atom:link href="http://www.jonmoore.co.uk/feed" rel="self" type="application/rss+xml" />
	<link>http://www.jonmoore.co.uk</link>
	<description>Tips &#039;n&#039; Snips</description>
	<lastBuildDate>Wed, 08 Feb 2012 14:43:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Drupal XML Sitemap Module Setup</title>
		<link>http://www.jonmoore.co.uk/uncategorized/drupal-xml-sitemap-module-setup</link>
		<comments>http://www.jonmoore.co.uk/uncategorized/drupal-xml-sitemap-module-setup#comments</comments>
		<pubDate>Wed, 08 Feb 2012 14:43:42 +0000</pubDate>
		<dc:creator>Jon Moore</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Content Type]]></category>
		<category><![CDATA[Content Types]]></category>
		<category><![CDATA[Cron]]></category>
		<category><![CDATA[Dropdown Menus]]></category>
		<category><![CDATA[Inclusion]]></category>
		<category><![CDATA[Lifetime]]></category>
		<category><![CDATA[Priority]]></category>
		<category><![CDATA[Search Engines]]></category>
		<category><![CDATA[Settings Tab]]></category>
		<category><![CDATA[Step 1]]></category>
		<category><![CDATA[Test Site]]></category>
		<category><![CDATA[Xml Sitemap]]></category>

		<guid isPermaLink="false">http://www.jonmoore.co.uk/uncategorized/drupal-xml-sitemap-module-setup</guid>
		<description><![CDATA[OK, I&#8217;ve managed to get to the bottom of it.. Here are the instructions which can be passed to Katherine or Dave to try. (I can&#8217;t remember the exact order...]]></description>
			<content:encoded><![CDATA[<p>OK, I&#8217;ve managed to get to the bottom of it.. Here are the instructions<br />
which can be passed to Katherine or Dave to try. (I can&#8217;t remember the exact<br />
order I did things).</p>
<p>Step 1 &#8211; Enable the module(s)<br />
.	Go to &#8216;admin/build/modules/list&#8217; and at the very bottom is the &#8216;XML<br />
Sitemap&#8217; module.<br />
.	Tick the first &#8216;XML Sitemap&#8217; and the &#8216;XML sitemap node&#8217; module.<br />
.	You might want to look at the &#8216;XML sitemap engines&#8217; module, as it<br />
submits to search engines, etc. I won&#8217;t turn it on here as it&#8217;s not what we<br />
want to do on the test site.<br />
.	Press &#8216;Save Configuration&#8217; at the bottom of the page.</p>
<p>Step 2 &#8211; Enable the &#8216;content types&#8217; we want the &#8216;XML sitemap node&#8217; module to<br />
pick-up. (this is the bit that was causing the problem).<br />
.	Go to &#8216;admin/content/types/list&#8217;<br />
.	You&#8217;ll need to decide &#8216;which&#8217; to activate, but for example, use<br />
&#8216;Tabbed Page&#8217;. Press the &#8216;edit&#8217; link.<br />
.	At the bottom of the next page you&#8217;ll see &#8216;XML sitemap&#8217; which opens<br />
up to show 2 dropdown menus.<br />
o	Inclusion &#8211; allows you to turn on/off<br />
o	Default priority &#8211; allows you to choose a level. You probably know<br />
more about the &#8216;correct&#8217; level than I do.<br />
.	Press &#8216;Save content type&#8217; to save.<br />
.	Do the same for all of the &#8216;content types&#8217; you want to be shown.</p>
<p>Step 3 &#8211; Sitemap Settings<br />
.	Go to &#8216;admin/settings/xmlsitemap&#8217;<br />
.	Under the settings set the &#8216;minimum sitemap lifetime&#8217; to 1 day as<br />
they recommend.<br />
.	Drop down &#8216;Content&#8217; and you&#8217;ll see a list of &#8216;content types&#8217; along<br />
with numbers to represent how many are &#8216;available&#8217;, &#8216;indexed&#8217;, and visible&#8217;.</p>
<p>.	If &#8216;indexed&#8217; and &#8216;visible&#8217; are at zero, you&#8217;ll need to run cron<br />
(which normally happens every hour), or use the &#8216;Rebuild links&#8217; tab to<br />
&#8216;Rebuild sitemap&#8217;.<br />
.	Check &#8216;Content&#8217; on the &#8216;Settings&#8217; tab again</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonmoore.co.uk/uncategorized/drupal-xml-sitemap-module-setup/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>youtube-z-index-embed-iframe-fix</title>
		<link>http://www.jonmoore.co.uk/uncategorized/youtube-z-index-embed-iframe-fix</link>
		<comments>http://www.jonmoore.co.uk/uncategorized/youtube-z-index-embed-iframe-fix#comments</comments>
		<pubDate>Wed, 25 Jan 2012 15:50:37 +0000</pubDate>
		<dc:creator>Jon Moore</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Iframe]]></category>
		<category><![CDATA[Youtube]]></category>

		<guid isPermaLink="false">http://www.jonmoore.co.uk/uncategorized/youtube-z-index-embed-iframe-fix</guid>
		<description><![CDATA[http://www.scorchsoft.com/news/youtube-z-index-embed-if= rame-fix]]></description>
			<content:encoded><![CDATA[<div class="3DWordSection1">
<p class="3DMsoNormal">http://www.scorchsoft.com/news/youtube-z-index-embed-if=<br />
rame-fix</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.jonmoore.co.uk/uncategorized/youtube-z-index-embed-iframe-fix/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>htaccess 301 Redirect Guide</title>
		<link>http://www.jonmoore.co.uk/html-and-css/htaccess-301-redirect-guide</link>
		<comments>http://www.jonmoore.co.uk/html-and-css/htaccess-301-redirect-guide#comments</comments>
		<pubDate>Fri, 16 Dec 2011 08:31:06 +0000</pubDate>
		<dc:creator>Jon Moore</dc:creator>
				<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[Handy Guide]]></category>
		<category><![CDATA[Htaccess Redirect]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://www.jonmoore.co.uk/?p=971</guid>
		<description><![CDATA[Handy guide from the team at Sitepoint&#8230; http://www.sitepoint.com/the-missing-guide-301-redirects-for-mac-and-pc/]]></description>
			<content:encoded><![CDATA[<p>Handy guide from the team at Sitepoint&#8230;</p>
<p><a href="http://www.sitepoint.com/the-missing-guide-301-redirects-for-mac-and-pc/">http://www.sitepoint.com/the-missing-guide-301-redirects-for-mac-and-pc/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonmoore.co.uk/html-and-css/htaccess-301-redirect-guide/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drupal 6 Set-up on Heart Internet</title>
		<link>http://www.jonmoore.co.uk/drupal/drupal-6-set-up-on-heart-internet</link>
		<comments>http://www.jonmoore.co.uk/drupal/drupal-6-set-up-on-heart-internet#comments</comments>
		<pubDate>Mon, 12 Dec 2011 18:42:24 +0000</pubDate>
		<dc:creator>Jon Moore</dc:creator>
				<category><![CDATA[Drupal]]></category>
		<category><![CDATA[Address Username]]></category>
		<category><![CDATA[Cgi Scripts]]></category>
		<category><![CDATA[Control]]></category>
		<category><![CDATA[Control Panel]]></category>
		<category><![CDATA[Default Folder]]></category>
		<category><![CDATA[Default Folders]]></category>
		<category><![CDATA[Dns Records]]></category>
		<category><![CDATA[Domain Name]]></category>
		<category><![CDATA[Dreamweaver Download]]></category>
		<category><![CDATA[Drupal Cms]]></category>
		<category><![CDATA[Heart]]></category>
		<category><![CDATA[Hosting Reseller]]></category>
		<category><![CDATA[Libraries]]></category>
		<category><![CDATA[Memory Allocation]]></category>
		<category><![CDATA[Memory Limit]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Reseller Account]]></category>
		<category><![CDATA[Server Name]]></category>
		<category><![CDATA[Using Dreamweaver]]></category>
		<category><![CDATA[White Pages]]></category>

		<guid isPermaLink="false">http://www.jonmoore.co.uk/?p=964</guid>
		<description><![CDATA[This is more for myself, but good if it helps someone else too&#8230;. This is a Drupal 6 (6.22) set-up on Heart Internet hosting (Reseller account). Once the hosting account...]]></description>
			<content:encoded><![CDATA[<p>This is more for myself, but good if it helps someone else too&#8230;.</p>
<p>This is a Drupal 6 (6.22) set-up on Heart Internet hosting (Reseller account).</p>
<ul>
<li>Once the hosting account has been set-up and the ‘install hour’ has passed, go to the ‘Manage Hosting Accounts’ page (https://customer.heartinternet.co.uk/manage/manage-packages.cgi) and select ‘Super User’ for the account you want to set-up.</li>
<li>From the ‘Control Panel Home’ page, select ‘Drupal CMS’ from the ‘CGI Scripts’ section near the bottom of the page.</li>
<li>Choose the location. Normally we’re installing at ‘root’ so leave the box blank. Press ‘Install Now’.</li>
<li>Once it has installed the scripts and database for you, you’ll notice 2 links near the bottom of the page. Both link to the domain name root (i.e. http://domainname.co.uk) however one will have the server name at the front (i.e. http://79.170.44.155/domainname.co.uk). If the first one works, use it, however if the domain name isn’t quite ready (DNS records) use the 2<sup>nd</sup>….</li>
<li>You are now at the beginning of ‘Drupals Installation Process’. Simply follow the instructions page by page adding in the Site Name, Your email address, Username and Password. Once done you’ll be at a familiar ‘welcome’ page…</li>
<li>Using Dreamweaver, download the ‘sites’ folder, which includes the ‘all’ and ‘default’ folders.</li>
<li>In the ‘default’ folder is the ‘settings.php’ file used to configure the database, etc. Open this file and locate the PHP settings, normally on lines  156 to 167.</li>
<li>Add a new line on the end to increase the memory allocation and to stop ‘white pages’ on heavy resource pages like ‘modules’ and ‘blocks’. So line 168 can become:<br />
‘<strong>ini_set(&#8216;memory_limit&#8217;,&#8217;516M&#8217;);</strong>’.<br />
Save and upload.</li>
<li>In the ‘all’ folder we need to add folders for the ‘modules’, ‘themes’, libraries’ plus our own ‘clereJquery’ folder. This is easiest done by copying the ‘all’ folder from another site already set up. It’s worth noting here that you don’t need to copy a theme already in the ‘theme’ folder unless you intend to use it… Like wise, you can copy a theme from another Drupal site into this folder if you want to use it. The ‘theme’ folder can contain as many themes as you want available, but it’s best to just copy the one you intend to use…</li>
<li>Upload your ‘new’ ‘all’ folder with your modules and themes.</li>
<li>Now you can go back to your browser and log into the site using the username and password you added a few steps ago…</li>
<li>Once in, we need to set a few basic thing up, so first we’ll start with ‘Modules’….</li>
<li>Go to ‘Administer &gt; Site Building &gt; Modules’ (or use this <strong>admin/build/modules</strong> for speed).</li>
<li>Preferably with another similar site open, tick the modules you are going to need, a suggestion is:
<ul>
<li>Administration
<ul>
<li>Administration Menu</li>
</ul>
</li>
<li>CCK
<ul>
<li>Content</li>
<li>Content Copy</li>
<li>Fieldgroup</li>
<li>Number</li>
<li>Text</li>
</ul>
</li>
<li>Core Optional
<ul>
<li>Aggregator</li>
<li>Contact</li>
<li>Database Logging</li>
<li>Help</li>
<li>Menu</li>
<li>Path</li>
<li>Taxonomy</li>
<li>Update Status</li>
<li>Upload</li>
</ul>
</li>
<li>Event
<ul>
<li>Event</li>
</ul>
</li>
<li>Image
<ul>
<li>Image</li>
<li>Image Attach</li>
<li>Image Gallery</li>
</ul>
</li>
<li>Mate Tags
<ul>
<li>Admin interface for Nodewords</li>
<li>Basic meta tags</li>
<li>Extra meta tags</li>
<li>Nodewords</li>
<li>Site verification meta tags</li>
</ul>
</li>
<li>Other
<ul>
<li>Clone modules</li>
<li>Global redirect</li>
<li>Googtube</li>
<li>IMCE</li>
<li>Lightbox 2</li>
<li>Path redirect</li>
<li>Pathauto</li>
<li>Sitemap</li>
<li>Token</li>
<li>Transliteration</li>
<li>Weather</li>
</ul>
</li>
<li>SEO Compliance Checker
<ul>
<li>Basic SEO Rules</li>
<li>Keyword Rules</li>
<li>SEO Compliance Checker</li>
</ul>
</li>
<li>User Interface
<ul>
<li>IMCE Wysiwyg API bridge</li>
<li>Wysiwyg</li>
</ul>
</li>
<li>Views
<ul>
<li>Views</li>
<li>Views Exporter</li>
<li>Views UI</li>
</ul>
</li>
</ul>
</li>
<li>Next we need to set the default time zone (<strong>admin/settings/date-time</strong>), to ‘Europe/London’, plus the date formats and the ‘First day of the week’.</li>
<li>Nodeword Meta tags can be set-up here: <strong>admin/content/nodewords</strong></li>
<li>The ‘Event’ content type needs to be created by going here: <strong>admin/content/node-type/event</strong></li>
<li>Set ‘Full HTML’ as the default Input Format here: <strong>admin/settings/filters/list</strong></li>
<li>Set WYSIWYG editior here: <strong>admin/settings/wysiwyg</strong> for ‘Full HTML’, then press ‘Edit’ to select the icons to use. Suggestions under ‘Buttons and plugins’:
<ul>
<li>Bold</li>
<li>Italic</li>
<li>Underline</li>
<li>Bullet list</li>
<li>Numbered list</li>
<li>Outdent</li>
<li>Indent</li>
<li>Undo</li>
<li>Redo</li>
<li>Link</li>
<li>Unlink</li>
<li>Image</li>
<li>Remove Format</li>
<li>HTML block format</li>
<li>Paste from Word</li>
<li>IMCE</li>
</ul>
</li>
<li>Set ‘Automated alias settings’, here: <strong>admin/build/path/pathauto</strong>. Drop ‘Node paths’ down and change:
<ul>
<li>the default from ‘content/[title-raw]’ to just ‘[title-raw]’</li>
<li>‘Event’ to ‘event/[eventyyyy]/[eventmon]/[eventdd]/[title-raw]’</li>
<li>‘image’ to ‘image/[title-raw]’</li>
</ul>
</li>
<li>Check for available updates here: <strong>admin/reports/updates</strong>. Download and install any updated modules, unzip, upload, etc.
<ul>
<li>Run ‘Updates’ to make sure the new modules are in sync with the database. (www.domain.co.uk/update.php?op=info)</li>
</ul>
</li>
<li>Check ‘Status Report’ (<strong>admin/reports/status</strong>) for any issues, run cron and check again.</li>
<li>Create a ‘Home’ page, then go to ‘Site Information (admin/settings/site-information) and change the setting ‘Default front page’ at the bottom from ‘node’ to ‘home’. Note: this is assuming you home page URL is ‘/home’…</li>
<li>Set up ‘Scheduled Tasks’ from the Heart Internet Control panel. It’s under ‘Web Tools’.
<ul>
<li>Under ‘Run this command’ paste: <strong>/usr/bin/php5 /home/sites/##########.co.uk/public_html/cron.php</strong></li>
<li><strong>C</strong>hange ‘<strong>##########</strong>’ for the domain name (no www.) and leave the other settings as they are.</li>
<li>Press ‘Update’ to save.</li>
<li>To test if it’s working, press ‘Test Command’, and you should get a message back ending with ‘Content-Type: text/html; charset=utf-8’.</li>
<li>Go back to Status Report, (admin/reports/status), and under ‘Cron maintenance tasks’ it should say ‘Last run’ and then how many minutes/seconds ago you pressed ‘Test Command’.</li>
</ul>
</li>
<li>Install a theme here: admin/build/themes, make sure that the only theme enabled is the one you uploaded to the ‘theme’ folder. Press ‘Save Configuration’. If everything has gone to plan, you should be looking at an empty site with your selected theme. If images are missing, it’ll just be the path in either the stylesheet, page.tpl.php or template.php files….</li>
<li>Reset Blocks (<strong>admin/build/block</strong>)  – Remove ‘Powered by Drupal’, ‘Navigation’ and ‘User Login’ from their regions by selecting ‘&lt;none&gt;’ from their dropdown lists and press ‘Save Blocks’.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.jonmoore.co.uk/drupal/drupal-6-set-up-on-heart-internet/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add new Region to Drupal Theme</title>
		<link>http://www.jonmoore.co.uk/drupal/add-new-region-to-drupal-theme</link>
		<comments>http://www.jonmoore.co.uk/drupal/add-new-region-to-drupal-theme#comments</comments>
		<pubDate>Thu, 08 Dec 2011 16:24:42 +0000</pubDate>
		<dc:creator>Jon Moore</dc:creator>
				<category><![CDATA[Drupal]]></category>
		<category><![CDATA[Banner]]></category>
		<category><![CDATA[Banner Width]]></category>
		<category><![CDATA[Div Id]]></category>
		<category><![CDATA[Footer]]></category>
		<category><![CDATA[Header Header]]></category>
		<category><![CDATA[Line 3]]></category>
		<category><![CDATA[Lowercase]]></category>
		<category><![CDATA[Lt]]></category>
		<category><![CDATA[Nbsp Nbsp Nbsp Nbsp Nbsp]]></category>
		<category><![CDATA[Prints]]></category>
		<category><![CDATA[Punctuation]]></category>
		<category><![CDATA[Regions]]></category>
		<category><![CDATA[Rsquo]]></category>
		<category><![CDATA[Style Sheet]]></category>
		<category><![CDATA[Stylesheet]]></category>
		<category><![CDATA[Tpl]]></category>

		<guid isPermaLink="false">http://www.jonmoore.co.uk/?p=953</guid>
		<description><![CDATA[There are loads of themes available, but you&#8217;ll rarely find one that&#8217;s exactly what you want (or what the client wants), straight out of the bag&#8230; So at some point...]]></description>
			<content:encoded><![CDATA[<p>There are loads of themes available, but you&#8217;ll rarely find one that&#8217;s exactly what you want (or what the client wants), straight out of the bag&#8230; So at some point you&#8217;ll need to add a region, and this is how.</p>
<p>In each &lsquo;theme&rsquo; you will have a .info file, a page.tpl.php file  and the style sheet. The .info file will start with the name of you theme, so themename.info for example.</p>
<p><strong>INFO</strong><br />
To add a new region called &lsquo;Banner&rsquo;, you open the .info file  and you should see a section like:</p>
<pre>
regions[sidebar_first] = sidebar first
regions[sidebar_last] = sidebar last
regions[header] = header
regions[nav] = nav
regions[content_top] = content top
regions[content] = content
regions[content_bottom] = content bottom
regions[footer] = footer</pre>
<p>To add our new region we just add it to the above like: <em>regions[banner] = Banner</em> <br />
    Note: the first &lsquo;banner&rsquo; is all lowercase, no spaces, and  the second &lsquo;Banner&rsquo; is for display, so can have spaces, etc, just be careful with punctuation.</p>
<p>Your new region will now show on the &lsquo;blocks&rsquo; page, and you can start assigning blocks to your new region. (Flush cache if it doesn&rsquo;t  show). However it won&rsquo;t appear on the website pages yet.</p>
<p><strong>PAGE TPL</strong><br />In the page.tpl.php page, find the area you want the new region to show and paste the following:</p>
<pre>
&lt;?php if($banner){ ?&gt;
    &lt;div id=&quot;banner&quot;&gt;
        &lt;?php print $banner; ?&gt;
    &lt;/div&gt;
&lt;?php } ?&gt;</pre>
<p>Note: The variable you used in <em>region[]</em> (banner) is also used here, but it has a <em>$</em> sign in front. i.e. <em>$banner</em>. The first line in the code above uses <em>if</em> to check that something has been put in the <em>banner</em> region, (i.e. a block),  and if it has, line 3 prints/writes it to the page as it&#8217;s being built. Lines 2 and 4 add the CSS div start/end with an <em>id</em> of <em>banner</em> so you can control it in the stylesheet by using <em>#banner</em>.</p>
<p><strong>STYLESHEET</strong><br />Add the following and amend it as you see fit:</p>
<pre>#banner  { 
    width: 960px; 
    height: 300px; 
    clear: both; 
    margin: 0; 
    padding: 0; 
    background: #f0f; 
    position: relative;
}</pre>
<p>See? Painless really&#8230; If something isn&#8217;t showing, remember to flush the cache so the system loads the .info and template files again.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonmoore.co.uk/drupal/add-new-region-to-drupal-theme/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert Database Date to Something More &#8216;User Friendly&#8217;</title>
		<link>http://www.jonmoore.co.uk/php/handy-functions/convert-database-date-to-something-more-user-friendly</link>
		<comments>http://www.jonmoore.co.uk/php/handy-functions/convert-database-date-to-something-more-user-friendly#comments</comments>
		<pubDate>Sat, 12 Nov 2011 20:06:38 +0000</pubDate>
		<dc:creator>Jon Moore</dc:creator>
				<category><![CDATA[Handy Functions]]></category>
		<category><![CDATA[Date Time]]></category>
		<category><![CDATA[Return Date]]></category>

		<guid isPermaLink="false">http://www.jonmoore.co.uk/?p=922</guid>
		<description><![CDATA[// // Convert database date to something more user friendly // function userFriendlyDbDate($date){ $time = strtotime($date); return date('d/m/Y H:i', $time); }]]></description>
			<content:encoded><![CDATA[<pre>//
//   Convert database date to something more user friendly
//
function userFriendlyDbDate($date){
   $time = strtotime($date);
   return date('d/m/Y H:i', $time);
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.jonmoore.co.uk/php/handy-functions/convert-database-date-to-something-more-user-friendly/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Email Validation</title>
		<link>http://www.jonmoore.co.uk/php/php-email-validation</link>
		<comments>http://www.jonmoore.co.uk/php/php-email-validation#comments</comments>
		<pubDate>Fri, 11 Nov 2011 11:45:59 +0000</pubDate>
		<dc:creator>Jon Moore</dc:creator>
				<category><![CDATA[Handy Functions]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[Domainname]]></category>
		<category><![CDATA[Email Addresses]]></category>
		<category><![CDATA[Email Validation]]></category>
		<category><![CDATA[Hostname]]></category>
		<category><![CDATA[Mark Jackson]]></category>
		<category><![CDATA[Match]]></category>
		<category><![CDATA[Php Email]]></category>
		<category><![CDATA[Valid Extension]]></category>
		<category><![CDATA[Validate Email]]></category>
		<category><![CDATA[Z0]]></category>

		<guid isPermaLink="false">http://www.jonmoore.co.uk/?p=880</guid>
		<description><![CDATA[Email validation is something that is needed in a variety of situations, but I&#8217;ve always struggled to find a good one&#8230;. Well, here are 2! The first is something I...]]></description>
			<content:encoded><![CDATA[<p>Email validation is something that is needed in a variety of situations, but I&#8217;ve always struggled to find a good one&#8230;. Well, here are 2!</p>
<p>The first is something I found online somewhere, and has been modified a little&#8230;</p>
<pre>$email = 'you@youremailaddress.com';

if(preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})+$/i", $email)) {
    // All OK, do something
}
else {
    // Not OK, throw error
}</pre>
<p>The second is from the legendary <a href="http://www.mjdigital.co.uk/blog/" target="_blank">Mark Jackson</a>, it requires PHP5 and in his words:</p>
<p><em>PHP actually has a built in function called filter_var which has an email validation flag in it but it will allow for any hostname (like mark@localhost) which I do not like so I have added another simple check to make sure it has a dot after the @ sign the function I use is:</em></p>
<pre>
function checkEmail($e,$bypassVal=false) {
    // ensure the email has a valid extension
    if(($bypassVal!==false)&#038;&#038;(is_array($bypassVal))&#038;&#038;(in_array($e,$bypassVal))) { return true; }
    if(strpos($e,'@')>=strrpos($e,'.')) { return false; }
    return (filter_var($e, FILTER_VALIDATE_EMAIL) &#038;&#038; preg_match('/@.+\./', $e)) ? true : false;
}
</pre>
<p><em>The $bypassVal variable allows you to specify any email addresses (in an array format) which can can go through without validation &#8211; just in case you want to specify a particular string or email which can get through.</em></p>
<p><em>Examples<br />
checkEmail(&#8216;mark@domainname.co.uk&#8217;); // returns true<br />
checkEmail(&#8216;mark@localhost&#8217;); // returns false<br />
checkEmail(&#8216;mark@localhost&#8217;,array(&#8216;mark@localhost&#8217;)); // returns true<br />
checkEmail(&#8216;__I_GET_THROUGH__&#8217;,array(&#8216;mark@localhost&#8217;,'__I_GET_THROUGH__&#8217;)); // returns true</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonmoore.co.uk/php/php-email-validation/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hide A Drupal Site From Public View</title>
		<link>http://www.jonmoore.co.uk/drupal/hide-a-drupal-site-from-public-view</link>
		<comments>http://www.jonmoore.co.uk/drupal/hide-a-drupal-site-from-public-view#comments</comments>
		<pubDate>Tue, 01 Nov 2011 09:23:43 +0000</pubDate>
		<dc:creator>Jon Moore</dc:creator>
				<category><![CDATA[Drupal]]></category>
		<category><![CDATA[Amp]]></category>
		<category><![CDATA[Com Dev]]></category>
		<category><![CDATA[Construction Text]]></category>
		<category><![CDATA[Content Type]]></category>
		<category><![CDATA[Doctype]]></category>
		<category><![CDATA[Doctype Html Public]]></category>
		<category><![CDATA[Echo]]></category>
		<category><![CDATA[Htaccess File]]></category>
		<category><![CDATA[Html Xmlns]]></category>
		<category><![CDATA[Iso 8859]]></category>
		<category><![CDATA[Lt]]></category>
		<category><![CDATA[Meta]]></category>
		<category><![CDATA[Nbsp Nbsp Nbsp Nbsp Nbsp]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Several Ways]]></category>
		<category><![CDATA[Site Php]]></category>
		<category><![CDATA[Something Simple]]></category>
		<category><![CDATA[Text Html]]></category>
		<category><![CDATA[Tpl]]></category>
		<category><![CDATA[Transitional Dtd]]></category>
		<category><![CDATA[W3c]]></category>

		<guid isPermaLink="false">http://www.jonmoore.co.uk/?p=857</guid>
		<description><![CDATA[There are several ways to do this, one would be using a list of allowed IP addresses in the .htaccess file&#8230;. But, if you want something simple, that can be...]]></description>
			<content:encoded><![CDATA[<p>There are several ways to do this, one would be using a list of allowed IP addresses in the .htaccess file&#8230;. But, if you want something simple, that can be accessed anywhere, by anyone you want to have access, then we can simply create a &#8216;dev&#8217; mode. To access the site, we just add &#8216;<em>?dev=1</em>&#8216; at the end of the url, i.e. &#8216;www.mydomain.com/?dev=1&#8242;.</p>
<p>Open the page.tpl.php file and add this code at the very top, so that the end <em>?></em> is followed immediately by the HTML declaration, i.e. <em>&lt;!DOCTYPE html PUBLIC</em> etc.</p>
<pre>&lt;?php
if(isset($_GET['dev']) &amp;&amp; $_GET['dev']==1){ $_SESSION['dev'] = true; }
if(isset($_GET['dev']) &amp;&amp; $_GET['dev']==0){ $_SESSION['dev'] = false; }

if(!isset($_SESSION['dev']) || $_SESSION['dev']!=true){
   echo '&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
   &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
   &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
      &lt;title&gt;Page Under Construction&lt;/title&gt;
   &lt;/head&gt;
   &lt;body&gt;
      &lt;p&gt;This site is under construction&lt;/p&gt;
   &lt;/body&gt;
   &lt;/html&gt;';
   exit();
}
?&gt;</pre>
<p>If you visit the site without setting anything, (or if you reset &#8216;dev mode&#8217; by using &#8216;<em>?dev=0</em>&#8216;), you&#8217;ll just get the &#8216;Under construction&#8217; text. This of course can be replaced with include files, etc&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonmoore.co.uk/drupal/hide-a-drupal-site-from-public-view/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Get Defined Vars</title>
		<link>http://www.jonmoore.co.uk/php/php-get-defined-vars</link>
		<comments>http://www.jonmoore.co.uk/php/php-get-defined-vars#comments</comments>
		<pubDate>Mon, 12 Sep 2011 09:12:02 +0000</pubDate>
		<dc:creator>Jon Moore</dc:creator>
				<category><![CDATA[Drupal]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Lt]]></category>
		<category><![CDATA[Variables]]></category>

		<guid isPermaLink="false">http://www.jonmoore.co.uk/uncategorized/php-get-defined-vars</guid>
		<description><![CDATA[Ever wanted to see the variables in a page? Warning!! It&#8217;ll show all of them&#8230;. &#60;?php print_r(get_defined_vars()); ?&#62;]]></description>
			<content:encoded><![CDATA[<p>Ever wanted to see the variables in a page? Warning!! It&#8217;ll show all of them&#8230;.</p>
<pre>&lt;?php
print_r(get_defined_vars());
?&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.jonmoore.co.uk/php/php-get-defined-vars/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FW: PHP Logout</title>
		<link>http://www.jonmoore.co.uk/php/fw-php-logout</link>
		<comments>http://www.jonmoore.co.uk/php/fw-php-logout#comments</comments>
		<pubDate>Fri, 09 Sep 2011 08:26:23 +0000</pubDate>
		<dc:creator>Jon Moore</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Add Url]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[Exit]]></category>
		<category><![CDATA[Header Location]]></category>
		<category><![CDATA[Index Php]]></category>
		<category><![CDATA[Index Server]]></category>
		<category><![CDATA[Logout]]></category>
		<category><![CDATA[Nbsp]]></category>
		<category><![CDATA[Php Self]]></category>
		<category><![CDATA[Php Server]]></category>
		<category><![CDATA[Php Session]]></category>
		<category><![CDATA[Server Php]]></category>
		<category><![CDATA[Session Name]]></category>
		<category><![CDATA[Session Variables]]></category>
		<category><![CDATA[Url Path]]></category>

		<guid isPermaLink="false">http://www.jonmoore.co.uk/?p=855</guid>
		<description><![CDATA[A good logout script is needed in most applications, and here&#8217;s the one I use. I have this script in a &#8216;config&#8217; file that I call at the beginning of...]]></description>
			<content:encoded><![CDATA[<p>A good logout script is needed in most applications, and here&#8217;s the one I use. I have this script in a &#8216;config&#8217; file that I call at the beginning of every file in the site, so you can logout from any page&#8230;</p>
<pre>
if(isset($_GET['logout'])){ // trigger if ?logout is in the url
	$_SESSION = array();
	if(isset($_COOKIE[session_name()])){
   		setcookie(session_name(), '', time()-42000, '/');
	}
	session_destroy();
	header ('location: /'); // redirect to root
	exit();
}
</pre>
<p>To trigger it, simply add &#8216;<em>?logout</em>&#8216; after a url path, i.e. <em>www.mydomain.com/?logout</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonmoore.co.uk/php/fw-php-logout/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

