This commit has been accessed 637 times via Git panel.
commit 699a04a0260a4b53d68b2022dddc012f35d9c9e7
tree 48f0e533c33f2dc299a9f390f94501a8ddc864fd
parent 90eb1ef74dcdd915e7565d133168e2591489bc75
author Engels Antonio <engels@majcms.org> 1332006036 +0800
committer Engels Antonio <engels@majcms.org> 1332006036 +0800
Add per-host logo support
diff --git a/index.php b/index.php
index 9e5bd78..a85a1ae 100644
--- a/index.php
+++ b/index.php
@@ -187,7 +187,21 @@ if (!isset($_SESSION['logged_uid']) and (($pw_put != $pw_get) or !isset($_POST['
echo "<div class=\"login\"><center>";
- echo "<img src=\"images/logo.png\" border=\"0\" width=\"100\" height=\"100\">";
+ if (file_exists("images/{$_SERVER['SERVER_NAME']}.png")) {
+
+ $logo_info = getimagesize("images/{$_SERVER['SERVER_NAME']}.png");
+
+ if (($logo_info[mime] == "image/png") and ($logo_info[0] > 0) and ($logo_info[1] > 0)) {
+ echo "<img src=\"images/{$_SERVER['SERVER_NAME']}.png\" border=\"0\" width=\"{$logo_info[0]}\" height=\"{$logo_info[1]}\">";
+ }
+ else {
+ echo "<img src=\"images/logo.png\" border=\"0\" width=\"100\" height=\"100\">";
+ }
+ }
+ else {
+ echo "<img src=\"images/logo.png\" border=\"0\" width=\"100\" height=\"100\">";
+ }
+
echo "<br>kartero v1.0 at {$_SERVER['SERVER_NAME']}<br><br>";
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\">";
tree 48f0e533c33f2dc299a9f390f94501a8ddc864fd
parent 90eb1ef74dcdd915e7565d133168e2591489bc75
author Engels Antonio <engels@majcms.org> 1332006036 +0800
committer Engels Antonio <engels@majcms.org> 1332006036 +0800
Add per-host logo support
diff --git a/index.php b/index.php
index 9e5bd78..a85a1ae 100644
--- a/index.php
+++ b/index.php
@@ -187,7 +187,21 @@ if (!isset($_SESSION['logged_uid']) and (($pw_put != $pw_get) or !isset($_POST['
echo "<div class=\"login\"><center>";
- echo "<img src=\"images/logo.png\" border=\"0\" width=\"100\" height=\"100\">";
+ if (file_exists("images/{$_SERVER['SERVER_NAME']}.png")) {
+
+ $logo_info = getimagesize("images/{$_SERVER['SERVER_NAME']}.png");
+
+ if (($logo_info[mime] == "image/png") and ($logo_info[0] > 0) and ($logo_info[1] > 0)) {
+ echo "<img src=\"images/{$_SERVER['SERVER_NAME']}.png\" border=\"0\" width=\"{$logo_info[0]}\" height=\"{$logo_info[1]}\">";
+ }
+ else {
+ echo "<img src=\"images/logo.png\" border=\"0\" width=\"100\" height=\"100\">";
+ }
+ }
+ else {
+ echo "<img src=\"images/logo.png\" border=\"0\" width=\"100\" height=\"100\">";
+ }
+
echo "<br>kartero v1.0 at {$_SERVER['SERVER_NAME']}<br><br>";
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\">";