This commit has been accessed 302 times via Git panel.
commit 3817a547f1c907283dc7e8b78eede3c7b2fdb7d2
tree c37f3f70d1ded50f70a69bd4c1d2b5fbe8f1d726
parent 3a601d6a71cb21aa8709feb2ee478092f7a58ddf
author Engels Antonio <engels@majcms.org> 1277314206 +0800
committer Engels Antonio <engels@majcms.org> 1277314206 +0800
maj-1.0-20081222-bb.zip
diff --git a/colors.php b/colors.php
index 474fefb..f51ece4 100644
--- a/colors.php
+++ b/colors.php
@@ -166,6 +166,30 @@ if (isset($_POST['id']) and !empty($_POST['id']) and !file_exists("data/schemes/
copy("data/colors/vlink.txt","data/schemes/colors/$id/vlink.txt");
}
+ if (file_exists("images/background.gif") and !file_exists("images/background.jpg") and !file_exists("images/background.png")) {
+ copy("images/background.gif","data/schemes/colors/$id/background.gif");
+ }
+
+ if (!file_exists("images/background.gif") and file_exists("images/background.jpg") and !file_exists("images/background.png")) {
+ copy("images/background.jpg","data/schemes/colors/$id/background.jpg");
+ }
+
+ if (!file_exists("images/background.gif") and !file_exists("images/background.jpg") and file_exists("images/background.png")) {
+ copy("images/background.png","data/schemes/colors/$id/background.png");
+ }
+
+ if (file_exists("data/bg-position.txt")) {
+ copy("data/bg-position.txt","data/schemes/colors/$id/bg-position.txt");
+ }
+
+ if (file_exists("data/bg-repeat.txt")) {
+ copy("data/bg-repeat.txt","data/schemes/colors/$id/bg-repeat.txt");
+ }
+
+ if (file_exists("data/bg-scroll.txt")) {
+ copy("data/bg-scroll.txt","data/schemes/colors/$id/bg-scroll.txt");
+ }
+
if (count(glob("data/schemes/colors/*")) === 1) {
$first_scheme = fopen("data/schemes/current/color.txt","w");
fwrite($first_scheme,$id);
@@ -232,7 +256,55 @@ if (isset($_POST['scheme']) and !empty($_POST['scheme'])) {
if (file_exists("data/colors/vlink.txt")) {
unlink("data/colors/vlink.txt");
}
-
+
+ if (file_exists("images/background.gif") and !file_exists("data/schemes/colors/$scheme/background.gif")) {
+ unlink("images/background.gif");
+ }
+
+ if (file_exists("images/background.jpg") and !file_exists("data/schemes/colors/$scheme/background.jpg")) {
+ unlink("images/background.jpg");
+ }
+
+ if (file_exists("images/background.png") and !file_exists("data/schemes/colors/$scheme/background.png")) {
+ unlink("images/background.png");
+ }
+
+ if (file_exists("images/background.gif") and file_exists("data/schemes/colors/$scheme/background.gif") and (md5(file_get_contents("images/background.gif")) != md5(file_get_contents("data/schemes/colors/$scheme/background.gif")))) {
+ unlink("images/background.gif");
+ }
+
+ if (file_exists("images/background.jpg") and file_exists("data/schemes/colors/$scheme/background.jpg") and (md5(file_get_contents("images/background.jpg")) != md5(file_get_contents("data/schemes/colors/$scheme/background.jpg")))) {
+ unlink("images/background.jpg");
+ }
+
+ if (file_exists("images/background.png") and file_exists("data/schemes/colors/$scheme/background.png") and (md5(file_get_contents("images/background.png")) != md5(file_get_contents("data/schemes/colors/$scheme/background.png")))) {
+ unlink("images/background.png");
+ }
+
+ if (file_exists("data/bg-position.txt") and !file_exists("data/schemes/colors/$scheme/bg-position.txt")) {
+ unlink("data/bg-position.txt");
+ }
+
+ if (file_exists("data/bg-repeat.txt") and !file_exists("data/schemes/colors/$scheme/bg-repeat.txt")) {
+ unlink("data/bg-repeat.txt");
+ }
+
+ if (file_exists("data/bg-scroll.txt") and !file_exists("data/schemes/colors/$scheme/bg-scroll.txt")) {
+ unlink("data/bg-scroll.txt");
+ }
+
+ if (file_exists("data/bg-position.txt") and file_exists("data/schemes/colors/$scheme/bg-position.txt") and (file_get_contents("data/bg-position.txt") != file_get_contents("data/schemes/colors/$scheme/bg-position.txt"))) {
+ unlink("data/bg-position.txt");
+ }
+
+ if (file_exists("data/bg-repeat.txt") and file_exists("data/schemes/colors/$scheme/bg-repeat.txt") and (file_get_contents("data/bg-repeat.txt") != file_get_contents("data/schemes/colors/$scheme/bg-repeat.txt"))) {
+ unlink("data/bg-repeat.txt");
+ }
+
+ if (file_exists("data/bg-scroll.txt") and file_exists("data/schemes/colors/$scheme/bg-scroll.txt") and (file_get_contents("data/bg-scroll.txt") != file_get_contents("data/schemes/colors/$scheme/bg-scroll.txt"))) {
+ unlink("data/bg-scroll.txt");
+ }
+
if (file_exists("data/schemes/colors/$scheme/bg.txt")) {
copy("data/schemes/colors/$scheme/bg.txt","data/colors/bg.txt");
}
@@ -280,6 +352,30 @@ if (isset($_POST['scheme']) and !empty($_POST['scheme'])) {
if (file_exists("data/schemes/colors/$scheme/vlink.txt")) {
copy("data/schemes/colors/$scheme/vlink.txt","data/colors/vlink.txt");
}
+
+ if (file_exists("data/schemes/colors/$scheme/background.gif") and !file_exists("data/schemes/colors/$scheme/background.jpg") and !file_exists("data/schemes/colors/$scheme/background.png")) {
+ copy("data/schemes/colors/$scheme/background.gif","images/background.gif");
+ }
+
+ if (!file_exists("data/schemes/colors/$scheme/background.gif") and file_exists("data/schemes/colors/$scheme/background.jpg") and !file_exists("data/schemes/colors/$scheme/background.png")) {
+ copy("data/schemes/colors/$scheme/background.jpg","images/background.jpg");
+ }
+
+ if (!file_exists("data/schemes/colors/$scheme/background.gif") and !file_exists("data/schemes/colors/$scheme/background.jpg") and file_exists("data/schemes/colors/$scheme/background.png")) {
+ copy("data/schemes/colors/$scheme/background.png","images/background.png");
+ }
+
+ if (file_exists("data/schemes/colors/$scheme/bg-position.txt")) {
+ copy("data/schemes/colors/$scheme/bg-position.txt","data/bg-position.txt");
+ }
+
+ if (file_exists("data/schemes/colors/$scheme/bg-repeat.txt")) {
+ copy("data/schemes/colors/$scheme/bg-repeat.txt","data/bg-repeat.txt");
+ }
+
+ if (file_exists("data/schemes/colors/$scheme/bg-scroll.txt")) {
+ copy("data/schemes/colors/$scheme/bg-scroll.txt","data/bg-scroll.txt");
+ }
if (!file_exists("data/schemes/current")) {
mkdir("data/schemes/current");
@@ -348,12 +444,48 @@ if (isset($_POST['scheme']) and !empty($_POST['scheme'])) {
$zip->add_file("README", file_get_contents("data/schemes/colors/$scheme/README"));
}
+ if (file_exists("images/background.gif") and !file_exists("images/background.jpg") and !file_exists("images/background.png")) {
+ $zip->add_file("background.gif", file_get_contents("images/background.gif"));
+ }
+
+ if (!file_exists("images/background.gif") and file_exists("images/background.jpg") and !file_exists("images/background.png")) {
+ $zip->add_file("background.jpg", file_get_contents("images/background.jpg"));
+ }
+
+ if (!file_exists("images/background.gif") and !file_exists("images/background.jpg") and file_exists("images/background.png")) {
+ $zip->add_file("background.png", file_get_contents("images/background.png"));
+ }
+
+ if (file_exists("data/bg-position.txt")) {
+ $zip->add_file("bg-position.txt", file_get_contents("data/bg-position.txt"));
+ }
+
+ if (file_exists("data/bg-repeat.txt")) {
+ $zip->add_file("bg-repeat.txt", file_get_contents("data/bg-repeat.txt"));
+ }
+
+ if (file_exists("data/bg-scroll.txt")) {
+ $zip->add_file("bg-scroll.txt", file_get_contents("data/bg-scroll.txt"));
+ }
+
$zip->finish();
break;
case 'click here to delete selected scheme':
+ if (file_exists("images/background.gif") and file_exists("data/schemes/colors/$scheme/background.gif") and (md5(file_get_contents("images/background.gif")) == md5(file_get_contents("data/schemes/colors/$scheme/background.gif")))) {
+ unlink("images/background.gif");
+ }
+
+ if (file_exists("images/background.jpg") and file_exists("data/schemes/colors/$scheme/background.jpg") and (md5(file_get_contents("images/background.jpg")) == md5(file_get_contents("data/schemes/colors/$scheme/background.jpg")))) {
+ unlink("images/background.jpg");
+ }
+
+ if (file_exists("images/background.png") and file_exists("data/schemes/colors/$scheme/background.png") and (md5(file_get_contents("images/background.png")) == md5(file_get_contents("data/schemes/colors/$scheme/background.png")))) {
+ unlink("images/background.png");
+ }
+
rmdirr("data/schemes/colors/$scheme");
if (file_exists("data/schemes/current/color.txt") and (file_get_contents("data/schemes/current/color.txt") == $scheme)) {
@@ -723,53 +855,58 @@ a:active {
<table border=0 cellspacing=1 cellpadding=10 bgcolor=#cccccc>
-<tr><td<?php
- if (file_exists("images/background.gif") or file_exists("images/background.jpg") or file_exists("images/background.png")) {
- echo ' style="';
- }
-
- if (file_exists("images/background.gif") and !file_exists("images/background.jpg") and !file_exists("images/background.png")) { ?>background-image: url('images/background.gif');
- background-attachment: <?php if (file_exists("data/bg-scroll.txt")) { echo scroll; } else { echo fixed; } ?>;
- background-repeat: <?php if (file_exists("data/bg-repeat.txt")) { readfile("data/bg-repeat.txt"); } else { echo repeat; } ?>;
- background-position: <?php if (file_exists("data/bg-position.txt")) { readfile("data/bg-position.txt"); } else { echo "top left"; } ?>;
- <?php
- }
- if (!file_exists("images/background.gif") and file_exists("images/background.jpg") and !file_exists("images/background.png")) { ?>background-image: url('images/background.jpg');
- background-attachment: <?php if (file_exists("data/bg-scroll.txt")) { echo scroll; } else { echo fixed; } ?>;
- background-repeat: <?php if (file_exists("data/bg-repeat.txt")) { readfile("data/bg-repeat.txt"); } else { echo repeat; } ?>;
- background-position: <?php if (file_exists("data/bg-position.txt")) { readfile("data/bg-position.txt"); } else { echo "top left"; } ?>;
- <?php
- }
- if (!file_exists("images/background.gif") and !file_exists("images/background.jpg") and file_exists("images/background.png")) { ?>background-image: url('images/background.png');
- background-attachment: <?php if (file_exists("data/bg-scroll.txt")) { echo scroll; } else { echo fixed; } ?>;
- background-repeat: <?php if (file_exists("data/bg-repeat.txt")) { readfile("data/bg-repeat.txt"); } else { echo repeat; } ?>;
- background-position: <?php if (file_exists("data/bg-position.txt")) { readfile("data/bg-position.txt"); } else { echo "top left"; } ?>;
- <?php
- }
-
- if (file_exists("images/background.gif") or file_exists("images/background.jpg") or file_exists("images/background.png")) {
- echo '"';
- }
-
- echo ' bgcolor="';
+<tr<?php
if (file_exists("data/colors/bg.txt")) {
+
$bgcolor = file_get_contents("data/colors/bg.txt");
+
if ($bgcolor == "transparent") {
- echo "#ffffff";
+ echo " bgcolor=\"#ffffff\"";
}
else {
- echo $bgcolor;
+ echo " bgcolor=\"$bgcolor\"";
}
}
else {
- echo "#ffffff";
+ echo " bgcolor=\"#ffffff\"";
}
- echo '">';
+ echo "><td";
+
+ if (file_exists("images/background.gif") or file_exists("images/background.jpg") or file_exists("images/background.png")) {
- ?>
+ if (file_exists("images/background.gif") and !file_exists("images/background.jpg") and !file_exists("images/background.png")) {
+ echo " style=\"background-image: url('images/background.gif')";
+ }
+ if (!file_exists("images/background.gif") and file_exists("images/background.jpg") and !file_exists("images/background.png")) {
+ echo " style=\"background-image: url('images/background.jpg')";
+ }
+ if (!file_exists("images/background.gif") and !file_exists("images/background.jpg") and file_exists("images/background.png")) {
+ echo " style=\"background-image: url('images/background.png')";
+ }
+ echo "; background-attachment: scroll; background-repeat: ";
+
+ if (file_exists("data/bg-repeat.txt")) {
+ readfile("data/bg-repeat.txt");
+ }
+ else {
+ echo "repeat";
+ }
+
+ echo "; background-position: ";
+
+ if (file_exists("data/bg-position.txt")) {
+ readfile("data/bg-position.txt");
+ }
+ else {
+ echo "top left";
+ }
+
+ echo ";\"";
+ }
+?>>
<div id=panel_out><b>Colors</b> Preview</div>
<div id=panel_title>Panel Title</div>
<div id=panel_body><font style="font-size: 10px; color: #999999;">panel body</font><p>Enter any of the sixteen standard colors (<i>aqua</i>, <i>black</i>, <i>blue</i>, <i>fuchsia</i>, <i>gray</i>, <i>green</i>, <i>lime</i>, <i>maroon</i>, <i>navy</i>, <i>olive</i>, <i>purple</i>, <i>red</i>, <i>silver</i>, <i>teal</i>, <i>white</i>, <i>yellow</i>) in the field under the color wheel. For more colors, click on the color wheel. Use <i>transparent</i> for see-through backgrounds.</p><p>While this serves as a convenient preview, colors are actually applied immediately after submission.</p><p><a href=none.php>Hyperlink #1</a><br><a href="<?php echo $_SERVER['PHP_SELF']; ?>">Hyperlink #2</a><br><a href="<?php echo $_SERVER['PHP_SELF']; ?>">Hyperlink #3</a></p></div>
@@ -834,7 +971,7 @@ if (file_exists("data/schemes/current/color.txt")) {
?></p>
-<p>Enter a unique ID below to save the current color scheme.</p></td></tr>
+<p>Enter a unique ID below to save the current color scheme.<br>The background image and its settings will also be saved.</p></td></tr>
<tr><td><input type=text class=input name=id autocomplete=off></td></tr>
<tr><td><input type=submit class=input value="click here to save current color scheme"></td></tr>
</table>
diff --git a/images/widget.orig.png b/images/widget.orig.png
new file mode 100644
index 0000000..c3b4462
Binary files /dev/null and b/images/widget.orig.png differ
diff --git a/rel.txt b/rel.txt
index ba2040b..b5ec2b4 100644
--- a/rel.txt
+++ b/rel.txt
@@ -1 +1 @@
-20081214
\ No newline at end of file
+20081222
\ No newline at end of file
diff --git a/wiki.php b/wiki.php
index aa6e506..04e6bd1 100644
--- a/wiki.php
+++ b/wiki.php
@@ -318,6 +318,7 @@ del {
echo "<a href=\"wiki.php?entry=$entry&del=$item\"><img src=\"images/widget.del.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"delete\"></a>";
}
echo "<a href=\"wiki.php?entry=$entry&restore=$item\"><img src=\"images/widget.back.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"restore\"></a>";
+ echo "<a href=\"index.php?entry=$entry\"><img src=\"images/widget.orig.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"home\"></a>";
echo "</div><div id=\"panel_body\"><font style=\"font-size: 10px; color: #999999;\">$author - ";
entry2date($entry);
echo "<br><br></font>$diff</div>";
tree c37f3f70d1ded50f70a69bd4c1d2b5fbe8f1d726
parent 3a601d6a71cb21aa8709feb2ee478092f7a58ddf
author Engels Antonio <engels@majcms.org> 1277314206 +0800
committer Engels Antonio <engels@majcms.org> 1277314206 +0800
maj-1.0-20081222-bb.zip
diff --git a/colors.php b/colors.php
index 474fefb..f51ece4 100644
--- a/colors.php
+++ b/colors.php
@@ -166,6 +166,30 @@ if (isset($_POST['id']) and !empty($_POST['id']) and !file_exists("data/schemes/
copy("data/colors/vlink.txt","data/schemes/colors/$id/vlink.txt");
}
+ if (file_exists("images/background.gif") and !file_exists("images/background.jpg") and !file_exists("images/background.png")) {
+ copy("images/background.gif","data/schemes/colors/$id/background.gif");
+ }
+
+ if (!file_exists("images/background.gif") and file_exists("images/background.jpg") and !file_exists("images/background.png")) {
+ copy("images/background.jpg","data/schemes/colors/$id/background.jpg");
+ }
+
+ if (!file_exists("images/background.gif") and !file_exists("images/background.jpg") and file_exists("images/background.png")) {
+ copy("images/background.png","data/schemes/colors/$id/background.png");
+ }
+
+ if (file_exists("data/bg-position.txt")) {
+ copy("data/bg-position.txt","data/schemes/colors/$id/bg-position.txt");
+ }
+
+ if (file_exists("data/bg-repeat.txt")) {
+ copy("data/bg-repeat.txt","data/schemes/colors/$id/bg-repeat.txt");
+ }
+
+ if (file_exists("data/bg-scroll.txt")) {
+ copy("data/bg-scroll.txt","data/schemes/colors/$id/bg-scroll.txt");
+ }
+
if (count(glob("data/schemes/colors/*")) === 1) {
$first_scheme = fopen("data/schemes/current/color.txt","w");
fwrite($first_scheme,$id);
@@ -232,7 +256,55 @@ if (isset($_POST['scheme']) and !empty($_POST['scheme'])) {
if (file_exists("data/colors/vlink.txt")) {
unlink("data/colors/vlink.txt");
}
-
+
+ if (file_exists("images/background.gif") and !file_exists("data/schemes/colors/$scheme/background.gif")) {
+ unlink("images/background.gif");
+ }
+
+ if (file_exists("images/background.jpg") and !file_exists("data/schemes/colors/$scheme/background.jpg")) {
+ unlink("images/background.jpg");
+ }
+
+ if (file_exists("images/background.png") and !file_exists("data/schemes/colors/$scheme/background.png")) {
+ unlink("images/background.png");
+ }
+
+ if (file_exists("images/background.gif") and file_exists("data/schemes/colors/$scheme/background.gif") and (md5(file_get_contents("images/background.gif")) != md5(file_get_contents("data/schemes/colors/$scheme/background.gif")))) {
+ unlink("images/background.gif");
+ }
+
+ if (file_exists("images/background.jpg") and file_exists("data/schemes/colors/$scheme/background.jpg") and (md5(file_get_contents("images/background.jpg")) != md5(file_get_contents("data/schemes/colors/$scheme/background.jpg")))) {
+ unlink("images/background.jpg");
+ }
+
+ if (file_exists("images/background.png") and file_exists("data/schemes/colors/$scheme/background.png") and (md5(file_get_contents("images/background.png")) != md5(file_get_contents("data/schemes/colors/$scheme/background.png")))) {
+ unlink("images/background.png");
+ }
+
+ if (file_exists("data/bg-position.txt") and !file_exists("data/schemes/colors/$scheme/bg-position.txt")) {
+ unlink("data/bg-position.txt");
+ }
+
+ if (file_exists("data/bg-repeat.txt") and !file_exists("data/schemes/colors/$scheme/bg-repeat.txt")) {
+ unlink("data/bg-repeat.txt");
+ }
+
+ if (file_exists("data/bg-scroll.txt") and !file_exists("data/schemes/colors/$scheme/bg-scroll.txt")) {
+ unlink("data/bg-scroll.txt");
+ }
+
+ if (file_exists("data/bg-position.txt") and file_exists("data/schemes/colors/$scheme/bg-position.txt") and (file_get_contents("data/bg-position.txt") != file_get_contents("data/schemes/colors/$scheme/bg-position.txt"))) {
+ unlink("data/bg-position.txt");
+ }
+
+ if (file_exists("data/bg-repeat.txt") and file_exists("data/schemes/colors/$scheme/bg-repeat.txt") and (file_get_contents("data/bg-repeat.txt") != file_get_contents("data/schemes/colors/$scheme/bg-repeat.txt"))) {
+ unlink("data/bg-repeat.txt");
+ }
+
+ if (file_exists("data/bg-scroll.txt") and file_exists("data/schemes/colors/$scheme/bg-scroll.txt") and (file_get_contents("data/bg-scroll.txt") != file_get_contents("data/schemes/colors/$scheme/bg-scroll.txt"))) {
+ unlink("data/bg-scroll.txt");
+ }
+
if (file_exists("data/schemes/colors/$scheme/bg.txt")) {
copy("data/schemes/colors/$scheme/bg.txt","data/colors/bg.txt");
}
@@ -280,6 +352,30 @@ if (isset($_POST['scheme']) and !empty($_POST['scheme'])) {
if (file_exists("data/schemes/colors/$scheme/vlink.txt")) {
copy("data/schemes/colors/$scheme/vlink.txt","data/colors/vlink.txt");
}
+
+ if (file_exists("data/schemes/colors/$scheme/background.gif") and !file_exists("data/schemes/colors/$scheme/background.jpg") and !file_exists("data/schemes/colors/$scheme/background.png")) {
+ copy("data/schemes/colors/$scheme/background.gif","images/background.gif");
+ }
+
+ if (!file_exists("data/schemes/colors/$scheme/background.gif") and file_exists("data/schemes/colors/$scheme/background.jpg") and !file_exists("data/schemes/colors/$scheme/background.png")) {
+ copy("data/schemes/colors/$scheme/background.jpg","images/background.jpg");
+ }
+
+ if (!file_exists("data/schemes/colors/$scheme/background.gif") and !file_exists("data/schemes/colors/$scheme/background.jpg") and file_exists("data/schemes/colors/$scheme/background.png")) {
+ copy("data/schemes/colors/$scheme/background.png","images/background.png");
+ }
+
+ if (file_exists("data/schemes/colors/$scheme/bg-position.txt")) {
+ copy("data/schemes/colors/$scheme/bg-position.txt","data/bg-position.txt");
+ }
+
+ if (file_exists("data/schemes/colors/$scheme/bg-repeat.txt")) {
+ copy("data/schemes/colors/$scheme/bg-repeat.txt","data/bg-repeat.txt");
+ }
+
+ if (file_exists("data/schemes/colors/$scheme/bg-scroll.txt")) {
+ copy("data/schemes/colors/$scheme/bg-scroll.txt","data/bg-scroll.txt");
+ }
if (!file_exists("data/schemes/current")) {
mkdir("data/schemes/current");
@@ -348,12 +444,48 @@ if (isset($_POST['scheme']) and !empty($_POST['scheme'])) {
$zip->add_file("README", file_get_contents("data/schemes/colors/$scheme/README"));
}
+ if (file_exists("images/background.gif") and !file_exists("images/background.jpg") and !file_exists("images/background.png")) {
+ $zip->add_file("background.gif", file_get_contents("images/background.gif"));
+ }
+
+ if (!file_exists("images/background.gif") and file_exists("images/background.jpg") and !file_exists("images/background.png")) {
+ $zip->add_file("background.jpg", file_get_contents("images/background.jpg"));
+ }
+
+ if (!file_exists("images/background.gif") and !file_exists("images/background.jpg") and file_exists("images/background.png")) {
+ $zip->add_file("background.png", file_get_contents("images/background.png"));
+ }
+
+ if (file_exists("data/bg-position.txt")) {
+ $zip->add_file("bg-position.txt", file_get_contents("data/bg-position.txt"));
+ }
+
+ if (file_exists("data/bg-repeat.txt")) {
+ $zip->add_file("bg-repeat.txt", file_get_contents("data/bg-repeat.txt"));
+ }
+
+ if (file_exists("data/bg-scroll.txt")) {
+ $zip->add_file("bg-scroll.txt", file_get_contents("data/bg-scroll.txt"));
+ }
+
$zip->finish();
break;
case 'click here to delete selected scheme':
+ if (file_exists("images/background.gif") and file_exists("data/schemes/colors/$scheme/background.gif") and (md5(file_get_contents("images/background.gif")) == md5(file_get_contents("data/schemes/colors/$scheme/background.gif")))) {
+ unlink("images/background.gif");
+ }
+
+ if (file_exists("images/background.jpg") and file_exists("data/schemes/colors/$scheme/background.jpg") and (md5(file_get_contents("images/background.jpg")) == md5(file_get_contents("data/schemes/colors/$scheme/background.jpg")))) {
+ unlink("images/background.jpg");
+ }
+
+ if (file_exists("images/background.png") and file_exists("data/schemes/colors/$scheme/background.png") and (md5(file_get_contents("images/background.png")) == md5(file_get_contents("data/schemes/colors/$scheme/background.png")))) {
+ unlink("images/background.png");
+ }
+
rmdirr("data/schemes/colors/$scheme");
if (file_exists("data/schemes/current/color.txt") and (file_get_contents("data/schemes/current/color.txt") == $scheme)) {
@@ -723,53 +855,58 @@ a:active {
<table border=0 cellspacing=1 cellpadding=10 bgcolor=#cccccc>
-<tr><td<?php
- if (file_exists("images/background.gif") or file_exists("images/background.jpg") or file_exists("images/background.png")) {
- echo ' style="';
- }
-
- if (file_exists("images/background.gif") and !file_exists("images/background.jpg") and !file_exists("images/background.png")) { ?>background-image: url('images/background.gif');
- background-attachment: <?php if (file_exists("data/bg-scroll.txt")) { echo scroll; } else { echo fixed; } ?>;
- background-repeat: <?php if (file_exists("data/bg-repeat.txt")) { readfile("data/bg-repeat.txt"); } else { echo repeat; } ?>;
- background-position: <?php if (file_exists("data/bg-position.txt")) { readfile("data/bg-position.txt"); } else { echo "top left"; } ?>;
- <?php
- }
- if (!file_exists("images/background.gif") and file_exists("images/background.jpg") and !file_exists("images/background.png")) { ?>background-image: url('images/background.jpg');
- background-attachment: <?php if (file_exists("data/bg-scroll.txt")) { echo scroll; } else { echo fixed; } ?>;
- background-repeat: <?php if (file_exists("data/bg-repeat.txt")) { readfile("data/bg-repeat.txt"); } else { echo repeat; } ?>;
- background-position: <?php if (file_exists("data/bg-position.txt")) { readfile("data/bg-position.txt"); } else { echo "top left"; } ?>;
- <?php
- }
- if (!file_exists("images/background.gif") and !file_exists("images/background.jpg") and file_exists("images/background.png")) { ?>background-image: url('images/background.png');
- background-attachment: <?php if (file_exists("data/bg-scroll.txt")) { echo scroll; } else { echo fixed; } ?>;
- background-repeat: <?php if (file_exists("data/bg-repeat.txt")) { readfile("data/bg-repeat.txt"); } else { echo repeat; } ?>;
- background-position: <?php if (file_exists("data/bg-position.txt")) { readfile("data/bg-position.txt"); } else { echo "top left"; } ?>;
- <?php
- }
-
- if (file_exists("images/background.gif") or file_exists("images/background.jpg") or file_exists("images/background.png")) {
- echo '"';
- }
-
- echo ' bgcolor="';
+<tr<?php
if (file_exists("data/colors/bg.txt")) {
+
$bgcolor = file_get_contents("data/colors/bg.txt");
+
if ($bgcolor == "transparent") {
- echo "#ffffff";
+ echo " bgcolor=\"#ffffff\"";
}
else {
- echo $bgcolor;
+ echo " bgcolor=\"$bgcolor\"";
}
}
else {
- echo "#ffffff";
+ echo " bgcolor=\"#ffffff\"";
}
- echo '">';
+ echo "><td";
+
+ if (file_exists("images/background.gif") or file_exists("images/background.jpg") or file_exists("images/background.png")) {
- ?>
+ if (file_exists("images/background.gif") and !file_exists("images/background.jpg") and !file_exists("images/background.png")) {
+ echo " style=\"background-image: url('images/background.gif')";
+ }
+ if (!file_exists("images/background.gif") and file_exists("images/background.jpg") and !file_exists("images/background.png")) {
+ echo " style=\"background-image: url('images/background.jpg')";
+ }
+ if (!file_exists("images/background.gif") and !file_exists("images/background.jpg") and file_exists("images/background.png")) {
+ echo " style=\"background-image: url('images/background.png')";
+ }
+ echo "; background-attachment: scroll; background-repeat: ";
+
+ if (file_exists("data/bg-repeat.txt")) {
+ readfile("data/bg-repeat.txt");
+ }
+ else {
+ echo "repeat";
+ }
+
+ echo "; background-position: ";
+
+ if (file_exists("data/bg-position.txt")) {
+ readfile("data/bg-position.txt");
+ }
+ else {
+ echo "top left";
+ }
+
+ echo ";\"";
+ }
+?>>
<div id=panel_out><b>Colors</b> Preview</div>
<div id=panel_title>Panel Title</div>
<div id=panel_body><font style="font-size: 10px; color: #999999;">panel body</font><p>Enter any of the sixteen standard colors (<i>aqua</i>, <i>black</i>, <i>blue</i>, <i>fuchsia</i>, <i>gray</i>, <i>green</i>, <i>lime</i>, <i>maroon</i>, <i>navy</i>, <i>olive</i>, <i>purple</i>, <i>red</i>, <i>silver</i>, <i>teal</i>, <i>white</i>, <i>yellow</i>) in the field under the color wheel. For more colors, click on the color wheel. Use <i>transparent</i> for see-through backgrounds.</p><p>While this serves as a convenient preview, colors are actually applied immediately after submission.</p><p><a href=none.php>Hyperlink #1</a><br><a href="<?php echo $_SERVER['PHP_SELF']; ?>">Hyperlink #2</a><br><a href="<?php echo $_SERVER['PHP_SELF']; ?>">Hyperlink #3</a></p></div>
@@ -834,7 +971,7 @@ if (file_exists("data/schemes/current/color.txt")) {
?></p>
-<p>Enter a unique ID below to save the current color scheme.</p></td></tr>
+<p>Enter a unique ID below to save the current color scheme.<br>The background image and its settings will also be saved.</p></td></tr>
<tr><td><input type=text class=input name=id autocomplete=off></td></tr>
<tr><td><input type=submit class=input value="click here to save current color scheme"></td></tr>
</table>
diff --git a/images/widget.orig.png b/images/widget.orig.png
new file mode 100644
index 0000000..c3b4462
Binary files /dev/null and b/images/widget.orig.png differ
diff --git a/rel.txt b/rel.txt
index ba2040b..b5ec2b4 100644
--- a/rel.txt
+++ b/rel.txt
@@ -1 +1 @@
-20081214
\ No newline at end of file
+20081222
\ No newline at end of file
diff --git a/wiki.php b/wiki.php
index aa6e506..04e6bd1 100644
--- a/wiki.php
+++ b/wiki.php
@@ -318,6 +318,7 @@ del {
echo "<a href=\"wiki.php?entry=$entry&del=$item\"><img src=\"images/widget.del.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"delete\"></a>";
}
echo "<a href=\"wiki.php?entry=$entry&restore=$item\"><img src=\"images/widget.back.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"restore\"></a>";
+ echo "<a href=\"index.php?entry=$entry\"><img src=\"images/widget.orig.png\" border=\"0\" width=\"11\" height=\"11\" align=\"right\" alt=\"home\"></a>";
echo "</div><div id=\"panel_body\"><font style=\"font-size: 10px; color: #999999;\">$author - ";
entry2date($entry);
echo "<br><br></font>$diff</div>";