This commit has been accessed 540 times via Git panel.
commit a67ef7506ec0ea49814e070fb08844de941b8b80
tree d1caa0a86ad4dfdc59c2acf8ba8063d9dd395da6
parent 9b48a4ab9c39f749881c3cb5ab6f525d3144f57d
author Engels Antonio <engels@majcms.org> 1277314203 +0800
committer Engels Antonio <engels@majcms.org> 1277314203 +0800
maj-1.0-20081126-bb.zip
diff --git a/edit.php b/edit.php
index adfebf7..506e06c 100644
--- a/edit.php
+++ b/edit.php
@@ -13,7 +13,7 @@ if (isset($_SESSION['logged_in']) and ($_SESSION['user_agent'] != $_SERVER['HTTP
if (get_magic_quotes_gpc()) {
function stripslashes_array($data) {
if (is_array($data)) {
- foreach ($data as $key => $value){
+ foreach ($data as $key => $value) {
$data[$key] = stripslashes_array($value);
}
return $data;
@@ -213,12 +213,41 @@ a:active {
border-style: none solid solid solid;
}
+.input_cat {
+ color: #666666;
+ background: #ffffff;
+ border: #999999 solid 1px;
+ width: 40px;
+ font-family: <?php
+ if (file_exists("data/fonts/panel-body.txt")) {
+ $font_panel_body = file_get_contents("data/fonts/panel-body.txt");
+ echo "{$font_panel_body},";
+ }
+ ?> arial, helvetica, sans-serif;
+ font-size: 11px
+}
+
<?php if (file_exists("data/css.txt")) { readfile("data/css.txt"); } ?>
</style>
<?php
+if (isset($_POST['category']) and !empty($_POST['category'])) {
+
+ if (!file_exists("data/items/{$_REQUEST['entry']}/categories")) {
+ mkdir("data/items/{$_REQUEST['entry']}/categories");
+ }
+
+ if (($_POST['do'] == "unfile") and file_exists("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}")) {
+ rmdirr("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}");
+ }
+
+ if (($_POST['do'] == "file") and !file_exists("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}")) {
+ mkdir("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}");
+ }
+}
+
if (isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_POST['comment_txt']) and !empty($_POST['comment_txt']) and isset($_REQUEST['type']) and !empty($_REQUEST['type']) and (($_REQUEST['type'] == "live") or ($_REQUEST['type'] == "pending"))) {
$comment_txt = ucfirst($_POST['comment_txt']);
$comment_txt = str_replace("\n", '<br />', $comment_txt);
@@ -337,22 +366,10 @@ if (file_exists($revisions_file)) {
echo ')';
}
-//if (file_exists("data/items/{$_REQUEST['entry']}/category.txt")) {
-// echo " Filed under ";
-// $category_key = file_get_contents("data/items/{$_REQUEST['entry']}/category.txt");
-// $category_key = strtolower($category_key);
-// if (file_exists("data/categories/{$category_key}/title.txt")) {
-// $category_dsp = file_get_contents("data/categories/{$category_key}/title.txt");
-// echo "$category_key ($category_dsp)";
-// }
-// else {
-// echo "$category_key";
-// }
-//}
-
-?></font></div>
-</td></tr></table>
+?>
+</font></div>
+</td></tr></table>
<form enctype="multipart/form-data" action="edit.php" method="post">
@@ -486,7 +503,7 @@ echo $body_read_content;
</td></tr></table>
-</td><td width="25"></td><td valign="top">
+</td><td width="25"></td><td valign="top" width="150">
<?php
if (file_exists("data/categories")) {
@@ -520,19 +537,18 @@ echo $body_read_content;
if ($count_filed_cat > 0) {
- echo "<p>This entry has been filed under the following ";
+ echo "<p><b>Filed Under</b></p>";
- if ($count_filed_cat == 1) {
- echo "category";
- }
- else {
- echo "categories";
- }
-
- echo ":</p><table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
+ echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
foreach ($filed_cat as $filed_category) {
- echo "<tr bgcolor=\"#ffffff\"><td>$filed_category</td><td width=\"16\"></td></tr>";
+ echo "<form enctype=\"multipart/form-data\" action=\"edit.php\" method=\"post\">";
+ echo "<input type=\"hidden\" name=\"entry\" value=\"{$_REQUEST['entry']}\">";
+ echo "<input type=\"hidden\" name=\"category\" value=\"$filed_category\">";
+ echo "<input type=\"hidden\" name=\"do\" value=\"unfile\">";
+ echo "<tr bgcolor=\"#ffffff\"><td>$filed_category</td>";
+ echo "<td width=\"14\"><input type=\"image\" src=\"images/widget.x.png\"></td></tr>";
+ echo "</form>";
}
echo "</table>";
@@ -540,18 +556,25 @@ echo $body_read_content;
}
?>
-</td><td width="25"></td><td valign="top">
+</td><td width="25"></td><td valign="top" width="150">
<?php
if ($count_unfiled_cat > 0) {
- echo "This entry has been filed under the following categories";
+ echo "<p><b>Available Categories</b></p>";
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
foreach ($unfiled_cat as $unfiled_category) {
- echo "<tr bgcolor=\"#ffffff\"><td width=\"16\"></td><td align=\"right\">$unfiled_category</td></tr>";
+
+ echo "<form enctype=\"multipart/form-data\" action=\"edit.php\" method=\"post\">";
+ echo "<input type=\"hidden\" name=\"entry\" value=\"{$_REQUEST['entry']}\">";
+ echo "<input type=\"hidden\" name=\"category\" value=\"$unfiled_category\">";
+ echo "<input type=\"hidden\" name=\"do\" value=\"file\">";
+ echo "<tr bgcolor=\"#ffffff\"><td width=\"14\"><input type=\"image\" src=\"images/widget.ok.png\"></td>";
+ echo "<td align=\"right\">$unfiled_category</td></tr>";
+ echo "</form>";
}
echo "</table>";
@@ -920,6 +943,7 @@ if ($_SESSION['logged_in'] == $login_username) {
}
$display_sem = "data/items/{$_REQUEST['entry']}/cat.txt";
+
if (isset($_POST['display']) and !empty($_POST['display']) and ($_POST['display'] == "on")) {
if (!file_exists($display_sem)) {
touch($display_sem);
@@ -1118,22 +1142,6 @@ if ($_SESSION['logged_in'] == $login_username) {
}
}
- if (isset($_POST['category']) and !empty($_POST['category'])) {
-
- if (!file_exists("data/categories")) {
- mkdir("data/categories");
- }
-
-// if ($_POST['category'] == "unfiled") {
-// unlink("data/items/{$_REQUEST['entry']}/category.txt");
-// }
-// if (file_exists("data/categories/{$_POST['category']}")) {
-// $fp_category_txt = fopen("data/items/{$_REQUEST['entry']}/category.txt","w");
-// fwrite($fp_category_txt, $_POST['category']);
-// fclose($fp_category_txt);
-// }
- }
-
$passwd_file = "data/items/{$_REQUEST['entry']}/passwd.txt";
if (isset($_POST['passwd']) and !empty($_POST['passwd']) and ($_POST['passwd'] != "password")) {
diff --git a/images/widget.ok.png b/images/widget.ok.png
new file mode 100644
index 0000000..3956d30
Binary files /dev/null and b/images/widget.ok.png differ
diff --git a/images/widget.x.png b/images/widget.x.png
new file mode 100644
index 0000000..2cdcd5b
Binary files /dev/null and b/images/widget.x.png differ
diff --git a/rel.txt b/rel.txt
index 9383d12..9421504 100644
--- a/rel.txt
+++ b/rel.txt
@@ -1 +1 @@
-20081125
\ No newline at end of file
+20081126
\ No newline at end of file
tree d1caa0a86ad4dfdc59c2acf8ba8063d9dd395da6
parent 9b48a4ab9c39f749881c3cb5ab6f525d3144f57d
author Engels Antonio <engels@majcms.org> 1277314203 +0800
committer Engels Antonio <engels@majcms.org> 1277314203 +0800
maj-1.0-20081126-bb.zip
diff --git a/edit.php b/edit.php
index adfebf7..506e06c 100644
--- a/edit.php
+++ b/edit.php
@@ -13,7 +13,7 @@ if (isset($_SESSION['logged_in']) and ($_SESSION['user_agent'] != $_SERVER['HTTP
if (get_magic_quotes_gpc()) {
function stripslashes_array($data) {
if (is_array($data)) {
- foreach ($data as $key => $value){
+ foreach ($data as $key => $value) {
$data[$key] = stripslashes_array($value);
}
return $data;
@@ -213,12 +213,41 @@ a:active {
border-style: none solid solid solid;
}
+.input_cat {
+ color: #666666;
+ background: #ffffff;
+ border: #999999 solid 1px;
+ width: 40px;
+ font-family: <?php
+ if (file_exists("data/fonts/panel-body.txt")) {
+ $font_panel_body = file_get_contents("data/fonts/panel-body.txt");
+ echo "{$font_panel_body},";
+ }
+ ?> arial, helvetica, sans-serif;
+ font-size: 11px
+}
+
<?php if (file_exists("data/css.txt")) { readfile("data/css.txt"); } ?>
</style>
<?php
+if (isset($_POST['category']) and !empty($_POST['category'])) {
+
+ if (!file_exists("data/items/{$_REQUEST['entry']}/categories")) {
+ mkdir("data/items/{$_REQUEST['entry']}/categories");
+ }
+
+ if (($_POST['do'] == "unfile") and file_exists("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}")) {
+ rmdirr("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}");
+ }
+
+ if (($_POST['do'] == "file") and !file_exists("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}")) {
+ mkdir("data/items/{$_REQUEST['entry']}/categories/{$_REQUEST['category']}");
+ }
+}
+
if (isset($_REQUEST['comment']) and !empty($_REQUEST['comment']) and isset($_POST['comment_txt']) and !empty($_POST['comment_txt']) and isset($_REQUEST['type']) and !empty($_REQUEST['type']) and (($_REQUEST['type'] == "live") or ($_REQUEST['type'] == "pending"))) {
$comment_txt = ucfirst($_POST['comment_txt']);
$comment_txt = str_replace("\n", '<br />', $comment_txt);
@@ -337,22 +366,10 @@ if (file_exists($revisions_file)) {
echo ')';
}
-//if (file_exists("data/items/{$_REQUEST['entry']}/category.txt")) {
-// echo " Filed under ";
-// $category_key = file_get_contents("data/items/{$_REQUEST['entry']}/category.txt");
-// $category_key = strtolower($category_key);
-// if (file_exists("data/categories/{$category_key}/title.txt")) {
-// $category_dsp = file_get_contents("data/categories/{$category_key}/title.txt");
-// echo "$category_key ($category_dsp)";
-// }
-// else {
-// echo "$category_key";
-// }
-//}
-
-?></font></div>
-</td></tr></table>
+?>
+</font></div>
+</td></tr></table>
<form enctype="multipart/form-data" action="edit.php" method="post">
@@ -486,7 +503,7 @@ echo $body_read_content;
</td></tr></table>
-</td><td width="25"></td><td valign="top">
+</td><td width="25"></td><td valign="top" width="150">
<?php
if (file_exists("data/categories")) {
@@ -520,19 +537,18 @@ echo $body_read_content;
if ($count_filed_cat > 0) {
- echo "<p>This entry has been filed under the following ";
+ echo "<p><b>Filed Under</b></p>";
- if ($count_filed_cat == 1) {
- echo "category";
- }
- else {
- echo "categories";
- }
-
- echo ":</p><table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
+ echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
foreach ($filed_cat as $filed_category) {
- echo "<tr bgcolor=\"#ffffff\"><td>$filed_category</td><td width=\"16\"></td></tr>";
+ echo "<form enctype=\"multipart/form-data\" action=\"edit.php\" method=\"post\">";
+ echo "<input type=\"hidden\" name=\"entry\" value=\"{$_REQUEST['entry']}\">";
+ echo "<input type=\"hidden\" name=\"category\" value=\"$filed_category\">";
+ echo "<input type=\"hidden\" name=\"do\" value=\"unfile\">";
+ echo "<tr bgcolor=\"#ffffff\"><td>$filed_category</td>";
+ echo "<td width=\"14\"><input type=\"image\" src=\"images/widget.x.png\"></td></tr>";
+ echo "</form>";
}
echo "</table>";
@@ -540,18 +556,25 @@ echo $body_read_content;
}
?>
-</td><td width="25"></td><td valign="top">
+</td><td width="25"></td><td valign="top" width="150">
<?php
if ($count_unfiled_cat > 0) {
- echo "This entry has been filed under the following categories";
+ echo "<p><b>Available Categories</b></p>";
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\" bgcolor=\"#cccccc\" width=\"150\">";
foreach ($unfiled_cat as $unfiled_category) {
- echo "<tr bgcolor=\"#ffffff\"><td width=\"16\"></td><td align=\"right\">$unfiled_category</td></tr>";
+
+ echo "<form enctype=\"multipart/form-data\" action=\"edit.php\" method=\"post\">";
+ echo "<input type=\"hidden\" name=\"entry\" value=\"{$_REQUEST['entry']}\">";
+ echo "<input type=\"hidden\" name=\"category\" value=\"$unfiled_category\">";
+ echo "<input type=\"hidden\" name=\"do\" value=\"file\">";
+ echo "<tr bgcolor=\"#ffffff\"><td width=\"14\"><input type=\"image\" src=\"images/widget.ok.png\"></td>";
+ echo "<td align=\"right\">$unfiled_category</td></tr>";
+ echo "</form>";
}
echo "</table>";
@@ -920,6 +943,7 @@ if ($_SESSION['logged_in'] == $login_username) {
}
$display_sem = "data/items/{$_REQUEST['entry']}/cat.txt";
+
if (isset($_POST['display']) and !empty($_POST['display']) and ($_POST['display'] == "on")) {
if (!file_exists($display_sem)) {
touch($display_sem);
@@ -1118,22 +1142,6 @@ if ($_SESSION['logged_in'] == $login_username) {
}
}
- if (isset($_POST['category']) and !empty($_POST['category'])) {
-
- if (!file_exists("data/categories")) {
- mkdir("data/categories");
- }
-
-// if ($_POST['category'] == "unfiled") {
-// unlink("data/items/{$_REQUEST['entry']}/category.txt");
-// }
-// if (file_exists("data/categories/{$_POST['category']}")) {
-// $fp_category_txt = fopen("data/items/{$_REQUEST['entry']}/category.txt","w");
-// fwrite($fp_category_txt, $_POST['category']);
-// fclose($fp_category_txt);
-// }
- }
-
$passwd_file = "data/items/{$_REQUEST['entry']}/passwd.txt";
if (isset($_POST['passwd']) and !empty($_POST['passwd']) and ($_POST['passwd'] != "password")) {
diff --git a/images/widget.ok.png b/images/widget.ok.png
new file mode 100644
index 0000000..3956d30
Binary files /dev/null and b/images/widget.ok.png differ
diff --git a/images/widget.x.png b/images/widget.x.png
new file mode 100644
index 0000000..2cdcd5b
Binary files /dev/null and b/images/widget.x.png differ
diff --git a/rel.txt b/rel.txt
index 9383d12..9421504 100644
--- a/rel.txt
+++ b/rel.txt
@@ -1 +1 @@
-20081125
\ No newline at end of file
+20081126
\ No newline at end of file