Katipo Project Survival Kit

Katipo Developers Blog

Author Archive

Sharl is your friend

Monday, October 11th, 2010

Sometimes your linux server partitions fill up faster than you expect and suddenly you are getting warning emails screaming at you.

This is when Sharl comes in handy.

ls -Sharl

It is a quick way to list the contents of a dir by size of file with the biggest ones being the last on the list just right there above the command prompt allowing you to easy banish those not needed tar, sql, zip files that are not needed with flourish to free up as much space as one can with the least number of keystrokes

Joomla vetting new signups

Monday, September 21st, 2009

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.

(more…)

Adding Access Keys to a Joomla 1.5 Website.

Monday, September 21st, 2009

Developing in Joomla sometimes throws up minor issues with solutions so simple that you wonder why they’re not in the core code.  While putting together the Rangitikei District Council’s website we discovered that there’s no easy way to set up Navigation Access Keys in Joomla 1.5, as per the New Zealand Government Web Standards (http://webstandards.govt.nz/8-4-navigation-access-keys/).  The keys are a great navigation aid to non-mouse users and are recommended by w3c (http://www.w3.org/WAI/WCAG20/quickref/#keyboard-operation).
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 http://docs.joomla.org/Adding_Access_Keys.  This sets up a new “Accessibility Access Key” field in the System Parameters dropdown that’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.

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.

The use of FPDF is nice and easy

Wednesday, July 19th, 2006

I’ve been trying to get PHP to be able to make PDF documents – nothing big just usually a list of information that has been shown to screen – and I tried installing the PDFlib library but got confused part way thru as I couldn’t find simple enough instructions for me :)

But then I stumbled on FPDF at http://www.fpdf.org and found this to be easy to use and invloved no installing of libraries.

Instead it uses a class of functions to create the pdf document.

I’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.

The best thing is it is free.

Using a simple js checker for required form fields

Monday, June 26th, 2006

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’s on your form fields and then for the required ones have this in the <form> tag

onsubmit=“return check_form(’formname’,'Title|Date|Name’)”

where ‘formname’ is the name of the form and the id’s you want to check are a listed separated by a |

and using the js

<script type=“text/javascript” />   // Function to grab inputs from specified fields by ID  // and check to see if they are blank and alert user if they are   function check_form(formname,ids)  {  var alert_str=”;  var idarray = ids.split("|");    for(var i=0;i  var fieldvalue = document.getElementById(idarray[i]).value;    if(fieldvalue ==”){  alert_str += idarray[i] + " is required\n";   // colour the field to help user    document.getElementById(idarray[i]).style.backgroundColor = "#FACADE";  } else {    // colour the field back to default -change if not white    document.getElementById(idarray[i]).style.backgroundColor = "#FFFFFF";  }  }   if(alert_str ==”){  eval("document."+formname+".submit()");    }    else {  alert(alert_str);  return false; }   //   <script />
 

It doesn’t tell you if the input is valid though just if it exists or not


Katipo Developers Blog is proudly powered by WordPress
Entries (RSS) and Comments (RSS).