<?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>DJS Consulting Tech Blog &#187; Programming</title>
	<atom:link href="http://djs-consulting.com/linux/blog/category/programming/feed" rel="self" type="application/rss+xml" />
	<link>http://djs-consulting.com/linux/blog</link>
	<description>Technical Information You Can Use (or not - but hey, at least it&#039;s free!)</description>
	<lastBuildDate>Tue, 02 Mar 2010 19:11:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Oracle SQL Developer Debian Package</title>
		<link>http://djs-consulting.com/linux/blog/2008/oracle-sql-developer-debian-package</link>
		<comments>http://djs-consulting.com/linux/blog/2008/oracle-sql-developer-debian-package#comments</comments>
		<pubDate>Wed, 29 Oct 2008 13:17:13 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[deb]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[rpm]]></category>
		<category><![CDATA[sql developer]]></category>
		<category><![CDATA[toad]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.djs-consulting.com/linux/blog/?p=72</guid>
		<description><![CDATA[Oracle SQL Developer is a Java-based tool that provides a graphical interface to a database.  While it&#8217;s main focus is Oracle (of course), it can be hooked up, via JDBC, to many other databases, such as MySQL, PostgreSQL, and SQL Server.  It&#8217;s similar to Toad, but is provided by Oracle at no cost.
Oracle [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.oracle.com/technology/products/database/sql_developer/index.html" title="Oracle SQL Developer &bull; Oracle">Oracle SQL Developer</a> is a Java-based tool that provides a graphical interface to a database.  While it&#8217;s main focus is Oracle (of course), it can be hooked up, via JDBC, to many other databases, such as MySQL, PostgreSQL, and SQL Server.  It&#8217;s similar to <a href="http://www.toadsoft.com/">Toad</a>, but is provided by Oracle at no cost.</p>
<p>Oracle provides SQL Developer in either an RPM, or a generic binary install.  I like the ability to manage packages, but I&#8217;ve never had much luck at getting RPM to run on Ubuntu.  I downloaded the RPM file, and, using <a href="http://kitenet.net/~joey/code/alien/">alien</a>, I converted the package to a .deb package (Debian package format) and installed it.  I worked like a charm!</p>
<p>I haven&#8217;t tested it with gcj, but using Sun&#8217;s Java 6 update 7 from the Ubuntu repositories, it ran just fine.  After you install the package, do a directory list on /usr/lib/jvm.  You&#8217;re looking for the Sun JDK &#8211; if it&#8217;s installed, you&#8217;ll have a symlink java-6-sun that points to java-6-sun-1.6.0.07.  Once you&#8217;ve determined the location of the JDK, run &#8220;sqldeveloper&#8221; from the command line &#8211; the program will prompt you for the path to your JDK.  Enter it (probably &#8220;/usr/lib/jvm/java-6-sun&#8221;) and you&#8217;re good to go.  (You have to install the package as root &#8211; but, for the rest of these steps, use your normal user, not root, as this puts settings in a .sqldeveloper directory off your home directory.)  The package installs an icon in the &#8220;Programming&#8221; or &#8220;Development&#8221; group.  Once you&#8217;ve told it where the JDK is, you can use this to launch it.</p>
<p><a href="http://www.djs-consulting.com/linux/software/sqldeveloper/sqldeveloper_1.5.54.40-2_all.deb" title="SQL Developer 1.5.1 Debian Package &bull; DJS Consulting Linux Software Repository">Download SQL Developer 1.5.1 Debian Package</a></p>
]]></content:encoded>
			<wfw:commentRss>http://djs-consulting.com/linux/blog/2008/oracle-sql-developer-debian-package/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Daniel&#8217;s DropDowns 2.1 &#8211; WordPress Plug-In</title>
		<link>http://djs-consulting.com/linux/blog/2008/daniels-dropdowns-21-wordpress-plug-in</link>
		<comments>http://djs-consulting.com/linux/blog/2008/daniels-dropdowns-21-wordpress-plug-in#comments</comments>
		<pubDate>Sat, 10 May 2008 02:14:39 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Plug-Ins]]></category>

		<guid isPermaLink="false">http://www.djs-consulting.com/linux/blog/?p=64</guid>
		<description><![CDATA[Version 2.1 of Daniel&#8217;s DropDowns has been released.  This fixes a problem introduced with the 2.5-series of WordPress &#8211; the output of the WordPress tag changed, so the search-and-replace portion that added a &#8220;Select Category&#8221; entry didn&#8217;t work.  This has been fixed in version 2.1.  I also corrected a small bug that [...]]]></description>
			<content:encoded><![CDATA[<p>Version 2.1 of Daniel&#8217;s DropDowns has been released.  This fixes a problem introduced with the 2.5-series of WordPress &#8211; the output of the WordPress tag changed, so the search-and-replace portion that added a &#8220;Select Category&#8221; entry didn&#8217;t work.  This has been fixed in version 2.1.  I also corrected a small bug that caused the first entry in the category list to be selected if a default wasn&#8217;t specified.</p>
<p>It can be downloaded from the <a href="http://wordpress.org/extend/plugins/daniels-dropdowns/">WordPress Plug-In Directory</a>.  Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://djs-consulting.com/linux/blog/2008/daniels-dropdowns-21-wordpress-plug-in/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>A Handy PHP Backup Script</title>
		<link>http://djs-consulting.com/linux/blog/2008/a-handy-php-backup-script</link>
		<comments>http://djs-consulting.com/linux/blog/2008/a-handy-php-backup-script#comments</comments>
		<pubDate>Sat, 29 Mar 2008 05:06:03 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[mysqldump]]></category>
		<category><![CDATA[pg_dump]]></category>

		<guid isPermaLink="false">http://www.djs-consulting.com/linux/blog/2008/a-handy-php-backup-script</guid>
		<description><![CDATA[I found a script over on the Lunarpages Forums about using PHP to back up your site.  I have taken it, modified it a little, beefed up the documentation a lot, and am now posting it here.  You can download the source code for it, and it is also displayed below.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
&#60;?php
/**
 * Generic [...]]]></description>
			<content:encoded><![CDATA[<p>I found a script over on the Lunarpages Forums about <a href="http://www.lunarforums.com/lunarpages_how_tos/site_and_mysql_backups_via_cron-t22118.0.html" title="Site and MySQL backups via cron - Lunarforums">using PHP to back up your site</a>.  I have taken it, modified it a little, beefed up the documentation a lot, and am now posting it here.  You can <a href="/linux/generic_backup.txt" title="Generic Backup Script">download the source code</a> for it, and it is also displayed below.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
</pre></td><td class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #0000ff; font-style: italic;">/**
 * Generic Backup Script.
 * 
 * To configure this script for your purposes, just edit the parameters below.
 * Once you have the parameters set properly, when the script executes, it will
 * create an archive file, gzip it, and e-mail it to the address specified.  It
 * can be executed through cron with the command
 * 
 * php -q [name of script]
 * 
 * You are free to use this, modify it, copy it, etc.  However, neither DJS
 * Consulting nor Daniel J. Summers assume any responsibility for good or bad
 * things that happen when modifications of this script are run.
 * 
 * @author Daniel J. Summers &lt;daniel@djs-consulting.com&gt;
 */</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// --- SCRIPT PARAMETERS ---</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/*  -- File Name --
	This is the name of the file that you're backing up, and should contain no
	slashes.  For example, if you're backing up a database, this might look
	something like...
$sFilename = &quot;backup-my_database_name-&quot; . date(&quot;Y-m-d&quot;) . &quot;.sql&quot;; */</span>
<span style="color: #000088;">$sFilename</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;backup-[whatever-it-is]-&quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Y-m-d&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;.[extension]&quot;</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">/*  -- E-mail Address --
	This is the e-mail address to which the message will be sent. */</span>
<span style="color: #000088;">$sEmailAddress</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;[your e-mail address]&quot;</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">/*  -- E-mail Subject --
	This is the subject that will be on the e-mail you receive. */</span>
<span style="color: #000088;">$sEmailSubject</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;[something meaningful]&quot;</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">/*  -- E-mail Message --
	This is the text of the message that will be sent. */</span>
<span style="color: #000088;">$sMessage</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Compressed database backup file $sFilename.gz attached.&quot;</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">/*  -- Backup Command --
	This is the command that does the work.
&nbsp;
	A note on the database commands - your setup likely requires a password
	for these commands, and they each allow you to pass a password on the
	command line.  However, this is very insecure, as anyone who runs &quot;ps&quot; can
	see your password!  For MySQL, you can create a ~/.my.cnf file - it is
	detailed at http://dev.mysql.com/doc/refman/4.1/en/password-security.html .
	For PostgreSQL, the file is ~/.pgpass, and it is detailed at
	http://www.postgresql.org/docs/8.0/interactive/libpq-pgpass.html .  Both of
	these files should be chmod-ded to 600, so that they can only be viewed by
	you, the creator.
&nbsp;
	That being said, some common commands are...
&nbsp;
- Backing Up a MySQL Database
$sBackupCommand = &quot;mysqldump -u [user_name] [db_name] &gt; $sFilename&quot;;
&nbsp;
- Backing Up a PostgreSQL Database
$sBackupCommand = &quot;pg_dump [db_name] -h localhost -U [user_name] -d -O &gt; $sFilename&quot;;
&nbsp;
- Backing Up a set of files (tar and gzip)
$sBackupCommand = &quot;tar cvf $sFilename [directory]/*&quot;;
&nbsp;
Whatever command you use, this script appends .gz to the filename after the command is executed.  */</span>
<span style="color: #000088;">$sBackupCommand</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;[a backup command]&quot;</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">// --- END OF SCRIPT PARAMETERS ---</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">// Edit below at your own risk.  :)</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Do the backup.</span>
<span style="color: #000088;">$sResult</span> <span style="color: #339933;">=</span> <span style="color: #990000;">passthru</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sBackupCommand</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;; gzip $sFilename&quot;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #000088;">$sFilename</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;.gz&quot;</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">// Create the message.</span>
<span style="color: #000088;">$sMessage</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Compressed database backup file $sFilename attached.&quot;</span>;
<span style="color: #000088;">$sMimeBoundary</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;&lt;&lt;:&quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #000088;">$sData</span> <span style="color: #339933;">=</span> <span style="color: #990000;">chunk_split</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">base64_encode</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">file</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sFilename</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #000088;">$sHeaders</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;From: $sEmailAddress<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
		<span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;MIME-Version: 1.0<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
		<span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;Content-type: multipart/mixed;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
		<span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot; boundary=<span style="color: #000099; font-weight: bold;">\&quot;</span>$sMimeBoundary<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
&nbsp;
<span style="color: #000088;">$sContent</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;This is a multi-part message in MIME format.<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
		<span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;--$sMimeBoundary<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
		<span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;Content-Type: text/plain; charset=<span style="color: #000099; font-weight: bold;">\&quot;</span>iso-8859-1<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
		<span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;Content-Transfer-Encoding: 7bit<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
		<span style="color: #339933;">.</span> <span style="color: #000088;">$sMessage</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
		<span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;--$sMimeBoundary<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
		<span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;Content-Disposition: attachment;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
		<span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;Content-Type: Application/Octet-Stream; name=<span style="color: #000099; font-weight: bold;">\&quot;</span>$sFilename<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
		<span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;Content-Transfer-Encoding: base64<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
		<span style="color: #339933;">.</span> <span style="color: #000088;">$sData</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
		<span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;--$sMimeBoundary<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">// Send the message.</span>
<span style="color: #990000;">mail</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sEmailAddress</span><span style="color: #339933;">,</span> <span style="color: #000088;">$sEmailSubject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$sContent</span><span style="color: #339933;">,</span> <span style="color: #000088;">$sHeaders</span><span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">// Delete the file - we don't need it any more.</span>
<span style="color: #990000;">unlink</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sFilename</span><span style="color: #009900;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://djs-consulting.com/linux/blog/2008/a-handy-php-backup-script/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Algorithm for One-to-Many Child Table Updates</title>
		<link>http://djs-consulting.com/linux/blog/2008/algorithm-for-one-to-many-child-table-updates</link>
		<comments>http://djs-consulting.com/linux/blog/2008/algorithm-for-one-to-many-child-table-updates#comments</comments>
		<pubDate>Sat, 29 Mar 2008 03:13:21 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[many-to-one]]></category>
		<category><![CDATA[one-to-many]]></category>
		<category><![CDATA[pdo]]></category>

		<guid isPermaLink="false">http://www.djs-consulting.com/linux/blog/2008/algorithm-for-one-to-many-child-table-updates</guid>
		<description><![CDATA[While working on the Not So Extreme Makeover: Community Edition site, I came up with an algorithm that simplifies anything else I&#8217;ve ever written to deal with this condition.  I&#8217;ll set the scenario, explain the algorithm, share how I implemented it in PHP, and provide a modification if the scenario is a bit more [...]]]></description>
			<content:encoded><![CDATA[<p>While working on the <a href="http://www.notsoextreme.org" title="Not So Extreme Makeover: Community Edition">Not So Extreme Makeover: Community Edition</a> site, I came up with an algorithm that simplifies anything else I&#8217;ve ever written to deal with this condition.  I&#8217;ll set the scenario, explain the algorithm, share how I implemented it in PHP, and provide a modification if the scenario is a bit more complicated.</p>
<p><strong>Scenario</strong> &#8211; You have two parent tables, and a child table with a many-to-one relationship with both parent tables, used to map entries in the two parent tables to each other.  For this example, we&#8217;ll use these three tables&#8230;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="sql sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> volunteer <span style="color: #66cc66;">&#40;</span>
    vol_id  integer  <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
    vol_last_name  varchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">50</span><span style="color: #66cc66;">&#41;</span>  <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
    <span style="color: #66cc66;">...</span>etc<span style="color: #66cc66;">...</span>
  <span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span> <span style="color: #66cc66;">&#40;</span>vol_id<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> r_volunteer_area <span style="color: #66cc66;">&#40;</span>
    rva_id  integer  <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
    rva_description  varchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span>  <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span> <span style="color: #66cc66;">&#40;</span>rva_id<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> volunteer_area <span style="color: #66cc66;">&#40;</span>
    va_volunteer_id  integer  <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
    va_area_id  integer  <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span> <span style="color: #66cc66;">&#40;</span>va_volunteer_id<span style="color: #66cc66;">,</span> va_area_id<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  <span style="color: #993333; font-weight: bold;">FOREIGN</span> <span style="color: #993333; font-weight: bold;">KEY</span> <span style="color: #66cc66;">&#40;</span>va_volunteer_id<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">REFERENCES</span> volunteer <span style="color: #66cc66;">&#40;</span>vol_id<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  <span style="color: #993333; font-weight: bold;">FOREIGN</span> <span style="color: #993333; font-weight: bold;">KEY</span> <span style="color: #66cc66;">&#40;</span>va_area_id<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">REFERENCES</span> r_volunteer_area <span style="color: #66cc66;">&#40;</span>rva_id<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p><strong>Algorithm</strong> &#8211; The three-step algorithm is as follows&#8230;</p>
<ol>
<li>Create a comma-delimited string of IDs for the child table.</li>
<li>Delete the IDs from the child table that are not in the list.</li>
<li>Insert the IDs into the child table that are not there already.</li>
</ol>
<p><strong>Implementation</strong> &#8211; In PHP, if you have an array, it&#8217;s easy to come up with comma-delimited list.  To get an array of values back in a post, define your fields with &#8220;[]&#8221; after the name&#8230;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="html4strict html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;checkbox&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;area[]&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;chkArea1&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">label</span> <span style="color: #000066;">for</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;chkArea1&quot;</span>&gt;</span>Do Something<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">label</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;checkbox&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;area[]&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;chkArea7&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;7&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">label</span> <span style="color: #000066;">for</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;chkArea7&quot;</span>&gt;</span>Do Something Else<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">label</span>&gt;</span></pre></td></tr></table></div>

<p>Here&#8217;s the PHP code, using <a href="http://us.php.net/pdo" title="PHP Data Objects (PDO)">PHP Data Objects (PDO)</a> as the database interface, behind a helper class that creates the statement, appends the parameters, and executes it.  <em>(The &#8220;quoting&#8221; escapes the statement to avoid potential SQL injection attacks &#8211; putting it in its own class would make the implementation here much cleaner.)</em></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
</pre></td><td class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #0000ff; font-style: italic;">/**
 * STEP 1
 *    Create a comma-delimited list of IDs.
 */</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Quote will return the string as '2,3,4' - since we're using this</span>
<span style="color: #666666; font-style: italic;">// as an IN clause of integers, we'll strip the quotes off.</span>
<span style="color: #000088;">$sAreas</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$pdo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">quote</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">join</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;,&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;area&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #000088;">$sAreas</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sAreas</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sAreas</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">// Quote the volunteer ID.</span>
<span style="color: #000088;">$iVol</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$pdo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">quote</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;vol&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> PDO<span style="color: #339933;">::</span><span style="color: #004000;">PARAM_INT</span><span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #0000ff; font-style: italic;">/**
 * STEP 2
 *    Delete the IDs that are no longer in the list.
 */</span>
<span style="color: #000088;">$dbService</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">executeCommand</span><span style="color: #009900;">&#40;</span>
    <span style="color: #0000ff;">&quot;DELETE FROM volunteer_area
    WHERE   va_volunteer_id = ?
        AND va_area_id NOT IN ($sAreas)&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$iVol</span><span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #0000ff; font-style: italic;">/**
 * STEP 3
 *    Insert the IDs that are not yet in the list.
 */</span>
<span style="color: #000088;">$dbService</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">executeCommand</span><span style="color: #009900;">&#40;</span>
    <span style="color: #0000ff;">&quot;INSERT INTO volunteer_area
        SELECT $iVol, rva_id
        FROM r_volunteer_area
        WHERE   rva_id IN ($sAreas)
            AND rva_id NOT IN
            (SELECT va_area_id
            FROM volunteer_area
            WHERE va_volunteer_id = ?)&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$iVol</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>;</pre></td></tr></table></div>

<p><strong>Modification</strong> &#8211; Suppose that now you accepted comments along with each of the checkboxes, so a simple two-integer insert/delete is no longer sufficient.  You would still only need to break step 3 into two steps.</p>
<ol>
<li>Get a list of IDs to update.</li>
<li>For each ID in the posted list
<ol>
<li>If the ID exists in the update list, update it.</li>
<li>Otherwise, insert it.</li>
</ol>
</li>
</ol>
<p>The implementation would then be able to use this list to make the decision without hitting the database every time.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Assume this returns an associative array of IDs.</span>
<span style="color: #000088;">$aUpdates</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$dbService</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">performSelect</span><span style="color: #009900;">&#40;</span>
    <span style="color: #0000ff;">&quot;SELECT va_area_id
    FROM volunteer_area
    WHERE   va_volunteer_id = ?
        AND va_area_id IN ($sAreas)&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$iVol</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;area&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$iArea</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">in_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$iArea</span><span style="color: #339933;">,</span> <span style="color: #000088;">$aUpdates</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">// Update the table</span>
        <span style="color: #339933;">...</span>etc<span style="color: #339933;">...</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">// Insert into the table</span>
        <span style="color: #339933;">...</span>etc<span style="color: #339933;">...</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>I think you&#8217;ll agree that this is much better than spinning through a loop, doing a count on each ID to see if it exists, then either doing an update or an insert based on the count.  And, while the implementation here is PHP, it could easily be implemented in any language that supports arrays and database access.</p>
]]></content:encoded>
			<wfw:commentRss>http://djs-consulting.com/linux/blog/2008/algorithm-for-one-to-many-child-table-updates/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HCSB Verse of the Day 2 &#8211; WordPress Plug-In</title>
		<link>http://djs-consulting.com/linux/blog/2008/hcsb-verse-of-the-day-2-wordpress-plug-in</link>
		<comments>http://djs-consulting.com/linux/blog/2008/hcsb-verse-of-the-day-2-wordpress-plug-in#comments</comments>
		<pubDate>Tue, 01 Jan 2008 18:02:14 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Plug-Ins]]></category>
		<category><![CDATA[bible]]></category>
		<category><![CDATA[gateway]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plug-in]]></category>
		<category><![CDATA[tags]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.djs-consulting.com/linux/blog/2008/hcsb-verse-of-the-day-2-wordpress-plug-in</guid>
		<description><![CDATA[I have released version 2 of HCSB Verse of the Day, the WordPress plug-in that provides a verse or passage each day, using the reference provided by BibleGateway.com.  I also completed the required files for the WordPress Plug-In Directory, so it can be downloaded from there.
New in this version..

New Tag &#8211; There is now [...]]]></description>
			<content:encoded><![CDATA[<p>I have released version 2 of HCSB Verse of the Day, the <a href="http://wordpress.org" title="WordPress">WordPress</a> plug-in that provides a verse or passage each day, using the reference provided by <a href="http://www.biblegateway.com" title="Bible Gateway">BibleGateway.com</a>.  I also completed the required files for the WordPress Plug-In Directory, so it can be <a href="http://wordpress.org/extend/plugins/hcsb-verse-of-the-day/" title="Download HCSB Verse of the Day 2">downloaded from there</a>.</p>
<p>New in this version..</p>
<ul>
<li><strong>New Tag</strong> &#8211; There is now a tag votd_hcsb() that puts out the heading, the text, the reference, and the credit line all in one.  This will simplify the template modification required to implement the plug-in.</li>
<li><strong>Custom Tag</strong> &#8211; There is a separate file where you can specify a separate group of tags, and the votd_hcsb() tag will utilize it instead of its default.  This also means that, even if future versions change the default, the custom tag layout will be used.</li>
<li><strong>Two Versions</strong> &#8211; WordPress (and most plug-ins) must be compatible with PHP version 4.  However, if your web server is running PHP version 5, there is now a PHP 5 version included.  It incorporates the object-oriented enhancements in PHP 5.</li>
<li><strong>Options Revamped</strong> &#8211; Since I initially wrote the plug-in, I&#8217;ve learned that WordPress allows an option to be an array.  So, to streamline its usage, the options are now an array, and only require one row in the database instead of five.  There is also a file to clean up the old options.</li>
<li><strong>Bug Fixes</strong> &#8211; BibleGateway.com changed the way they display multiple passages (ex. &#8220;Matthew 1:13, 17-19&#8243;); version 2 has a fix that makes that work again.</li>
</ul>
<p>As always, if you encounter any problems with the plug-in, just let me know and I&#8217;ll try to help.  Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://djs-consulting.com/linux/blog/2008/hcsb-verse-of-the-day-2-wordpress-plug-in/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Daniel&#8217;s DropDowns 2.0.1 &#8211; WordPress Plug-In</title>
		<link>http://djs-consulting.com/linux/blog/2007/daniels-dropdowns-201-wordpress-plug-in</link>
		<comments>http://djs-consulting.com/linux/blog/2007/daniels-dropdowns-201-wordpress-plug-in#comments</comments>
		<pubDate>Mon, 24 Dec 2007 17:34:06 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Plug-Ins]]></category>

		<guid isPermaLink="false">http://www.djs-consulting.com/linux/blog/2007/daniels-dropdowns-201-wordpress-plug-in</guid>
		<description><![CDATA[I have released version 2.0.1 of Daniel&#8217;s DropDowns, the WordPress plug-in that provides category and archive dropdown template tags.  It is available on its page at the WordPress Plug-In Directory.
This was a minor change &#8211; the auto-navigating lists added in version 2 needed a slight tweak.  There wasn&#8217;t a &#8220;select category&#8221; entry, so [...]]]></description>
			<content:encoded><![CDATA[<p>I have released version 2.0.1 of Daniel&#8217;s DropDowns, the <a href="http://wordpress.org">WordPress</a> plug-in that provides category and archive dropdown template tags.  It is available on <a href="http://wordpress.org/extend/plugins/daniels-dropdowns/" title="Download Daniel's DropDowns 2.0.1">its page at the WordPress Plug-In Directory</a>.</p>
<p>This was a minor change &#8211; the auto-navigating lists added in version 2 needed a slight tweak.  There wasn&#8217;t a &#8220;select category&#8221; entry, so one could not navigate to the first item in the list without going somewhere else first.  The category dropdown now has this entry, and is consistent with the archive dropdown.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://djs-consulting.com/linux/blog/2007/daniels-dropdowns-201-wordpress-plug-in/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Daniel&#8217;s DropDowns 2 &#8211; WordPress Plug-In</title>
		<link>http://djs-consulting.com/linux/blog/2007/daniels-dropdowns-2-wordpress-plug-in</link>
		<comments>http://djs-consulting.com/linux/blog/2007/daniels-dropdowns-2-wordpress-plug-in#comments</comments>
		<pubDate>Mon, 24 Dec 2007 06:02:19 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Plug-Ins]]></category>

		<guid isPermaLink="false">http://www.djs-consulting.com/linux/blog/2007/daniels-dropdowns-2-wordpress-plug-in</guid>
		<description><![CDATA[I have released version 2 of my category and archive drop-down plug-in for WordPress.  It is hosted at the WordPress Plug-In Directory &#8211; you can go get it there.  Following are a few of the changes that were made.

Both tags now have only 2 parameters &#8211; the type of navigation and the text [...]]]></description>
			<content:encoded><![CDATA[<p>I have released version 2 of my category and archive drop-down plug-in for <a href="http://wordpress.org" title="WordPress">WordPress</a>.  It is hosted at the WordPress Plug-In Directory &#8211; you can <a href="http://wordpress.org/extend/plugins/daniels-dropdowns/" title="Download Daniel's DropDowns 2">go get it there</a>.  Following are a few of the changes that were made.</p>
<ul>
<li>Both tags now have only 2 parameters &#8211; the type of navigation and the text for the link or button.  For navigation type, &#8216;button&#8217; remains the default, and &#8216;link&#8217; is still available.  However, a third option of &#8216;auto&#8217; has been added, which will render the list as an auto-navigating select box.</li>
<li>The CSS parameters for the select and button elements were dropped.  How these elements can be specified using CSS is detail in the top-of-plugin comments, along with an example.</li>
<li>The usage examples in the comments now have an example of how to put the tag in a template in such a way that, if the plug-in is disabled, the template will still render.  This could be done with 1.0, but I didn&#8217;t give an example.</li>
<li>I added PHP Documentor-style comments to both functions.</li>
</ul>
<p>Let me know if you have any problems with it, or any ideas for other behavior.  Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://djs-consulting.com/linux/blog/2007/daniels-dropdowns-2-wordpress-plug-in/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding Tags to a WordPress Theme</title>
		<link>http://djs-consulting.com/linux/blog/2007/adding-tags-to-a-wordpress-theme</link>
		<comments>http://djs-consulting.com/linux/blog/2007/adding-tags-to-a-wordpress-theme#comments</comments>
		<pubDate>Mon, 26 Nov 2007 05:47:11 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.djs-consulting.com/linux/blog/2007/adding-tags-to-a-wordpress-theme</guid>
		<description><![CDATA[WordPress 2.3 introduced tags, but unless you&#8217;re using the default theme, your theme (like mine) probably didn&#8217;t support them.  Nowhere did I find a good example of how to add tags to your theme.  Then, I was playing around with the theme switcher on my personal blog, and discovered that the default theme [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress 2.3 introduced tags, but unless you&#8217;re using the default theme, your theme (like mine) probably didn&#8217;t support them.  Nowhere did I find a good example of how to add tags to your theme.  Then, I was playing around with the theme switcher on my personal blog, and discovered that the default theme had tag support.  I looked at it, and it was amazingly simple.</p>
<p>There is a new template tag called &#8230;drumroll&#8230;  the_tags.  It takes three parameters: how to begin the list, how to separate each tag, and how to end the list.  The tag does not do any output if a post hasn&#8217;t been tagged, so it can safely sit in your theme until you need it to be active.</p>
<p>Here&#8217;s how I did it in my personal blog.  (Tags will appear on this blog shortly.)</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> the_tags<span style="color: #009900;">&#40;</span><span style="">'&lt;div class=&quot;tags&quot;&gt;Tags &amp;raquo; '</span><span style="color: #339933;">,</span> <span style="">' &amp;bull; '</span><span style="color: #339933;">,</span> <span style="">'&lt;/div&gt;'</span><span style="color: #009900;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Of course, you could also do it using an unordered list&#8230;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> the_tags<span style="color: #009900;">&#40;</span><span style="">'Tags&lt;ul class=&quot;tags&quot;&gt;&lt;li&gt;'</span><span style="color: #339933;">,</span> <span style="">'&lt;/li&gt;&lt;li&gt;'</span><span style="color: #339933;">,</span> <span style="">'&lt;/li&gt;&lt;/ul&gt;'</span><span style="color: #009900;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Drop some styling for the &#8220;tags&#8221; class in your theme&#8217;s CSS, and you&#8217;re good to go!</p>
<p>(Well, not quite.  You&#8217;ll want to make sure to make the same change in your main index template, single post template, and archive template, so that the tags appear no matter how the user got to the post.)</p>
]]></content:encoded>
			<wfw:commentRss>http://djs-consulting.com/linux/blog/2007/adding-tags-to-a-wordpress-theme/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Daniel&#8217;s DropDowns 1.0 &#8211; WordPress Plug-In</title>
		<link>http://djs-consulting.com/linux/blog/2007/daniels-dropdowns-10-wordpress-plug-in</link>
		<comments>http://djs-consulting.com/linux/blog/2007/daniels-dropdowns-10-wordpress-plug-in#comments</comments>
		<pubDate>Wed, 03 Oct 2007 01:54:26 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Plug-Ins]]></category>

		<guid isPermaLink="false">http://www.djs-consulting.com/linux/blog/2007/daniels-dropdowns-10-wordpress-plug-in</guid>
		<description><![CDATA[I&#8217;ve created a plug-in that I&#8217;m now using on my personal site to provide the category and archive drop-down lists.  It&#8217;s called &#8220;Daniel&#8217;s DropDowns&#8221;, and it will create drop-downs with either a link or a button to go to the selection in the drop-down, and a CSS class can be specified for the button [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve created a plug-in that I&#8217;m now using on my personal site to provide the category and archive drop-down lists.  It&#8217;s called &#8220;Daniel&#8217;s DropDowns&#8221;, and it will create drop-downs with either a link or a button to go to the selection in the drop-down, and a CSS class can be specified for the button and the drop-down box.</p>
<p><a href="http://www.djs-consulting.com/linux/daniels_dropdowns.txt" title="Click to Download Daniel's DropDowns 1.0">daniels_dropdowns.txt</a> &#8211; Daniel&#8217;s DropDowns 1.0</p>
<p>To install it, download the file, rename it &#8220;daniels_dropdowns.php&#8221;, and upload it to your /wp-content/plugins directory.  Then, enable it, and add the template tags to your theme.  (The documentation at the top of the file lists all the template tags provided, and the options that can be passed to them.)</p>
]]></content:encoded>
			<wfw:commentRss>http://djs-consulting.com/linux/blog/2007/daniels-dropdowns-10-wordpress-plug-in/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>HCSB Verse of the Day 1.0 &#8211; WordPress Plug-In</title>
		<link>http://djs-consulting.com/linux/blog/2007/hcsb-verse-of-the-day-10-wordpress-plug-in</link>
		<comments>http://djs-consulting.com/linux/blog/2007/hcsb-verse-of-the-day-10-wordpress-plug-in#comments</comments>
		<pubDate>Wed, 26 Sep 2007 04:08:23 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Plug-Ins]]></category>

		<guid isPermaLink="false">http://www.djs-consulting.com/linux/blog/2007/hcsb-verse-of-the-day-10-wordpress-plug-in</guid>
		<description><![CDATA[I have used a hack in the theme of my personal site for a while to obtain the &#8220;Verse of the Day&#8221; in the Holman Christian Standard Bible (HCSB) version.  With things that I&#8217;ve learned about plug-ins, I decided to take a stab at creating a plug-in to do this work.  That way, [...]]]></description>
			<content:encoded><![CDATA[<p>I have used a hack in the theme of my personal site for a while to obtain the &#8220;Verse of the Day&#8221; in the Holman Christian Standard Bible (HCSB) version.  With things that I&#8217;ve learned about plug-ins, I decided to take a stab at creating a plug-in to do this work.  That way, if I changed themes, I wouldn&#8217;t have to hack the new one they way I&#8217;ve hacked the current one.</p>
<p>The fruits of my labor is the new HCSB Verse of the Day plug-in for WordPress.  It uses the reference from <a href="http://www.biblegateway.com" title="Bible Gateway">BibleGateway.com</a>, then gets the text from their regular website.  (They do not provide the service, citing copyright restrictions.)  How to use the plug-in, along with my justification on copyright grounds, is in the top of the file&#8217;s comments.  If they&#8217;re not clear, certainly post comments here and I&#8217;ll address them.  (I do plan to submit the plug-in to <a href="http://wordpress.org" title="WordPress">WordPress.org</a> &#8211; but, they require a specific README file format that it will take me a bit to put together.)</p>
<p><a href="/linux/votd_hcsb.txt" title="Click to download HCSB Verse of the Day 1.0">votd_hcsb.txt</a> &mdash; HCSB Verse of the Day 1.0</p>
<p>To install it, download the file, rename it &#8220;votd_hcsb.php&#8221;, and upload it to your /wp-content/plugins directory.  Then, enable it, and add the template tags to your theme &#8211; that&#8217;s it!</p>
]]></content:encoded>
			<wfw:commentRss>http://djs-consulting.com/linux/blog/2007/hcsb-verse-of-the-day-10-wordpress-plug-in/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
