<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>girlswhogeek.com</title>
	
	<link>http://girlswhogeek.com</link>
	<description>Girls Who Geek</description>
	<lastBuildDate>Fri, 09 Mar 2012 20:29:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/girlswhogeek" /><feedburner:info uri="girlswhogeek" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>girlswhogeek</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Creating a Custom WordPress Shortcode</title>
		<link>http://feedproxy.google.com/~r/girlswhogeek/~3/nWWCZjQVMUg/creating-custom-wordpress-shortcode</link>
		<comments>http://girlswhogeek.com/tutorials/2011/creating-custom-wordpress-shortcode#comments</comments>
		<pubDate>Wed, 23 Mar 2011 20:46:18 +0000</pubDate>
		<dc:creator>Jem</dc:creator>
				<category><![CDATA[3rd Party Scripts]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[shortcode]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://girlswhogeek.com/?p=154</guid>
		<description><![CDATA[Creating your own WordPress shortcodes is a nifty way to build dynamic elements into your website without relying on 3rd party developers or plugins. This tutorial offers a beginner&#8217;s guide to creating your first WordPress plugin which will be referenced &#8230; <a href="http://girlswhogeek.com/tutorials/2011/creating-custom-wordpress-shortcode">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Creating your own WordPress shortcodes is a nifty way to build dynamic elements into your website without relying on 3rd party developers or plugins. This tutorial offers a beginner&#8217;s guide to creating your first WordPress plugin which will be referenced by a custom shortcode. </p>
<p>In this example we&#8217;ll be creating a basic random quote generator plugin. This can just as easily be achieved through your themes <var>functions.php</var> but I prefer to be able to turn items on and off in WordPress without having to edit blocks of code. </p>
<h4>Creating the WordPress Plugin File</h4>
<p>If you&#8217;re familiar with WordPress plugins and have installed them before, you&#8217;ve probably seen folders chock full of complicated PHP classes. This is not necessary for a working plugin; something as simple as a quote generator only needs 1 file. Create your plugin file (in this example we&#8217;ll call it <var>gwg_quote.php</var>) and enter the following base info:</p>
<pre><code>&lt;?php
/*
	Plugin Name: gwg Random Quote Generator
	Plugin URI: http://girlswhogeek.com/?p=154
	Description: Basic custom WordPress plugin example: random quote generator
	Version: 1.0
	Author: Girls Who Geek
	Author URI: http://girlswhogeek.com
	License: GPL2

	Copyright 2011 GirlsWhoGeek  (email: jem@girlswhogeek.com)

	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License, version 2, as
	published by the Free Software Foundation.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/</code></pre>
<p>This is the required plugin info which will be used to populate the WordPress plugins page, and the license information. In this instance we&#8217;re using GPL2 because a) it&#8217;s what WordPress uses and b) I am a big fan of free code :)</p>
<h4>Creating the Plugin Function</h4>
<p>Although WordPress supports classes (and encourages their use to prevent naming clashes) it&#8217;s too big a subject for the scope of this plugin. Creating a basic PHP function is plenty sufficient. If you&#8217;re unfamiliar with the syntax for creating a function with PHP, or have never heard of scope before, I recommend reading <a href="http://jemturner.co.uk/php/beginners-guide-to-php-part-six/">PHP Beginner&#8217;s Guide Part Six</a> on my development blog (off site).</p>
<p>And so we add the barebones of the function underneath the previously entered licencing information:</p>
<pre><code>&lt;?php
/*
	[license info]
*/

function gwg_random_quote_generator() {

}</code></pre>
<p>I&#8217;ve used a descriptive name for the function to make it easier to find/modify later on, and prefixed the function with gwg_ to avoid naming clashes briefly mentioned earlier.</p>
<p>It&#8217;s worth noting at this point that if we wanted to create a WordPress shortcode via which we&#8217;d pass arguments, e.g. [foo id=#], we&#8217;d need to pass an array of attributes to the function. We don&#8217;t need this functionality, and as the shortcode will work without it, I&#8217;ve left it out for simplicity&#8217;s sake. Moving swiftly on&#8230;</p>
<p>Inside our new (currently empty) function we place the code which powers the functionality we wish to achieve when we use our shortcode; our random quote generator (you may recognise the code from an old tutorialtastic tutorial&#8230;)</p>
<pre><code>&lt;?php
/*
	[license info]
*/

function gwg_random_quote_generator() {
	// define our array
	$quotes = array();

	// populate with quotes
	$quotes[] = "A superior man is modest in his speech, but exceeds in his actions.";
	$quotes[] = "Do not impose on others what you yourself do not desire.";
	$quotes[] = "An ounce of practice is worth more than tons of preaching.";

	// generate a random number between 0 and the total count of $quotes minus 1
	// we minus 1 from the total quotes because array indices start at 0 rather than 1 by default
	$r = rand(0,count($quotes)-1);

	// return the quote in the array with an indices of $r - our random number
	return $quotes[$r];
}</code></pre>
<p>Now that we have the meat of the plugin in place, we can use the WordPress add_shortcode to specify our custom shortcode: <code>add_shortcode( 'randomquotes', 'gwg_random_quote_generator');</code> This enables us to use An ounce of practice is worth more than tons of preaching. in posts and pages, which WordPress will apply the gwg_random_quote_generator function too.</p>
<p>Altogether now:</p>
<pre><code>&lt;?php
/*
	Plugin Name: gwg Random Quote Generator
	Plugin URI: http://girlswhogeek.com/?p=154
	Description: Basic custom WordPress plugin example: random quote generator
	Version: 1.0
	Author: Girls Who Geek
	Author URI: http://girlswhogeek.com
	License: GPL2

	Copyright 2011 GirlsWhoGeek  (email: jem@girlswhogeek.com)

	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License, version 2, as
	published by the Free Software Foundation.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

function gwg_random_quote_generator() {
	// define our array
	$quotes = array();

	// populate with quotes
	$quotes[] = "A superior man is modest in his speech, but exceeds in his actions.";
	$quotes[] = "Do not impose on others what you yourself do not desire.";
	$quotes[] = "An ounce of practice is worth more than tons of preaching.";

	// generate a random number between 0 and the total count of $quotes minus 1
	// we minus 1 from the total quotes because array indices start at 0 rather than 1 by default
	$r = rand(0,count($quotes)-1);

	// return the quote in the array with an indices of $r - our random number
	return $quotes[$r];
}

add_shortcode( 'randomquotes', 'gwg_random_quote_generator');
?&gt;
</code></pre>
<p>Save to the <var>gwg_quote.php</var> file you created earlier and upload to /wp-content/plugins/. Once the plugin is enabled via your WordPress admin panel, test it out by popping &#91;randomquotes&#93; into a post or page, and Bob&#8217;s your uncle:</p>
<blockquote>Do not impose on others what you yourself do not desire.</blockquote>
<p> One basic WordPress plugin with shortcode.</p>
<img src="http://feeds.feedburner.com/~r/girlswhogeek/~4/nWWCZjQVMUg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://girlswhogeek.com/tutorials/2011/creating-custom-wordpress-shortcode/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://girlswhogeek.com/tutorials/2011/creating-custom-wordpress-shortcode</feedburner:origLink></item>
		<item>
		<title>Build a Blog – Tips and Tricks</title>
		<link>http://feedproxy.google.com/~r/girlswhogeek/~3/GUy87YsqPEg/tips-and-tricks</link>
		<comments>http://girlswhogeek.com/tutorials/2011/tips-and-tricks#comments</comments>
		<pubDate>Wed, 23 Mar 2011 18:58:04 +0000</pubDate>
		<dc:creator>Amelie</dc:creator>
				<category><![CDATA[Build A Blog]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://girlswhogeek.com/?p=141</guid>
		<description><![CDATA[A few tips and tricks shared by users on the old CodeGrrl forums over the years, to help you customise your blog. Includes archives by month, emoticons, bbcode, email notification and more. <a href="http://girlswhogeek.com/tutorials/2011/tips-and-tricks">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A few tips and tricks shared by users on the old CodeGrrl forums over the years, to help you customise your blog.</p>
<p>Jump to:</p>
<ul>
<li><a href="#month">Archives by month</a></li>
<li><a href="#spam">Spam protection</a></li>
<li><a href="#redirect">Remove redirection after editing a post</a></li>
<li><a href="#email">Comment notification emails</a></li>
<li><a href="#excerpt">Show an excerpt of a post with read more link</a></li>
<li><a href="#emoticons">Emoticons and BBCode</a></li>
</ul>
<p><strong>Please note: The Build-A-Blog series is an introduction to creating a simple blog script using PHP. These tutorials are meant to help you to learn PHP and MySQL and to use these to fetch and store data and display it on a web page. These tutorials should not be used ‘as is’ on a production website – especially if you are new to PHP and do not understand what you are doing. We would recommend that you try the B-A-B series on a safe, development environment – such as an offline installation of PHP and MySQL – so you can learn how everything works.</strong></p>
<p><strong>GWG and its staffers accept no responsibility for anything that may (or may not) happen to your site or server as a result of you using these tutorials – you do so AT YOUR OWN RISK.</strong></p>
<h2 id="month">Archive by month</h2>
<p>Change this part in your archive list page:</p>
<pre>$result = mysql_query("SELECT FROM_UNIXTIME(timestamp, '%Y') AS get_year, COUNT(*) AS entries FROM php_blog GROUP BY get_year");</pre>
<p>To this:</p>
<pre>$result = mysql_query("SELECT FROM_UNIXTIME(timestamp, '%M %Y') AS get_month, COUNT(*) AS entries FROM php_blog GROUP BY get_month ORDER BY timestamp ASC"); </pre>
<p>(Note: If you want your most recent entries first, change ASC to DESC in the query above)</p>
<p>Next, change this:</p>
<pre>while ($row = mysql_fetch_array($result)) {
    $get_year = $row['get_year'];
    $entries = $row['entries'];

    echo "&lt;a href=\"archives.php?year=" . $get_year . "\"&gt;Entries from " . $get_year . "&lt;/a&gt; (" . $entries . ")&lt;br /&gt;";
}</pre>
<p>To this:</p>
<pre>while ($row = mysql_fetch_array($result)) {
	$get_month = $row['get_month'];
	$entries = $row['entries'];
	echo "&lt;a href=\"archives.php?month=" . $get_month . "\"&gt;Entries from " . $get_month . "&lt;/a&gt; (" . $entries . ")&lt;br /&gt;";
}</pre>
<p>Then, in your archive display page, change this:</p>
<pre>$result = mysql_query("SELECT timestamp, id, title FROM php_blog WHERE FROM_UNIXTIME(timestamp, '%Y') = '$year' ORDER BY id DESC");</pre>
<p>To this:</p>
<pre>$result = mysql_query("SELECT timestamp, id, title FROM php_blog WHERE FROM_UNIXTIME(`timestamp`, '%M %Y') = '" . mysql_real_escape_string($month) . "' ORDER BY id DESC")</pre>
<p>And this:</p>
<pre>if (!isset($_GET['year'])) {
    die("Invalid year specified.");
}
else {
    $year = (int)$_GET['year'];
}</pre>
<p>To this:</p>
<pre>if (!isset($_GET['month'])) {
    die("Invalid month specified.");
}
else {
    $month = htmlentities(strip_tags($_GET['month']));
}</pre>
<p>Remember to change any other parts that say $year in your page to $month too.</p>
<h2 id="spam">Spam protection</h2>
<p><strong>Tip 1: Based on Jem&#8217;s original BellaBook spam protection.</strong></p>
<p>In your individual entries page, put this just after the comment box, but before the submit button:</p>
<pre>&lt;script type="text/javascript"&gt;
&lt;!--
document.write('&lt;input type="hidden" name="spamtest" id="spamtest" value="SPAMWORD" /&gt;');
//--&gt;
&lt;/script&gt;</pre>
<p>Change SPAMWORD to something random, no one will have to remember this so make it as complicated as you like.</p>
<p>Then, in process.php, find this part (should be right at the top):</p>
<pre>&lt;?php
if (isset($_POST['submit_comment'])) {</pre>
<p>Add this underneath:</p>
<pre>if (!isset($_POST['spamtest']) || $_POST['spamtest'] != "SPAMWORD") {
   exit("&lt;p&gt;JavaScript must be enabled to comment here due to spam restrictions in place.&lt;/p&gt;");
}</pre>
<p>Again, replace SPAMWORD with the word you used earlier.</p>
<p><strong>Tip 2: Simple maths problem</strong></p>
<p>Add a new field to your comments form with a sum of your choice, e.g. 1+2.</p>
<pre>1+2 = &lt;input type="text" size="5" name="sumtest" id="sumtest" /&gt;</pre>
<p>Then, in process.php, add this in the same place as for tip 1 (under the first two lines):</p>
<pre>if (!isset($_POST['sumtest']) || $_POST['sumtest'] != 3) {
    exit('&lt;p&gt;Sorry, the answer to the maths problem was not correct.&lt;/p&gt;');
}</pre>
<p>You can change the sum whenever you want, just remember to change the answer (in this case 3) in process.php.</p>
<p>Note that these are extremely simple spam prevention measures and spammers may learn to get around them eventually. You can use both tips together &#8211; it doesn&#8217;t matter which bit comes first in process.php as long as they are both there.</p>
<h2 id="redirect">Remove redirection after updating a post</h2>
<p>If you would like to go back to the edit page after saving an entry, instead of to the entry itself, try the following:</p>
<p>Find this line:</p>
<pre>header("Location: journal.php?id=" . $id);</pre>
<p>Change it to:</p>
<pre>header("Location: update.php?id=" . $id);</pre>
<p>Where update.php is the name of your update page. Note: the page will appear to have just refreshed when you save your entry, but it will have been saved (check the contents of your entry to make sure!).</p>
<h2 id="email">Comment notification emails</h2>
<p>Find this line in process.php:</p>
<pre>$result = mysql_query("INSERT INTO php_blog_comments (entry, timestamp, name, email, url, comment) VALUES ('$entry','$timestamp','$name','$email','$url','$comment')");</pre>
<p>Add this underneath:</p>
<pre>    $youraddress = "YOU@YOURSITE.COM";
    $emailsubject = "New comment on entry #" . $entry;
    $bodyemail = "A new comment was posted on entry #" . $entry . " of your blog. The comment was made by " . $name . " (" . $email . "; " . $url. ") on " . date('d.m.y \a\\t H:i',$timestamp) . " and their message was &quot;" . $comment . "&quot;.";
    $extra = "From: YOUR SITE NAME &lt;" . $youraddress . "&gt;\r\n" . "X-Mailer: PHP/" . phpversion();
    mail($youraddress, $emailsubject, $bodyemail, $extra);</pre>
<p>Change items in uppercase, such as the email address and YOUR SITE NAME. If you would like to change the date/time format, change this part:</p>
<pre>date('d.m.y \a\\t H:i',$timestamp)</pre>
<p>Change the letters in the first part (i.e. d.m.y \a\\t H:i &#8211; leave the rest as it is or it won&#8217;t work) using the guide on <a href="http://php.net/date" title="PHP Date reference">php.net</a>.</p>
<h2 id="excerpt">Show an excerpt of a post with read more link</h2>
<p>Open up the main page of your blog, find the following code:</p>
<pre>    $title = stripslashes($row['title']);
    $entry = stripslashes($row['entry']);
    $password = $row['password'];
    $id = $row['id'];</pre>
<p>And beneath that paste this code:</p>
<pre>if (strlen($entry) &gt; 90) {
    $entry = substr($entry, 0, 90);
    $entry = "$entry... &lt;br /&gt;&lt;br /&gt;&lt;a href=\"journal.php?id=" . $id . "\"&gt;read more&lt;/a&gt;";
}</pre>
<p>This is set to show an excerpt of 90 characters of the post. If you would like to show more (or less), just change 90 to another number.</p>
<h2 id="emoticons">Emoticons and BBCode</h2>
<p>Note: this is for comments only.</p>
<p>Find this part in journal.php:</p>
<pre>$sql = "SELECT * FROM php_blog_comments WHERE entry='$id' ORDER BY timestamp";
$result = mysql_query ($sql) or print ("Can't select comments from table php_blog_comments.&lt;br /&gt;" . $sql . "&lt;br /&gt;" . mysql_error());
while($row = mysql_fetch_array($result)) {
    $timestamp = date("l F d Y", $row['timestamp']);
</pre>
<p>Add this below:</p>
<pre>$bbcode = array('[b]', '[i]', '[u]', '[/b]', '[/i]', '[/u]');
$bbcode_replace = array('&lt;b&gt;', '&lt;i&gt;', '&lt;u&gt;', '&lt;/b&gt;', '&lt;/i&gt;', '&lt;/u&gt;');

$emoticons = array(":)", ":(", ":'(", ";)", ":P", ":o", ":D");
$emoticons_replace = array(
    '&lt;img src="smile.gif" alt=":)" /&gt;',
    '&lt;img src="sad.gif" alt=":(" /&gt;',
    '&lt;img src="cry.gif" alt=":\'(" /&gt;',
    '&lt;img src="wink.gif" alt=";)" /&gt;',
    '&lt;img src="tongue.gif" alt=":P" /&gt;',
    '&lt;img src="shocked.gif" alt=":o" /&gt;',
    '&lt;img src="happy.gif" alt=":D" /&gt;'
);
$formatted_comment = str_replace($bbcode, $bbcode_replace, stripslashes($row['comment']));
$formatted_comment = str_replace($emoticons, $emoticons_replace, $formatted_comment);</pre>
<p>Replace the parts in the <code>&lt;img src=""&gt;</code> parts with the correct URLs to your images (note you will need to have images already, we can&#8217;t provide these for you!). Feel free to add more emoticons, just add more options to the $emoticons part (before the &#8216;);&#8217; &#8211; make sure to separate each one by commas and and enclose them in quotes). Add its corresponding image in a new line to the $emoticons_replace part, before the &#8216;);&#8217; at the bottom. Each line should have a comma at the end EXCEPT the last line, and each line should be surrounded by quotes (I have used single quotes so as not to interfere with the double quotes used in the HTML). Same goes for the BBCode &#8211; feel free to add more items you want to allow, such as [code] or &#91;quote]. Remember to add the closing tags as well, or your comments page will look very messy!</p>
<p>Note: it is very important that you specify the images and replacement HTML code in the same order that you specified the image and bbcode codes, otherwise you will get the wrong image/HTML replacement in your comments!</p>
<p>When you have done that, find this part in journal.php:</p>
<pre>print("&lt;p&gt;" . stripslashes($row['comment']) . "&lt;/p&gt;");</pre>
<p>Change it to:</p>
<pre>print("&lt;p&gt;" . $formatted_comment . "&lt;/p&gt;");</pre>
<img src="http://feeds.feedburner.com/~r/girlswhogeek/~4/GUy87YsqPEg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://girlswhogeek.com/tutorials/2011/tips-and-tricks/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://girlswhogeek.com/tutorials/2011/tips-and-tricks</feedburner:origLink></item>
		<item>
		<title>Code Converter</title>
		<link>http://feedproxy.google.com/~r/girlswhogeek/~3/6Ir5trXz4RA/code-converter</link>
		<comments>http://girlswhogeek.com/tools/2010/code-converter#comments</comments>
		<pubDate>Sat, 17 Jul 2010 08:40:31 +0000</pubDate>
		<dc:creator>Jem</dc:creator>
				<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://girlswhogeek.com/?p=87</guid>
		<description><![CDATA[Enter your code below to convert it to &#8216;friendly&#8217; HTML entities, ready to display on web pages. Example: from &#60;head&#62; to &#38;lt;head&#38;gt;.]]></description>
			<content:encoded><![CDATA[<p>Enter your code below to convert it to &#8216;friendly&#8217; HTML entities, ready to display on web pages. Example: from &lt;head&gt; to &amp;lt;head&amp;gt;.</p>
<form action="http://girlswhogeek.com/tools/2010/code-converter#codeconverter" method="post" id="codeconverter">
<p><textarea id="code" name="code" style="width: 80%;"></textarea></p>
<input type="submit" id="submit" name="submit" value="Convert" />
</form>
<img src="http://feeds.feedburner.com/~r/girlswhogeek/~4/6Ir5trXz4RA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://girlswhogeek.com/tools/2010/code-converter/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://girlswhogeek.com/tools/2010/code-converter</feedburner:origLink></item>
		<item>
		<title>Writing Useful Error Pages</title>
		<link>http://feedproxy.google.com/~r/girlswhogeek/~3/9b2qq87vAFM/writing-useful-error-pages</link>
		<comments>http://girlswhogeek.com/articles/2010/writing-useful-error-pages#comments</comments>
		<pubDate>Sat, 29 May 2010 12:14:21 +0000</pubDate>
		<dc:creator>Jem</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[error-pages]]></category>
		<category><![CDATA[http]]></category>

		<guid isPermaLink="false">http://girlswhogeek.com/?p=51</guid>
		<description><![CDATA[You and I know what 404 means &#8212; page not found &#8212; but to your average Internet user it could be the number for your favourite dish on the local Chinese takeaway menu. 404, and its friends 403 and 500 &#8230; <a href="http://girlswhogeek.com/articles/2010/writing-useful-error-pages">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>You and I know what 404 means &#8212; page not found &#8212; but to your average Internet user it could be the number for your favourite dish on the local Chinese takeaway menu. 404, and its friends 403 and 500 are the three most common error pages that you&#8217;re likely to come across while browsing. Despite your best efforts, perhaps, this is likely to occur on your website and more often than you think. So why risk confusing your visitor? Let&#8217;s make those error pages more useful&#8230;</p>
<ul>
<li><strong>Ditch unnecessary page elements</strong><br />Error pages shouldn&#8217;t have your full layout/navigation system on them. It simply adds clutter and confusion. Make sure, though, that you link to your home page so that users can start again if necessary.</li>
<li><strong>Make it clear in plain English what&#8217;s wrong</strong><br />You can keep the number 404/403/500 in there somewhere for uber geek friends, but &#8220;page not found&#8221;/&#8221;server currently unavailable&#8221; (or something similar) needs to be big, bold and obvious.</li>
<li><strong>Accept responsibility and try to fix it</strong><br />There&#8217;s nothing more annoying than coming across an error page when you&#8217;re looking for something important. Don&#8217;t make out that it&#8217;s the fault of the visitor (even if sometimes it is) simply accept that the problem is yours and offer ways out: a site map, a search box, a list of recent/most popular articles and if all else fails, a quick way to get in touch so that if they&#8217;re really lost you can show them the way.</li>
<li><strong>Don&#8217;t rely on the visitor to notify you</strong><br />Keep on track of your error pages so that you can pre-empt complaints and fix problems as they happen by regularly checking your logs or setting up error pages to auto-notify you when they&#8217;re loaded (include the referrer in case it&#8217;s a broken link on your site causing problems). Your visitors are not responsible for your site maintenance.</li>
</ul>
<p>If you have the time and inclination, you might also like to pop a little image or joke on your error page just to lighten the mood. However you decide to play it, just <strong>don&#8217;t rely on the default error pages</strong>: they&#8217;re confusing, boring and not in the slightest bit helpful!</p>
<img src="http://feeds.feedburner.com/~r/girlswhogeek/~4/9b2qq87vAFM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://girlswhogeek.com/articles/2010/writing-useful-error-pages/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://girlswhogeek.com/articles/2010/writing-useful-error-pages</feedburner:origLink></item>
		<item>
		<title>Where can I find [..] script?</title>
		<link>http://feedproxy.google.com/~r/girlswhogeek/~3/xUn-8L-SmBs/where-can-i-find-script</link>
		<comments>http://girlswhogeek.com/faqs/2010/where-can-i-find-script#comments</comments>
		<pubDate>Thu, 07 Jan 2010 11:47:04 +0000</pubDate>
		<dc:creator>Jem</dc:creator>
				<category><![CDATA[FAQs]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://girlswhogeek.com/?p=49</guid>
		<description><![CDATA[If you&#8217;re looking for a particular script for your website, checkout our Which script? forum for recommendations.]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re looking for a particular script for your website, checkout our <a href="http://girlswhogeek.com/forums/forum/which-script">Which script? forum</a> for recommendations.</p>
<img src="http://feeds.feedburner.com/~r/girlswhogeek/~4/xUn-8L-SmBs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://girlswhogeek.com/faqs/2010/where-can-i-find-script/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://girlswhogeek.com/faqs/2010/where-can-i-find-script</feedburner:origLink></item>
		<item>
		<title>What’s my “absolute path”?</title>
		<link>http://feedproxy.google.com/~r/girlswhogeek/~3/MzmUiwahhc0/whats-my-absolute-path</link>
		<comments>http://girlswhogeek.com/faqs/2010/whats-my-absolute-path#comments</comments>
		<pubDate>Thu, 07 Jan 2010 11:04:42 +0000</pubDate>
		<dc:creator>Jem</dc:creator>
				<category><![CDATA[FAQs]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">http://girlswhogeek.com/?p=45</guid>
		<description><![CDATA[Create a .php page and paste in the following snippet: &#60;?php $path = pathinfo($_SERVER['SCRIPT_FILENAME']); echo $path['dirname']; ?&#62; Upload the page to your server to the folder you need the path for and view in your browser; the absolute path will &#8230; <a href="http://girlswhogeek.com/faqs/2010/whats-my-absolute-path">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Create a .php page and paste in the following snippet:</p>
<pre>&lt;?php
$path = pathinfo($_SERVER['SCRIPT_FILENAME']);
echo $path['dirname'];
?&gt;</pre>
<p>Upload the page to your server to the folder you need the path for and view in your browser; the absolute path will be shown.</p>
<img src="http://feeds.feedburner.com/~r/girlswhogeek/~4/MzmUiwahhc0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://girlswhogeek.com/faqs/2010/whats-my-absolute-path/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://girlswhogeek.com/faqs/2010/whats-my-absolute-path</feedburner:origLink></item>
	</channel>
</rss>

