<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-11972894-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();



I’m a web developer who works with HTML, PHP, CSS, ExpressionEngine, Javascript, jQuery, MySQL, SEO and UI/UX design. Always looking to learn new web related stuff, and a bit of a PC gamer.You can also find me on Twitter and LinkedIn, and I’ve got myself a blog.</description><title>meteoracle</title><generator>Tumblr (3.0; @meteoracle)</generator><link>http://meteoracle.tumblr.com/</link><item><title>Javascript back links and Firefox 3.6</title><description>&lt;p&gt;Whenever I needed to do a back link, I used to use this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;javascript:history.go(-1);&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;As I learned today, Firefox 3.6 doesn&amp;#8217;t like this. So instead, you can use this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;javascript:history.back();&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Hope that helps anyone who may have come across the same issue.&lt;/p&gt;</description><link>http://meteoracle.tumblr.com/post/34854655866</link><guid>http://meteoracle.tumblr.com/post/34854655866</guid><pubDate>Fri, 02 Nov 2012 22:01:00 +0000</pubDate></item><item><title>Generating a list of months for a select box</title><description>&lt;p&gt;I came across an issue in generating a list of months for a select input. This particular issue will crop up on the 29th, 30th and 31st of any month.&lt;/p&gt;
&lt;p class="p1"&gt;The code I was using is below:&lt;/p&gt;
&lt;p class="p1"&gt;&lt;code&gt;&lt;span class="s2"&gt;&amp;lt;&lt;/span&gt;&lt;span class="s3"&gt;select name&lt;/span&gt;&lt;span class="s2"&gt;=&lt;/span&gt;"fld_month" &lt;span class="s3"&gt;id&lt;/span&gt;&lt;span class="s2"&gt;=&lt;/span&gt;"fld_month"&lt;span class="s2"&gt;&amp;gt;&lt;br/&gt;&lt;/span&gt;  &amp;lt;?php&lt;span class="s4"&gt; &lt;/span&gt;&lt;span class="s5"&gt;for &lt;/span&gt;(&lt;span class="s6"&gt;$x&lt;/span&gt;&lt;span class="s5"&gt;=&lt;/span&gt;&lt;span class="s7"&gt;1&lt;/span&gt;;&lt;span class="s6"&gt;$x&lt;/span&gt;&lt;span class="s5"&gt;&amp;lt;=&lt;/span&gt;&lt;span class="s7"&gt;12&lt;/span&gt;;&lt;span class="s6"&gt;$x&lt;/span&gt;&lt;span class="s5"&gt;++&lt;/span&gt;){&lt;span class="s4"&gt; &lt;/span&gt;?&amp;gt;&lt;br/&gt;&lt;span class="s3"&gt;    &amp;lt;option value&lt;/span&gt;&lt;span class="s2"&gt;=&lt;/span&gt;&lt;span class="s8"&gt;"&lt;/span&gt;&amp;lt;?php&lt;span class="s4"&gt; &lt;/span&gt;&lt;span class="s9"&gt;echo &lt;/span&gt;&lt;span class="s6"&gt;$x&lt;/span&gt;;&lt;span class="s4"&gt; &lt;/span&gt;?&amp;gt;&lt;span class="s8"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;&amp;gt;&lt;/span&gt;&amp;lt;?php&lt;span class="s4"&gt; &lt;/span&gt;&lt;span class="s9"&gt;echo date&lt;/span&gt;(&lt;span class="s4"&gt; &lt;/span&gt;&lt;span class="s8"&gt;'M'&lt;/span&gt;, &lt;strong&gt;&lt;span class="s9"&gt;mktime&lt;/span&gt;(&lt;span class="s7"&gt;0&lt;/span&gt;, &lt;span class="s7"&gt;0&lt;/span&gt;, &lt;span class="s7"&gt;0&lt;/span&gt;, &lt;span class="s6"&gt;$x&lt;/span&gt;)&lt;/strong&gt; );&lt;span class="s4"&gt; &lt;/span&gt;?&amp;gt;&lt;span class="s2"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="s3"&gt;option&lt;/span&gt;&lt;span class="s2"&gt;&amp;gt;&lt;br/&gt;&lt;/span&gt;  &amp;lt;?php&lt;span class="s4"&gt; &lt;/span&gt;}&lt;span class="s4"&gt; &lt;/span&gt;?&amp;gt;&lt;br/&gt;&lt;span class="s2"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="s3"&gt;select&lt;/span&gt;&lt;span class="s2"&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;span class="s2"&gt;The mktime function highlighted in bold is the reason for the issue. For an example of the issue, I can use today. Today is the 30th January 2012. As I wasn&amp;#8217;t passing the current day to the mktime function, it was automatically assuming that it should use todays date.&lt;/span&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;span class="s2"&gt;Unfortunately, there is no 30th of February, so my select list looked like this:&lt;/span&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;em&gt;&lt;span class="s2"&gt;Jan&lt;br/&gt;Mar&lt;br/&gt;Mar&lt;br/&gt;Apr&lt;br/&gt;May &lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p class="p2"&gt;So in order to correct this (and the same issue that would occur on the 31st with any month with only 30 days), we updated the mktime function to use the first day of the month (see below).&lt;/p&gt;
&lt;p class="p2"&gt;&lt;code&gt;&lt;span class="s2"&gt;&amp;lt;&lt;/span&gt;&lt;span class="s3"&gt;select name&lt;/span&gt;&lt;span class="s2"&gt;=&lt;/span&gt;"fld_month" &lt;span class="s3"&gt;id&lt;/span&gt;&lt;span class="s2"&gt;=&lt;/span&gt;"fld_month"&lt;span class="s2"&gt;&amp;gt;&lt;br/&gt;&lt;/span&gt;  &amp;lt;?php&lt;span class="s4"&gt; &lt;/span&gt;&lt;span class="s5"&gt;for &lt;/span&gt;(&lt;span class="s6"&gt;$x&lt;/span&gt;&lt;span class="s5"&gt;=&lt;/span&gt;&lt;span class="s7"&gt;1&lt;/span&gt;;&lt;span class="s6"&gt;$x&lt;/span&gt;&lt;span class="s5"&gt;&amp;lt;=&lt;/span&gt;&lt;span class="s7"&gt;12&lt;/span&gt;;&lt;span class="s6"&gt;$x&lt;/span&gt;&lt;span class="s5"&gt;++&lt;/span&gt;){&lt;span class="s4"&gt; &lt;/span&gt;?&amp;gt;&lt;br/&gt;&lt;span class="s3"&gt;    &amp;lt;option value&lt;/span&gt;&lt;span class="s2"&gt;=&lt;/span&gt;&lt;span class="s8"&gt;"&lt;/span&gt;&amp;lt;?php&lt;span class="s4"&gt; &lt;/span&gt;&lt;span class="s9"&gt;echo &lt;/span&gt;&lt;span class="s6"&gt;$x&lt;/span&gt;;&lt;span class="s4"&gt; &lt;/span&gt;?&amp;gt;&lt;span class="s8"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;&amp;gt;&lt;/span&gt;&amp;lt;?php&lt;span class="s4"&gt; &lt;/span&gt;&lt;span class="s9"&gt;echo date&lt;/span&gt;(&lt;span class="s4"&gt; &lt;/span&gt;&lt;span class="s8"&gt;'M'&lt;/span&gt;, &lt;strong&gt;&lt;span class="s9"&gt;mktime&lt;/span&gt;(&lt;span class="s7"&gt;0&lt;/span&gt;, &lt;span class="s7"&gt;0&lt;/span&gt;, &lt;span class="s7"&gt;0&lt;/span&gt;, &lt;span class="s6"&gt;$x&lt;/span&gt;, &lt;span class="s7"&gt;1&lt;/span&gt;)&lt;/strong&gt; );&lt;span class="s4"&gt; &lt;/span&gt;?&amp;gt;&lt;span class="s2"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="s3"&gt;option&lt;/span&gt;&lt;span class="s2"&gt;&amp;gt;&lt;br/&gt;&lt;/span&gt;  &amp;lt;?php&lt;span class="s4"&gt; &lt;/span&gt;}&lt;span class="s4"&gt; &lt;/span&gt;?&amp;gt;&lt;br/&gt;&lt;span class="s2"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="s3"&gt;select&lt;/span&gt;&lt;span class="s2"&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p class="p2"&gt;Do you have a better way of generating a list of months, date of birth or general date selectors? Let me know&amp;#8230;&lt;/p&gt;</description><link>http://meteoracle.tumblr.com/post/16760348193</link><guid>http://meteoracle.tumblr.com/post/16760348193</guid><pubDate>Mon, 30 Jan 2012 14:41:07 +0000</pubDate><category>select</category><category>date of birth</category><category>dates</category><category>months</category></item><item><title>Create a custom 'tweet this' link including hashtags</title><description>&lt;p&gt;Want to create your own Tweet this button so it fits in with your design (or just doesn&amp;#8217;t look like the official button) AND you want to include a hashtag?&lt;/p&gt;
&lt;p&gt;Well, here&amp;#8217;s what you can do:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Create your link around text, an image or whatever else you can think of&lt;/li&gt;
&lt;li&gt;Point your href to &lt;a href="http://twitter.com/share"&gt;http://twitter.com/share&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Add some querystring variables to generate the tweet&lt;/li&gt;
&lt;li&gt;That&amp;#8217;s it!&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;So, the querystring variables I&amp;#8217;ve used (for a basic tweet including hashtags) are:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;url (this is needed in order to get someone to visit your site from the tweet)&lt;/li&gt;
&lt;li&gt;text (this is the body of the tweet)&lt;/li&gt;
&lt;li&gt;hashtags (a comma seperated list of hashtags placed at the end of the tweet)&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Here&amp;#8217;s the resulting link:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://twitter.com/share?url=http://yourdomain.com&amp;amp;text=This+is+where+your+tweets+goes...&amp;amp;hashtags=hash,tags,here"&gt;http://twitter.com/share?url=http://yourdomain.com&amp;amp;text=This+is+where+your+tweets+goes&amp;#8230;&amp;amp;hashtags=hash,tags,here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;There is also a list of the other variables you can use at &lt;a href="https://dev.twitter.com/discussions/512" title="Twitter Developers - Tweet Button" target="_blank"&gt;&lt;a href="https://dev.twitter.com/discussions/512"&gt;https://dev.twitter.com/discussions/512&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://meteoracle.tumblr.com/post/12878057379</link><guid>http://meteoracle.tumblr.com/post/12878057379</guid><pubDate>Wed, 16 Nov 2011 11:22:00 +0000</pubDate><category>tweet</category><category>hashtag</category><category>custom</category><category>sharing</category><category>twitter</category></item><item><title>Create a date ordinal with javascript</title><description>&lt;p&gt;Here&amp;#8217;s a little javacript function that will get the date ordinal (the bit after the date which can be st, nd, rd or th). It&amp;#8217;s by no means perfect, and there&amp;#8217; most likely a more efficient way of doing it, but thought it useful enough to share&lt;/p&gt;
&lt;pre&gt;function get_date_ordinal(num) {
  var end_num = num.charAt(num.length - 1);
  var start_num = num.charAt(0);
  var abbrev = 'th';
  if (end_num == '1' &amp;amp;&amp;amp; start_num != '1') abbrev = 'st';
  if (end_num == '2' &amp;amp;&amp;amp; start_num != '1') abbrev = 'nd';
  if (end_num == '3' &amp;amp;&amp;amp; start_num != '1') abbrev = 'rd';
  return num + abbrev;
}
&lt;/pre&gt;
&lt;p&gt;I knocked this together as I was pulling in a daily RSS feed, and wanted to present the date in a slightly different way to what was provided.&lt;/p&gt;</description><link>http://meteoracle.tumblr.com/post/11319470910</link><guid>http://meteoracle.tumblr.com/post/11319470910</guid><pubDate>Tue, 11 Oct 2011 17:32:38 +0100</pubDate><category>javascript</category><category>date</category><category>formatting</category><category>ordinal</category></item><item><title>Add a 'Clear Cache' shortcut to the Drupal 7 admin toolbar</title><description>&lt;p&gt;I don&amp;#8217;t know about you, but I just don&amp;#8217;t like waiting for different admin panels to load up just to get to the place where I can clear the cache so I can see the changes I just made.&lt;/p&gt;
&lt;p&gt;So, I&amp;#8217;ve added a shortcut to the Configuration &amp;gt; Performance area of the Drupal admin to my admin toolbar, and this is how I did it:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Click the &amp;#8216;Edit shortcuts&amp;#8217; link in the admin toolbar, then click &amp;#8216;Add shortcut&amp;#8217;.&lt;/li&gt;
&lt;li&gt;Enter &amp;#8216;Clear cache&amp;#8217; in the Name field (or copy and paste if you&amp;#8217;re like me)&lt;/li&gt;
&lt;li&gt;Enter &amp;#8216;admin/config/development/performance&amp;#8217; in the Path field&lt;/li&gt;
&lt;li&gt;Click &amp;#8216;Save&amp;#8217;&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;You may need to refresh, but now you have a direct shortcut to the Performance panel which you can jump to for that lovely &amp;#8216;Clear all caches&amp;#8217; button.&lt;/p&gt;</description><link>http://meteoracle.tumblr.com/post/9118614596</link><guid>http://meteoracle.tumblr.com/post/9118614596</guid><pubDate>Fri, 19 Aug 2011 11:46:27 +0100</pubDate><category>drupal</category><category>cache</category><category>shortcut</category></item><item><title>Fix for MAMP when MySQL is not starting</title><description>&lt;a href="http://twob.net/journal/fix-for-mamp-mysql/"&gt;Fix for MAMP when MySQL is not starting&lt;/a&gt;: &lt;p&gt;This just helped me out, so this is for those having the same problem, but mainly posted here so I have a reference of it!&lt;/p&gt;</description><link>http://meteoracle.tumblr.com/post/6975213749</link><guid>http://meteoracle.tumblr.com/post/6975213749</guid><pubDate>Mon, 27 Jun 2011 16:19:48 +0100</pubDate><category>mysql</category><category>mamp</category></item><item><title>Stop the iPad from auto-scaling your background image</title><description>&lt;p&gt;I was just in the midst of building a site with a rather large background that spills well outside of the 960 grid the site is built on (2000px of rather large to be exact).&lt;/p&gt;
&lt;p&gt;It looked great on the large monitors in the office with this bit of CSS displaying this huge background nicely:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; #sitebg {
  background-image: url(../img/sitebg.jpg);
  background-position: top center;
  background-repeat: no-repeat;
  left: 50%;
  margin-left: -1000px;
  min-height: 1200px;
  position: fixed;
  width: 2000px; } &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As the particular image I was working with had a central piece of text that a number of absolutely positioned divs relate to in positioning, the iPad pulled a lovely trick on me by automatically resizing the background image to fit the width of the screen.&lt;/p&gt;
&lt;p&gt;All of a sudden my absolutely positioned divs looked like they were all over the shop due to the resizing of the background image. After a bit of digging, it turns out you need to tell the iPad the specific size of the background like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;-webkit-background-size: 2000px 1200px;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Adding this to the CSS rule sorts the issue and everything displays at the correct size.&lt;/p&gt;
&lt;p&gt;\o/&lt;/p&gt;</description><link>http://meteoracle.tumblr.com/post/6863721861</link><guid>http://meteoracle.tumblr.com/post/6863721861</guid><pubDate>Fri, 24 Jun 2011 14:17:08 +0100</pubDate><category>ipad</category><category>css</category><category>background</category><category>image</category><category>resize</category><category>scale</category></item><item><title>Plan, Then Build.: Writer's Block</title><description>&lt;a href="http://planthenbuild.tumblr.com/post/831401683"&gt;Plan, Then Build.: Writer's Block&lt;/a&gt;: &lt;blockquote&gt;
&lt;p&gt;Its an awkward one this. We don’t like to admit it, but as developers or programmers sometimes we just pull a blank card.&lt;/p&gt;
&lt;p&gt;You can’t shift into gear. You can’t quite pick yourself up. You’re neurons are just not firing right.&lt;/p&gt;
&lt;p&gt;Other metaphors.&lt;/p&gt;
&lt;p&gt;You’re trying to, but its just not kicking off for…&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://meteoracle.tumblr.com/post/2941176080</link><guid>http://meteoracle.tumblr.com/post/2941176080</guid><pubDate>Wed, 26 Jan 2011 15:36:45 +0000</pubDate></item><item><title>Adding styles to the drop-down in Wygwam</title><description>&lt;p&gt;&lt;a title="Wygwam by Pixel &amp;amp; Tonic" target="_blank" href="http://pixelandtonic.com/wygwam"&gt;Wygwam by Pixel &amp;amp; Tonic&lt;/a&gt; is a WYSIWYG editor powered by CKEditor 3.4 and CKFinder 2.0.1 and is available as a module for &lt;a title="Expression Engine" target="_blank" href="http://expressionengine.com/"&gt;Expression Engine&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It makes it very easy to set up a custom WYSIWYG editor with the just options you want to make available to the website content administrators. It&amp;#8217;s dead simple. Until you want to change the styles available in the drop-down.&lt;/p&gt;
&lt;p&gt;It would be great if you had an easy way of editing the available styles directly from the Module configuration, but unfortunately we can&amp;#8217;t, so I had to hunt down the file which I eventually found here (I&amp;#8217;m using Expression Engine 2):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/themes/third_party/wygwam/lib/ckeditor/plugins/styles/styles/default.js&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This javascript file, hidden deep within the folder structure, contains the script we need to edit to get the styles we want to be easily available to the administrator whilst editing their content.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s a shortened version of what you&amp;#8217;ll find (I&amp;#8217;ve adjusted the formatting to make it easier to read):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;CKEDITOR.stylesSet.add('default',[&lt;br/&gt;  {name:'Purple Title',element:'h3',styles:{color:'Purple'}},&lt;br/&gt;  {name:'Red Title',element:'h3',styles:{color:'Red'}}&lt;br/&gt;]);&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As an example, I&amp;#8217;d like to add a style that will highlight a paragraph with a a light green background colour, my javascript would now look like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;CKEDITOR.stylesSet.add('default',[&lt;br/&gt;  {name:'Purple Title',element:'h3',styles:{color:'Purple'}},&lt;br/&gt;  {name:'Red Title',element:'h3',styles:{color:'Red'}},&lt;br/&gt;  {name:'Boxout Text',element:'p',styles:{'background-color':'#EAF5F4'}}}&lt;br/&gt;]);&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;At the moment, we&amp;#8217;re only adding a single style element to our intended target element. What is we want a whole bunch of style rules? Well, in that case we can do this (again I&amp;#8217;ve formatted this to be easily readable, the whole script should be kept to a single line):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;CKEDITOR.stylesSet.add('default',[&lt;br/&gt;  {name:'Purple Title',element:'h3',styles:{color:'Purple'}},&lt;br/&gt;  {name:'Red Title',element:'h3',styles:{color:'Red'}},&lt;br/&gt;  {name:'Boxout Text',element:'p',styles:{&lt;br/&gt;    'background-color':'#EAF5F4',&lt;br/&gt;    'border-left':'2px solid #08B1A2',&lt;br/&gt;    'color':'#08B1A2',&lt;br/&gt;    'font-style':'italic',&lt;br/&gt;    'margin':'0 auto 1em',&lt;br/&gt;    'padding':'1em'}}&lt;br/&gt;]);&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So there we go, we&amp;#8217;ve given the website content administrator the ability to style their content, without giving them enough rope to hang themselves with (by which I mean make the site look awful with different fonts, colouring and styles).&lt;/p&gt;</description><link>http://meteoracle.tumblr.com/post/1373694375</link><guid>http://meteoracle.tumblr.com/post/1373694375</guid><pubDate>Fri, 22 Oct 2010 15:54:41 +0100</pubDate><category>ee</category><category>expressionengine</category><category>eecms</category><category>wygwam</category></item><item><title>Formatting the email produced by the Expression Engine Email Module</title><description>&lt;p&gt;With my first attempt at producing a &amp;#8216;simple&amp;#8217; contact form I realised that the email sent by this module is very basic indeed. It reall only caters for a user to enter their name, email address, subject (which you may well have as a hidden field) and message.&lt;/p&gt;
&lt;p&gt;It just so turned out that the firtst site I&amp;#8217;ve attempted to use this module on is a corporate site, and they generally want the company name of whoever is using the contact form. So my contact form looked like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{exp:email:contact_form user_recipients="false" 
recipients="info@domain.com" charset="utf-8" form_id="contact"}
  &amp;lt;label for="name"&amp;gt;Your Name: &amp;lt;/label&amp;gt;
  &amp;lt;input type="text" name="name" id="name" value="" /&amp;gt;
  
  &amp;lt;label&amp;gt;Company Name: &amp;lt;/label&amp;gt;
  &amp;lt;input type="text" name="message[]" id="company" value="" /&amp;gt;
  
  &amp;lt;label for="from"&amp;gt;Email Address: &amp;lt;/label&amp;gt;
  &amp;lt;input type="text" name="from" id="from" value="" /&amp;gt;
  
  &amp;lt;label&amp;gt;Message: &amp;lt;/label&amp;gt;
  &amp;lt;textarea name="message[]" id="message"&amp;gt;&amp;lt;/textarea&amp;gt;
  
  &amp;lt;input type="hidden" name="subject" value="A message from your 
