custom.inc
2.66 KB
<?phpini_set('auto_detect_line_endings', true);## setting ####################################$home_url = $_SESSION["home_url"];$home_path = $_SESSION["home_path"];$logfile_path = "image.log";$images_url = "{$home_url}images/";$images_path = "{$home_path}images/";// functions ///////////////////////////////////////////function log_read ($name, $key) {
global $home_path, $logfile_path;
$file = file("{$home_path}functions/{$logfile_path}");
foreach ($file as $value) {
$array = split(",", $value);
if ($array[0] == $name) {
$con = $array[$key];
}
}
return $con;}function show_image ($file_name) {
global $home_path, $images_url;
if ($file_name == "slide_show_1") {
$up_image_path = "credit1";
} elseif ($file_name == "slide_show_2") {
$up_image_path = "credit2";
} elseif ($file_name == "slide_show_3") {
$up_image_path = "credit3";
} elseif ($file_name == "slide_show_4") {
$up_image_path = "credit4";
} elseif ($file_name == "side_banner_1") {
$up_image_path = "banner/banner1";
} elseif ($file_name == "side_banner_2") {
$up_image_path = "banner/banner2";
} elseif ($file_name == "side_banner_3") {
$up_image_path = "banner/banner3";
} elseif ($file_name == "side_banner_4") {
$up_image_path = "banner/banner4";
} elseif ($file_name == "side_banner_5") {
$up_image_path = "banner/banner5";
} elseif ($file_name == "side_banner_6") {
$up_image_path = "banner/banner6";
} elseif ($file_name == "side_banner_7") {
$up_image_path = "banner/banner7";
} elseif ($file_name == "side_banner_8") {
$up_image_path = "banner/banner8";
} elseif ($file_name == "side_banner_9") {
$up_image_path = "banner/banner9";
} elseif ($file_name == "side_banner_10") {
$up_image_path = "banner/banner10";
} elseif ($file_name == "credit_1") {
$up_image_path = "credit/contents1";
} elseif ($file_name == "credit_2") {
$up_image_path = "credit/contents2";
} elseif ($file_name == "credit_3") {
$up_image_path = "credit/contents3";
} elseif ($file_name == "credit_4") {
$up_image_path = "credit/contents4";
} elseif ($file_name == "credit_5") {
$up_image_path = "credit/contents5";
} elseif ($file_name == "credit_6") {
$up_image_path = "credit/contents6";
} elseif ($file_name == "credit_global") {
$up_image_path = "credit/global";
}
$unique = date("YmdHis", time());
$extension = log_read ($file_name, 1);
$alt = log_read ($file_name, 2);
if (ereg("^credit", $file_name)) {
$image = '<img src="'.$images_url.$up_image_path.'.'.$extension.'?'.$unique.'" width="250" alt="'.$alt.'" /><br />';
} else {
$image = '<img src="'.$images_url.$up_image_path.'.'.$extension.'?'.$unique.'" width="150" alt="'.$alt.'" /><br />';
}
return $image;}?>