/////The following code is Copyright 2007 by AutomateXL LLC. /////
/////You may use the following code ONLY for the purpose of /////
////developing a mini website. You may NOT redistribute /////
////or sell the following code. For more information please /////
////email Mark Wielgus at mark@45n5.com. Thanks. /////
if(isset($admin))
{
if($admin==true)
{
$pw = explode("-",$_COOKIE['19cookies']);
$pw = str_replace("\n","",$pw[1]);
$pw = $pw . "\n";
$pwconfig = file("../config.php");
for($i = 0; $i < count($pwconfig); $i++)
{
if(strpos($pwconfig[$i], "") != 0)
{
$pwforconfig = str_replace("","",$pwconfig[$i]);
break;
}
}
//echo $pwforconfig . $pw;
if($pw != $pwforconfig)
{
header("Location: /admin/login.php");
exit; }
}
}
function makepermalink($thisurl) {
$thisurl=str_replace ( " ", "-", $thisurl);
$thisurl = preg_replace("/[^a-z0-9-_]/i","",$thisurl);
return strtolower(trim($thisurl));
}
function pagecount() {
$d="../articles/";
$dir = opendir($d);
while ($f = readdir($dir)) {
$contentcenter = $contentcenter+1;
}
$contentcenter=$contentcenter-3;
return $contentcenter;
}
function myconfig($findwhat) {
$d="./";
$dir = opendir($d);
while ($f = readdir($dir)) {
$thefile="config.php";
$pos = strpos($f, $thefile);
if ($pos === false) {
} else {
//found so go get the details
$myFile = $thefile;
$fh = fopen($myFile, 'r');
$data = fread($fh, filesize($myFile));
fclose($fh);
switch ($findwhat) {
case "template":
$text = explode("",$data);
break;
case "index":
$text = explode("",$data);
break;
case "sitename":
$text = explode("",$data);
break;
case "password":
$text = explode("",$data);
break;
case "email":
$text = explode("",$data);
break;
}
$contentcenter .= trim($text[1]);
}
}
return $contentcenter;
}
//had to do because relative is different, this works for folder one deep
function adminmyconfig($findwhat) {
$d="../";
$dir = opendir($d);
while ($f = readdir($dir)) {
$thefile="config.php";
$pos = strpos($f, $thefile);
if ($pos === false) {
} else {
//found so go get the details
$myFile = "../" . $thefile;
$fh = fopen($myFile, 'r');
$data = fread($fh, filesize($myFile));
fclose($fh);
switch ($findwhat) {
case "template":
$text = explode("",$data);
break;
case "index":
$text = explode("",$data);
break;
case "sitename":
$text = explode("",$data);
break;
case "password":
$text = explode("",$data);
break;
case "email":
$text = explode("",$data);
break;
}
$contentcenter .= trim($text[1]);
}
}
return $contentcenter;
}
?>
Fatal error: Call to undefined function myconfig() in /var/www/la-osteoporosis.com/index.php on line 11