"; echo "".$farmname." - ".$page.""; echo ""; $header="header.inc"; $self=explode("/", $_SERVER['PHP_SELF']); $a=count($self); $page=$self[$a-1]; $page=rm_ext($page); $filename=$page.".txt"; $imgdir=$page."_files/"; $tndir="tndir/"; $filename1=$homedir.$farmdir.$prodir.$filename; $keyname=$page."key"; $key=$$keyname; $newpage="stpage.php"; $photogal="photogal"; if (!$key) { $keyname="defaultkey"; $key= $$keyname; } if (!is_file($filename1)) { mkfile($filename1); echo "created new file ".$filename1; } include($header); //echo "

"; //echo "Manage

\n"; //echo "

\n"; echo "

".$farmname." - ".ucwords($page)."

\n"; // Read in the entire file. $entrys=file($filename1); $num_entrys = count($entrys); if ($num_entrys == 0) { echo "

No Entires Listed for ".$farmname; } //For each entry for ($i=0; $i<$num_entrys; $i++) { $line = explode( $d, $entrys[$i] ); $num_items = count($line); for ($a=0; $a<$num_items; $a++) { // For each item in a line $key[$a]=trim($key[$a]); $line[$a]=trim($line[$a]); $$key[$a]=$line[$a]; } //------------------Write Page ------------------------------ echo " \n"; foreach ($key as $akey) { if ($akey=="edate") { echo ""; } elseif ($akey=="photo") { if (($photo!= "") && ($photo!= "noimg.gif")) { echo ""; } } elseif ($akey=="title") { echo ""; } else { echo $$akey."
\n"; } } //foreach key echo "
\n"; echo ""; echo " \n"; echo "".$title."
\n"; } elseif ($akey=="name") { echo "
".$name."
\n"; } elseif (($akey=="email") && ($email != "")) { $email = str_replace("@", "@", $email); echo "email: "; echo "".$email."
\n"; } elseif (($akey=="website")&& ($website != "")) { echo "website: "; echo "".$website."
\n"; } elseif (($akey=="photodir")&& ($photodir != "")) { if (!is_dir($photodir)) { $source=$homedir.$farmdir.$photogal; $dest=$homedir.$farmdir.$photodir; echo "photogallery created for".$name; copydirs($source, $dest); } echo "Additional Photos: "; echo "".$photodir."   \n"; } elseif (($akey=="videos")&& ($videos != "")) { echo "Videos: "; echo "".$videos."
\n"; } elseif ($akey=="date") { echo "
"; } // foreach entry include("footer.inc"); ?>