<?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>Binary Expressions &#187; PHP/MySQL/MSSQL</title>
	<atom:link href="http://www.adamsdesk.com/be/category/development/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.adamsdesk.com/be</link>
	<description>The life experiences of Adam Douglas. Technical help too!</description>
	<lastBuildDate>Tue, 27 Jul 2010 19:45:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP &#8211; mssql_query() Error</title>
		<link>http://www.adamsdesk.com/be/archives/2009/04/28/php-mssql_query-error/</link>
		<comments>http://www.adamsdesk.com/be/archives/2009/04/28/php-mssql_query-error/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 13:16:29 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[PHP/MySQL/MSSQL]]></category>

		<guid isPermaLink="false">http://www.adamsdesk.com/be/?p=440</guid>
		<description><![CDATA[Background Knowledge

I&#8217;m running PHP v5.2.9-2 with SQL Server 2005 Express on Windows Server 2003 R2 SP2.
Error Message

Warning: mssql_query() [function.mssql-query]: message: Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier. (severity 16)
Solution

Specify the database columns within your database query (select [...]]]></description>
			<content:encoded><![CDATA[<h4>Background Knowledge</h4>
<hr />
<p>I&#8217;m running PHP v5.2.9-2 with SQL Server 2005 Express on Windows Server 2003 R2 SP2.</p>
<h4>Error Message</h4>
<hr />
<p>Warning: mssql_query() [function.mssql-query]: message: Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier. (severity 16)</p>
<h4>Solution</h4>
<hr />
<p>Specify the database columns within your database query (select filed1, field2 from foo). Avoid doing queries with the wildcard (*), select * from foo. </p>
<p>Source: <a href="http://ca3.php.net/manual/en/function.mssql-query.php#82949" title="User Comment">PHP Manual on MSSQL_Query()</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamsdesk.com/be/archives/2009/04/28/php-mssql_query-error/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Example of a Basic MSSQL Query using PHP</title>
		<link>http://www.adamsdesk.com/be/archives/2009/04/23/basic-mssql-query-with-php-example/</link>
		<comments>http://www.adamsdesk.com/be/archives/2009/04/23/basic-mssql-query-with-php-example/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 23:22:21 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[PHP/MySQL/MSSQL]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[mssql]]></category>
		<category><![CDATA[PHP/MySQL]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.adamsdesk.com/be/archives/2009/04/23/basic-mssql-query-with-php-example/</guid>
		<description><![CDATA[An example of a basic MSSQL (Microsoft SQL Server/SQL Server Express) query using PHP.

1
2
3
4
5
6
7
8
9
$szQry = &#34;SELECT column1, column2 FROM foo&#34;;
$szDBConn = mssql_connect&#40;&#34;host&#34;,&#34;username&#34;,&#34;password&#34;&#41;;
mssql_select_db&#40;&#34;database_name&#34;, $szDBConn&#41;;
$saResults = mssql_query&#40;$szQry, $szDBConn&#41;;
while&#40;$obResults = mssql_fetch_row&#40;$saResults&#41;&#41;
&#123;
   echo $obResults&#91;0&#93;.&#34; &#34;.$obResults&#91;1&#93;;
&#125;
mssql_close&#40;$szDBConn&#41;;

Comments/description of Example

Line #1
SQL statement that will be sent to the MySQL database server.
Line #2
MSSQL database login credentilas; host (127.0.0.1), username and password.
The [...]]]></description>
			<content:encoded><![CDATA[<p>An example of a basic MSSQL (Microsoft SQL Server/SQL Server Express) query using PHP.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$szQry</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT column1, column2 FROM foo&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$szDBConn</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mssql_connect</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;host&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;username&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;password&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mssql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;database_name&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$szDBConn</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$saResults</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mssql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$szQry</span><span style="color: #339933;">,</span> <span style="color: #000088;">$szDBConn</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$obResults</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mssql_fetch_row</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$saResults</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
   <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$obResults</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$obResults</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #990000;">mssql_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$szDBConn</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h4>Comments/description of Example</h4>
<dl>
<dt>Line #1</dt>
<dd>SQL statement that will be sent to the MySQL database server.</dd>
<dt>Line #2</dt>
<dd>MSSQL database login credentilas; host (127.0.0.1), username and password.</dd>
<dd>The &#8220;host&#8221; is the server name or IP address of your database server. If your host has multiple instances the &#8220;host&#8221; value would be formatted like so &#8220;foo\bar&#8221;. If your using SQL Server Express the &#8220;host&#8221; name locally would be &#8220;.\SQLEXPRESS&#8221;.
</dd>
<dt>Line #3</dt>
<dd>Select database using the login credentials provided above.</dd>
<dt>Line #4</dt>
<dd>Send SQL statement to database.</dd>
<dt>Line #5-8</dt>
<dd>Fetch results returned back from the SQL statement. I use a while loop to enumerate through each row of results returned. If you know only one row is going to be retunred the while loop is not necessary.</dd>
<dt>Line #9</dt>
<dd> Close database connection.</dd>
</dl>
]]></content:encoded>
			<wfw:commentRss>http://www.adamsdesk.com/be/archives/2009/04/23/basic-mssql-query-with-php-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP &#8211; Upgrading v5.2.5 to v5.2.8</title>
		<link>http://www.adamsdesk.com/be/archives/2009/02/12/php-upgrading-v525-to-v528/</link>
		<comments>http://www.adamsdesk.com/be/archives/2009/02/12/php-upgrading-v525-to-v528/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 19:05:32 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP/MySQL/MSSQL]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[OpenBSD]]></category>
		<category><![CDATA[PHP/MySQL]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://www.adamsdesk.com/be/archives/2009/02/12/php-upgrading-v525-to-v528/</guid>
		<description><![CDATA[Background Knowledge

The following is the process I took to upgrade a web server with PHP v5.2.5 to PHP v5.2.8 running on OpenBSD. PEAR is already installed on this system and up to date. I wasn&#8217;t sure if I should exclude PEAR at install or not so therefore did not tell the configurator to exclude PEAR [...]]]></description>
			<content:encoded><![CDATA[<h4>Background Knowledge</h4>
<hr />
<p>The following is the process I took to upgrade a web server with <a href="http://www.php.net/">PHP</a> v5.2.5 to <a href="http://www.php.net/">PHP</a> v5.2.8 running on <a href="http://www.openbsd.org/">OpenBSD</a>. <a href="http://pear.php.net/">PEAR</a> is already installed on this system and up to date. I wasn&#8217;t sure if I should exclude PEAR at install or not so therefore did not tell the configurator to exclude PEAR at install.</p>
<h4>Installation Process</h4>
<hr />
<ol>
<li>Download the latest stable PHP release from command prompt # wget http://ca.php.net/get/php-5.2.8.tar.gz/from/a/mirror</li>
<li># tar -zxvf php-5.2.8.tar.gz</li>
<li>./configure &#8211;with-mysql=/usr/local &#8211;with-mssql=/usr/local &#8211;with-apxs &#8211;with-zlib-dir=/usr/lib &#8211;with-config-file-path=/var/www/conf &#8211;with-iconv=/usr/local/bin/iconv &#8211;enable-exif &#8211;enable-mbstring &#8211;enable-calendar</li>
<li># make</li>
<li># make test</li>
<li># make install</li>
<li># make clean</li>
</ol>
<p>As far as I could tell in the <a href="http://www.php.net/ChangeLog-5.php">PHP 5 ChangeLog</a> since at least PHP v5.2.5 there has not be any changes made to the php.ini configuration file. Therefore I chose to leave the PHP configuration file (php.ini) that was being used with PHP v5.2.5 for PHP v5.2.8.</p>
<h4>Issues</h4>
<hr />
<ol>
<li>At configure I received the following message &#8220;checking for a sed that does not truncate output&#8230; (cached) /usr/bin/sed<br />
expr: syntax error ./configure[2322]: test: 0: unexpected operator/operand expr: syntax error ./configure[2337]: test: 0: unexpected operator/operand&#8221;</li>
</ol>
<p>I&#8217;m not sure what to make of this error message. I tried to search on Google but was not successful finding any answers. I tested my PHP installation and all appears to be okay. If anyone knows what exactly this error means and how to resolve it please let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamsdesk.com/be/archives/2009/02/12/php-upgrading-v525-to-v528/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL &#8211; Can You Concatenate Strings From a Column Into a Single Row?</title>
		<link>http://www.adamsdesk.com/be/archives/2008/12/05/mysql-can-you-concatenate-strings-from-a-column-into-a-single-row/</link>
		<comments>http://www.adamsdesk.com/be/archives/2008/12/05/mysql-can-you-concatenate-strings-from-a-column-into-a-single-row/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 19:56:13 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP/MySQL/MSSQL]]></category>
		<category><![CDATA[concatenate]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[sql server]]></category>

		<guid isPermaLink="false">http://www.adamsdesk.com/be/archives/2008/12/05/mysql-can-you-concatenate-strings-from-a-column-into-a-single-row/</guid>
		<description><![CDATA[How would one concatenate strings from a column (multiple rows) into a single row using MySQL? I see its possible with MS SQL Server 2005 and above. Any incite into how to achieve this in MySQL would be much appreciated.
MS SQL Server 2005 &#8211; Example


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
SELECT Web_Account_ID,
GroupNameConcat = REPLACE&#40;
	&#40;
	SELECT
		Web_Account_Group_Name_ID AS &#91;DATA&#40;&#41;&#93;
	FROM
		tblWebAccountGroup WAG
	WHERE
		WAG.Web_Account_ID = WA.Web_Account_ID
	ORDER BY
		Web_Account_Group_Name_ID
  [...]]]></description>
			<content:encoded><![CDATA[<p>How would one concatenate strings from a column (multiple rows) into a single row using MySQL? I see its possible with MS SQL Server 2005 and above. Any incite into how to achieve this in MySQL would be much appreciated.</p>
<h4>MS SQL Server 2005 &#8211; Example</h4>
<hr />

<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
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> Web_Account_ID<span style="color: #66cc66;">,</span>
GroupNameConcat <span style="color: #66cc66;">=</span> <span style="color: #993333; font-weight: bold;">REPLACE</span><span style="color: #66cc66;">&#40;</span>
	<span style="color: #66cc66;">&#40;</span>
	<span style="color: #993333; font-weight: bold;">SELECT</span>
		Web_Account_Group_Name_ID <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #66cc66;">&#91;</span><span style="color: #993333; font-weight: bold;">DATA</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>
	<span style="color: #993333; font-weight: bold;">FROM</span>
		tblWebAccountGroup WAG
	<span style="color: #993333; font-weight: bold;">WHERE</span>
		WAG<span style="color: #66cc66;">.</span>Web_Account_ID <span style="color: #66cc66;">=</span> WA<span style="color: #66cc66;">.</span>Web_Account_ID
	<span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span>
		Web_Account_Group_Name_ID
            <span style="color: #993333; font-weight: bold;">FOR</span> XML PATH <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">''</span><span style="color: #66cc66;">&#41;</span>
        <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">' '</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">','</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">FROM</span> tblWebAccounts WA
<span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> Web_Account_ID</pre></td></tr></table></div>

<h4>Query Results Example</h4>
<hr />
<p><a href='http://www.adamsdesk.com/be/wp-content/uploads/2008/12/dbqueryresults.png' title='MS SQL Server 2005 query example'><img src='http://www.adamsdesk.com/be/wp-content/uploads/2008/12/dbqueryresults.png' alt='MS SQL Server 2005 query example' width="310" height="420" /></a></p>
<p>Source: <a href="http://databases.aspfaq.com/general/how-do-i-concatenate-strings-from-a-column-into-a-single-row.html">aspfaq.com &#8211; How do I concatenate strings from a column into a single row?</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamsdesk.com/be/archives/2008/12/05/mysql-can-you-concatenate-strings-from-a-column-into-a-single-row/feed/</wfw:commentRss>
		<slash:comments>38</slash:comments>
		</item>
		<item>
		<title>TaskFreak! v0.6.2 &#8211; Tweaking Priority Menu</title>
		<link>http://www.adamsdesk.com/be/archives/2008/10/23/taskfreak-v062-tweaking-priority-menu/</link>
		<comments>http://www.adamsdesk.com/be/archives/2008/10/23/taskfreak-v062-tweaking-priority-menu/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 16:42:03 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP/MySQL/MSSQL]]></category>
		<category><![CDATA[alter]]></category>
		<category><![CDATA[change]]></category>
		<category><![CDATA[getting things done]]></category>
		<category><![CDATA[gtd]]></category>
		<category><![CDATA[manage]]></category>
		<category><![CDATA[management]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[mod]]></category>
		<category><![CDATA[modification]]></category>
		<category><![CDATA[modifying]]></category>
		<category><![CDATA[mods]]></category>
		<category><![CDATA[priority]]></category>
		<category><![CDATA[task]]></category>
		<category><![CDATA[taskfreak!]]></category>
		<category><![CDATA[tasks]]></category>
		<category><![CDATA[tweak]]></category>
		<category><![CDATA[tweaking]]></category>

		<guid isPermaLink="false">http://www.adamsdesk.com/be/archives/2008/10/23/taskfreak-v062-tweaking-priority-menu/</guid>
		<description><![CDATA[Background Knowledge

For some reason or another the priority menu in the edit task panel is not wide enough and therefore it cuts off the priority names. This can be easily fixed by modifying some inline CSS. Yes I agree this should be done within the skin&#8217;s CSS file, however there is nothing present in the [...]]]></description>
			<content:encoded><![CDATA[<h4>Background Knowledge</h4>
<hr />
<p>For some reason or another the priority menu in the edit task panel is not wide enough and therefore it cuts off the priority names. This can be easily fixed by modifying some inline <acronym title="cascading style sheets">CSS</acronym>. Yes I agree this should be done within the skin&#8217;s <acronym title="cascading style sheets">CSS</acronym> file, however there is nothing present in the <acronym title="cascading style sheets">CSS</acronym> file to alter that I could find.</p>
<p><span id="more-411"></span></p>
<h4>Solution</h4>
<hr />
<p>Edit /taskfreak/include/html/xajax_panel_edit.php at line #18 by changing the width value of &#8220;40px&#8221; to &#8220;125px&#8221; or to what you desired width.</p>
<h5>Code Before</h5>
<hr />

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>16
17
18
19
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>td<span style="color: #339933;">&gt;&lt;</span> ?php
<span style="color: #000088;">$objTemp</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ItemPriority<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$objTemp</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">qSelect</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'priority'</span><span style="color: #339933;">,</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$objTask</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">priority</span><span style="color: #009900;">&#41;</span>?<span style="color: #000088;">$objTask</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">priority</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'style=&quot;width:40px&quot;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #339933;">&lt;/</span>td<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<h5>Code After</h5>
<hr />

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>td<span style="color: #339933;">&gt;&lt;</span> ?php
<span style="color: #000088;">$objTemp</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ItemPriority<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$objTemp</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">qSelect</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'priority'</span><span style="color: #339933;">,</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$objTask</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">priority</span><span style="color: #009900;">&#41;</span>?<span style="color: #000088;">$objTask</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">priority</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'style=&quot;width:125px&quot;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #339933;">&lt;/</span>td<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.adamsdesk.com/be/archives/2008/10/23/taskfreak-v062-tweaking-priority-menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TaskFreak! v0.6.2 &#8211; Add My Projects List</title>
		<link>http://www.adamsdesk.com/be/archives/2008/10/23/taskfreak-v062-add-my-projects-list/</link>
		<comments>http://www.adamsdesk.com/be/archives/2008/10/23/taskfreak-v062-add-my-projects-list/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 16:17:28 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP/MySQL/MSSQL]]></category>
		<category><![CDATA[add]]></category>
		<category><![CDATA[alter]]></category>
		<category><![CDATA[change]]></category>
		<category><![CDATA[getting things done]]></category>
		<category><![CDATA[gtd]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[manage]]></category>
		<category><![CDATA[management]]></category>
		<category><![CDATA[mod]]></category>
		<category><![CDATA[modification]]></category>
		<category><![CDATA[modifying]]></category>
		<category><![CDATA[mods]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[task]]></category>
		<category><![CDATA[taskfreak!]]></category>
		<category><![CDATA[tasks]]></category>
		<category><![CDATA[tweak]]></category>
		<category><![CDATA[tweaking]]></category>

		<guid isPermaLink="false">http://www.adamsdesk.com/be/archives/2008/10/23/taskfreak-v062-add-my-projects-list/</guid>
		<description><![CDATA[Background Knowledge

TaskFreak! presently does not have a means via the web interface to present a complete list of tasks for which the current user is the project leader. I will show you how to add &#8220;My Projects&#8221; list based on bpiper&#8217;s solution with a slight difference. My solution is almost identical to bpiper&#8217;s but with [...]]]></description>
			<content:encoded><![CDATA[<h4>Background Knowledge</h4>
<hr />
<p>TaskFreak! presently does not have a means via the web interface to present a complete list of tasks for which the current user is the project leader. I will show you how to add &#8220;My Projects&#8221; list based on <a href="http://forum.taskfreak.com/index.php?topic=1235.0" title="Read forum message by bpiper">bpiper&#8217;s solution</a> with a slight difference. My solution is almost identical to bpiper&#8217;s but with a different approach to continue support of the supported interface languages. To do this each supported language file will require to be edited.</p>
<p>Thanks to bpiper for posting your solution.</p>
<p><span id="more-412"></span></p>
<h4>Solution</h4>
<hr />
<ol>
<li>Edit /taskfreak/include/language/en/freak.php starting at line #15. Add in a new array key/value at any point you desire like so &#8220;&#8216;my_projects&#8217; => &#8216;My Projects&#8217;,&#8221; (without double quotes), see below for example.
<p><strong>Note:</strong> Each interface language file will be required to be edited if you desire to use them. If you do not do so, you will receive error messages and it may cripple TaskFreak!</p>
<h4>Code &#8211; Before</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// top menu / navigation</span>
<span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'langMenu'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'task'</span>                  <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Task'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'print_list'</span>            <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Printing version'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'new_todo'</span>          <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'New Todo'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'view'</span>                 <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'View'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'all_projects'</span>        <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'All Projects'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'future_tasks'</span>       <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Future Tasks'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'past_tasks'</span>         <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Past Tasks'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'my_tasks'</span>           <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'My Tasks'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'all_tasks'</span>            <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'All Tasks'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'all_contexts'</span>       <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'All Contexts'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'all_users'</span>            <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'All Users'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'reload'</span>               <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Reload'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'manage'</span>             <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Manage'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'projects'</span>            <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Projects'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'users'</span>                <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Users'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'preferences'</span>       <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'My Profile'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'settings'</span>            <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'System Settings'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'login'</span>                 <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Login'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'logout'</span>               <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Logout'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'warning'</span>             <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Warning'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'warning_install'</span>    <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Install folder still exists, you should delete it for security purposes'</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h4>Code &#8211; After</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>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
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// top menu / navigation</span>
<span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'langMenu'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'task'</span>                  <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Task'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'print_list'</span>            <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Printing version'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'new_todo'</span>          <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'New Todo'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'view'</span>                 <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'View'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'all_projects'</span>        <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'All Projects'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'future_tasks'</span>       <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Future Tasks'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'past_tasks'</span>         <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Past Tasks'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'my_tasks'</span>           <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'My Tasks'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'my_projects'</span>       <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'My Projects'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'all_tasks'</span>            <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'All Tasks'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'all_contexts'</span>       <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'All Contexts'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'all_users'</span>            <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'All Users'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'reload'</span>               <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Reload'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'manage'</span>             <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Manage'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'projects'</span>            <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Projects'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'users'</span>                <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Users'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'preferences'</span>       <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'My Profile'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'settings'</span>            <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'System Settings'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'login'</span>                 <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Login'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'logout'</span>               <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Logout'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'warning'</span>             <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Warning'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'warning_install'</span>    <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Install folder still exists, you should delete it for security purposes'</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

</li>
<li>Edit /taskfreak/include/html/header.php at line #214 add &#8220;My Projects&#8221; link as shown below.<br />
<h4>Code Before</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>213
214
215
216
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;div id=&quot;rightmenu&quot;&gt;
  &lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> Tzn<span style="color: #339933;">::</span><span style="color: #004000;">concatUrl</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'linkItems'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'sUser='</span><span style="color: #339933;">.</span><span style="color: #000088;">$objUser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;&lt; ?php echo $langMenu['my_tasks']; ?&gt;&lt;/a&gt; |
  &lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> Tzn<span style="color: #339933;">::</span><span style="color: #004000;">concatUrl</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'linkItems'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'sUser=all'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;&lt; ?php echo $langMenu['all_users']; ?&gt;&lt;/a&gt; |
&lt;/div&gt;</pre></td></tr></table></div>

<h4>Code After</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>213
214
215
216
217
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;div id=&quot;rightmenu&quot;&gt;
  &lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> Tzn<span style="color: #339933;">::</span><span style="color: #004000;">concatUrl</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'linkItems'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'sUser=myprojects'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;&lt; ?php echo $langMenu['my_projects'];?&gt;&lt;/a&gt; |
  &lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> Tzn<span style="color: #339933;">::</span><span style="color: #004000;">concatUrl</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'linkItems'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'sUser='</span><span style="color: #339933;">.</span><span style="color: #000088;">$objUser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;&lt; ?php echo $langMenu['my_tasks']; ?&gt;&lt;/a&gt; |
  &lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> Tzn<span style="color: #339933;">::</span><span style="color: #004000;">concatUrl</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'linkItems'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'sUser=all'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;&lt; ?php echo $langMenu['all_users']; ?&gt;&lt;/a&gt; |
&lt;/div&gt;</pre></td></tr></table></div>

</li>
<li>Edit /taskfreak/index.php at line #72 as shown below.<br />
<h4>Code Before</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>72
73
74
75
76
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$pUser</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$objItemList</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addWhere</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ii.memberId = \''</span><span style="color: #339933;">.</span><span style="color: #000088;">$pUser</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'\''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'selUser'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$pUser</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$pDefaultUserId</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$pUser</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span></pre></td></tr></table></div>

<h4>Code After</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>72
73
74
75
76
77
78
79
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'sUser'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'myprojects'</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'selUser'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
   <span style="color: #000088;">$objItemList</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addWhere</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ii.authorId='</span><span style="color: #339933;">.</span><span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'selUser'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$pUser</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$objItemList</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addWhere</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ii.memberId = \''</span><span style="color: #339933;">.</span><span style="color: #000088;">$pUser</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'\''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'selUser'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$pUser</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$pDefaultUserId</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$pUser</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span></pre></td></tr></table></div>

</li>
</ol>
<p>Source: <a href="http://forum.taskfreak.com/index.php?topic=1235.0" title="Read forum message by bpiper">My Projects List</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamsdesk.com/be/archives/2008/10/23/taskfreak-v062-add-my-projects-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pear::Date Returned Timezone is Wrong</title>
		<link>http://www.adamsdesk.com/be/archives/2008/10/14/peardate-returned-timezone-is-wrong/</link>
		<comments>http://www.adamsdesk.com/be/archives/2008/10/14/peardate-returned-timezone-is-wrong/#comments</comments>
		<pubDate>Tue, 14 Oct 2008 19:05:48 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[PHP/MySQL/MSSQL]]></category>
		<category><![CDATA[cst]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[default]]></category>
		<category><![CDATA[pear]]></category>
		<category><![CDATA[PHP/MySQL]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[timezone]]></category>
		<category><![CDATA[utc]]></category>
		<category><![CDATA[zone]]></category>

		<guid isPermaLink="false">http://www.adamsdesk.com/be/archives/2008/10/14/peardate-returned-timezone-is-wrong/</guid>
		<description><![CDATA[Background Knowledge

I&#8217;m trying to determine the difference in minutes between two timestamps. I&#8217;m using Pear::Date to do this. The issue comes into play when I noticed that the wrong timezone was being used by Pear::Date, UTC. If I do not use Pear::Date the timezone is set correctly.
I have tried using date_default_timezone_set() and it does set [...]]]></description>
			<content:encoded><![CDATA[<h4>Background Knowledge</h4>
<hr />
<p>I&#8217;m trying to determine the difference in minutes between two timestamps. I&#8217;m using <a href="http://pear.php.net/package/Date">Pear::Date</a> to do this. The issue comes into play when I noticed that the wrong timezone was being used by Pear::Date, UTC. If I do not use Pear::Date the timezone is set correctly.</p>
<p>I have tried using <a href="http://www.php.net/date_default_timezone_set">date_default_timezone_set()</a> and it does set the timezone back, however I feel this shouldn&#8217;t be necessary as the default timezone should be used. I have been using <a href="http://www.php.net/date_default_timezone_get">date_default_timezone_get()</a> to determine what timezone is being used.</p>
<p>It&#8217;s my understanding that Pear::Date uses UTC when it is unable to determine the default timezone. As far as I know I have the default timezone set correctly and with a valid ID (see below). I was able to determine that the timezone changed from my default timezone to UTC after I used <a href="http://pear.php.net/package/Date/docs/latest/Date/Date_Span.html#methodsetFromDateDiff">Date::setFromDateDiff()</a>. This does not seem right at all.</p>
<p>I have checked the following.</p>
<ul>
<li>Pear v1.7.2 stable</li>
<li>Pear::Date v1.4.7 stable</li>
</ul>
<ul>
<li>php.ini (default timezone) &#8211; date.timezone = &#8220;Canada/Saskatchewan&#8221;</li>
<li>phpinfo() &#8211; Correct configure file being loaded, /var/www/conf/php.ini.</li>
<li>phpinfo() &#8211; Under Date, date/time support is enabled.</li>
<li>phpinfo() &#8211; Default timezone &#8211; Canada/Saskatchewan</li>
<li>phpinfo() &#8211; date.timezone	- Canada/Saskatchewan / Canada/Saskatchewan</li>
</ul>
<h4>PHP Code Test Case</h4>
<hr />

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Date.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$obFirstDate</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #990000;">Date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'20081014155640'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$obSecondDate</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #990000;">Date</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;YmdHis&quot;</span><span style="color: #339933;">,</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: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$obDateSpan</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Date_Span<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$obDateSpan</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setFromDateDiff</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$obFirstDate</span><span style="color: #339933;">,</span> <span style="color: #000088;">$obSecondDate</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span><span style="color: #000088;">$obDateSpan</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">toMinutes</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">date_default_timezone_get</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h4>Solution &#8211; Unknown</h4>
<hr />
<p>Does anyone have any suggestions where to look or what to do to fix this problem?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamsdesk.com/be/archives/2008/10/14/peardate-returned-timezone-is-wrong/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using short if statement in programming</title>
		<link>http://www.adamsdesk.com/be/archives/2008/10/08/using-short-if-statement-in-programming/</link>
		<comments>http://www.adamsdesk.com/be/archives/2008/10/08/using-short-if-statement-in-programming/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 20:50:46 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP/MySQL/MSSQL]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[condensed]]></category>
		<category><![CDATA[if]]></category>
		<category><![CDATA[line]]></category>
		<category><![CDATA[one]]></category>
		<category><![CDATA[operator]]></category>
		<category><![CDATA[PHP/MySQL]]></category>
		<category><![CDATA[short]]></category>
		<category><![CDATA[statement]]></category>
		<category><![CDATA[ternary]]></category>

		<guid isPermaLink="false">http://www.adamsdesk.com/be/archives/2008/10/08/using-short-if-statement-in-programming/</guid>
		<description><![CDATA[In many programing languages it is possible to shorten if statements using what&#8217;s called the ternary operator. It is sometimes referred as the &#8220;one line if statement&#8221; or the &#8220;short if statement&#8221;. This can help at times to produce cleaner code, however use this operator wisely as it is not always best to be used [...]]]></description>
			<content:encoded><![CDATA[<p>In many programing languages it is possible to shorten if statements using what&#8217;s called the <a href="http://en.wikipedia.org/wiki/%3F:" title="Read further on ternary operator">ternary operator</a>. It is sometimes referred as the &#8220;one line if statement&#8221; or the &#8220;short if statement&#8221;. This can help at times to produce cleaner code, however use this operator wisely as it is not always best to be used for more complicated statements.</p>
<h4>PHP Example of an if statement</h4>
<hr />

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$nFoo</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
   <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;I'm at the work.&quot;</span><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: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;I'm at home.&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<h4>PHP Example using the ternary operator</h4>
<hr />

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #000088;">$nFoo</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span> ? <span style="color: #0000ff;">&quot;I'm at the work.&quot;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;I'm at home.&quot;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>The expression (expr1) ? (expr2) : (expr3)  evaluates to expr2 if expr1 evaluates to TRUE, and expr3 if expr1 evaluates to FALSE.</p>
<p>Source: <a href="http://en.wikipedia.org/wiki/%3F:" title="Read Wikipedia's article on Ternary Operator">Wikipedia on Ternary Operator</a><br />
Source: <a href="http://www.php.net/operators.comparison" title="Read PHP Manual">PHP Manual: Comparison Operators</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamsdesk.com/be/archives/2008/10/08/using-short-if-statement-in-programming/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>How To &#8211; Remove Leading Zeros</title>
		<link>http://www.adamsdesk.com/be/archives/2008/10/07/how-to-remove-leading-zeros/</link>
		<comments>http://www.adamsdesk.com/be/archives/2008/10/07/how-to-remove-leading-zeros/#comments</comments>
		<pubDate>Tue, 07 Oct 2008 17:49:16 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[How Tos]]></category>
		<category><![CDATA[PHP/MySQL/MSSQL]]></category>
		<category><![CDATA[intval]]></category>
		<category><![CDATA[leading]]></category>
		<category><![CDATA[ltrim]]></category>
		<category><![CDATA[PHP/MySQL]]></category>
		<category><![CDATA[remove]]></category>
		<category><![CDATA[strip]]></category>
		<category><![CDATA[zero]]></category>
		<category><![CDATA[zeros]]></category>

		<guid isPermaLink="false">http://www.adamsdesk.com/be/archives/2008/10/07/how-to-remove-leading-zeros/</guid>
		<description><![CDATA[Solutions
Using PHP function intval().
Code example: echo intval(&#8220;05&#8243;);
Returned value: 5
Using PHP function ltrim().
Code example: echo ltrim(&#8220;005&#8243;,&#8221;0&#8243;);
Returned value: 5
]]></description>
			<content:encoded><![CDATA[<h4>Solutions</h4>
<p>Using PHP function <a href="http://www.php.net/intval" title="Read PHP Manual on intval() function">intval()</a>.</p>
<p>Code example: echo intval(&#8220;05&#8243;);<br />
Returned value: 5</p>
<p>Using PHP function <a href="http://www.php.net/manual/en/function.ltrim.php" title="Read PHP Manual on ltrim() function">ltrim()</a>.</p>
<p>Code example: echo ltrim(&#8220;005&#8243;,&#8221;0&#8243;);<br />
Returned value: 5</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamsdesk.com/be/archives/2008/10/07/how-to-remove-leading-zeros/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How To &#8211; Convert MySQL Timestamp/Datetime to Unix Timestamp</title>
		<link>http://www.adamsdesk.com/be/archives/2008/10/07/how-to-convert-mysql-timestampdatetime-to-unix-timestamp/</link>
		<comments>http://www.adamsdesk.com/be/archives/2008/10/07/how-to-convert-mysql-timestampdatetime-to-unix-timestamp/#comments</comments>
		<pubDate>Tue, 07 Oct 2008 17:35:19 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[How Tos]]></category>
		<category><![CDATA[PHP/MySQL/MSSQL]]></category>
		<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[datetime]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[PHP/MySQL]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[timestamp]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.adamsdesk.com/be/archives/2008/10/07/how-to-convert-mysql-timestampdatetime-to-unix-timestamp/</guid>
		<description><![CDATA[Background Knowledge

Since MySQL v4.1 timestamp and datetime data types are formatted &#8220;YYYY-MM-DD HH:MM:SS&#8221;. Prior to MySQL v4.1 the timestamp was formatted as YYYYMMDDHHMMSS&#8221; and datetime formatted as &#8220;YYYY-MM-DD HH:MM:SS&#8221;. Refer to MySQL Reference Manual for further details.
The Unix timestamp differs from MySQL. Unix&#8217;s timestamp is a integer value of seconds since January 1, 1970. For [...]]]></description>
			<content:encoded><![CDATA[<h4>Background Knowledge</h4>
<hr />
<p>Since MySQL v4.1 timestamp and datetime data types are formatted &#8220;YYYY-MM-DD HH:MM:SS&#8221;. Prior to MySQL v4.1 the timestamp was formatted as YYYYMMDDHHMMSS&#8221; and datetime formatted as &#8220;YYYY-MM-DD HH:MM:SS&#8221;. Refer to <a href="http://dev.mysql.com/doc/refman/5.0/en/timestamp.html" title="Read further on timestamp and datetime">MySQL Reference Manual</a> for further details.</p>
<p>The Unix timestamp differs from MySQL. Unix&#8217;s timestamp is a integer value of seconds since January 1, 1970. For further explanation of Unix timestamps refer to <a href="http://en.wikipedia.org/wiki/Unix_time" title="Read Wikipedia's article on Unix time">Wikiepedia</a> or <a href="http://www.unixtimestamp.com/" title="Read further on Unix time and use the Unix time converter">UnixTimestamp.com</a>.</p>
<h4>Solutions</h4>
<hr />
<p>In MySQL you can use <a href="http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_unix-timestamp" title="Read about the MySQL Unix_Timestamp)() function">Unix_Timestamp()</a> function.</p>
<p>Query Example: SELECT Unix_Timestamp(Date_Entered) FROM Foo;</p>
<p>Using PHP you can use <a href="http://www.php.net/strtotime">strtotime()</a> function.</p>
<p>PHP Example: $nUnixTimestamp = strtotime($nTimestamp);</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamsdesk.com/be/archives/2008/10/07/how-to-convert-mysql-timestampdatetime-to-unix-timestamp/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>French Characters Not Rendering Correctly</title>
		<link>http://www.adamsdesk.com/be/archives/2007/11/16/french-characters-not-rendering-correctly/</link>
		<comments>http://www.adamsdesk.com/be/archives/2007/11/16/french-characters-not-rendering-correctly/#comments</comments>
		<pubDate>Fri, 16 Nov 2007 15:13:44 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP/MySQL/MSSQL]]></category>
		<category><![CDATA[accent]]></category>
		<category><![CDATA[accents]]></category>
		<category><![CDATA[character encoding]]></category>
		<category><![CDATA[character set]]></category>
		<category><![CDATA[charset]]></category>
		<category><![CDATA[french characters]]></category>
		<category><![CDATA[iso-8859-1]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[PHP/MySQL]]></category>
		<category><![CDATA[utf-8]]></category>
		<category><![CDATA[utf8]]></category>

		<guid isPermaLink="false">http://www.adamsdesk.com/be/archives/2007/11/16/french-characters-not-rendering-correctly/</guid>
		<description><![CDATA[Background Knowledge

The MySQL database v4.0.23 is using the default character set of &#8220;Latin1&#8243;. When the database was created I had no knowledge of character sets other wise it would have been &#8220;UTF-8&#8243;.
The web pages are using a character set of &#8220;UTF-8&#8243;.
Problem

Data being queried from a MySQL database that contains French accent characters will not render [...]]]></description>
			<content:encoded><![CDATA[<h4>Background Knowledge</h4>
<hr />
<p>The <a href="http://www.mysql.com/">MySQL database</a> v4.0.23 is using the default character set of &#8220;Latin1&#8243;. When the database was created I had no knowledge of <a href="http://en.wikipedia.org/wiki/Character_encoding">character sets</a> other wise it would have been &#8220;UTF-8&#8243;.<br />
The web pages are using a character set of &#8220;UTF-8&#8243;.</p>
<h4>Problem</h4>
<hr />
<p>Data being queried from a <a href="http://www.mysql.com/">MySQL database</a> that contains French accent characters will not render correctly in the browser even after applying <a href="http://www.php.net/">PHP</a> <a href="http://php.net/htmlentities">htmlentities()</a>.</p>
<p>Example code: $string = htmlentities($string , ENT_QUOTES, &#8220;UTF-8&#8243;);</p>
<h4>Solution</h4>
<hr />
<p>The queried data from the database was inputted using the character set &#8220;ISO-8859-1&#8243;. I found this out by changing the browser&#8217;s character encoding to &#8220;Western ISO-8859-1&#8243; and the French accent characters then rendered properly. With the use of <a href="http://www.php.net/">PHP</a> <a href="http://www.php.net/iconv">iconv()</a> I was able to convert the data from &#8220;ISO-8859-1&#8243; to &#8220;UTF-8&#8243; character set and the French characters then rendered properly in the browser.</p>
<p>Example code: $string = iconv(&#8220;ISO-8859-1&#8243;,&#8221;UTF-8&#8243;,&#8221;$string&#8221;);</p>
<hr />
<p>If you are unaware of what <a href="http://www.mysql.com/">MySQL</a> default character set being used, you can run this SQL command &#8220;show variables like &#8220;%character%&#8221; and check your MySQL configuration file. Refer to the <a href="http://dev.mysql.com/doc/">MySQL manual</a> for further details.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamsdesk.com/be/archives/2007/11/16/french-characters-not-rendering-correctly/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>HTML_QuickForm Generates Invalid Code for XHTML Strict</title>
		<link>http://www.adamsdesk.com/be/archives/2007/11/08/html_quickform-generates-invalid-code-for-xhtml-strict/</link>
		<comments>http://www.adamsdesk.com/be/archives/2007/11/08/html_quickform-generates-invalid-code-for-xhtml-strict/#comments</comments>
		<pubDate>Thu, 08 Nov 2007 22:18:40 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP/MySQL/MSSQL]]></category>

		<guid isPermaLink="false">http://www.adamsdesk.com/be/archives/2007/11/08/html_quickform-generates-invalid-code-for-xhtml-strict/</guid>
		<description><![CDATA[One of the biggest complaints I&#8217;ve had with HTML_QuickForm is not producing valid XHTML Strict code. Well there is a simple solution to removing the name attribute of the HTML form element tag using remoteAttribute().
Example
$form->removeAttribute(&#8216;name&#8217;);
]]></description>
			<content:encoded><![CDATA[<p>One of the biggest complaints I&#8217;ve had with HTML_QuickForm is not producing valid XHTML Strict code. Well there is a simple solution to removing the name attribute of the HTML form element tag using remoteAttribute().</p>
<p><strong>Example</strong><br />
$form->removeAttribute(&#8216;name&#8217;);</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamsdesk.com/be/archives/2007/11/08/html_quickform-generates-invalid-code-for-xhtml-strict/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Calendar Functions Error</title>
		<link>http://www.adamsdesk.com/be/archives/2007/11/01/php-calendar-functions-error/</link>
		<comments>http://www.adamsdesk.com/be/archives/2007/11/01/php-calendar-functions-error/#comments</comments>
		<pubDate>Thu, 01 Nov 2007 17:56:06 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP/MySQL/MSSQL]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[PHP/MySQL]]></category>

		<guid isPermaLink="false">http://www.adamsdesk.com/be/archives/2007/11/01/php-calendar-functions-error/</guid>
		<description><![CDATA[I was trying to use the PHP calendar API and immediately received this error message, &#8220;Fatal error: Call to undefined function cal_days_in_month()&#8221;. This error message means PHP was not compiled with the calendar extension.
Solution

The only solution to this error message and other similar error messages relating to the PHP calendar API requires PHP to be [...]]]></description>
			<content:encoded><![CDATA[<p>I was trying to use the PHP calendar API and immediately received this error message, &#8220;Fatal error: Call to undefined function cal_days_in_month()&#8221;. This error message means PHP was not compiled with the calendar extension.</p>
<h4>Solution</h4>
<hr />
<p>The only solution to this error message and other similar error messages relating to the PHP calendar API requires PHP to be compiled with the calendar extension by adding &#8220;&#8211;enable-calendar&#8221; to the &#8220;configure command&#8221; as stated in the PHP documentation on the <a href="http://ca.php.net/calendar">Calendar functions</a> page.</p>
<h4>How to Tell if the Calendar Extension is Installed</h4>
<hr />
<p>You can verify weather or not the PHP Calendar extension was compiled at install by using the phpinfo() function. When viewing the output of phpinfo() look under &#8220;Configure Command&#8221; just below &#8220;Build Date&#8221; and if you do not see &#8220;&#8211;enable-calendar&#8221; present then all PHP Calendar functions will not work.</p>
<h4>Configure Example</h4>
<hr />
<p>./configure &#8211;with-mysql=/usr/local &#8211;with-mssql=/usr/local &#8211;with-apxs &#8211;with-zlib-dir=/usr/lib &#8211;with-libxml-dir=/usr/local &#8211;with-config-file-path=/var/www/conf &#8211;with-iconv=/usr/local/bin/iconv &#8211;enable-exif –-enable-mbstring &#8211;enable-calendar</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamsdesk.com/be/archives/2007/11/01/php-calendar-functions-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Free Chat &#8211; Joining Chat Email Notification</title>
		<link>http://www.adamsdesk.com/be/archives/2007/10/17/php-free-chat-joining-chat-email-notification/</link>
		<comments>http://www.adamsdesk.com/be/archives/2007/10/17/php-free-chat-joining-chat-email-notification/#comments</comments>
		<pubDate>Wed, 17 Oct 2007 20:50:24 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP/MySQL/MSSQL]]></category>
		<category><![CDATA[chat]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[notification]]></category>
		<category><![CDATA[PHP/MySQL]]></category>

		<guid isPermaLink="false">http://www.adamsdesk.com/be/archives/2007/10/17/php-free-chat-joining-chat-email-notification/</guid>
		<description><![CDATA[I recently upgraded an install of PHP Free Chat to that latest version of 1.0 Final. However it was still lacking a feature to notify individual(s) that someone has joined the chat if they were not already in the chat application to begin with. I came across a posting explaining how to achieve this in [...]]]></description>
			<content:encoded><![CDATA[<p>I recently upgraded an install of <a href="http://www.phpfreechat.net/">PHP Free Chat</a> to that latest version of 1.0 Final. However it was still lacking a feature to notify individual(s) that someone has joined the chat if they were not already in the chat application to begin with. I came across a posting explaining how to achieve this in PHP Free Chat at <a href="http://www.phpfreechat.net/forum/viewtopic.php?id=355">PHP Free Chat Forum</a>. After a little reading and discussion I was able to implement the feature.</p>
<p>Here&#8217;s my modified version for the solution based on the forum posting. The pfcmail() function can be made to be way more versatile for any use, however for my use it was made to be simple and produce properly formated email messages.</p>
<h4>Solution</h4>
<hr />
<ol>
<li>Create a new PHP file called pfcmail.php with the following lines of code.</li>
<li style="list-type-type: none;">
<dl>
<dd style="padding-left:0; margin-left:0;">

<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
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php
<span style="color: #000000; font-weight: bold;">function</span> pfcmail<span style="color: #009900;">&#40;</span><span style="color: #000088;">$szChannel</span><span style="color: #339933;">,</span><span style="color: #000088;">$szNickname</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$szCurrentDateTime</span> <span style="color: #339933;">=</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'F j, Y @ g:i:sa'</span><span style="color: #339933;">,</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: #339933;">;</span>
	<span style="color: #000088;">$szClientIP</span> <span style="color: #339933;">=</span> <span style="color: #990000;">getenv</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;REMOTE_ADDR&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$szHostName</span> <span style="color: #339933;">=</span> <span style="color: #990000;">gethostbyaddr</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$szClientIP</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$szServerName</span> <span style="color: #339933;">=</span> <span style="color: #990000;">getenv</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SERVER_NAME&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$szEmailWebmaster</span> <span style="color: #339933;">=</span> <span style="color: #990000;">getenv</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SERVER_ADMIN&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$szEmailTo</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Webmaster &lt;<span style="color: #006699; font-weight: bold;">$szEmailWebmaster</span>&gt;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$szMsgHeaders</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;From: <span style="color: #006699; font-weight: bold;">$szEmailWebmaster</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;">$szMsgHeaders</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;X-Mailer: PHP<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;">$szMsgHeaders</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: #000088;">$szMsgHeaders</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;Content-type: text/plain; charset=UTF-8&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$szMsgSubject</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;[WEB] Chat Login - <span style="color: #006699; font-weight: bold;">$szNickname</span> in channel <span style="color: #006699; font-weight: bold;">$szChannel</span> at <span style="color: #006699; font-weight: bold;">$szCurrentDateTime</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$szMsgBody</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Date<span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span>: <span style="color: #006699; font-weight: bold;">$szCurrentDateTime</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$szMsgBody</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;Server Name<span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span>: <span style="color: #006699; font-weight: bold;">$szServerName</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$szMsgBody</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;Client IP<span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span>: <span style="color: #006699; font-weight: bold;">$szClientIP</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$szMsgBody</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;Client Hostname<span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span>: <span style="color: #006699; font-weight: bold;">$szHostName</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$szMsgBody</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;Join chat now by going to http://<span style="color: #006699; font-weight: bold;">$szServerName</span>/chat/index.php.<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$szMsgBody</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;---<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$szMsgBody</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;Email message auto-generated by PHP mail().&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$nSendEmail</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mail</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$szEmailTo</span><span style="color: #339933;">,</span> <span style="color: #000088;">$szMsgSubject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$szMsgBody</span><span style="color: #339933;">,</span> <span style="color: #000088;">$szMsgHeaders</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

</dd>
<dd><strong>Note:</strong> The extra r, n and t&#8217;s should have a \ character before them to produce a carriage return, new line and tab. WordPress appears to remove the character.</dd>
</dl>
</li>
<li>Make sure to modifiy the code in pfcmail.php for the To, from, subject and body of the email message to your requirements.</li>
<li>Save pfcmail.php file into the following path, /src/commands/.
	</li>
<li>Edit /src/commands/nick.class.php at line number 84, just before &#8220;return true;&#8221; add the following code and save.</li>
<li style="list-style-type: none;">
<dl>
<dd>require_once(dirname(__FILE__).&#8221;/pfcmail.php&#8221;);<br />
      pfcmail($c->title, $newnick);</dd>
</dl>
</li>
</ol>
<p>You should now be receiving email notifications each time an individual joins chat.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamsdesk.com/be/archives/2007/10/17/php-free-chat-joining-chat-email-notification/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PEAR::HTML_BBCodeParser Upgrade 1.1 to 1.2.2</title>
		<link>http://www.adamsdesk.com/be/archives/2007/07/10/pearhtml_bbcodeparser-upgrade-11-to-122/</link>
		<comments>http://www.adamsdesk.com/be/archives/2007/07/10/pearhtml_bbcodeparser-upgrade-11-to-122/#comments</comments>
		<pubDate>Tue, 10 Jul 2007 18:54:23 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[OpenBSD]]></category>
		<category><![CDATA[PHP/MySQL/MSSQL]]></category>

		<guid isPermaLink="false">http://www.adamsdesk.com/be/archives/2007/07/10/pearhtml_bbcodeparser-upgrade-11-to-122/</guid>
		<description><![CDATA[Problem #1 &#8211; &#8220;[notice] child pid 13449 exit signal Segmentation fault (11)&#8221;
On a OpenBSD v3.7 i386 system running Apache v1.3.29 (not chrooted) with PHP v5.1.4 I upgraded HTML_BBCodeParser from version 1.1 to version 1.2.2 by running at command line &#8220;pear upgrade-all&#8221;. After the upgrades were complete the web site would not load a web page [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem #1 &#8211; &#8220;[notice] child pid 13449 exit signal Segmentation fault (11)&#8221;</strong></p>
<p>On a <a href="http://www.openbsd.org/" title="Free, Functional and Secure operating system">OpenBSD</a> v3.7 i386 system running <a href="http://httpd.apache.org/" title="The Apache HTTP Server Project">Apache</a> v1.3.29 (not chrooted) with <a href="http://www.php.net/" title="PHP: Hypertext Processor">PHP</a> v5.1.4 I upgraded <a href="http://pear.php.net/package/HTML_BBCodeParser" title="UBB style tag parser">HTML_BBCodeParser</a> from version 1.1 to version 1.2.2 by running at command line &#8220;pear upgrade-all&#8221;. After the upgrades were complete the web site would not load a web page anymore. I looked at my HTTPD server logs and noticed I was receiving the following error message in error_log file, &#8220;[notice] child pid 13449 exit signal Segmentation fault (11)&#8221; whenever there was a HTTP request on port 80 or 443 to the web site. I couldn&#8217;t understand what the problem could be but then decided to uninstall HTML_BBCodeParser v1.2.2 and re-install HTML_BBCodeParser v1.1 to see if the web site would still function. Indeed the web site did load and function fine. So I decided to uninstall and install  each version up to v1.2.2 to see where the breaking point was. As soon as the latest version of HTML_BBCodeParser v1.2.2 is installed the web site stops functioning. I was able to determine that there was something that has changed in v1.2.2 or something I did wrong in the Filters I created and existing filters I altered.</p>
<p><strong>Solution #1</strong></p>
<p>I uninstalled HTML_BBCodeParser then manually removed the directory /usr/local/lib/php/HTML/HTML_BBCodeParser. Then I installed HTML_BBCodeParser v1.2.2 and copied the BBCodeParser.ini example from /usr/local/lib/php/doc/HTML_BBCodeParser/BBCodeParser/example/ to /usr/local/lib/php/HTML/BBCodeParse/. After that the web site functioned as normal again.</p>
<p><strong>Problem #2 &#8211; &#8220;Warning: strpos() [function.strpos]: Empty delimiter.&#8221;</strong></p>
<p>However I discovered that when using PHP 5 one has to alter the BBCodeParser.ini file otherwise you will receive the following warning message when trying to load a web page using HTML_BBCodeParser, &#8220;Warning: strpos() [function.strpos]: Empty delimiter. in /usr/local/lib/php/HTML/BBCodeParser.php on line 354&#8243;.</p>
<p><strong>Solution #2</strong></p>
<p>Edit your BBCodeParser.ini and alter the line for the opening tag character and closing tag character to be enclosed by double quotes around the square brackets, [ and ]. Apparently this has been an issue for awhile now, <a href="http://pear.php.net/bugs/bug.php?id=2580">http://pear.php.net/bugs/bug.php?id=2580</a>.</p>
<p><strong>Example After Alteration &#8211; BBCodeParser.ini</strong></p>
<p><code>[HTML_BBCodeParser]</p>
<p>; possible values: single|double<br />
; use single or double quotes for attributes<br />
quotestyle  = single</p>
<p>; possible values: all|nothing|strings<br />
; quote all attribute values, none, or only the strings<br />
quotewhat   = all</p>
<p>; the opening tag character<br />
open        = "["</p>
<p>; the closing tag character<br />
close       = "]"</p>
<p>; possible values: true|false<br />
; use xml style closing tags for single html tags (<img /> or <img />)<br />
xmlclose    = true</p>
<p>; possible values: a comma seperated list of filters<br />
; comma seperated list of filters to use<br />
filters     = Basic,Extended,Links,Images,Lists,Email</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamsdesk.com/be/archives/2007/07/10/pearhtml_bbcodeparser-upgrade-11-to-122/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
