Database PHP Class

I’m back with another chunk of code. This time, it’s my database class. I got sick of coming across classes that didn’t have everything I needed, or didn’t do it correctly. One of my biggest problems was an inability to nest query calls within another query result’s output. Example: <?php // main query // gets a list of companies from the companies table $a = "SELECT id, company_name FROM companies"; $a = $db->query($a); while ($aa = $db->fetch_object($a) ) : echo '<div...

read more

jQuery Accordian without plug-ins & with a bit of design freedom

So you have a design and you have decided you want to use a jQuery accordion. You start to layout your design and implement the accordion only to find out that your design is going to cause problems with the standard accordion plug-ins. The problem with the standard accordion is that they require the child and header elements to be nested within a parent. Example: <div id="accordion-wrapper"> <h1>Clickable Header 1</h1> <p>Collapsible child 1</p> <h1>Clickable Header...

read more

tnyb.it API Calls

I’ve worked hard to make tnyb.it‘s service valuable and easy to use. I continue to add features constantly and make existing features easier and easier to use.  There are a number of ways you can call to the tnyb.it service to have your URLs shortened remotely. URL Shortening http://tnyb.it/s?u=http://example.com http://tnyb.it/s?u=example.com http://tnyb.it/s?u=example.com&i=123 (associates url to your account) http://tnyb.it/s?u=example.com&i=123&h=Y (sets the URL to private & will not show in your RSS...

read more

(UPDATED 08-10-2010) Forms Class for easy and consistant forms

UPDATED 08-10-2010: I’ve cleaned up a lot of code and organized the code a little better. One major improvement is the passing of element attributes. You can now pass an unlimited number of attributes. If there are any you want omitted from the actual element tag, you can add it to the $attributes_not_allowed array. I’ve added notes everywhere and hopefully they will assist you. If you find any bugs, feel free to post in comments and will fix them ASAP As it states in the notes of the script, this is not for auto-generated forms....

read more

Load multiple JS files in one call

With this script, you can easily load multiple JavaScript files in one call. The main purpose behind this is to simply cut down on the clutter in your source code. The function can be called from anywhere and the files are specified in an array /* ********************************************************* * * Setup a global config variable that * stores all sitewide values such root * url, absolute paths, Javascript library paths, etc. * ********************************************************* */ var config; config = { URL :...

read more

jQuery “characters remaining” script

This is a jQuery script for displaying “characters remaining” for input fields. It will look for any input element with the class “input” (or whatever you specify) and use the element’s maxlength attribute as the value to count against and update the “fieldName-counter” element. This is a very useful script for those occasions when you want to limit the character entry for an input field. <!-- input and character count element --> <span...

read more