<?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"
	>

<channel>
	<title>Short Like A Fox</title>
	<atom:link href="http://shortlikeafox.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://shortlikeafox.com</link>
	<description>They Say I'm Short...</description>
	<pubDate>Fri, 19 Sep 2008 22:30:56 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<item>
		<title>How to Send Out a Mass Email Using PHP</title>
		<link>http://shortlikeafox.com/2008/09/19/how-to-send-out-a-mass-email-using-php/</link>
		<comments>http://shortlikeafox.com/2008/09/19/how-to-send-out-a-mass-email-using-php/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 22:30:56 +0000</pubDate>
		<dc:creator>ShortLikeAFox</dc:creator>
		
		<category><![CDATA[php]]></category>

		<category><![CDATA[database]]></category>

		<category><![CDATA[mail()]]></category>

		<guid isPermaLink="false">http://shortlikeafox.com/?p=93</guid>
		<description><![CDATA[So you want to send out a mass email or you want to create a program that can quickly be changed to send out multiple mass emails. PHP makes this easy. In this example I will assume that you have a list of email addresses you want to send a certain email to. I will [...]]]></description>
			<content:encoded><![CDATA[<p>So you want to send out a mass email or you want to create a program that can quickly be changed to send out multiple mass emails. PHP makes this easy. In this example I will assume that you have a list of email addresses you want to send a certain email to. I will also assume that you are keeping this list in a database, but this code could easily be adjusted to use either a hardcoded email address list or list from another source.</p>
<p class="style1">&lt;?php</p>
<p class="style1">&nbsp;	</p>
<blockquote>
<p> <span class="style9">//First connect to the database that contains the email address information.</span> <br />
    $user = <span class="style1">&quot;USER&quot;</span>;<br />
    $host = <span class="style1">&quot;HOST&quot;</span>;<br />
    $password = <span class="style1">&quot;PASSWORD&quot;</span>;<br />
    $database = <span class="style1">&quot;DATABASE&quot;</span>;</p>
<p>    $cxn = <span class="style3">mysql_connect</span>($host, $user, $password) or <span class="style3">die</span> (<span class="style1">&quot;Couldn&#8217;t connect to server&quot;</span>);<br />
    <span class="style3">mysql_select_db</span>($database);</p>
<p> <span class="style9">//Query the table that contains the email addresses. Fill in your own table name here&#8230;</span> <br />
    $query = <span class="style1">&quot;SELECT * FROM theEmailAddresses &quot;</span>; <br />
    $result = <span class="style3">mysql_query</span>($query, $cxn) or <span class="style3">die</span> (<span class="style3">mysql_error</span>($cxn));<br />
    $nrows = <span class="style3">mysql_num_rows</span>($result);
  </p>
<p> <span class="style9">//Who the sender will be identified as. You can put what you want here, but it really isn&#8217;t too ethical to place an email address that you don&#8217;t control here.</span> <br />
    $from = <span class="style1">&quot;From: me@mydomain.com&quot;</span>;<br />
    <span class="style9">//A standard email subject line</span> <br />
    $subject = <span class="style1">&quot;What&#8217;s new at mydomain.com &quot;</span>;<br />
    <span class="style9">//The message</span><br />
$message = <span class="style1">&quot;Hi valued friend,</span></p>
<p><span class="style1">We now sell cookies at mydomain.com. Be sure to check it out!<br />
    Sincerely,<br />
    me&quot;</span>;</p>
<p>    <span class="style9">//We&#8217;ve already queried all of the email address. Now we just need to send the email <br />
      </span> <span class="style4">for</span> ($i <span class="style3">=</span> <span class="style1">0</span>; $i <span class="style3">&lt;</span>$nrows; $i<span class="style3">++</span>){</p>
<blockquote>
<p>$row = <span class="style3">mysql_fetch_assoc</span>($result);<br />
      <span class="style3">extract</span>($row);<br />
      <span class="style9">//Replace $email with whatever the column of email addresses is called <br />
      </span>$to = <span class="style1">&quot;$email&quot;</span>;<br />
      <span class="style9">//Send the email to each email in the database</span> <br />
    if(<span class="style3">mail</span>($to, $subject, $message, $from)){</p>
<blockquote>
<p><span class="style9">//Print the name of emails that were successfully sent. I use this just to make sure that the program hasn&#8217;t frozen. In theory their should be a steady stream of names being printed&gt;</span></p>
<p><span class="style3">echo</span>(<span class="style1">&quot;$to&lt;br/&gt;&quot;</span>); </p>
</blockquote>
<p>}</p>
</blockquote>
<p> }</p>
</blockquote>
<p><span class="style9"><br /> <br />
  </span><br />
<span class="style1">?&gt;</span></p>
<p>This bit of code takes advantage of the php <a href="http://us3.php.net/function.mail" target="_blank">mail()</a> function. This is a very powerful and easy to use function. Remember that with great power comes great responsibility. Try not to use this function for evil. </p>
]]></content:encoded>
			<wfw:commentRss>http://shortlikeafox.com/2008/09/19/how-to-send-out-a-mass-email-using-php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to Tell Where Your Visitors are Geographically Using PHP</title>
		<link>http://shortlikeafox.com/2008/09/13/how-to-tell-where-your-visitors-are-geographically-using-php/</link>
		<comments>http://shortlikeafox.com/2008/09/13/how-to-tell-where-your-visitors-are-geographically-using-php/#comments</comments>
		<pubDate>Sat, 13 Sep 2008 18:52:12 +0000</pubDate>
		<dc:creator>ShortLikeAFox</dc:creator>
		
		<category><![CDATA[PEAR]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[Net_Geo]]></category>

		<guid isPermaLink="false">http://shortlikeafox.com/?p=90</guid>
		<description><![CDATA[If you have a website and want to tell where your users are coming from geographically PHP and PEAR make this possible. To turn a guest&#8217;s IP into a physical location the first thing you are going to need to do is make sure that you have the Net_Geo PEAR module. If you don&#8217;t have [...]]]></description>
			<content:encoded><![CDATA[<p>If you have a website and want to tell where your users are coming from geographically PHP and PEAR make this possible. To turn a guest&#8217;s IP into a physical location the first thing you are going to need to do is make sure that you have the Net_Geo PEAR module. If you don&#8217;t have the Net_Geo PEAR module, you are going to have to use the PEAR Package Manager to acquire it. </p>
<p>If you don&#8217;t think that you have access to PEAR because of your hosting package, <a href="http://abbyandwin.net/blog/2008/06/16/installing-pear-on-godaddy-shared-accounts/" target="_blank">check out this explanation</a> on how to install PEAR on an account that doesn&#8217;t allow access by default. It is written with GoDaddy shared accounts in mind, but should work for most hosting packages that don&#8217;t come with PEAR set up.</p>
<p>After you have Net_Geo package installed, it only takes a few lines of code to acquire geographical data:</p>
<blockquote>
<p class="style1">&lt;?php</p>
<p><span class="style4">require_once</span>(<span class="style1">&quot;Net/Geo.php&quot;</span>);<br />
    $ip = <span class="style3">$_SERVER</span>[<span class="style1">'REMOTE_ADDR'</span>];<br />
    //$ip = <span class="style1">&quot;64.246.30.37&quot;</span>;<br />
    $firstNetGeo = <span class="style4">new</span> Net_Geo();<br />
    $geoData = $firstNetGeo-&gt;getRecord($ip);</p>
<p class="style1">?&gt;</p>
<p>IP: <span class="style1">&lt;?php</span> <span class="style3">echo</span>($ip); <span class="style1">?&gt;</span>&lt;br/&gt;<br />
  Latitude: <span class="style1">&lt;?php</span> <span class="style3">echo</span>($geoData[<span class="style1">'LAT'</span>]); <span class="style1">?&gt;</span><span class="style3">&lt;br/&gt;</span><br />
Longitude: <span class="style1">&lt;?php</span> <span class="style3">echo</span>($geoData[<span class="style1">'LONG'</span>]); <span class="style1">?&gt;</span><br />
  <span class="style3">&lt;br/&gt;</span><br />
  Country: <span class="style1">&lt;?php</span> <span class="style3">echo</span>($geoData[<span class="style1">'COUNTRY'</span>]); <span class="style1">?&gt;</span><span class="style3">&lt;br/&gt;</span><br />
State: <span class="style1">&lt;?php</span> <span class="style3">echo</span>($geoData[<span class="style1">'STATE'</span>]); <span class="style1">?&gt;</span><span class="style3">&lt;br/&gt;</span><br />
  City: <span class="style1">&lt;?php</span> <span class="style3">echo</span>($geoData[<span class="style1">'CITY'</span>]); <span class="style1">?&gt;</span><span class="style3">&lt;br/&gt;</span></p>
<p>&nbsp;</p>
</blockquote>
<p>The Code At Work:</p>
<p>
    IP: 38.103.63.60<br/><br />
  Latitude: 38.98<br/><br />
  Longitude: -77.39 <br/><br />
  Country: US<br/><br />
  State: VIRGINIA<br/><br />
  City: HERNDON<br/></p>
]]></content:encoded>
			<wfw:commentRss>http://shortlikeafox.com/2008/09/13/how-to-tell-where-your-visitors-are-geographically-using-php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to Add a Cool Tag Cloud to a WordPress Blog</title>
		<link>http://shortlikeafox.com/2008/08/27/how-to-add-a-cool-tag-cloud-to-a-wordpress-blog/</link>
		<comments>http://shortlikeafox.com/2008/08/27/how-to-add-a-cool-tag-cloud-to-a-wordpress-blog/#comments</comments>
		<pubDate>Thu, 28 Aug 2008 06:27:17 +0000</pubDate>
		<dc:creator>ShortLikeAFox</dc:creator>
		
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://shortlikeafox.com/?p=86</guid>
		<description><![CDATA[
AEVAC
browser specific
database
dynamic variables
forum
functions
images
ISBN
ISBNdb.com
jpeg
mail()
mysql
Net_Geo
PEAR
php
plugins
quick fixes
sitemap
SMF
thumbnails
users
videos
WordPress
WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.

var rnumber = Math.floor(Math.random()*9999999);var so = new SWFObject("http://shortlikeafox.com/wp-content/plugins/wp-cumulus/tagcloud.swf?r="+rnumber, "tagcloudflash", "200", "160", "9", "#ffffff");so.addParam("allowScriptAccess", "always");so.addVariable("tcolor", "0x247DA9");so.addVariable("tspeed", "100");so.addVariable("distr", "true");so.addVariable("mode", "tags");so.addVariable("tagcloud", "%3Ctags%3E%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Faevac%2F%27+class%3D%27tag-link-15%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3EAEVAC%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fbrowser-specific%2F%27+class%3D%27tag-link-4%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3Ebrowser+specific%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fdatabase%2F%27+class%3D%27tag-link-11%27+title%3D%272+topics%27+rel%3D%22tag%22+style%3D%27font-size%3A+10pt%3B%27%3Edatabase%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fdynamic-variables%2F%27+class%3D%27tag-link-18%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3Edynamic+variables%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fforum%2F%27+class%3D%27tag-link-14%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3Eforum%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Ffunctions%2F%27+class%3D%27tag-link-6%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3Efunctions%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fimages%2F%27+class%3D%27tag-link-21%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3Eimages%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fisbn%2F%27+class%3D%27tag-link-16%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3EISBN%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fisbndbcom%2F%27+class%3D%27tag-link-17%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3EISBNdb.com%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fjpeg%2F%27+class%3D%27tag-link-22%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3Ejpeg%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fmail%2F%27+class%3D%27tag-link-26%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3Email%28%29%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fmysql%2F%27+class%3D%27tag-link-12%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3Emysql%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fnet_geo%2F%27+class%3D%27tag-link-25%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3ENet_Geo%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fpear%2F%27+class%3D%27tag-link-24%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3EPEAR%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fphp%2F%27+class%3D%27tag-link-3%27+title%3D%278+topics%27+rel%3D%22tag%22+style%3D%27font-size%3A+22pt%3B%27%3Ephp%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fplugins%2F%27+class%3D%27tag-link-20%27+title%3D%272+topics%27+rel%3D%22tag%22+style%3D%27font-size%3A+10pt%3B%27%3Eplugins%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fquick-fixes%2F%27+class%3D%27tag-link-5%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3Equick+fixes%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fsitemap%2F%27+class%3D%27tag-link-23%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3Esitemap%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fsmf%2F%27+class%3D%27tag-link-9%27+title%3D%273+topics%27+rel%3D%22tag%22+style%3D%27font-size%3A+12pt%3B%27%3ESMF%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fthumbnails%2F%27+class%3D%27tag-link-7%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3Ethumbnails%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fusers%2F%27+class%3D%27tag-link-10%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3Eusers%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fvideos%2F%27+class%3D%27tag-link-13%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3Evideos%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fwordpress%2F%27+class%3D%27tag-link-19%27+title%3D%273+topics%27+rel%3D%22tag%22+style%3D%27font-size%3A+12pt%3B%27%3EWordPress%3C%2Fa%3E%3C%2Ftags%3E");so.write("wpcumuluscontent");
Isn&#8217;t that cool? I think it&#8217;s cool. It&#8217;s a very customizable tag cloud available with the plugin titled WP-Cumulus. Getting it [...]]]></description>
			<content:encoded><![CDATA[<div align="center"><!-- SWFObject embed by Geoff Stearns geoff@deconcept.com http://blog.deconcept.com/swfobject/ --><script type="text/javascript" src="http://shortlikeafox.com/wp-content/plugins/wp-cumulus/swfobject.js"></script>
<div id="wpcumuluscontent">
<p style="display:none"><a href='http://shortlikeafox.com/tag/aevac/' class='tag-link-15' title='1 topic' rel="tag" style='font-size: 8pt;'>AEVAC</a><br />
<a href='http://shortlikeafox.com/tag/browser-specific/' class='tag-link-4' title='1 topic' rel="tag" style='font-size: 8pt;'>browser specific</a><br />
<a href='http://shortlikeafox.com/tag/database/' class='tag-link-11' title='2 topics' rel="tag" style='font-size: 10pt;'>database</a><br />
<a href='http://shortlikeafox.com/tag/dynamic-variables/' class='tag-link-18' title='1 topic' rel="tag" style='font-size: 8pt;'>dynamic variables</a><br />
<a href='http://shortlikeafox.com/tag/forum/' class='tag-link-14' title='1 topic' rel="tag" style='font-size: 8pt;'>forum</a><br />
<a href='http://shortlikeafox.com/tag/functions/' class='tag-link-6' title='1 topic' rel="tag" style='font-size: 8pt;'>functions</a><br />
<a href='http://shortlikeafox.com/tag/images/' class='tag-link-21' title='1 topic' rel="tag" style='font-size: 8pt;'>images</a><br />
<a href='http://shortlikeafox.com/tag/isbn/' class='tag-link-16' title='1 topic' rel="tag" style='font-size: 8pt;'>ISBN</a><br />
<a href='http://shortlikeafox.com/tag/isbndbcom/' class='tag-link-17' title='1 topic' rel="tag" style='font-size: 8pt;'>ISBNdb.com</a><br />
<a href='http://shortlikeafox.com/tag/jpeg/' class='tag-link-22' title='1 topic' rel="tag" style='font-size: 8pt;'>jpeg</a><br />
<a href='http://shortlikeafox.com/tag/mail/' class='tag-link-26' title='1 topic' rel="tag" style='font-size: 8pt;'>mail()</a><br />
<a href='http://shortlikeafox.com/tag/mysql/' class='tag-link-12' title='1 topic' rel="tag" style='font-size: 8pt;'>mysql</a><br />
<a href='http://shortlikeafox.com/tag/net_geo/' class='tag-link-25' title='1 topic' rel="tag" style='font-size: 8pt;'>Net_Geo</a><br />
<a href='http://shortlikeafox.com/tag/pear/' class='tag-link-24' title='1 topic' rel="tag" style='font-size: 8pt;'>PEAR</a><br />
<a href='http://shortlikeafox.com/tag/php/' class='tag-link-3' title='8 topics' rel="tag" style='font-size: 22pt;'>php</a><br />
<a href='http://shortlikeafox.com/tag/plugins/' class='tag-link-20' title='2 topics' rel="tag" style='font-size: 10pt;'>plugins</a><br />
<a href='http://shortlikeafox.com/tag/quick-fixes/' class='tag-link-5' title='1 topic' rel="tag" style='font-size: 8pt;'>quick fixes</a><br />
<a href='http://shortlikeafox.com/tag/sitemap/' class='tag-link-23' title='1 topic' rel="tag" style='font-size: 8pt;'>sitemap</a><br />
<a href='http://shortlikeafox.com/tag/smf/' class='tag-link-9' title='3 topics' rel="tag" style='font-size: 12pt;'>SMF</a><br />
<a href='http://shortlikeafox.com/tag/thumbnails/' class='tag-link-7' title='1 topic' rel="tag" style='font-size: 8pt;'>thumbnails</a><br />
<a href='http://shortlikeafox.com/tag/users/' class='tag-link-10' title='1 topic' rel="tag" style='font-size: 8pt;'>users</a><br />
<a href='http://shortlikeafox.com/tag/videos/' class='tag-link-13' title='1 topic' rel="tag" style='font-size: 8pt;'>videos</a><br />
<a href='http://shortlikeafox.com/tag/wordpress/' class='tag-link-19' title='3 topics' rel="tag" style='font-size: 12pt;'>WordPress</a></p>
<p>WP Cumulus Flash tag cloud by <a href="http://www.roytanck.com">Roy Tanck</a> requires Flash Player 9 or better.</p>
</div>
<p><script type="text/javascript">var rnumber = Math.floor(Math.random()*9999999);var so = new SWFObject("http://shortlikeafox.com/wp-content/plugins/wp-cumulus/tagcloud.swf?r="+rnumber, "tagcloudflash", "200", "160", "9", "#ffffff");so.addParam("allowScriptAccess", "always");so.addVariable("tcolor", "0x247DA9");so.addVariable("tspeed", "100");so.addVariable("distr", "true");so.addVariable("mode", "tags");so.addVariable("tagcloud", "%3Ctags%3E%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Faevac%2F%27+class%3D%27tag-link-15%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3EAEVAC%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fbrowser-specific%2F%27+class%3D%27tag-link-4%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3Ebrowser+specific%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fdatabase%2F%27+class%3D%27tag-link-11%27+title%3D%272+topics%27+rel%3D%22tag%22+style%3D%27font-size%3A+10pt%3B%27%3Edatabase%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fdynamic-variables%2F%27+class%3D%27tag-link-18%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3Edynamic+variables%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fforum%2F%27+class%3D%27tag-link-14%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3Eforum%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Ffunctions%2F%27+class%3D%27tag-link-6%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3Efunctions%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fimages%2F%27+class%3D%27tag-link-21%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3Eimages%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fisbn%2F%27+class%3D%27tag-link-16%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3EISBN%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fisbndbcom%2F%27+class%3D%27tag-link-17%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3EISBNdb.com%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fjpeg%2F%27+class%3D%27tag-link-22%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3Ejpeg%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fmail%2F%27+class%3D%27tag-link-26%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3Email%28%29%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fmysql%2F%27+class%3D%27tag-link-12%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3Emysql%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fnet_geo%2F%27+class%3D%27tag-link-25%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3ENet_Geo%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fpear%2F%27+class%3D%27tag-link-24%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3EPEAR%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fphp%2F%27+class%3D%27tag-link-3%27+title%3D%278+topics%27+rel%3D%22tag%22+style%3D%27font-size%3A+22pt%3B%27%3Ephp%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fplugins%2F%27+class%3D%27tag-link-20%27+title%3D%272+topics%27+rel%3D%22tag%22+style%3D%27font-size%3A+10pt%3B%27%3Eplugins%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fquick-fixes%2F%27+class%3D%27tag-link-5%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3Equick+fixes%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fsitemap%2F%27+class%3D%27tag-link-23%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3Esitemap%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fsmf%2F%27+class%3D%27tag-link-9%27+title%3D%273+topics%27+rel%3D%22tag%22+style%3D%27font-size%3A+12pt%3B%27%3ESMF%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fthumbnails%2F%27+class%3D%27tag-link-7%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3Ethumbnails%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fusers%2F%27+class%3D%27tag-link-10%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3Eusers%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fvideos%2F%27+class%3D%27tag-link-13%27+title%3D%271+topic%27+rel%3D%22tag%22+style%3D%27font-size%3A+8pt%3B%27%3Evideos%3C%2Fa%3E%0A%3Ca+href%3D%27http%3A%2F%2Fshortlikeafox.com%2Ftag%2Fwordpress%2F%27+class%3D%27tag-link-19%27+title%3D%273+topics%27+rel%3D%22tag%22+style%3D%27font-size%3A+12pt%3B%27%3EWordPress%3C%2Fa%3E%3C%2Ftags%3E");so.write("wpcumuluscontent");</script></div>
<p>Isn&#8217;t that cool? I think it&#8217;s cool. It&#8217;s a very customizable tag cloud available with the plugin titled <a href="http://wordpress.org/extend/plugins/wp-cumulus/" target="_blank">WP-Cumulus</a>. Getting it is as easy as downloading it from the link provided, installing it like any plugin, customizing it, and adding this line of code where you want it to appear: &lt;?php wp_cumulus_insert(); ?&gt;. </p>
<p>Have fun!  </p>
]]></content:encoded>
			<wfw:commentRss>http://shortlikeafox.com/2008/08/27/how-to-add-a-cool-tag-cloud-to-a-wordpress-blog/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to Add a Table of Contents to a WordPress Blog</title>
		<link>http://shortlikeafox.com/2008/08/27/how-to-add-a-table-of-contents-to-a-wordpress-blog/</link>
		<comments>http://shortlikeafox.com/2008/08/27/how-to-add-a-table-of-contents-to-a-wordpress-blog/#comments</comments>
		<pubDate>Thu, 28 Aug 2008 01:31:58 +0000</pubDate>
		<dc:creator>ShortLikeAFox</dc:creator>
		
		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[plugins]]></category>

		<category><![CDATA[sitemap]]></category>

		<guid isPermaLink="false">http://shortlikeafox.com/?p=82</guid>
		<description><![CDATA[So you run a WordPress blog and want to add a table of contents or sitemap. No Problem. Just download the Dagon Design Sitemap Generator. I use that plugin for this site and it is highly customizable to match your needs. I have personally found that it works better than many of the other sitemap/table [...]]]></description>
			<content:encoded><![CDATA[<p>So you run a WordPress blog and want to add a table of contents or sitemap. No Problem. Just download the <a href="http://www.dagondesign.com/articles/sitemap-generator-plugin-for-wordpress/" target="_blank">Dagon Design Sitemap Generator. </a>I use that plugin for <a href="http://shortlikeafox.com/table-of-contents/">this site</a> and it is highly customizable to match your needs. I have personally found that it works better than many of the other sitemap/table of contents generators out there. </p>
]]></content:encoded>
			<wfw:commentRss>http://shortlikeafox.com/2008/08/27/how-to-add-a-table-of-contents-to-a-wordpress-blog/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to Divide One Image Into Multiple Images Using PHP</title>
		<link>http://shortlikeafox.com/2008/08/26/how-to-divide-one-image-into-multiple-images-using-php/</link>
		<comments>http://shortlikeafox.com/2008/08/26/how-to-divide-one-image-into-multiple-images-using-php/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 06:27:07 +0000</pubDate>
		<dc:creator>ShortLikeAFox</dc:creator>
		
		<category><![CDATA[functions]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[images]]></category>

		<category><![CDATA[jpeg]]></category>

		<guid isPermaLink="false">http://shortlikeafox.com/?p=80</guid>
		<description><![CDATA[So you want to break one large image into multiple smaller images? No problem. This may seem like an obscure problem, but there are multiple reasons you&#8217;d want to do this. Maybe you want to create a visual sliding puzzle.  Or maybe you are running a unique WordPress theme. Or maybe you want to [...]]]></description>
			<content:encoded><![CDATA[<p>So you want to break one large image into multiple smaller images? No problem. This may seem like an obscure problem, but there are multiple reasons you&#8217;d want to do this. Maybe you want to create a visual <a href="http://en.wikipedia.org/wiki/Sliding_puzzle" target="_blank">sliding puzzle</a>.  Or maybe you are running a <a href="http://wp-themes.com/3col-rdmban-rr/" target="_blank">unique WordPress theme</a>. Or maybe you want to create a collage of some kind. It really doesn&#8217;t matter why you want to split an image into smaller image, PHP makes this task easy. The example below only deals with jpegs. Changing the function to deal with other types of images wouldn&#8217;t be that hard.</p>
<p>&nbsp;</p>
<p><span class="style1">&lt;?php</span><br />
  <span class="style9">//This function will split an image into a number of equally sized columns and rows.<br />
  </span><span class="style3">function</span> split_image($number_of_rows, $number_of_cols, $path_to_image, $file_name){ </p>
<p class="style9"> //$number_of_rows = # of rows you want; <br />
  //$number_of_cols = # of cols you wnat<br />
  //$path_to_image = the path to the folder the image is in, something like: 	/home/content/username/html/list/uploads/ <br />
//$file_name = The filename of the image: archery.jpg, etc.</p>
<p> <span class="style9">// parse path for the extension</span><br />
  $info = <span class="style3">pathinfo</span>($path_to_image <span class="style3">.</span> $file_name);
</p>
<p> <span class="style9">//make sure we are dealing with a jpeg<br />
</span>  <span class="style4">if</span> ( (<span class="style3">strtolower</span>($info[<span class="style1">'extension'</span>]) == <span class="style1">&#8216;jpg&#8217;</span>) || (<span class="style3">strtolower</span>($info[<span class="style1">'extension'</span>]) == <span class="style1">&#8216;jpeg&#8217;</span>) ){</p>
<blockquote>
<p> <span class="style9">// load image and get image size</span><br />
    $source = <span class="style3">imagecreatefromjpeg</span>( <span class="style1">&quot;{$path_to_image}{$file_name}&quot;</span> );<br />
    $width = <span class="style3">imagesx</span>( $source ); <span class="style9">//Find the width</span> <br />
    $height = <span class="style3">imagesy</span>( $source ); <span class="style9">//Find the height</span> <br />
    $segment_width = $width/$number_of_cols; <span class="style9">//Determine the width of the individual segments</span> <br />
    $segment_height = $height/$number_of_rows; <span class="style9">//Determine the height of the individual segments</span> </p>
<p>    <span class="style4">for</span>( $col = 0; $col &lt; $number_of_cols; $col++)<br />
    {
    </p>
<blockquote>
<p><span class="style4">for</span>( $row = 0; $row &lt; $number_of_rows; $row++)<br />{
    </p>
<blockquote>
<p>$fn =<span class="style3"> sprintf</span>( <span class="style1">&quot;img%02d_%02d.jpg&quot;</span>, $col, $row );<br/><span class="style3">echo</span>(<span class="style1"> &quot;$fn&quot;</span> ); <span class="style9">//I print the image name here, so that the process shows itself as it runs<br />
      </span>$im = <span class="style3">@imagecreatetruecolor</span>( $segment_width, $segment_height );<br />
        <span class="style3">imagecopyresized</span>( $im, $source, 0, 0, $col * $segment_width, $row * $segment_height, $segment_width, $segment_height, $segment_width, $segment_height );<br />
$file = <span class="style1">&quot;test.jpg&quot;</span>;<br />
<span class="style9">//Save the images </span><br />
  if(<span class="style3">imagejpeg</span>( $im,<span class="style1">&quot;INSERT DESTINATION HERE &quot;</span>, 100 )) <span class="style9">//The destination will be something like</span><span class="style9">/home/content/c/h/d/images/$fn</span>
      </p>
<blockquote>
<p>echo(<span class="style1">&quot;Has been made!&lt;br/&gt;&quot;</span>);
          </p>
</blockquote>
<p>}
        </p>
</blockquote>
<p>}      </p>
</blockquote>
<p>}</p>
</blockquote>
<p>}</p>
<p><span class="style1">?&gt;</span></p>
]]></content:encoded>
			<wfw:commentRss>http://shortlikeafox.com/2008/08/26/how-to-divide-one-image-into-multiple-images-using-php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to Include Functioning PHP Code in Your WordPress Posts</title>
		<link>http://shortlikeafox.com/2008/08/17/how-to-include-functioning-php-code-in-your-wordpress-posts/</link>
		<comments>http://shortlikeafox.com/2008/08/17/how-to-include-functioning-php-code-in-your-wordpress-posts/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 02:53:55 +0000</pubDate>
		<dc:creator>ShortLikeAFox</dc:creator>
		
		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://shortlikeafox.com/?p=77</guid>
		<description><![CDATA[So you want to be able to use PHP in your WordPress blog posts and pages. That&#8217;s no problem. Just using &#60;?php&#8230;&#8230;..?&#62;  is going to make WordPress angry unless you install a plugin first. There are a few plugins out there that claim to offer this capability, but the one that I have found [...]]]></description>
			<content:encoded><![CDATA[<p>So you want to be able to use PHP in your WordPress blog posts and pages. That&#8217;s no problem. Just using &lt;?php&#8230;&#8230;..?&gt;  is going to make WordPress angry unless you install a plugin first. There are a few plugins out there that claim to offer this capability, but the one that I have found works the best is <a href="http://bluesome.net/post/2005/08/18/50/" target="_blank">Exec-PHP</a>.To begin using PHP code, follow these steps: </p>
<ol>
<li><a href="http://bluesome.net/post/2005/08/18/50/" target="_blank">Download Exec-PHP</a></li>
<li>Install it like you would any plugin (The link above and readme file will walk you through this) </li>
<li>If you are currently using it, you must turn off the WYSIWYG editor. To do this, go to Users -&gt; Your Profile and uncheck the <em>Use the visual editor when writing</em> checkbox </li>
<li>Start writing php code like you normally would: &lt;?php &#8230;.code goes here ?&gt;</li>
</ol>
<p>That&#8217;s all there is to it!</p>
]]></content:encoded>
			<wfw:commentRss>http://shortlikeafox.com/2008/08/17/how-to-include-functioning-php-code-in-your-wordpress-posts/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to Create and Use Dynamically Named Variables with PHP</title>
		<link>http://shortlikeafox.com/2008/08/17/how-to-create-and-use-dynamically-named-variables-with-php/</link>
		<comments>http://shortlikeafox.com/2008/08/17/how-to-create-and-use-dynamically-named-variables-with-php/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 02:07:48 +0000</pubDate>
		<dc:creator>ShortLikeAFox</dc:creator>
		
		<category><![CDATA[php]]></category>

		<category><![CDATA[dynamic variables]]></category>

		<guid isPermaLink="false">http://shortlikeafox.com/?p=73</guid>
		<description><![CDATA[So you want to use dynamic variable names in your code. No problem. Let&#8217;s say you have 100 variables named  dog0, dog1, dog2, &#8230;., dog98, dog99. Why you would want to use 100 variables like this instead of an array is beyond me, but it doesn&#8217;t matter for this example. To set these variables [...]]]></description>
			<content:encoded><![CDATA[<p>So you want to use dynamic variable names in your code. No problem. Let&#8217;s say you have 100 variables named  dog0, dog1, dog2, &#8230;., dog98, dog99. Why you would want to use 100 variables like this instead of an array is beyond me, but it doesn&#8217;t matter for this example. To set these variables in a quick loop you could use the following:</p>
<p><span class="style4">for</span> ($i <span class="style3">=</span> <span class="style1">0</span>; $i <span class="style3">&lt;</span> <span class="style1">100</span>; $i <span class="style3">++</span>){</p>
<blockquote>
<p>
    $variableName <span class="style3">=</span> <span class="style1">&quot;dog$i&quot;</span>;<br />
    $$variableName <span class="style3">=</span> $i; <span class="style9">//sets $dog1 to 1, $dog2 to 2, $dog 34 to 34, etc&#8230;. </span>
  </p>
</blockquote>
<p>} </p>
<p>Now let&#8217;s say you wanted to access all of these variables. You could use the following:</p>
<p><span class="style4">for</span> ($i <span class="style3">=</span> <span class="style1">0</span>; $i <span class="style3">&lt;</span> <span class="style1">100</span>; $i <span class="style3">++</span>){</p>
<blockquote>
<p>$variableName <span class="style3">=</span> <span class="style1">&quot;dog$i&quot;</span>;<br />
    echo(<span class="style1">&quot;&lt;br/&gt;&quot;</span>);<br />
    echo(<span class="style1">&quot;$variableName: &quot;</span>);<br />
    echo($$variableName);
</p>
</blockquote>
<p>}</p>
<p>This loop prints:</p>
<p>dog0: 0<br />
  dog1: 1<br />
  dog2: 2<br />
  dog3: 3<br />
  dog4: 4<br />
  dog5: 5<br />
  dog6: 6<br />
  dog7: 7<br />
dog8: 8</p>
<p>etc&#8230; all the way to<br />
  dog99: 99</p>
]]></content:encoded>
			<wfw:commentRss>http://shortlikeafox.com/2008/08/17/how-to-create-and-use-dynamically-named-variables-with-php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to Intergrate ISBN Access on Your Webpages Using PHP</title>
		<link>http://shortlikeafox.com/2008/08/12/how-to-intergrate-isbn-access-on-your-webpages-using-php/</link>
		<comments>http://shortlikeafox.com/2008/08/12/how-to-intergrate-isbn-access-on-your-webpages-using-php/#comments</comments>
		<pubDate>Wed, 13 Aug 2008 05:13:23 +0000</pubDate>
		<dc:creator>ShortLikeAFox</dc:creator>
		
		<category><![CDATA[php]]></category>

		<category><![CDATA[ISBN]]></category>

		<category><![CDATA[ISBNdb.com]]></category>

		<guid isPermaLink="false">http://shortlikeafox.com/?p=67</guid>
		<description><![CDATA[ISBNs or International Standard Book Numbers are useful identifiers that can be used to find information about individual books. If you want to integrate ISBN lookups in your web applications PHP makes it doable. 
Step One:  ISBNdb.com is a has created an API that allows users from around the web to access their database [...]]]></description>
			<content:encoded><![CDATA[<p>ISBNs or International Standard Book Numbers are useful identifiers that can be used to find information about individual books. If you want to integrate ISBN lookups in your web applications PHP makes it doable. </p>
<p><strong>Step One:  </strong><a href="https://isbndb.com/" target="_blank">ISBNdb.com</a> is a has created an API that allows users from around the web to access their database of ISBN records. Here is their own description of the API: </p>
<blockquote>
<p><em> ISBNdb.com&#8217;s remote access application programming interface (API) is  designed to allow other websites and standalone applications use the  vast collection of data collected by ISBNdb.com since 2003. As of this  writing, in July 2005, the data includes nearly 1,800,000 books; almost  3,000,000 million library records; close to a million subjects; hundreds  of thousands of author and publisher records parsed out of library  data; more than 10,000,000 records of actual and historic prices. </em></p>
</blockquote>
<p>To use this API you must first <a href="https://isbndb.com/account/create.html?return=https://isbndb.com/account/index.html" target="_blank">register. </a>Registration takes literally seconds to complete. After this, you need to set up a key. Keys allow you to directly access the ISBN database from your own code. The ISBNdb.com website makes setting up keys easy. </p>
<p><strong>Step Two: </strong>Now you&#8217;re start writing code to interact with the database. A request for an ISBN lookup will look something like this: </p>
<blockquote>
<p> $isbnData = <span class="style1">&quot;http://isbndb.com/api/books.xml?access_key=XXXXXX&amp;index1=isbn&amp;value1=$isbnQuery&quot;</span>;</p>
</blockquote>
<p>You would insert your access key in the place of XXXXXX.  <em>$isbnQuery </em>would be the isbn number you are interested in. <em>$isbnData</em> is an XML file. To access this data you need to let your code know what it is dealing with. Something like this will work:</p>
<blockquote>
<p> $xmlData = @simplexml_load_file($isbnData) <span class="style3">or die </span>(<span class="style1">&quot;no file loaded&quot;</span>) ;</p>
</blockquote>
<p>Now you can access individual variables with calls similar to this:</p>
<blockquote>
<p> $title = 		$xmData-&gt;BookList[<span class="style1">0</span>]-&gt;BookData[<span class="style1">0</span>]-&gt;Title ;
  </p>
</blockquote>
<p>Here is a complete working example:</p>
<blockquote>
<p class="style1">&lt;?php</p>
<p>$searchQuery = <span class="style1">&quot;9780684801223&quot;</span>; <span class="style9">//The ISBN for Ernest Hemingway&#8217;s Old Man and the Sea </span><br />
    $isbnData =<span class="style1"> &quot;http://isbndb.com/api/books.xml?access_key=XXXXXX&amp;index1=isbn&amp;value1=$searchQuery&quot;</span>; <span class="style9">//Remember to replace XXXXXX with your own access key</span> <br />
    $xmlData = @simplexml_load_file($isbnData) <span class="style3">or die</span> (<span class="style1">&quot;no file loaded&quot;</span>) ;<br />
    $title = 		$xmlData-&gt;BookList[<span class="style1">0</span>]-&gt;BookData[<span class="style1">0</span>]-&gt;Title ;<br />
    $authors =		$xmlData-&gt;BookList[<span class="style1">0</span>]-&gt;BookData[<span class="style1">0</span>]-&gt;AuthorsText ;<br />
  $publisher =	$xmlData-&gt;BookList[<span class="style1">0</span>]-&gt;BookData[<span class="style1">0</span>]-&gt;PublisherText ;</p>
<p><span class="style3">echo</span>(<span class="style1">&quot;$title&lt;br/&gt;&quot;</span>);<br />
    <span class="style3">echo</span>(<span class="style1">&quot;$authors&lt;br/&gt;&quot;</span>);<br />
    <span class="style3">echo</span>(<span class="style1">&quot;$publisher&lt;br/&gt;&quot;</span>);</p>
<p class="style9">//This example prints:<br />
  //The old man and the sea<br />
    //Ernest Hemingway<br />
  //New York : Scribner Paperback Fiction, 1995.</p>
<p class="style1">?&gt;</p>
</blockquote>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://shortlikeafox.com/2008/08/12/how-to-intergrate-isbn-access-on-your-webpages-using-php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to Help Users Easily Embed Videos on an SMF Site</title>
		<link>http://shortlikeafox.com/2008/08/10/how-to-help-users-easily-embed-videos-on-an-smf-site/</link>
		<comments>http://shortlikeafox.com/2008/08/10/how-to-help-users-easily-embed-videos-on-an-smf-site/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 07:41:44 +0000</pubDate>
		<dc:creator>ShortLikeAFox</dc:creator>
		
		<category><![CDATA[SMF (Simple Machine Forum)]]></category>

		<category><![CDATA[AEVAC]]></category>

		<category><![CDATA[forum]]></category>

		<category><![CDATA[SMF]]></category>

		<category><![CDATA[videos]]></category>

		<guid isPermaLink="false">http://shortlikeafox.com/?p=64</guid>
		<description><![CDATA[So you are in charge of setting up a Simple Machines Forum based site and want a foolproof way to allow users to embed videos from popular video sites (YouTube, Google Video, IGN, etc.). You may justifiably be afraid in allowing users to simply use the embed code from those individual sites, because God knows [...]]]></description>
			<content:encoded><![CDATA[<p>So you are in charge of setting up a Simple Machines Forum based site and want a foolproof way to allow users to embed videos from popular video sites (YouTube, Google Video, IGN, etc.). You may justifiably be afraid in allowing users to simply use the embed code from those individual sites, because God knows what the results will be. The solution to this problem is as simple as can be. Karl Benson wrote a modification package that makes video embedding as simple as cutting and pasting the URL of the page the video appears in. This package works for over 150 sites and is called AEVAC (Audio Embed Video/Audio Clips). The most recent release is version 3.1.2 and it can be found <a href="http://custom.simplemachines.org/mods/index.php?mod=977" target="_blank">here.</a> </p>
<p>This is a mod I highly recommend. Used correctly it has the potential to greatly reduce the frequency and severity of forum administrator headaches. </p>
]]></content:encoded>
			<wfw:commentRss>http://shortlikeafox.com/2008/08/10/how-to-help-users-easily-embed-videos-on-an-smf-site/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to Confirm an Email Address Using PHP</title>
		<link>http://shortlikeafox.com/2008/08/05/how-to-confirm-an-email-address-using-php/</link>
		<comments>http://shortlikeafox.com/2008/08/05/how-to-confirm-an-email-address-using-php/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 05:33:25 +0000</pubDate>
		<dc:creator>ShortLikeAFox</dc:creator>
		
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://shortlikeafox.com/?p=56</guid>
		<description><![CDATA[So you need confirmation of a user&#8217;s email address? No problem.  There are a lot of reasons to require email confirmation, and PHP makes it simple.
Email confirmation can be completed is these steps:

Prompt the user for whatever information you need from them (including their email address)
Input this data in a database
Send the user an [...]]]></description>
			<content:encoded><![CDATA[<p>So you need confirmation of a user&#8217;s email address? No problem.  There are a lot of reasons to require email confirmation, and PHP makes it simple.</p>
<p>Email confirmation can be completed is these steps:</p>
<ol>
<li>Prompt the user for whatever information you need from them (including their email address)</li>
<li>Input this data in a database</li>
<li>Send the user an email with a special confirmation key</li>
<li>&quot;Unlock&quot; the data in the database once the confirmation key is entered.  </li>
</ol>
<p><strong>How to do it:</strong></p>
<p class="style1">&lt;?php</p>
<p> <span class="style9">//First, let&#8217;s connect to the database</span><br/><br />
  $user_name = <span class="style1">&quot;dbUserName &quot;</span>;<br />
$host = <span class="style1">&quot;dbHost&quot;</span>;<br />
$my_password = <span class="style1">&quot;dbPassword&quot;</span>;<br />
$db_name = <span class="style1">&quot;dbName&quot;</span>;</p>
<p> <span class="style9">//Connect to server and select database</span>.<br />
  <span class="style3">mysql_connect</span>(<span class="style1">&quot;$host&quot;</span>, <span class="style1">&quot;$user_name&quot;</span>, <span class="style1">&quot;$my_password&quot;</span>)<span class="style3">or die</span>(<span class="style1">&quot;cannot connect to server&quot;</span>);<br />
  <span class="style3">mysql_select_db</span>(<span class="style1">&quot;$db_name&quot;</span>)<span class="style3">or die</span>(<span class="style1">&quot;cannot select DB&quot;</span>);</p>
<p><span class="style9">//The following line basically asks if the user needs to have the form displayed.  Read down a little if you want to see where the variables come from</span><br/><br />
  <span class="style4">if</span>(<span class="style3">!</span>(@<span class="style3">$_GET</span>[<span class="style1">'first'</span>] <span class="style3">==</span> <span class="style1">&quot;no&quot;</span>) <span class="style3">&amp;&amp;</span> <span class="style3">!</span>(@<span class="style3">$_GET</span>[<span class="style1">'confirm'</span>] == <span class="style1">&quot;yes&quot;</span>){<br />
  <span class="style9">//Since this is the page&#8217;s first display and no confirmation code is included we should display the form for the user to fill out<br />
  //This form only takes one argument (the user&#8217;s email address).  </span><br />
  <span class="style1">?&gt;</span></p>
<blockquote>
<p> <span class="style9">&lt;form name=</span><span class="style3">&quot;emailConfirmation&quot;</span><span class="style9"> method=</span><span class="style3">&quot;post&quot; </span><span class="style9">action=</span><span class="style3">&quot;index.php?first=no&quot;</span><span class="style9">&gt;</span></p>
<p>  &lt;table align=&quot;center&quot;&gt;<br />
  &lt;tr&gt;<br />
  &lt;td&gt;<br />
    Email: <span class="style9">&lt;input name=</span><span class="style3">&quot;email&quot;</span><span class="style9"> type=</span><span class="style3">&quot;text&quot;</span> <span class="style9">id=</span><span class="style3">&quot;email&quot;</span> <span class="style9">size=</span><span class="style3">&quot;30&quot;</span> <span class="style9">/&gt;</span><br />
  &lt;/td&gt;<br />
  &lt;/tr&gt;<br />
  &lt;tr&gt;<br />
  &lt;td align=&quot;center&quot;&gt;<br />
  <span class="style9">&lt;input type=</span><span class="style3">&quot;submit&quot;</span> <span class="style9">name=</span><span class="style3">&quot;Submit&quot;</span> <span class="style9">value=</span><span class="style3">&quot;Submit&quot;</span><span class="style9">/&gt;</span><br />
  &lt;/td&gt;<br />
  &lt;/tr&gt;<br />
  &lt;/table&gt;<br />
  &lt;/form&gt;</p>
</blockquote>
<p>&nbsp;</p>
<p class="style1">&lt;?php</p>
<p>}</p>
<p><span class="style9">//if the form has been filled out, we need to generate a confirmation code, insert the confirmation code and user email into a database, and send an email to the email address.<br />
</span><span class="style4">elseif</span> (@<span class="style3">$_GET</span>[<span class="style1">'first'</span>] == <span class="style1">&quot;no&quot;</span>){ <span class="style9">//if the form has been filled out&#8230;</span></p>
<blockquote>
<p><span class="style9">//is_valid_email_address is <strong>NOT</strong> a valid php function. Insert your own email address checking function here&#8230; </span><br />
  <span class="style4">if</span> (<span class="style3">!</span>is_valid_email_address(<span class="style3">$_POST</span>[<span class="style1">'email'</span>]))  </p>
<blockquote>
<p>
      <span class="style3">echo</span>(<span class="style1">&quot;Sorry!  The email address you entered is not valid.&quot;</span>); </p>
</blockquote>
<p><span class="style9">//If the email address appears valid and safe&#8230;</span><br />
    <span class="style4">else</span>{
    </p>
<blockquote>
<p>$email = (<span class="style3">$_POST</span>[<span class="style1">'email'</span>]);<br />
      <span class="style9">//Generate a confirmation code here. This is the way I choose to do it, but there are innumerable ways that will work.</span><br />
      $confirmation_code=<span class="style3">md5</span>(<span class="style3">uniqid</span>(<span class="style3">rand</span>()));<br />
      <span class="style9">//Everything is more or less OK to enter into the database and then send an email to the user<br />
      </span>$query = <span class="style1">&quot;INSERT INTO emailConfirmationTable(user_email, con_code) VALUES(&#8217;$email&#8217;, &#8216;$confirmation_code&#8217;)&quot;</span>; <br />
      $result = <span class="style3">mysql_query</span>($query) <span class="style3">or die</span> (&quot;Config Error 2223 &quot;);<br />
      <span class="style9">//Send the email </span><br />
      $to=$email;<br />
      $subject=<span class="style1">&quot;Your shortlikeafox example confirmation&quot;</span>;<span class="style9">// From</span><br />
  $header=<span class="style1">&quot;from: shortlikeafox &lt;info@shortlikeafox.com&gt;&quot;</span>;<br />
  <span class="style9">// Your message</span><br />
  $message=<span class="style1">&quot;Your Comfirmation link! \r\n&quot;</span>;<br />
  $message.=<span class="style1">&quot;Click on this link to activate your account \r\n&quot;</span>;<br />
  $message.=<span class="style1">&quot;This link with expire whenever I feel like cleaning out the unconfirmed emails (every week or so) \r\n&quot;</span>;<br />
  $message.=<span class="style1">&quot;http://www.shortlikeafox.com/simple-email-confirmation-example/index.php?confirm=yes&amp;confirmCode=$confirmation_code \r\n&quot;</span>;<br />
  $sentmail = <span class="style3">mail</span>($to,$subject,$message,$header);</p>
<p><span class="style3">echo</span>(<span class="style1">&quot;Your Confirmation Email Has Been Sent!&quot;</span>);
      </p>
</blockquote>
<p>}
    </p>
</blockquote>
<p>}<br />
  <span class="style9">//If the user found this script from a link in his email, confirm it&#8230;. </span><br />
  <span class="style4">elseif</span>(@<span class="style3">$_GET</span>[<span class="style1">'confirm'</span>] <span class="style3">==</span> <span class="style1">&quot;yes&quot;</span>){<br />
  <span class="style9">//Make the confirmCode relatively safe to use</span> </p>
<blockquote>
<p>
    $confirmCode <span class="style3">= mysql_real_escape_string</span>(@<span class="style3">$_GET</span>[<span class="style1">'confirmCode'</span>]);</p>
<p>$query = <span class="style1">&quot;SELECT * FROM emailConfirmationTable WHERE con_code = &#8216;$confirmCode&#8217; AND is_confirmed = &#8216;0&#8242;&quot;</span>;<br />
    $result = <span class="style3">mysql_query</span>($query) <span class="style3">or die</span> (<span class="style1">&quot;Error 234234&quot;</span>);<br />
    $nrows = <span class="style3">mysql_num_rows</span>($result);<br />
    <span class="style4">if </span>($nrows<span class="style3">==</span>1){<br />
    $query = <span class="style1">&quot;UPDATE emailConfirmationTable SET is_confirmed = &#8216;1&#8242; WHERE con_code = &#8216;$confirmCode&#8217; &quot;</span>; <br />
    $result =<span class="style3"> mysql_query</span>($query) <span class="style3">or die</span> (<span class="style1">&quot;Config Error 222231231233 &quot;</span>);<br />
    <span class="style4">if</span> ($result)<br />
    <span class="style3">echo</span>(<span class="style1">&quot;EMAIL CONFIRMED!!!&quot;</span>);
  </p>
</blockquote>
<p>  }<br />
  <span class="style4">else</span></p>
<blockquote>
<p><span class="style3">echo</span>(<span class="style1">&quot;Could not confirm Email&quot;</span>);
    </p>
</blockquote>
<p>}</p>
<p>&nbsp;</p>
<p class="style1">?&gt;</p>
<p>It is very important to remember to validate the information that the user inserts in any form. I didn&#8217;t include a function for email address validation above, but a good place to start is Cal Henderson&#8217;s email validation function found <a href="http://code.iamcal.com/php/rfc822/rfc822.phps" target="_blank">here.</a> </p>
<p>If you want to see this script in action, you can do so <a href="http://shortlikeafox.com/simple-email-confirmation-example/">here.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://shortlikeafox.com/2008/08/05/how-to-confirm-an-email-address-using-php/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
