credit.css 3.67 KB
<?php
header('Content-Type: text/css; charset=utf-8');
$file = file("../image.log");
foreach ($file as $value) {
	$array = split(",", $value);

	if ($array[0] == "credit_1") {
		$ex_1 = $array[1];
	}
	if ($array[0] == "credit_2") {
		$ex_2 = $array[1];
	}
	if ($array[0] == "credit_3") {
		$ex_3 = $array[1];
	}
	if ($array[0] == "credit_4") {
		$ex_4 = $array[1];
	}
	if ($array[0] == "credit_5") {
		$ex_5 = $array[1];
	}
	if ($array[0] == "credit_6") {
		$ex_6 = $array[1];
	}
	if ($array[0] == "credit_global") {
		$ex_global = $array[1];
	}
}

if (isset($_GET['cms'])) $cms = $_GET['cms'];

if ($cms=="testselesite") {
	$dbhost = "192.168.1.208";
	$dbname = "cms_testselesite_com";
} elseif ($cms=="selesite") {
	$dbhost = "db-int.wp.systec2000.com";
	$dbname = "sele2_cms_selesite_com";
} elseif ($cms=="yadokari_cms") {
	$dbhost = "db-int.wp.systec2000.com";
	$dbname = "sele_cms_yadokari_co_jp";
} elseif ($cms=="otegaru_web") {
	$dbhost = "db-int.wp.systec2000.com";
	$dbname = "sele_cms_otegaru_web_jp";
} elseif ($cms=="testing_environment") {
	$dbhost = "db-int.wp.systec2000.com";
	$dbname = "cms_testing_environment";
} elseif ($cms=="estate") {
	$dbhost = "db-int.wp.systec2000.com";
	$dbname = "sele_estate_selesite_com";
} else {
	$dbhost = "db-int.wp.systec2000.com";
	$dbname = "sele2_cms_selesite_com";
}
$dbuser = "sele2_cms";
$dbpass = "cVY7hvaX6V47qFYY";
$t_blog = "mt_blog";
$t_tmpl = "mt_template";

$con = mysql_connect($dbhost, $dbuser, $dbpass);

$getchara = mysql_client_encoding($con);
if ($getchara != "utf8") {
	$set_name = "SET NAMES utf8";
	mysql_query($set_name, $con);
}

$home_url = 'http://'.$_SERVER["HTTP_HOST"].$_SERVER['PHP_SELF'];
$home_url = str_replace("functions/util/credit.css", "", $home_url);

	$select = "select template_text, template_name from {$t_tmpl} where template_blog_id = 0 and template_name like '%SETTING%' and template_text like '%{$home_url}\n%';";
	$result = mysql_db_query($dbname, $select, $con);
	while ($row = mysql_fetch_array($result)) {
		$setting_text = $row["template_text"];
	}
	$setting_text = explode("\n", $setting_text);
	foreach ($setting_text as $val) {
		if (ereg("^contents_class_1", $val)) {
			$contents_class_1 = ereg_replace("contents_class_1=", '', $val);
		}
		if (ereg("^contents_class_2", $val)) {
			$contents_class_2 = ereg_replace("contents_class_2=", '', $val);
		}
		if (ereg("^contents_class_3", $val)) {
			$contents_class_3 = ereg_replace("contents_class_3=", '', $val);
		}
		if (ereg("^contents_class_4", $val)) {
			$contents_class_4 = ereg_replace("contents_class_4=", '', $val);
		}
		if (ereg("^contents_class_5", $val)) {
			$contents_class_5 = ereg_replace("contents_class_5=", '', $val);
		}
		if (ereg("^contents_class_6", $val)) {
			$contents_class_6 = ereg_replace("contents_class_6=", '', $val);
		}
	}
echo '// '.$cms."\n";
?>
.home p.credit {
	background-image : url(../../images/credit/home.jpg);
}
.<?php echo $contents_class_1; ?> p.credit {
	background-image : url(../../images/credit/contents1.<?php echo $ex_1; ?>);
}
.<?php echo $contents_class_2; ?> p.credit {
	background-image : url(../../images/credit/contents2.<?php echo $ex_2; ?>);
}
.<?php echo $contents_class_3; ?> p.credit {
	background-image : url(../../images/credit/contents3.<?php echo $ex_3; ?>);
}
.<?php echo $contents_class_4; ?> p.credit {
	background-image : url(../../images/credit/contents4.<?php echo $ex_4; ?>);
}
.<?php echo $contents_class_5; ?> p.credit {
	background-image : url(../../images/credit/contents5.<?php echo $ex_5; ?>);
}
.<?php echo $contents_class_6; ?> p.credit {
	background-image : url(../../images/credit/contents6.<?php echo $ex_6; ?>);
}
.global p.credit {
	background-image : url(../../images/credit/global.<?php echo $ex_global; ?>);
}