Monthly Archives: January 2009

My Form Library

An example of one of my form library functions (I have a copious amount – for textarea, radio button, check box, select box – DB and array driven, hidden, etc. etc.):

/**
* Function to create a text box form element
*
* @param resource string $field
* @param resource string $size
* @param resource string $post_value
* @param resource string $text
* [...]

Instant Forms with Application Super Arrays

If you have built an application using a super array, it is exceedinly simple to add new forms into an application. Into my main cms.php file located in admin, I have a section of the file which reads:

$module_dir = “faqs”;
$item = “FAQ”;
$item_plural = “FAQs”;
$id_name = “faq_id”;
$this_tbl = $tbl_faqs;

$order_by = $APP_CONFIG[$this_tbl]["question"]["field_name"];
$table_headers = array(”Question”,”Ordering”,”Display”,”Edit”,”Delete”);
$field_names = array(
$APP_CONFIG[$this_tbl]["question"]["field_name"],
$APP_CONFIG[$this_tbl]["ordering"]["field_name"],
$APP_CONFIG[$this_tbl]["display"]["field_name"]
);
break;

Then, contained [...]

Application Super Heroes (PHP Application Super Arrays)

The super hero of the web application is the super array. An example of one from my CMS is detailed below.

$APP_CONFIG[$tbl_faqs]["id_name"] = “faq_id”;
$APP_CONFIG[$tbl_faqs]["question"] = array();
$APP_CONFIG[$tbl_faqs]["question"]["field_name"] = “question”;
$APP_CONFIG[$tbl_faqs]["question"]["field_title"] = “Question”;
$APP_CONFIG[$tbl_faqs]["question"]["field_type"] = “string”;
$APP_CONFIG[$tbl_faqs]["question"]["required"] = “Y”;
$APP_CONFIG[$tbl_faqs]["answer"] = array();
$APP_CONFIG[$tbl_faqs]["answer"]["field_name"] = “answer”;
$APP_CONFIG[$tbl_faqs]["answer"]["field_title"] = “Answer”;
$APP_CONFIG[$tbl_faqs]["answer"]["field_type"] = “string”;
$APP_CONFIG[$tbl_faqs]["answer"]["required"] = “Y”;
$APP_CONFIG[$tbl_faqs]["ordering"] = array();
$APP_CONFIG[$tbl_faqs]["ordering"]["field_name"] = “ordering”;
$APP_CONFIG[$tbl_faqs]["ordering"]["field_title"] = “Ordering”;
$APP_CONFIG[$tbl_faqs]["ordering"]["field_type"] = “int”;
$APP_CONFIG[$tbl_faqs]["ordering"]["required"] = “N”;
$APP_CONFIG[$tbl_faqs]["display"] = array();
$APP_CONFIG[$tbl_faqs]["display"]["field_name"] [...]

New Years, New Goals, New Dreams

I don’t believe in New Years resolutions; I believe in goals and dreams. The turning of the year is the time when most people make their resolutions, and as such, it is a wonderful time for me to evaluate my goals.
2008 was fantastic. I loved and lost, and loved again. I traveled and studied, I [...]