Warning: Constant tf_dir already defined in /home/du7m326nv6yf/public_html/pro/db_demo/tf_functions_core.php on line 133
$intTwo) { $intBigger=$intOne; } else { $intBigger=$intTwo; } return $intBigger; } } if(!function_exists("getMin")) { function getMin($intOne, $intTwo) //Returns the smaller of two numbers. { if ($intOne<$intTwo) { $intSmaller=$intOne; } else { $intSmaller=$intTwo; } return $intSmaller; } } if(!function_exists("killBetweenTags")) { function killBetweenTags($oldString, $taglist, $maxLength=9500, $begin="<", $end=">") //Judas Gutenberg Jan 2 2007 //gets rid of XML tags from $oldString if they are present in the space-delimited list $taglist. also gets rid of the closer. //this function doesn't consider whether or not content inside a node should be removed. it just removes matching tags //i made this function mostly to target DIVs and SPANs i didn't want in my truncated synopses. { $newString = ""; $inUnapprovedTag = false; $inApprovedTag=false; for($i = 0; $i < strlen($oldString); $i++) { if(substr($oldString,$i,strlen($begin)) == $begin || ($end=="" && $inUnapprovedTag ==true) ) { $strProspectiveTag=substr($oldString, $i + 1,getMin(strpos($oldString, " ",$i+1), strpos($oldString, ">",$i+1))-($i+1)); //echo $strProspectiveTag . "
\n"; //echo hexdump($strProspectiveTag) . "
\n"; if(inList($taglist, $strProspectiveTag) || inList($taglist, RemoveFirstCharacterIfMatch($strProspectiveTag, "/"))) { $inUnapprovedTag = true; } else { $inApprovedTag=true; } } if(!$inUnapprovedTag) { $newString.= substr($oldString,$i,1); } if( substr($oldString,$i,strlen($end)) == $end && $inUnapprovedTag ==true && !($end=="" && $inUnapprovedTag ==true)) { $inUnapprovedTag = false; //$i++; } if( substr($oldString,$i,strlen($end)) == $end && $inApprovedTag ==true && !($end=="" && $inApprovedTag ==true)) { $inApprovedTag = false; //$i++; } //i want to bail at $maxLength, but not if we're still in a good tag if (strlen($newString)>$maxLength && !$inApprovedTag) { break 1; } } return $newString; } } if(!function_exists("RemoveLastCharacterIfMatch")) { function RemoveLastCharacterIfMatch($strIn, $chrIn) //Trim off the last character of $strIn if they happen to be $chrIn. //Only works with one-character $chrIn. { $out=$strIn; if (substr($strIn, strlen($strIn)-1, 1) ==$chrIn) { $out= substr($strIn, 0, strlen($strIn)-1); } return $out; } } if(!function_exists("RemoveFirstCharacterIfMatch")) { function RemoveFirstCharacterIfMatch($strIn, $chrIn) //Trim off the first character of $strIn if they happen to be $chrIn. //Only works with one-character $chrIn. { $out=$strIn; //echo substr($strIn, 0, 1) . "
"; if (substr($strIn, 0, 1) ==$chrIn) { $out= substr($strIn, 1); } return $out; } } if(!function_exists("RemoveEndCharactersIfMatch")) { function RemoveEndCharactersIfMatch($strIn, $chrIn) //Trim off the end characters of $strIn if they happen to be $chrIn. //Only works with one-character $chrIn. { $out= RemoveFirstCharacterIfMatch($strIn, $chrIn); $out= RemoveLastCharacterIfMatch($out, $chrIn); return $out; } } if(!function_exists("truncate")) { function truncate($strIn, $intNumber) //Truncates $strIn to $intNumber (more or less) at the nearest space less than $intNumber and adds ... //I've added some code to make sure an image tag early in $strIn is shown in full, but shrunk to a thumbnail { $taglist="div span DIV SPAN p br P BR strong b STRONG B i I h3 h2 h1 H1 H2 H3"; $strIn= killBetweenTags($strIn, $taglist, $intNumber + 10); //echo "+" . $strIn . "\n"; $strLen=strlen($strIn); $bwlSkipElipsis=false; if ($strLen<$intNumber+2) { return $strIn; } //parsehyperlink($strIn, 55); $intStart=$intNumber; for ($i=$intStart; $i>1; $i--) { if (substr($strIn, $i, 1)==" " || substr($strIn, $i, 1)==",") { $out= substr($strIn, 0, $i); $lespos=strrpos($out,"<"); $grepos=strrpos($out,">"); if (($grepos<$lespos || $grepos === false ) && $lespos<$intNumber && !($lespos === false) ) { $grepos=strpos($strIn,">", $lespos)+1; $out = substr($strIn, 0, $grepos); $out=str_replace(""); if (($grepos<$lespos || $grepos=="") && $lespos<$intNumber && !($lespos === false)) { $grepos=strpos($strIn,">", $lespos)+1; $out = substr($strIn, 0, $grepos); $out=str_replace(" Gus Mueller "; } else { $out=" \n"; $out.="\n"; } //$out.="\n\n"; if ($strfilename!= $strthisfile && !($arrthis[0]=="db_demo/tableform.php" && contains($_SERVER['PHP_SELF'], "db_demo")) ) { $out=$out . "" . chr(13); } else { $out=$out . " " . chr(13); } $out=$out . ""; } } $out=$out . "

"; $out.="\n
" . chr(13); //$out.= "\n" . chr(13); $out.= ""; $out.= " "; //if($tourinfo!="") //{ $out.=" "; //} $out.= ""; $out.= "\n"; $out= $out ."\n"; $out= $out ."\n"; $out= $out ."
"; //$out.= "Gus Mueller\n"; //$out= $out ."
"; $out.= nav(); $out.=" "; $out.=TourInfo(); $out.="
"; return($out); } function sfooter() { $width=800; $strfilename=thisfilename(); //this is a total kludge for the unusual width og the sponsorsplash page. //end of kludge $out=""; $out= $out .""; $out.= "\"\"\n"; $out= $out ."
\n"; $out= $out ."\n"; $out= $out ."\n"; return($out); } function random() { list($usec, $sec) = explode(" ",microtime()); $usec=substr($usec,strlen($usec)-5); //$usec=strrev($usec); $val=intval($usec)/99999; //echo("
" .$val); return($val); } if(!function_exists("inList")) { function inList($strList, $item) //look to see if item is in the space-delimited strList (similar to my ASP version) { $arrThis=explode(' ', $strList); for ($t=0; $t"); if ($arrThis[$intTypeIn]==$strIn) { $strOut=$arrThis[$intTypeOut]; $bwlDone=1; } } } } return($strOut); } } if(!function_exists("beginswith")) { function beginswith($strIn, $what) { if (substr($strIn,0, strlen($what))==$what) { return true; } return false; } } if(!function_exists("contains")) { function contains($strIn, $what) { if (strpos(" " . $strIn, $what)>0) { return true; } return false; } } if(!function_exists("addlettersbyte")) { function addlettersbyte($in, $key, $mode="numeric") //converts numbers into a byte stream { $out=""; $in=$in.""; while (strlen($key)"; if(!$bwlBanFrom || $bwlBanFrom && $strthisfile!="feedback.php") { $out=$out . "
"; return($out); } //new cool content functions if(!function_exists("GenericDataPulldown")) { function GenericDataPulldown($strConfig, $intIDField, $intLabelField, $strQueryVariableName, $intThis, $strPHP, $strFormName) { $intTop=-1; $strOut=""; if ($strConfig!="") { if (strpos($strConfig, "-") >0) { $intTop=count(split("-",$strConfig)); } } if (($strPHP!="") and ($strFormName!="")) { $strOut=chr(13) . "