website." /&amp;gt;
  &amp;lt;input type="submit" value="Submit" class="form-submit" /&amp;gt;
{/exp:email:contact_form}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Unfortunately when the email is sent (in plain text of course), there&amp;#8217;s no formatting to tell what the info in the email is. For example, the body of the email from this form would look something like:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Widgets Ltd
I am writing you to find out more about your wonderful widgets. 
Please send me lots of widget based gubbins.&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So, in order to tidy the format up slightly I&amp;#8217;ve used the message field a few extra fields:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{exp:email:contact_form user_recipients="false" 
recipients="info@domain.com" charset="utf-8" form_id="contact"}
  &amp;lt;label for="name"&amp;gt;Your Name: &amp;lt;/label&amp;gt;
  &amp;lt;input type="text" name="name" id="name" value="" /&amp;gt;
  
  &amp;lt;label&amp;gt;Company Name: &amp;lt;/label&amp;gt;
  &amp;lt;input type="hidden" name="message[]" id="companytitle" 
value="Company:" /&amp;gt;
  &amp;lt;input type="text" name="message[]" id="company" value="" /&amp;gt;
  
  &amp;lt;label for="from"&amp;gt;Email Address: &amp;lt;/label&amp;gt;
  &amp;lt;input type="text" name="from" id="from" value="" /&amp;gt;
  
  &amp;lt;label&amp;gt;Message: &amp;lt;/label&amp;gt;
  &amp;lt;input type="hidden" name="message[]" id="messagespacer" value="" /&amp;gt;
  &amp;lt;input type="hidden" name="message[]" id="messagetitle" 
