define ('SYS_START', 1); function formatdate($myTimestamp) { return date("M jS, Y", $myTimestamp); //F jS, Y } function formattime($myTimestamp) { return date("g:i A", $myTimestamp); } function formatdatetime($myTimestamp) { return date("M jS, Y - g:i A ", $myTimestamp); } function ahref ($linkurl, $title, $class="") { // start link $link = ""; $link .= $title; $link .= ""; return $link; } function link_email ($email, $title="") { if (!empty($title)) { $return="$title"; } else { $return="$email"; } } function remove_trailing_newlines ($myString) { //return $myString; return eregi_replace ("^(\?:\\r\\n)+|(\?:\\r\\n)+\$|((\\r\\n)\\2)\\2+", "", $myString); //return eregi_replace("^s\/\\s+$\/\/+", "DAIVD", $myString); } function strtotitle($title) // Converts $title to Title Case, and returns the result. { // Our array of 'small words' which shouldn't be capitalised if // they aren't the first word. Add your own words to taste. $smallwordsarray = array( 'of','a','the','and','an','or','nor','but','is','if','then','else','when', 'at','from','by','on','off','for','in','out','over','to','into','with' ); $replaceme = array (); // Split the string into separate words $words = explode(' ', $title); foreach ($words as $key => $word) { // If this word is the first, or it's not one of our small words, capitalise it // with ucwords(). if ($key == 0 or !in_array($word, $smallwordsarray)) $words[$key] = ucwords($word); } // Join the words back into a string $newtitle = implode(' ', $words); return $newtitle; } // this function strips the outermost html paragraph tage // [