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

<channel>
	<title>Lightning Shock &#187; Coding</title>
	<atom:link href="http://www.lightningshock.com/category/internet/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lightningshock.com</link>
	<description>(Were you expecting a witty tagline?)</description>
	<lastBuildDate>Fri, 30 Apr 2010 20:31:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to Create and Understand a Simple Database-Driven Website</title>
		<link>http://www.lightningshock.com/2009/09/05/how-to-create-and-understand-a-simple-database-driven-website/</link>
		<comments>http://www.lightningshock.com/2009/09/05/how-to-create-and-understand-a-simple-database-driven-website/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 00:09:29 +0000</pubDate>
		<dc:creator>James Lewitzke</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Crazy Ideas]]></category>

		<guid isPermaLink="false">http://www.lightningshock.com/?p=94</guid>
		<description><![CDATA[Alright, this had been driving me nuts for months, and all the online tutorials and guides sucked ass. And after hours through trial and error coding, I finally discovered the correct portions and amount of code to use. So basically, I&#8217;m going to explain here exactly what you need to do to create a simple [...]]]></description>
			<content:encoded><![CDATA[<p>Alright, this had been driving me nuts for months, and all the online tutorials and guides sucked ass. And after hours through trial and error coding, I finally discovered the correct portions and amount of code to use.</p>
<p>So basically, I&#8217;m going to explain here exactly what you need to do to create a simple PHP / MySQL backed DB-driven website that draws all of the data straight from the database.</p>
<p>An example URL of a page we&#8217;ll create could look like this:</p>
<blockquote><p>http://www.site.com/index.php?id=1<span id="more-94"></span><strong></strong></p></blockquote>
<p><strong>1) Prepare the Front-End Design and Content</strong></p>
<p>First, you&#8217;ll want to make sure that you have the basic design of the site coded. You may use whatever CSS styling you want to, it won&#8217;t make any difference on the backend. (One index.html file is fine, but be sure to rename it as index.php once it goes online.) Also all the information for our website needs to be properly entered into the database. Using a tool such as phpmyadmin will work great to enter the data, however you can use SQL if you wish. For the purpose of keeping this tutorial quick, I&#8217;m going to assume that you already know how to do this.</p>
<p>To keep things extremely simple, we&#8217;ll only need to create one table, I decided to name mine &#8220;page&#8221;. Also include a minimum of two fields (I&#8217;m using three) and two pages to understand what&#8217;s going on. Below is an example of a DB table that you could use:</p>
<p><strong></p>
<table class="wptable rowstyle-alt" id="wptable-2"  cellspacing="1">
	<thead>
	<tr>
		<th class="sortable" style="width:30px" align="center">ID</th>
		<th class="sortable" style="width:50px" align="center">Title</th>
		<th class="sortable" style="width:250px" align="center">Content</th>
	</tr>
	</thead>
	<tr>
		<td style="width:30px" align="center">1</td>
		<td style="width:50px" align="center">Home</td>
		<td style="width:250px" align="center">Welcome to the Homepage.</td>
	</tr>
	<tr>
		<td style="width:30px" align="center">2</td>
		<td style="width:50px" align="center">About</td>
		<td style="width:250px" align="center">A brief description about the site.</td>
	</tr>
</table><p>
</strong></p>
<p>You can use whatever data you wish, however most sites have these pages and that&#8217;s what I have decided to use. Also be sure to set the ID to the primary key, so it&#8217;ll automatically update later when you decide to add more webpages.</p>
<p><strong>2) Connect to the DB and Format the Website Structure<br />
</strong></p>
<p>Alright, next step. After we get all that out of the way, we now need to interact with our database table we just created, so we need to use PHP to configure a connection. You can include this in a few different ways, what I did was create a config.php file and wrote a require_once function to include the data from the PHP file onto my main index.php page.</p>
<p>There&#8217;s plenty of other sites that go into more depth on this, but I&#8217;ll give you an example here. For the config.php file:</p>
<pre>&lt;?php
$username="DB_USERNAME";
$password="DB_PASSWORD";
$database="DB_NAME";
$url="localhost";

$link = mysql_connect($url,$username,$password);

mysql_select_db($database) or die("Unable to select database");

mysql_close();</pre>
<p>?&gt;</p>
<p>And as for the index.php page, I know this probably could have been more securely coded (aka placing the DB retrieval info before the DOCTYPE), but for simplicity&#8217;s sake, here&#8217;s an example file:</p>
<pre>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;</pre>
<pre>&lt;html&gt;</pre>
<pre>    &lt;head&gt;</pre>
<pre>        &lt;?php require_once ("config.php"); ?&gt;</pre>
<pre>        &lt;?php require_once ("functions.php"); ?&gt;</pre>
<pre>    &lt;title&gt;</pre>
<pre>    &lt;/title&gt;</pre>
<pre>    &lt;link rel="stylesheet" type="text/css" href="style.css" /&gt;</pre>
<pre>    &lt;/head&gt;</pre>
<pre>    &lt;body&gt;</pre>
<pre>        &lt;?php require_once ("header.php"); ?&gt;</pre>
<pre>        &lt;?php require_once ("content.php"); ?&gt;</pre>
<pre>        &lt;?php require_once ("footer.php"); ?&gt;</pre>
<pre>    &lt;/body&gt;</pre>
<pre>&lt;/html&gt;</pre>
<p>Note this also includes other files, like the header, function, and footer documents, but they aren&#8217;t required to have, they&#8217;re just apart of the design structure.</p>
<p><strong>3) Write the PHP Script</strong></p>
<p>Now all we need to do is get the database to actually read the different DB rows as separate webpages. To do this we will be using the PHP superglobal associative array $_GET, and a mysql_fetch function. If you caught the additional function in the above index.php file, we also included a file called content.php. This is where the script will be stored. First, we need to write some PHP variables:</p>
<pre>$id = $_GET['id'];</pre>
<pre>$query = "SELECT * FROM Page WHERE id='$id'";</pre>
<pre>$results = mysql_query($query, $link) or die(mysql_error());</pre>
<p>If you noticed, we assigned the $id variable to the PHP superglobal $_GET, where we want it to &#8220;get&#8221; the ID from each column and return all the information in that row based upon it&#8217;s ID, and what we tell it to later, which you can tell by the SQL query I wrote for the $query variable. The $results variable basically just combines everything we want it to do and kill it in case there&#8217;s an error, (You can see what we&#8217;re getting from the $link variable in the config.php file).</p>
<p>The $_GET superglobal is also useful for passing variables onto the end of a URL string. Let me try to explain. Since the script is asking for the ID from the page table we created earlier, we can now apprehend a result to the end of the URL via a question mark (?). For example, say we want to fetch the data contained in the first row, we can call upon the ID to fetch us everything we ask for (which is what we&#8217;re going to write next). I know, it sounds confusing, but with more practice, you&#8217;ll eventually get the hang of it.</p>
<p>Now to actually display that data on the webpage, we need to write a while loop using a mysql_fetch_array PHP function:</p>
<pre>while($row = mysql_fetch_array($results))</pre>
<pre>    {</pre>
<pre>    echo "&lt;div id='title'&gt;" . $row['title'] . "&lt;/div&gt; &lt;div id='content'&gt;" . $row['content'];</pre>
<pre>    echo "&lt;/div&gt;&lt;br /&gt;";</pre>
<pre>    }</pre>
<pre>?&gt;</pre>
<p>The while loop basically tells us that &#8220;while&#8221; we are fetching the DB row info, here&#8217;s what we&#8217;re doing with it. In this instance, just echoing the data onto the page. Since the first thing we are asking for is the data contained within the title column, the PHP will display this for us via the $row variable, because it &#8220;fetches&#8221; this specific instance of the array (whatever we ask for when we type the URL address in).</p>
<p>You could also base the URL off of other portions of the DB table if you wanted to, like &#8220;title&#8221; for example. You&#8217;d just have to get the title data via the $_GET superglobal and ask for it when you assign the value to an array via a variable (aka $title = $_GET['title'];) along with altering the other variables appropriately. You can name your variables whatever you wish, I just used $title for convenience.</p>
<p>In addition to the PHP, I&#8217;ve also echoed some div elements which help style the content appropriately through the stylesheet (they&#8217;re not a portion of the tutorial, but you can use whatever CSS properties you desire to apply).</p>
<p>Now after understanding the technical aspects behind the PHP code, we just need to put it all together. Save the following code as content.php:</p>
<pre>&lt;?php</pre>
<pre>$id = $_GET['id'];</pre>
<pre>$query = "SELECT * FROM Entry_Page WHERE id='$id'";</pre>
<pre>$results = mysql_query($query, $link) or die(mysql_error());</pre>
<pre>while($row = mysql_fetch_array($results))</pre>
<pre>    {</pre>
<pre>    echo "&lt;div id='title'&gt;" . $row['title'] . "&lt;/div&gt; &lt;div id='content'&gt;" . $row['content'];</pre>
<pre>    echo "&lt;/div&gt;&lt;br /&gt;";</pre>
<pre>    }</pre>
<pre>?&gt;</pre>
<p><strong>4) Place the Finishing Touches on the Site</strong></p>
<p>And now upload everything to the server, all in the same folder: index.php, config.php, and content.php (also header.php, footer.php, and style.css if you bothered to edit / create them yourself, so the site doesn&#8217;t look like crap).</p>
<p>Now you can access the different pages you created by calling upon the MySQL database via the various URL variables, in essence &#8220;creating the webpages based upon whatever information is stored within the field&#8217;s (ID&#8217;s) row&#8221;.</p>
<p>And there you have it, your very first Database-Driven Website!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lightningshock.com/2009/09/05/how-to-create-and-understand-a-simple-database-driven-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Comprehensive List of Web and Programming Languages to Learn</title>
		<link>http://www.lightningshock.com/2009/04/02/a-comprehensive-list-of-web-and-programming-languages-to-learn/</link>
		<comments>http://www.lightningshock.com/2009/04/02/a-comprehensive-list-of-web-and-programming-languages-to-learn/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 17:28:30 +0000</pubDate>
		<dc:creator>James Lewitzke</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Satire]]></category>

		<guid isPermaLink="false">http://www.lightningshock.com/?p=87</guid>
		<description><![CDATA[Not sure which programming language you want to learn? Don&#8217;t even know if you want to write software, develop websites, or enter some other sort of programming field? Well below I composed a list of the top languages you can start learning today: Ajax = The #1 language of plumbers worldwide. ASP = Stands for [...]]]></description>
			<content:encoded><![CDATA[<p>Not sure which programming language you want to learn? Don&#8217;t even know if you want to write software, develop websites, or enter some other sort of programming field? Well below I composed a list of the top languages you can start learning today:</p>
<p><span id="more-87"></span></p>
<p><strong>Ajax = </strong>The #1 language of plumbers worldwide.</p>
<p><strong>ASP = </strong>Stands for Arachnid Spider Presence. It&#8217;s the language used by electronic spider crawlers to weave the web together.</p>
<p><strong>ASP.NET = </strong>Same as ASP, except the spiders are armed with nets they shoot out of their rear to assist with the weaving.</p>
<p><strong>BASIC = </strong>Boot Camp for programmers, this is where they go to learn the &#8216;basics&#8217;.</p>
<p><strong>C =</strong> Your language for average programmers, given they couldn&#8217;t earn a grade above C in school.</p>
<p><strong>C++ = </strong>A really difficult and more confusing version of the C programming language.</p>
<p><strong>C# = </strong>The musical implementation of C.</p>
<p><strong>ColdFusion = </strong>The programming language of Nuclear Scientists and Astrophysicists, who often conduct and compile the code in deep space.</p>
<p><strong>CSS =</strong> Short for Corrupt Schutzstaffel. Extensively used by Web Nazis to force old school webmasters to design within their standards. CSS has it&#8217;s roots in Germany, where Hitler used this language to plan the holocaust before World War II.</p>
<p><strong>Flash =</strong> What female programmers do.</p>
<p><strong>HTML = </strong>Abbreviated form of How-To-Make-a-Language. It&#8217;ll present tutorials and examples needed ro understand web programming and site creation.</p>
<p><strong>Java = </strong>This language requires you to not only become addicted to coffee, but you must also learn how to code with it.<strong><br />
</strong></p>
<p><strong>Javascript =</strong> Hollywood&#8217;s version of Java. Don&#8217;t forget that after you finish writing your script, you must submit it to every web director(y) you can find for approval.</p>
<p><strong>MySQL = </strong>Stands for My-Station&#8217;s-Quick-Learner. My Network TV is a prime example of this language in action. See PHP for details.</p>
<p><strong>Perl = </strong>A shortened version of pearl, commonly used by upper-class people to show off their wealth.</p>
<p><strong>PHP = </strong>Short for Programming-with-a-Highdef-Priority. Geeks often use this method to to multi-task (ala setting their TiVOs and watching Television) when writing their code. Often used in conjunction with a station&#8217;s quick learner for creating efficient television programming schedules.</p>
<p><strong>Python =</strong> The programming language of snakes. Learn it if you have a fondness for scales and slithering.</p>
<p><strong>Ruby = </strong>The sister language of Perl.</p>
<p><strong>Visual Basic = </strong>Just a more graphic and violent version of basic, see basic above.<strong><br />
</strong></p>
<p><strong>XHTML = </strong>HTML on Steroids.</p>
<p><strong>XML =</strong> An erotic markup language, basically used to create porn sites.</p>
<p>There you go, every programming language you need to know or learn, hopefully this list will help you choose a new place to begin as much as it did for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lightningshock.com/2009/04/02/a-comprehensive-list-of-web-and-programming-languages-to-learn/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>How to Repeat Youtube Videos Automatically</title>
		<link>http://www.lightningshock.com/2009/03/06/how-to-repeat-youtube-videos-automatically/</link>
		<comments>http://www.lightningshock.com/2009/03/06/how-to-repeat-youtube-videos-automatically/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 21:43:37 +0000</pubDate>
		<dc:creator>James Lewitzke</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Music]]></category>

		<guid isPermaLink="false">http://www.lightningshock.com/?p=85</guid>
		<description><![CDATA[If you&#8217;re like me, and enjoy listening to the music videos on Youtube, you may get tired of having to manually click the replay button every time the song ends. It is possible to reiterate each video on it&#8217;s own, all you have to do is enter in a URI with specific looping parameters. The [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re like me, and enjoy listening to the music videos on Youtube, you may get tired of having to manually click the replay button every time the song ends.<span id="more-85"></span></p>
<p>It is possible to reiterate each video on it&#8217;s own, all you have to do is enter in a URI with specific looping parameters. The following is the format you will use to accomplish this task:</p>
<p>http://www.youtube.com/v/(VideoID)&amp;loop=1</p>
<p>This will redirect you to a much longer URI, but don&#8217;t worry about it, it will still achieve the same results. To see a full list of Youtube parameters available, just visit their <a href="http://code.google.com/apis/youtube/player_parameters.html">embedded player parameters page</a>.</p>
<p>To find the ID of a Youtube video however, visit the video page as you would normally would, like this one for example:</p>
<p><a href="http://www.youtube.com/watch?v=YUVwcnhoUJQ">http://www.youtube.com/watch?v=YUVwcnhoUJQ</a></p>
<p>Every character after the equals sign is included in the video ID (meaning this video&#8217;s ID is YUVwcnhoUJQ). So in order to repeat this video automatically (and to see an example of a repeating video in action), the full URI will be:</p>
<p><a href="http://www.youtube.com/v/YUVwcnhoUJQ&amp;loop=1">http://www.youtube.com/v/YUVwcnhoUJQ&amp;loop=1</a></p>
<p>This is a great way to listen to your favorite songs over and over again without much effort, (while purchasing the song or album at a later date, of course).</p>
<p>UPDATE 5/18/2009 = The old video seems to have died, so I put up another one, a really great new song.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lightningshock.com/2009/03/06/how-to-repeat-youtube-videos-automatically/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>New HTML Attribute Values For Everyone</title>
		<link>http://www.lightningshock.com/2008/09/30/new-html-attribute-values-for-everyone/</link>
		<comments>http://www.lightningshock.com/2008/09/30/new-html-attribute-values-for-everyone/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 04:42:50 +0000</pubDate>
		<dc:creator>James Lewitzke</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Satire]]></category>

		<guid isPermaLink="false">http://www.lightningshock.com/?p=79</guid>
		<description><![CDATA[So many SEO&#8217;s out there like to believe they can create new HTML values, such as dofollow. Here&#8217;s a newsflash for those of you who refer to normal links as dofollow: Dofollow Doesn&#8217;t Exist! Don&#8217;t follow that! dofollow this instead. http://dictionary.reference.com/browse/dofollow Just because one Search Engine implements a new value for the relationship attribute of [...]]]></description>
			<content:encoded><![CDATA[<p>So many SEO&#8217;s out there like to believe they can create new HTML values, such as dofollow. Here&#8217;s a newsflash for those of you who refer to normal links as dofollow: Dofollow Doesn&#8217;t Exist!</p>
<p><a href="http://www.modtalk.co.uk/talk/seo/dont-follow-that-dofollow-this-instead">Don&#8217;t follow that! dofollow this instead</a>.</p>
<p><a href="http://dictionary.reference.com/browse/dofollow">http://dictionary.reference.com/browse/dofollow</a></p>
<p>Just because one Search Engine implements a new value for the relationship attribute of anchor elements doesn&#8217;t mean you have to refer to the norm as something else based of the new value.<span id="more-79"></span></p>
<p><span style="color: #000000;">.</span></p>
<p>But hey, as long as we&#8217;re inventing new HTML Attribute Values and making up buzzwords, I have a few more I&#8217;d like to add to the list:</p>
<p><strong>Badfollow =</strong> an OBL&#8217;s value telling Google that the page it&#8217;s linking to is awful and absolutely SUCKS!</p>
<p>Example = &lt;a href=&#8221;http://forums.digitalpoint.com/&#8221; rel=&#8221;badfollow&#8221;&gt;Digital Point Forums&lt;/a&gt;</p>
<p><strong>NoText =</strong> This is a brand new HTML style Attribute Value added to various text elements (ie: &lt;p&gt;, &lt;h1&gt;, etc.) you use to tell the browser you don&#8217;t want the text to be displayed anywhere in any fashion. It will look something like this:</p>
<p>&lt;p style=&#8221;notext&#8221;&gt;This is some Text.&lt;/p&gt;</p>
<p>Which will output this:</p>
<p><span style="color: #000000;">.</span></p>
<p>Perfect to use for Text you don&#8217;t want to show anyone who visits the Page! Even Search Engines will ignore this Element now!</p>
<p><strong>Superlink =</strong> a new link descriptor that takes you to another web page and then brings you back to the original page almost instantaneously. It&#8217;ll be like you never left the first page to begin with!</p>
<p>Just add &#8220;super&#8221; to the target attribute, like so:</p>
<p>&lt;a href=&#8221;http://www.lightningshock.com&#8221; target=&#8221;super&#8221;&gt;Greatest Website Ever&lt;/a&gt;</p>
<p><span style="color: #000000;">.</span></p>
<p>These new Values are going to be a MUST for any SEO, new or experienced, or any webmaster for that matter, who wishes to code and market their site properly!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lightningshock.com/2008/09/30/new-html-attribute-values-for-everyone/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to Create a Widgetized Page in WordPress</title>
		<link>http://www.lightningshock.com/2008/06/10/how-to-create-a-widgetized-page-in-wordpress/</link>
		<comments>http://www.lightningshock.com/2008/06/10/how-to-create-a-widgetized-page-in-wordpress/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 23:17:26 +0000</pubDate>
		<dc:creator>James Lewitzke</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://www.lightningshock.com/?p=54</guid>
		<description><![CDATA[This tutorial I&#8217;m writing will show you the basics of how to add widgets to the actual page of a blog, rather than just having widgets contained within the sidebar. I was assisted by Joni Mueller in the process. This will allow you to easily display things like &#8220;Recent Posts&#8221;, Text inserts, and even Google [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial I&#8217;m writing will show you the basics of how to add widgets to the actual page of a blog, rather than just having widgets contained within the sidebar. I was assisted by <a href="http://www.pixelita.com/">Joni Mueller</a> in the process.</p>
<p>This will allow you to easily display things like &#8220;Recent Posts&#8221;, Text inserts, and even Google Adsense Ads on your homepage. My website&#8217;s front page was created using this process, so I will specifically teach you how two create a two column page layout. Any text editor will do, I used Notepad++, which works great.<span id="more-54"></span></p>
<p>First, you have to register the widgets and create two new custom sidebars for your theme. I named each sidebar &#8220;col-left&#8221; and &#8220;col-right&#8221;, so, if you wish to name them something differently, then replace the phrase within the code appropriately. To do this, open your functions.php file in your theme&#8217;s folder and insert the following code (It works fine for me right at the top of the file):</p>
<p><code>&lt;?php<br />
if ( function_exists('register_sidebar') )<br />
register_sidebar(array('name'=&gt;'col-left',<br />
'before_widget' =&gt; '',<br />
'after_widget' =&gt; '',<br />
'before_title' =&gt; '&lt;h2&gt;',<br />
'after_title' =&gt; '&lt;/h2&gt;',<br />
));<br />
register_sidebar(array('name'=&gt;'col-right',<br />
'before_widget' =&gt; '',<br />
'after_widget' =&gt; '',<br />
'before_title' =&gt; '&lt;h2&gt;',<br />
'after_title' =&gt; '&lt;/h2&gt;',<br />
));<br />
?&gt;</code></p>
<p>Assuming your theme is already using widgets, you&#8217;ll want to find the specific section of code in functions.php where the widgets are already registered. For my theme, this is where it was:</p>
<p><code>&lt;?php<br />
if (function_exists('register_sidebar')) {<br />
register_sidebar();<br />
register_sidebar();<br />
register_sidebar(array('name'=&gt;'Royale Top'));<br />
register_sidebar(array('name'=&gt;'Royale Bottom'));<br />
}</code></p>
<p>And then I added the newly defined sidebars to it, like this:</p>
<p><code>&lt;?php<br />
if (function_exists('register_sidebar')) {<br />
<strong> register_sidebar();<br />
register_sidebar();</strong><br />
register_sidebar();<br />
register_sidebar();<br />
<strong> register_sidebar(array('name'=&gt;'col-left'));<br />
register_sidebar(array('name'=&gt;'col-right'));</strong><br />
register_sidebar(array('name'=&gt;'Royale Top'));<br />
register_sidebar(array('name'=&gt;'Royale Bottom'));<br />
}</code></p>
<p>Now that we&#8217;ve got the functions out of the way, we need to create a Page Template. For my homepage, I decided to include a header, footer, and the new widget sidebars we just defined.</p>
<p>Open a new text document and save the file, I decided to call it welcome.php. To be sure that wordpress reads this appropriately, we need to include the template name in the file, like so:</p>
<p><code>&lt;?php</code></p>
<p><code>/*<br />
Template Name: Welcome Page<br />
*/<br />
?&gt;</code></p>
<p>And to include the sidebars and everything else in this specific template, insert the following:</p>
<p><code>&lt;?php get_header(); ?&gt;</code></p>
<p><code>&lt;div id="widecontent"&gt;<br />
&lt;div id="col-left"&gt;<br />
&lt;?php if ( !function_exists('dynamic_sidebar')<br />
|| !dynamic_sidebar('col-left') ) : ?&gt;<br />
&lt;?php endif; ?&gt;<br />
&lt;/div&gt;<br />
&lt;div id="col-right"&gt;<br />
&lt;?php if ( !function_exists('dynamic_sidebar')<br />
|| !dynamic_sidebar('col-right') ) : ?&gt;<br />
&lt;?php endif; ?&gt;<br />
&lt;/div&gt;</code></p>
<p><code>&lt;/div&gt;</code></p>
<p><code>&lt;?php get_footer(); ?&gt;</code></p>
<p>Then you can upload the welcome.php we just created to your theme&#8217;s root folder (the same folder that contains your functions.php file). To actually apply this template is fairly easy, just go to &#8220;Write &gt; Page&#8221;, scroll down to &#8220;Page Template&#8221; and select the appropriate file you just created (Welcome Page, in my case). Then go to &#8220;Design &gt; Widgets&#8221; and select which features you want to appear in each sidebar (col-left and col-right).</p>
<p>Woohoo! The sidebars are now showing up on the main page. But, it looks pretty bad, just one underneath the other. To adjust where and how these widgets look, we must apply styles to the newly created sidebars. If you&#8217;ve noticed, when we coded the template, we applied some divisional IDs to the sidebars, so we have to open up style.css and insert them somewhere (preferably a section where you&#8217;ll be able to find them easily) and float the sidebars and add margins to the content, for example:</p>
<p><code>#widecontent {<br />
font-size: 1.9em;<br />
width: 45%;<br />
list-style: none;<br />
margin-left: 100px;<br />
}</code></p>
<p><code>#col-left {<br />
float: left;<br />
}</code></p>
<p><code>#col-right {<br />
float: left;<br />
}</code></p>
<p>It&#8217;s really up to you how you want to style the sidebars, so have fun and play around with them for a little bit. Adjust them to your personal tastes and likings. I was able to include many things on my homepage now that I wasn&#8217;t able to before.</p>
<p>(UPDATE = 6/21/2009) I made a few style changes to the homepage, so it doesn&#8217;t look exactly like the code written above, however the basic premise of the concept is still the same. The Homepage still uses a widgetized page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lightningshock.com/2008/06/10/how-to-create-a-widgetized-page-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How to Fix the SRG Clean Archives WordPress 2.5 Plugin Bug</title>
		<link>http://www.lightningshock.com/2008/05/12/how-to-fix-the-srg-clean-archives-wordpress-25-plugin-bug/</link>
		<comments>http://www.lightningshock.com/2008/05/12/how-to-fix-the-srg-clean-archives-wordpress-25-plugin-bug/#comments</comments>
		<pubDate>Mon, 12 May 2008 22:30:34 +0000</pubDate>
		<dc:creator>James Lewitzke</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://www.lightningshock.com/?p=72</guid>
		<description><![CDATA[For those that have recently updated to WordPress 2.5, you have probably experienced a few bugs and workarounds along the way. The Plugin First I want to say that the SRG Clean Archives Plugin is the BEST Archive plugin for wordpress out there. If you don&#8217;t have it installed, I&#8217;d highly recommend you do. The [...]]]></description>
			<content:encoded><![CDATA[<p>For those that have recently updated to WordPress 2.5, you have probably experienced a few bugs and workarounds along the way.<span id="more-72"></span></p>
<p><strong>The Plugin</strong></p>
<p>First I want to say that the <a href="http://www.idunzo.com/projects/clean-archives/">SRG Clean Archives</a> Plugin is the BEST Archive plugin for wordpress out there. If you don&#8217;t have it installed, I&#8217;d highly recommend you do.</p>
<p><strong>The Problem</strong></p>
<p>When you download the plugin, everything should be working fine, display-wise. You can still create the page and have a list of all your blog posts in one place.</p>
<p>However, in the administration control panel, you&#8217;ll notice that the plugin will NOT allow you to update options. After you check a few off and click &#8220;Update Options&#8221; It takes you to a completely blank, white screen.</p>
<p><strong>The Solution</strong></p>
<p>The fix for this error is actually pretty simple. Just open up the srg_clean_archives.php file in a text editor, scroll down to approximately line 240 or so. Look for this highlighted portion of the code:</p>
<p><code>function srg_admin_page() {<br />
if (isset($_POST['srg_submit'])) {</code></p>
<p><code><strong>check_admin_referer( '$myplugin_nonce', $myplugin_nonce );</strong></code></p>
<p><code>if (isset($_POST['srg_show-comments'])) {<br />
update_option('srg-clean_comment-display', 'true');<br />
} else {<br />
update_option('srg-clean_comment-display', 'false');<br />
}</code></p>
<p>And add two forward slashes in front of that line, so you&#8217;ll end up with this:</p>
<p><code>function srg_admin_page() {<br />
if (isset($_POST['srg_submit'])) {</code></p>
<p><code><strong>// check_admin_referer( '$myplugin_nonce', $myplugin_nonce );</strong></code></p>
<p><code>if (isset($_POST['srg_show-comments'])) {<br />
update_option('srg-clean_comment-display', 'true');<br />
} else {<br />
update_option('srg-clean_comment-display', 'false');<br />
}</code></p>
<p>Now you can change and edit all the plugin options you wish to make. <img src='http://www.lightningshock.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Lastly, I have to give credit to <a href="http://wordpress.org/support/profile/512135">clowny</a> for finding the error.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lightningshock.com/2008/05/12/how-to-fix-the-srg-clean-archives-wordpress-25-plugin-bug/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.439 seconds -->