value="Message:" /&amp;gt;
  &amp;lt;textarea name="message[]" id="message"&amp;gt;&amp;lt;/textarea&amp;gt;
  
  &amp;lt;input type="hidden" name="subject" value="A message from your 
website." /&amp;gt;
  &amp;lt;input type="submit" value="Submit" class="form-submit" /&amp;gt;
{/exp:email:contact_form}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will now produce something along the lines of:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Company:
Widgets Ltd

Message:
I am writing you to find out more about your wonderful widgets. 
Please send me lots of 
widget based gubbins.&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Admittedly not the most beautiful email you&amp;#8217;ll ever get, but it&amp;#8217;s now much easier to understand what&amp;#8217;s been sent in the body of the email, and still only utilise the simple tags available in the Email Module.&lt;/p&gt;</description><link>http://meteoracle.tumblr.com/post/1179165664</link><guid>http://meteoracle.tumblr.com/post/1179165664</guid><pubDate>Fri, 24 Sep 2010 16:06:29 +0100</pubDate><category>expressionengine</category><category>ee</category><category>email</category><category>module</category><category>contact from</category></item><item><title>How To: Apply jQuery Masonry correctly when using images</title><description>&lt;p&gt;&lt;a title="jQuery Masonry" target="_blank" href="http://desandro.com/resources/jquery-masonry/"&gt;jQuery Masonry&lt;/a&gt;, by &lt;a title="David DeSandro" target="_blank" href="http://desandro.com/"&gt;David DeSandro&lt;/a&gt; is an excellent jQuery plugin to enhance the layout of a page.&lt;/p&gt;
&lt;p&gt;However, you may find that when using images in the content of the divs you are aligning with Masonry, you may get some overlapping where the script has lodaed before your images.&lt;/p&gt;
&lt;p&gt;In order to fire the Masonry script once your images have loaded on the page, use the following code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$(window).load(function() {
  $('#athediv').masonry({ columnWidth: 200 });
});
&lt;/code&gt;&lt;/pre&gt;</description><link>http://meteoracle.tumblr.com/post/745087672</link><guid>http://meteoracle.tumblr.com/post/745087672</guid><pubDate>Mon, 28 Jun 2010 10:16:00 +0100</pubDate><category>jquery</category><category>masonry</category><category>images</category></item><item><title>Why isn't my Expression Engine SAEF being displayed?</title><description>&lt;p&gt;Depending on who you want to see the SAEF (Stand Alone Entry Form), you&amp;#8217;ll need to assign the relevant weblog to their Member Group.&lt;/p&gt;
&lt;p&gt;In my case I have a form that a registered member can submit news to, but it&amp;#8217;s not displaying on the front end. In order to correct this, log in to the Expression Engine control panel and go to:&lt;/p&gt;
&lt;p&gt;Admin &amp;gt; Members and Groups &amp;gt; Member Groups &amp;gt; Edit Group &amp;gt; Weblog Assignment&lt;/p&gt;
&lt;p&gt;Here you&amp;#8217;ll have a list of all your weblogs and you can simply select &amp;#8216;Yes&amp;#8217; for the weblogs you wish to allow a member to add content to.&lt;/p&gt;
&lt;p&gt;Hey presto, your form is now visible on the front end and your users can add their content.&lt;/p&gt;</description><link>http://meteoracle.tumblr.com/post/636982415</link><guid>http://meteoracle.tumblr.com/post/636982415</guid><pubDate>Thu, 27 May 2010 08:44:29 +0100</pubDate><category>expressionengine</category><category>ee</category><category>saef</category><category>form</category><category>weblog</category></item><item><title>Change how often users can search in Expression Engine</title><description>&lt;p&gt;Some settings can be an absolute nightmare to find in the Expression Engine Control Panel, and the setting for how often a user can search your site is one of them.&lt;/p&gt;
&lt;p&gt;By default, these are the restrictions on the search priveleges for member groups:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Admins = No restriction&lt;/li&gt;
&lt;li&gt;Members = 10 seconds&lt;/li&gt;
&lt;li&gt;Guests = 15 seconds&lt;/li&gt;
&lt;li&gt;Pending = 15 seconds&lt;/li&gt;
&lt;li&gt;Banned = 60 seconds&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;In order to change these, you&amp;#8217;ll need to go to:&lt;/p&gt;
&lt;p&gt;Admin &amp;gt; Members and Groups &amp;gt; Member Groups &amp;gt; Edit Group &amp;gt; Search Privileges&lt;/p&gt;
&lt;p&gt;There you&amp;#8217;ll find &amp;#8216;&lt;span class="defaultBold"&gt;Number of seconds between searches&lt;/span&gt;&amp;#8217;. Change this and the selected user group will then be able to search however many times you want.&lt;/p&gt;
&lt;p&gt;Hopefully you can now avoid that awful grey box telling the user &amp;#8220;You are only allowed to search every 15 seconds&amp;#8221;.&lt;/p&gt;</description><link>http://meteoracle.tumblr.com/post/561068572</link><guid>http://meteoracle.tumblr.com/post/561068572</guid><pubDate>Fri, 30 Apr 2010 16:20:14 +0100</pubDate><category>ee</category><category>expressionengine</category><category>search</category><category>flood</category><category>privileges</category></item><item><title>Blog comments: The fuel of the design community fire?</title><description>&lt;p&gt;I&amp;#8217;m not much of an article writer, especially on opinions, although I did do one a while ago about my iPhone, and there are some rangom things on here. But the majority of stuff I post is intended as a record of things I&amp;#8217;ve learnde which may help me again in future, or hopefully benefit others who come across the same development issues. With that said, here I go anyway:&lt;/p&gt;
&lt;p&gt;I used my friend Google to search for &amp;#8216;&lt;a title="define:Weblog" target="_blank" href="http://www.google.co.uk/search?hl=en&amp;amp;client=firefox-a&amp;amp;hs=QNV&amp;amp;rls=org.mozilla:en-GB:official&amp;amp;defl=en&amp;amp;q=define:Weblog&amp;amp;ei=SO2-S975N4Lu0gTc6eGmCQ&amp;amp;sa=X&amp;amp;oi=glossary_definition&amp;amp;ct=title&amp;amp;ved=0CAkQkAE"&gt;define:Weblog&lt;/a&gt;&amp;#8217;. Here&amp;#8217;s a selection of the results:&lt;/p&gt;
&lt;blockquote&gt;A blog (a contraction of the term weblog) is a type of website, usually  maintained by an individual with regular entries of commentary &amp;#8230;&lt;/blockquote&gt;
&lt;blockquote&gt;A website in the form of an ongoing journal; a blog&lt;/blockquote&gt;
&lt;blockquote&gt;a website which contains posts or short dated entries in reverse  chronological order.&lt;/blockquote&gt;
&lt;p&gt;Not once is it mentioned that a blog is for other people to commment on. And I believe they shouldn&amp;#8217;t be. At least not directly.&lt;/p&gt;
&lt;p&gt;If you&amp;#8217;re writing a blog it&amp;#8217;s basically a journal, whatever the subject matter, just one that anyone with access to an internet connection can read. If it was your journal, offline, would you be letting people write their comments on it?&lt;/p&gt;
&lt;p&gt;If you want to discuss a topic of your chosing you&amp;#8217;d use a forum. The Google results for &amp;#8216;&lt;a title="defin:Forum" target="_blank" href="http://www.google.co.uk/search?hl=en&amp;amp;client=firefox-a&amp;amp;hs=ZNV&amp;amp;rls=org.mozilla%3Aen-GB%3Aofficial&amp;amp;q=define%3AForum&amp;amp;btnG=Search&amp;amp;meta="&gt;define:Forum&lt;/a&gt;&amp;#8217;?&lt;/p&gt;
&lt;blockquote&gt;a public meeting or assembly for open discussion&lt;/blockquote&gt;
&lt;blockquote&gt;A forum, or message board, is an online discussion site. It is the modern  equivalent of a traditional bulletin board, and a technological  evolution of the dialup bulletin board system.&lt;/blockquote&gt;
&lt;p&gt;If you want a good discussion on any matter, why not use a forum.&lt;/p&gt;
&lt;p&gt;If you don&amp;#8217;t want this so-called back-patting &amp;#8216;designer clique&amp;#8217;, disable comments on your blog. Sure it won&amp;#8217;t stop it totally, but at least you won&amp;#8217;t be encouraging it.&lt;/p&gt;
&lt;p&gt;People can pat backs all day long by sharing things via social media, just don&amp;#8217;t encourage it on your own site.&lt;/p&gt;
&lt;p&gt;If people want to comment about your article or article or piece of work, they can do it on their own blog and reference it. At least then they&amp;#8217;ll have to put some thought into a response. Which is exactly what you&amp;#8217;ll have to do with this one.&lt;/p&gt;</description><link>http://meteoracle.tumblr.com/post/507886242</link><guid>http://meteoracle.tumblr.com/post/507886242</guid><pubDate>Fri, 09 Apr 2010 10:26:35 +0100</pubDate><category>blog</category><category>design</category><category>community</category><category>clique</category><category>forum</category><category>opinion</category></item><item><title>A Non-Blog: Weirdness in Expression Engine. </title><description>&lt;a href="http://meredithmarsh.tumblr.com/post/472680382/weirdness-in-expression-engine"&gt;A Non-Blog: Weirdness in Expression Engine. &lt;/a&gt;: &lt;blockquote&gt;
&lt;p&gt;The text should say something like, “xx posts in xx categories have generated xx comments.”&lt;/p&gt;
&lt;p&gt;Including the post you’re reading, the weblog called blog (I know, right) has 5 posts, 6 categories, and 22 comments (mind you, this is all in experimental phase right now).&lt;/p&gt;
&lt;p&gt;My solution spits out 5…&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://meteoracle.tumblr.com/post/472694026</link><guid>http://meteoracle.tumblr.com/post/472694026</guid><pubDate>Thu, 25 Mar 2010 15:46:34 +0000</pubDate></item><item><title>Convert a Unix Timestamp using a MySQL Query</title><description>&lt;p&gt;Many, many times have I had to convert a MySQL timestamp (YYYY-MM-DD HH:MM:SS) into a more human readable format directly from a MySQL query. I&amp;#8217;ve always done this with &lt;a title="MySQL Date Format" target="_blank" href="http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-format"&gt;DATE_FORMAT&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Today, however, I needed to do something a little different. A Unix formatted timestamp held in the database needed to be converted to a human readable format.&lt;/p&gt;
&lt;p&gt;And this is the answer I came across, the rather useful &lt;a title="MySQL FROM_UNIXTIME" target="_blank" href="http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_from-unixtime"&gt;FROM_UNIXTIME&lt;/a&gt;.&lt;/p&gt;</description><link>http://meteoracle.tumblr.com/post/450093169</link><guid>http://meteoracle.tumblr.com/post/450093169</guid><pubDate>Mon, 15 Mar 2010 15:27:53 +0000</pubDate><category>mysql</category><category>timestamp</category><category>format</category><category>date</category><category>date_format</category><category>unix</category><category>database</category><category>convert</category></item><item><title>How To: Log member login activity in ExpressionEngine</title><description>&lt;p&gt;I was looking for a way to create a historical log of every member that logged into an ExpressionEngine site. I came across the &lt;a title="ExpressionEngine Statistics Module" target="_blank" href="http://expressionengine.com/docs/modules/statistics/index.html"&gt;Statistics module&lt;/a&gt; which I was hoping would do the job, but this module only worked to display statistics of users currently logged in to the site, very much akin to what you would see in the footer of a forum.&lt;/p&gt;
&lt;p&gt;What I needed to do in this case was to log a timestamp of when a member logged in to the site, and the members ID so that I can pull other data available on that member to generate reports at a later date.&lt;/p&gt;
&lt;p&gt;So, first of all I need a new database table to hold this data. It&amp;#8217;s very simple, and here&amp;#8217; the SQL I used to create it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;CREATE TABLE `UserLog` (

  `ID` mediumint(9) NOT NULL auto_increment,

  `MemberID` mediumint(9) NOT NULL,

  `LoginTimestamp` int(10) NOT NULL,

  PRIMARY KEY  (`ID`)

)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now that we have our database table, we need the code to fill it.&lt;/p&gt;
&lt;p&gt;The code below was added into the page which the user is redirected to once they have logged in. We need to make sure that this template has &amp;#8216;Allow PHP?&amp;#8217; is enabled and the &amp;#8216;PHP Parsing Stage&amp;#8217; is set to &amp;#8216;Output&amp;#8217; for this to work.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{exp:member:custom_profile_data}

  &amp;lt;?php

    if ({current_time} == {last_activity}){

      global $DB;

      $DB-&amp;gt;query('INSERT INTO UserLog (MemberID, LoginTimestamp)

        VALUES ({member_id}, {last_activity})');

    }

  ?&amp;gt;

{/exp:member:custom_profile_data}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There we go, you can copy and paste to your hearts content, but if you&amp;#8217;d like to know what&amp;#8217;s going on, and perhaps learn a little something, please read on.&lt;/p&gt;
&lt;p&gt;Firstly we need to get the {last_activity} timestamp from the member that is logging in. This is basically the most recent time the user has logged in to the site, so we employ the {exp:member:custom_profile_data} tag to let us grab it.&lt;/p&gt;
&lt;p&gt;Inside this tag we include our PHP. We compare the {last_activity} timestamp to the {current_time} timestamp. If they match, we know the user has just logged in, and that&amp;#8217;s when we want to add a record to our UserLog database table.&lt;/p&gt;
&lt;p&gt;We then use the ExpressionEngine database class to insert the {member_id} and {last_activity} timestamp into the table.&lt;/p&gt;
&lt;p&gt;So there we have it. You&amp;#8217;re now logging every member as they log in to your site. Once you&amp;#8217;ve got some data in there you can explore the possibilities of generating reports and statistics on this data. I&amp;#8217;ll be doing this myself soon, so I&amp;#8217;ll be sure to share my ideas on this.&lt;/p&gt;</description><link>http://meteoracle.tumblr.com/post/438853091</link><guid>http://meteoracle.tumblr.com/post/438853091</guid><pubDate>Wed, 10 Mar 2010 11:48:00 +0000</pubDate><category>expressionengine</category><category>ee</category><category>log</category><category>memger</category><category>activity</category><category>login</category><category>php</category><category>stats</category><category>statistics</category></item><item><title>ExpressionEngine Edit Menu Extension</title><description>&lt;a href="http://expressionengine.com/forums/viewthread/68277/"&gt;ExpressionEngine Edit Menu Extension&lt;/a&gt;: &lt;p&gt;Extremely useful extension for the ExpressionEngine Control Panel. It adds a drop-down menu to the Edit tab in the same mould as the Publish tab. This will save you a LOT of time when editing content.&lt;/p&gt;</description><link>http://meteoracle.tumblr.com/post/406728365</link><guid>http://meteoracle.tumblr.com/post/406728365</guid><pubDate>Tue, 23 Feb 2010 09:29:44 +0000</pubDate><category>expressionengine</category><category>ee</category><category>extension</category></item><item><title>What can Apple do to make me keep an iPhone?</title><description>&lt;p&gt;It was the best timing possible for me. My Orange contract was up in less than a month, and Apple go and sell their flagship mobile talkie device on a service provider other than O2. Rejoicing occured.&lt;/p&gt;
&lt;p&gt;Before jumping ship on my Nokia n95&amp;#160;8GB, I considered the drawbacks;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Poor camera in comparison. Ah, I don&amp;#8217;t use it that much anyway.&lt;/li&gt;
&lt;li&gt;Storage limited to iTunes. That 16GB iPhone may be twice the capacity, but I can&amp;#8217;t just wang any old files on it. I&amp;#8217;ll have to get a passport hard drive for that now.&lt;/li&gt;
&lt;li&gt;Applications aren&amp;#8217;t (neccessarily) free. You could stick pretty much any application on that Nokia. I could even play Secret of Monkey Island!&lt;/li&gt;
&lt;li&gt;Would the syncing and backup of calendars, emails and texts work as well?&lt;/li&gt;
&lt;li&gt;Battery life. I got ~5 days from the Nokia. The iPhone is a &lt;i&gt;lot &lt;/i&gt;less.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Then there were the advantages;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;All data included in tariff. Internet anywhere with a signal and nothing extra to pay? Brilliant.&lt;/li&gt;
&lt;li&gt;Great screen for watching TV and movies. Basically a bundled media player with the phone.&lt;/li&gt;
&lt;li&gt;Great design, and the touch screen interface. My 3 year old boy can use it to play games on. The interface is so intuitive that he learnt to swipe to a new screen without even being shown.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;So after a good few months of use, the things I&amp;#8217;ve realised my next iPhone needs, if I&amp;#8217;m going to get one, are;&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;I use the camera a lot more than I thought. It needs to be better. A &lt;i&gt;lot&lt;/i&gt; better.&lt;/li&gt;
&lt;li&gt;I don&amp;#8217;t mind charging it everyday during the week on my PC, but weekends I can struggle. Longer battery life please. 2 days instead of 1 is all I&amp;#8217;m asking.&lt;/li&gt;
&lt;li&gt;Oh, and a louder speakerphone would be nice.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;That&amp;#8217;s it. Nothing outrageous. These are all hardware based, for lack of a better word, requests. So, if Apple can do just these 3 things, I may well get the next generation iPhone. Let&amp;#8217;s see what they can do.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Disclaimer&lt;/b&gt;&lt;br/&gt;This statement will not prevent me from changing my mind in the future if something better comes along. This is a completely personal opinion on the way I use my phone on a daily basis, and what I&amp;#8217;m looking for from a mobile phone.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m fully aware other people have different requirements from their mobiel phone. They should always choose a phone on their own needs and weigh the pros and cons.&lt;/p&gt;
&lt;p&gt;Unless they&amp;#8217;re a blindly obedient fanboy.&lt;/p&gt;</description><link>http://meteoracle.tumblr.com/post/381710825</link><guid>http://meteoracle.tumblr.com/post/381710825</guid><pubDate>Wed, 10 Feb 2010 12:14:37 +0000</pubDate><category>apple</category><category>iphone</category><category>mobile</category><category>phone</category><category>upgrade</category></item><item><title>How to: Allow duplicate screen names in ExpressionEngine</title><description>&lt;p&gt;I&amp;#8217;ve been working on a site which users must register to gain access. I&amp;#8217;ve removed the need for a user to create a unique username by using their email address for their username. This also removes the need for the email field on the registration form.&lt;/p&gt;
&lt;p&gt;However, the screen name, which I&amp;#8217;m currently using to welcome the user to the site in a personal fashion, has to also be unique. Luckily the verification for unique screen names can be removed, so John Smith doesn&amp;#8217;t have to call himself JSmith79 just to be able to register.&lt;/p&gt;
&lt;p&gt;In order to remove the validation you&amp;#8217;ll need to:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Go into /system/core/&lt;/li&gt;
&lt;li&gt;Open core.validate.php&lt;/li&gt;
&lt;li&gt;Find &amp;#8220;Is screen name taken?&amp;#8221;&lt;/li&gt;
&lt;li&gt;Comment out the &lt;em&gt;if &lt;/em&gt;statement below there&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;The resulting code should look like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/** --------------------------------

/**  Is screen name taken?

/** --------------------------------

if (strtolower($this-&amp;gt;cur_screen_name) !=
strtolower($this-&amp;gt;screen_name))

{

  $query = $DB-&amp;gt;query("SELECT COUNT(*) AS count FROM exp_members

  WHERE screen_name = '".$DB-&amp;gt;escape_str($this-&amp;gt;screen_name)."'");

  if ($query-&amp;gt;row['count'] &amp;gt; 0)&lt;br/&gt;  {

    $this-&amp;gt;errors[] = $LANG-&amp;gt;line('screen_name_taken');

  }

}*/&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;br/&gt;And that&amp;#8217;s it, users will now be able to choose whatever screen name they want, without the worry of duplicating that of another user.&lt;/p&gt;</description><link>http://meteoracle.tumblr.com/post/379695089</link><guid>http://meteoracle.tumblr.com/post/379695089</guid><pubDate>Tue, 09 Feb 2010 09:07:00 +0000</pubDate><category>expressionengine</category><category>ee</category><category>screen_name</category><category>duplicate</category><category>unique</category></item></channel></rss>
