"; 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"; 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 ------------------------------ if ($i==0){ echo " \n"; foreach ($key as $akey) { if ($akey=="edate") { echo ""; } elseif ($akey=="photo") { if (($photo!= "") && ($photo!= "noimg.gif")) { echo ""; } } elseif ($akey=="title") { 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=="pglink") { if (!$pgglink) { copy($newpage, $pglink); echo "created new page for ".$pglink; } } elseif ($akey=="date") { echo "
"; } else { echo $$akey."
\n"; } } //foreach key } else { echo " \n"; foreach ($key as $akey) { if ($akey=="edate") { echo ""; } elseif ($akey=="photo") { if (($photo!= "") && ($photo!= "noimg.gif")) { echo ""; } } elseif ($akey=="title") { 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=="date") { echo "
"; } else { echo $$akey."
\n"; } } //foreach key } // end if i==0 } // foreach entry include("footer.inc"); ?>