<?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>Katipo Developers Blog &#187; bob</title>
	<atom:link href="http://blog.katipo.co.nz/author/bob/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.katipo.co.nz</link>
	<description></description>
	<lastBuildDate>Fri, 04 Jun 2010 02:39:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Joomla vetting new signups</title>
		<link>http://blog.katipo.co.nz/2009/09/21/joomla-vetting-new-signups/</link>
		<comments>http://blog.katipo.co.nz/2009/09/21/joomla-vetting-new-signups/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 04:24:36 +0000</pubDate>
		<dc:creator>bob</dc:creator>
				<category><![CDATA[joomla]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=87</guid>
		<description><![CDATA[A few sites that we have been working on  wanted an extra step with the signup process on their website that requires an additional level of vetting by the site administrator when a new user submits the online form.  To achieve this we made some minor changes to the core code.

The following change [...]]]></description>
			<content:encoded><![CDATA[<p>A few sites that we have been working on  wanted an extra step with the signup process on their website that requires an additional level of vetting by the site administrator when a new user submits the online form.  To achieve this we made some minor changes to the core code.</p>
<p><span id="more-87"></span></p>
<p>The following change removes the activation link from the email issued to the user and sends them an email notification that their application has been received.<br />
From the root of your Joomla site, go to /components/com_user/controller.php (approx line 367) and add:</p>
<div class="codesnip-container" >// Email the user that they have been vetted<br />
$mailfrom = $mainframe-&gt;getCfg(&#8217;mailfrom&#8217;);<br />
$fromname = $mainframe-&gt;getCfg(&#8217;fromname&#8217;);<br />
$email = $euser-&gt;email;<br />
$siteURL = JURI::base();<br />
$subject = &#8220;Vetting Accepted for [sitename]&#8220;;<br />
$message2 = sprintf(JText::_(&#8217;REG_ACTIVATE_COMPLETE_USER&#8217;),$siteURL);<br />
JUtility::sendMail($mailfrom, $fromname, $email, $subject, $message2);<br />
// *** END Email the user that they have been vetted</div>
<p>We also need to change&#8230;</p>
<div class="codesnip-container" >if (JUserHelper::activateUser($activation))</div>
<p>to:</p>
<div class="codesnip-container" >if ($euser = JUserHelper::activateUser($activation))</div>
<p>The next bit of code emails the account activation link and details through to the site administrator, who gets to decide if the application is successful.<br />
From the root of your Joomla site, go to /components/com_user/controller.php (approx line 524) and change to:</p>
<div class="codesnip-container" >// *** Added Site Admin activation link<br />
if ( $useractivation == 1 ){<br />
// $message = sprintf ( JText::_( &#8216;SEND_MSG_ACTIVATE&#8217; ), $name, $sitename, $siteURL.&#8221;index.php?option=com_user&amp;task=activate&amp;activation=&#8221;.$user-&gt;get(&#8217;activation&#8217;), $siteURL, $username, $password);<br />
$message = sprintf ( JText::_( &#8216;SEND_MSG_ACTIVATE&#8217; ), $name, $sitename, $siteURL.&#8221;index.php?option=com_user&amp;task=activate&amp;activation=&#8221;.$user-&gt;get(&#8217;activation&#8217;));<br />
$message2 = sprintf ( JText::_( &#8216;SEND_MSG_USER&#8217; ), $name, $sitename, $siteURL, $username, $password);<br />
} else {<br />
$message = sprintf ( JText::_( &#8216;SEND_MSG&#8217; ), $name, $sitename, $siteURL);<br />
$message2 = &#8221;;<br />
}<br />
// *** END Added Site Admin activation link</div>
<p>We then need to pass both user and admin notifications through to the script that generates and sends emails.<br />
From the root of your Joomla site, go to /components/com_user/controller.php (approx line 548) Added:</p>
<div class="codesnip-container" >// *** Added send User AND Admin notification<br />
JUtility::sendMail($mailfrom, $fromname, $mailfrom, $subject, $message);<br />
JUtility::sendMail($mailfrom, $fromname, $email, $subject, $message2);<br />
// JUtility::sendMail($mailfrom, $fromname, $email, $subject, $message); // old line<br />
// *** END Added send User AND Admin notification</div>
<p>Joomla now issues 2 emails when the signup form is submitted, rather than the usual one.</p>
<p>Some final changes are needed to the language files on the site, so that the email notifications make sense.  Make the following changes. From the root of your Joomla site, go to</p>
<p>/language/en-GB/en-GB.com_user.ini (approx line 84) and change:</p>
<div class="codesnip-container" >REG_ACTIVATE_COMPLETE=The Account has been successfully activated. The user has been sent an email and they now can log in.</div>
<p>/language/en-GB/en-GB.com_user.ini (approx line 85) and change:</p>
<div class="codesnip-container" >REG_ACTIVATE_COMPLETE_USER=Congratulations, your application to join the [sitename] website has been approved.\n\nYou can now use the login details you entered when registered to log in at %s</div>
<p>/language/en-GB/en-GB.com_user.ini (approx line 92) and change:</p>
<div class="codesnip-container" >REG_COMPLETE_ACTIVATE=Your account has been created and now is awaiting the vetting process &#8211; you should get an email containing your username and password. Once you are vetted you will use these to login.</div>
<p>/language/en-GB/en-GB.com_user.ini (approx line 120) and change:</p>
<div class="codesnip-container" >SEND_MSG_ACTIVATE=The following person %s has registered at %s. Their account activation link is that needs to be copied into your browser:\n%s\n\nAfter activation they will be able to login.</div>
<div class="codesnip-container" >SEND_MSG_USER=Hello %s,\n\nThank you for registering at %s. Your account is currently waiting to be vetted.\nYou will be notified by email once it is approved by an administrator.\nYou may then login to %s using the following username and password:\n\nUsername: %s\nPassword: %s</div>
<p>Finally, the User() helper function needs to be updated so that the activation confirmation email is sent to the user in question rather than the user currently logged into joomla (eg site administrator):  To do that, go to:</p>
<div class="codesnip-container" >/libraries/joomla/user/helper.php (line 72) Added:<br />
// *** Added send confirmation to user not admin<br />
// return true;<br />
return $user;<br />
// *** END Added send confirmation to user not admin</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2009/09/21/joomla-vetting-new-signups/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adding Access Keys to a Joomla 1.5 Website.</title>
		<link>http://blog.katipo.co.nz/2009/09/21/adding-access-keys-to-a-joomla-1-5-website/</link>
		<comments>http://blog.katipo.co.nz/2009/09/21/adding-access-keys-to-a-joomla-1-5-website/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 03:22:56 +0000</pubDate>
		<dc:creator>bob</dc:creator>
				<category><![CDATA[joomla]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=82</guid>
		<description><![CDATA[Developing in Joomla sometimes throws up minor issues with solutions so  simple that you wonder why they&#8217;re not in the core code.  While putting  together the Rangitikei District Council&#8217;s website we discovered that  there&#8217;s no easy way to set up Navigation Access Keys in Joomla 1.5, as  per the New Zealand [...]]]></description>
			<content:encoded><![CDATA[<p>Developing in Joomla sometimes throws up minor issues with solutions so  simple that you wonder why they&#8217;re not in the core code.  While putting  together the Rangitikei District Council&#8217;s website we discovered that  there&#8217;s no easy way to set up Navigation Access Keys in Joomla 1.5, as  per the New Zealand Government Web Standards  (<a href="http://webstandards.govt.nz/8-4-navigation-access-keys/">http://webstandards.govt.nz/8-4-navigation-access-keys/</a>).  The keys are  a great navigation aid to non-mouse users and are recommended by w3c  (<a href="http://www.w3.org/WAI/WCAG20/quickref/#keyboard-operation">http://www.w3.org/WAI/WCAG20/quickref/#keyboard-operation</a>).<br />
To add Access Keys to a Joomla site you need to hack at the core code of  your Joomla install.  There are some basic instructions on the Joomla  documentation site at <a href="http://docs.joomla.org/Adding_Access_Keys">http://docs.joomla.org/Adding_Access_Keys</a>.  This  sets up a new &#8220;Accessibility Access Key&#8221; field in the System Parameters  dropdown that&#8217;s available when you edit an menu item, allowing you to  simply enter the keystroke you want to associate with that menu link on  your site.</p>
<p>The hack makes it easy to add as many access keys as you need, and you  can offer more than just the basic keystroke options set on most  government websites.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2009/09/21/adding-access-keys-to-a-joomla-1-5-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The use of FPDF is nice and easy</title>
		<link>http://blog.katipo.co.nz/2006/07/19/the-use-of-fpdf-is-nice-and-easy/</link>
		<comments>http://blog.katipo.co.nz/2006/07/19/the-use-of-fpdf-is-nice-and-easy/#comments</comments>
		<pubDate>Tue, 18 Jul 2006 21:56:12 +0000</pubDate>
		<dc:creator>bob</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[random]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=14</guid>
		<description><![CDATA[I&#8217;ve been trying to get PHP to be able to make PDF documents &#8211; nothing big just usually a list of information that has been shown to screen &#8211; and I tried installing the PDFlib library but got confused part way thru as I couldn&#8217;t find simple enough instructions for me  
But then I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been trying to get PHP to be able to make PDF documents &#8211; nothing big just usually a list of information that has been shown to screen &#8211; and I tried installing the PDFlib library but got confused part way thru as I couldn&#8217;t find simple enough instructions for me <img src='http://blog.katipo.co.nz/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>But then I stumbled on FPDF at <a target="_blank" href="http://www.ftp.org">http://www.fpdf.org</a> and found this to be easy to use and invloved no installing of libraries.</p>
<p>Instead it uses a class of functions to create the pdf document.</p>
<p>I&#8217;ve only had a little play with it but it seems to meet my basic needs of creating a document with data given to it via php database calls.</p>
<p>The best thing is it is free.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2006/07/19/the-use-of-fpdf-is-nice-and-easy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using a simple js checker for required form fields</title>
		<link>http://blog.katipo.co.nz/2006/06/26/using-a-simple-js-checker-for-required-form-fields/</link>
		<comments>http://blog.katipo.co.nz/2006/06/26/using-a-simple-js-checker-for-required-form-fields/#comments</comments>
		<pubDate>Sun, 25 Jun 2006 23:19:38 +0000</pubDate>
		<dc:creator>bob</dc:creator>
				<category><![CDATA[random]]></category>

		<guid isPermaLink="false">http://blog.katipo.co.nz/?p=8</guid>
		<description><![CDATA[This is just a little js that I was working on to make a form check more portable.
To use it all you need to do is have id&#8217;s on your form fields and then for the required ones have this in the &#60;form&#62; tag

onsubmit=&#8220;return check_form(&#8217;formname&#8217;,'Title&#124;Date&#124;Name&#8217;)&#8221;

where &#8216;formname&#8217; is the name of the form and the id&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>This is just a little js that I was working on to make a form check more portable.</p>
<p>To use it all you need to do is have id&#8217;s on your form fields and then for the required ones have this in the &lt;form&gt; tag</p>
<div class="codesnip-container" >
<div class="codesnip">onsubmit=<span class="st0">&#8220;return check_form(&#8217;formname&#8217;,'Title|Date|Name&#8217;)&#8221;</span></div>
</div>
<p>where &#8216;formname&#8217; is the name of the form and the id&#8217;s you want to check are a listed separated by a |</p>
<p>and using the js</p>
<div class="codesnip-container" >
<div class="codesnip">&lt;script type=<span class="st0">&#8220;text/javascript&#8221;</span> /&gt;&nbsp; &nbsp;<span class="co1">// Function to grab inputs from specified fields by ID&nbsp; // and check to see if they are blank and alert user if they are&nbsp; &nbsp;function check_form(formname,ids)&nbsp; {&nbsp; var alert_str=&#8221;;&nbsp; var idarray = ids.split(&quot;|&quot;);&nbsp; &nbsp; for(var i=0;i&nbsp; var fieldvalue = document.getElementById(idarray[i]).value;&nbsp; &nbsp; if(fieldvalue ==&#8221;){&nbsp; alert_str += idarray[i] + &quot; is required\n&quot;;&nbsp; &nbsp;// colour the field to help user&nbsp; &nbsp; document.getElementById(idarray[i]).style.backgroundColor = &quot;#FACADE&quot;;&nbsp; } else {&nbsp; &nbsp; // colour the field back to default -change if not white&nbsp; &nbsp; document.getElementById(idarray[i]).style.backgroundColor = &quot;#FFFFFF&quot;;&nbsp; }&nbsp; }&nbsp; &nbsp;if(alert_str ==&#8221;){&nbsp; eval(&quot;document.&quot;+formname+&quot;.submit()&quot;);&nbsp; &nbsp; }&nbsp; &nbsp; else {&nbsp; alert(alert_str);&nbsp; return false; }&nbsp; &nbsp;//&nbsp; &nbsp;&lt;script /&gt; </span><br />
&nbsp;</div>
</div>
<p>It doesn&#8217;t tell you if the input is valid though just if it exists or not</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.katipo.co.nz/2006/06/26/using-a-simple-js-checker-for-required-form-fields/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
