This commit has been accessed 596 times via Git panel.
commit d653f7a83cf2341be6f36c34753bf6c57ab4b259
tree 5da45f789fa22130ce3a4bc1095981583d25c0f5
parent d9af0b649fcad3cfe52ffc8c351f98cfbf5df7e8
author Engels Antonio <engels@majcms.org> 1277314208 +0800
committer Engels Antonio <engels@majcms.org> 1277314208 +0800
maj-1.0-20090115-bb.zip
diff --git a/index.php b/index.php
index cf34df9..8881e24 100644
--- a/index.php
+++ b/index.php
@@ -308,23 +308,13 @@ if (isset($req_entry) and !empty($req_entry) and isset($_REQUEST['comment']) and
unlink("$live_dir/key.txt");
- $cmonth = date("Ym",time() + $offset);
+ // clean-up old latest comments dir
- if (!file_exists("data/comments/latest")) {
- mkdir("data/comments/latest");
+ if (file_exists("data/comments/latest")) {
+ rmdirr("data/comments/latest");
}
- if (!file_exists("data/comments/latest/$cmonth")) {
- mkdir("data/comments/latest/$cmonth");
- }
-
- if (!file_exists("data/comments/latest/$cmonth/$req_entry")) {
- mkdir("data/comments/latest/$cmonth/$req_entry");
- }
-
- if (!file_exists("data/comments/latest/$cmonth/$req_entry/{$_REQUEST['comment']}")) {
- mkdir("data/comments/latest/$cmonth/$req_entry/{$_REQUEST['comment']}");
- }
+ // clean-up old latest comments dir
if (file_exists("data/members/active") and !file_exists("data/xucomment.txt")) {
@@ -5887,68 +5877,6 @@ if (!file_exists("data/xucomment.txt") and isset($_SESSION['logged_in'])) {
}
}
-$count_latest_comments = 0;
-
-$cmonth = date("Ym",time() + $offset);
-
-if (!file_exists("data/comments/latest/$cmonth")) {
- rmdirr("data/comments/latest");
-}
-
-if (!file_exists("data/comments/latest")) {
- mkdir("data/comments/latest");
-}
-
-if (file_exists("data/comments/latest/$cmonth")) {
-
- if ($dh_latest_comments = opendir("data/comments/latest/$cmonth")) {
- while (($entry_latest_comments = readdir($dh_latest_comments)) !== false) {
-
- $today = date("YmdHis",time() + $offset);
-
- if (($entry_latest_comments > $today) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
- }
-
- if ($entry_latest_comments != "." && $entry_latest_comments != "..") {
- $show_latest_comments[] = $entry_latest_comments;
- }
- }
- closedir($dh_latest_comments);
- }
-
- rsort($show_latest_comments);
- reset($show_latest_comments);
-
- $count_latest_comments = count($show_latest_comments);
-}
-
-if (($count_latest_comments > 0) and ($count_latest > $increase) and (!file_exists("data/xlcomment.txt") or isset($_SESSION['logged_in']))) {
-
- if (file_exists("data/round.txt")) {
- echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
- }
- else {
- echo '<div id="panel_title">';
- }
-
- echo 'Latest Comments</div><div id=panel_body><table border="0" cellspacing="0" cellpadding="0" width="100%">';
-
- foreach ($show_latest_comments as $latest_comment_entry) {
-
- $latest_comment_entry_title = file_get_contents("data/items/$latest_comment_entry/title.txt");
- $latest_comment_entry_count = count(glob("data/comments/latest/$cmonth/$latest_comment_entry/*"));
-
- echo "<tr><td valign=\"bottom\"><a class=\"navlink\" href=\"index.php?entry=$latest_comment_entry&show=comments\">$latest_comment_entry_title</a></td><td align=\"right\" valign=\"bottom\">$latest_comment_entry_count</td></tr>";
- }
-
- echo '</table></div>';
-
- if (file_exists("data/round.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
- }
-}
-
if ($count_albums > 0) {
if (file_exists("data/round.txt")) {
diff --git a/rel.txt b/rel.txt
index 8b86c7f..c86e797 100644
--- a/rel.txt
+++ b/rel.txt
@@ -1 +1 @@
-20090114
\ No newline at end of file
+20090115
\ No newline at end of file
diff --git a/rss.php b/rss.php
index ed3c5d6..855176e 100644
--- a/rss.php
+++ b/rss.php
@@ -96,6 +96,10 @@ if (isset($_REQUEST['ver']) and !empty($_REQUEST['ver'])) {
continue;
}
+ if (isset($_REQUEST['cat']) and !empty($_REQUEST['cat']) and file_exists("data/categories/{$_REQUEST['cat']}") and !file_exists("data/items/$entry_rss_items/categories/{$_REQUEST['cat']}")) {
+ continue;
+ }
+
if ($entry_rss_items != "." && $entry_rss_items != ".." && fnmatch("*", $entry_rss_items) && !file_exists("data/items/$entry_rss_items/private.txt")) {
$show_rss_items[] = $entry_rss_items;
}
diff --git a/settings.php b/settings.php
index 16cc125..2defda5 100644
--- a/settings.php
+++ b/settings.php
@@ -257,18 +257,6 @@ if (!isset($_POST['xrecent']) or empty($_POST['xrecent'])) {
}
}
-if (isset($_POST['xlcomment']) and !empty($_POST['xlcomment']) and ($_POST['xlcomment'] == "on") and !file_exists("data/xlcomment.txt")) {
- touch("data/xlcomment.txt");
-}
-
-if (!isset($_POST['xlcomment']) or empty($_POST['xlcomment'])) {
- if (isset($_POST['edit']) and ($_POST['edit'] == "on")) {
- if (file_exists("data/xlcomment.txt")) {
- unlink("data/xlcomment.txt");
- }
- }
-}
-
if (isset($_POST['xucomment']) and !empty($_POST['xucomment']) and ($_POST['xucomment'] == "on") and !file_exists("data/xucomment.txt")) {
touch("data/xucomment.txt");
}
@@ -1096,10 +1084,10 @@ a:active {
<tr><td>ping on content change</td><td><input autocomplete="off" class="input" type="text" name="ping" value="<?php readfile("data/ping.txt"); ?>"></td></tr>
<tr><td rowspan="<?php
if (file_exists("data/email.txt")) {
- echo "15";
+ echo "14";
}
else {
- echo "14";
+ echo "13";
}
?>">toggles</td><td><input type="checkbox" name="nocomment" <?php if (file_exists("data/nocomment.txt")) { echo checked; } ?>> Do not allow visitors to post comments.</td></tr>
<tr><td><input type="checkbox" name="memcomment" <?php if (file_exists("data/memcomment.txt")) { echo checked; } ?>> Do not prevent members from posting comments.</td></tr>
@@ -1109,7 +1097,6 @@ a:active {
<tr><td><input type="checkbox" name="xscreen" <?php if (file_exists("data/xscreen.txt")) { echo checked; } ?>> Do not screen comments. Automatically approve them.</td></tr>
<tr><td><input type="checkbox" name="nopdf" <?php if (file_exists("data/nopdf.txt")) { echo checked; } ?>> Do not allow PDF generation for all entries.</td></tr>
<tr><td><input type="checkbox" name="xrecent" <?php if (file_exists("data/xrecent.txt")) { echo checked; } ?>> Do not show recent entries panel to guests.</td></tr>
-<tr><td><input type="checkbox" name="xlcomment" <?php if (file_exists("data/xlcomment.txt")) { echo checked; } ?>> Do not show latest comments panel to guests.</td></tr>
<tr><td><input type="checkbox" name="xucomment" <?php if (file_exists("data/xucomment.txt")) { echo checked; } ?>> Do not show unread comments panel.</td></tr>
<tr><td><input type="checkbox" name="xrand" <?php if (file_exists("data/xrand.txt")) { echo checked; } ?>> Do not show random entries panel.</td></tr>
<tr><td><input type="checkbox" name="xarc" <?php if (file_exists("data/xarc.txt")) { echo checked; } ?>> Do not show archives panel.</td></tr>
tree 5da45f789fa22130ce3a4bc1095981583d25c0f5
parent d9af0b649fcad3cfe52ffc8c351f98cfbf5df7e8
author Engels Antonio <engels@majcms.org> 1277314208 +0800
committer Engels Antonio <engels@majcms.org> 1277314208 +0800
maj-1.0-20090115-bb.zip
diff --git a/index.php b/index.php
index cf34df9..8881e24 100644
--- a/index.php
+++ b/index.php
@@ -308,23 +308,13 @@ if (isset($req_entry) and !empty($req_entry) and isset($_REQUEST['comment']) and
unlink("$live_dir/key.txt");
- $cmonth = date("Ym",time() + $offset);
+ // clean-up old latest comments dir
- if (!file_exists("data/comments/latest")) {
- mkdir("data/comments/latest");
+ if (file_exists("data/comments/latest")) {
+ rmdirr("data/comments/latest");
}
- if (!file_exists("data/comments/latest/$cmonth")) {
- mkdir("data/comments/latest/$cmonth");
- }
-
- if (!file_exists("data/comments/latest/$cmonth/$req_entry")) {
- mkdir("data/comments/latest/$cmonth/$req_entry");
- }
-
- if (!file_exists("data/comments/latest/$cmonth/$req_entry/{$_REQUEST['comment']}")) {
- mkdir("data/comments/latest/$cmonth/$req_entry/{$_REQUEST['comment']}");
- }
+ // clean-up old latest comments dir
if (file_exists("data/members/active") and !file_exists("data/xucomment.txt")) {
@@ -5887,68 +5877,6 @@ if (!file_exists("data/xucomment.txt") and isset($_SESSION['logged_in'])) {
}
}
-$count_latest_comments = 0;
-
-$cmonth = date("Ym",time() + $offset);
-
-if (!file_exists("data/comments/latest/$cmonth")) {
- rmdirr("data/comments/latest");
-}
-
-if (!file_exists("data/comments/latest")) {
- mkdir("data/comments/latest");
-}
-
-if (file_exists("data/comments/latest/$cmonth")) {
-
- if ($dh_latest_comments = opendir("data/comments/latest/$cmonth")) {
- while (($entry_latest_comments = readdir($dh_latest_comments)) !== false) {
-
- $today = date("YmdHis",time() + $offset);
-
- if (($entry_latest_comments > $today) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
- }
-
- if ($entry_latest_comments != "." && $entry_latest_comments != "..") {
- $show_latest_comments[] = $entry_latest_comments;
- }
- }
- closedir($dh_latest_comments);
- }
-
- rsort($show_latest_comments);
- reset($show_latest_comments);
-
- $count_latest_comments = count($show_latest_comments);
-}
-
-if (($count_latest_comments > 0) and ($count_latest > $increase) and (!file_exists("data/xlcomment.txt") or isset($_SESSION['logged_in']))) {
-
- if (file_exists("data/round.txt")) {
- echo '<b class="rbtop"><b class="rb1t"></b><b class="rb2t"></b><b class="rb3t"></b><b class="rb4t"></b></b><div class="xtitle">';
- }
- else {
- echo '<div id="panel_title">';
- }
-
- echo 'Latest Comments</div><div id=panel_body><table border="0" cellspacing="0" cellpadding="0" width="100%">';
-
- foreach ($show_latest_comments as $latest_comment_entry) {
-
- $latest_comment_entry_title = file_get_contents("data/items/$latest_comment_entry/title.txt");
- $latest_comment_entry_count = count(glob("data/comments/latest/$cmonth/$latest_comment_entry/*"));
-
- echo "<tr><td valign=\"bottom\"><a class=\"navlink\" href=\"index.php?entry=$latest_comment_entry&show=comments\">$latest_comment_entry_title</a></td><td align=\"right\" valign=\"bottom\">$latest_comment_entry_count</td></tr>";
- }
-
- echo '</table></div>';
-
- if (file_exists("data/round.txt")) {
- echo '<b class="rbbottom"><b class="rb4b"></b><b class="rb3b"></b><b class="rb2b"></b><b class="rb1b"></b></b>';
- }
-}
-
if ($count_albums > 0) {
if (file_exists("data/round.txt")) {
diff --git a/rel.txt b/rel.txt
index 8b86c7f..c86e797 100644
--- a/rel.txt
+++ b/rel.txt
@@ -1 +1 @@
-20090114
\ No newline at end of file
+20090115
\ No newline at end of file
diff --git a/rss.php b/rss.php
index ed3c5d6..855176e 100644
--- a/rss.php
+++ b/rss.php
@@ -96,6 +96,10 @@ if (isset($_REQUEST['ver']) and !empty($_REQUEST['ver'])) {
continue;
}
+ if (isset($_REQUEST['cat']) and !empty($_REQUEST['cat']) and file_exists("data/categories/{$_REQUEST['cat']}") and !file_exists("data/items/$entry_rss_items/categories/{$_REQUEST['cat']}")) {
+ continue;
+ }
+
if ($entry_rss_items != "." && $entry_rss_items != ".." && fnmatch("*", $entry_rss_items) && !file_exists("data/items/$entry_rss_items/private.txt")) {
$show_rss_items[] = $entry_rss_items;
}
diff --git a/settings.php b/settings.php
index 16cc125..2defda5 100644
--- a/settings.php
+++ b/settings.php
@@ -257,18 +257,6 @@ if (!isset($_POST['xrecent']) or empty($_POST['xrecent'])) {
}
}
-if (isset($_POST['xlcomment']) and !empty($_POST['xlcomment']) and ($_POST['xlcomment'] == "on") and !file_exists("data/xlcomment.txt")) {
- touch("data/xlcomment.txt");
-}
-
-if (!isset($_POST['xlcomment']) or empty($_POST['xlcomment'])) {
- if (isset($_POST['edit']) and ($_POST['edit'] == "on")) {
- if (file_exists("data/xlcomment.txt")) {
- unlink("data/xlcomment.txt");
- }
- }
-}
-
if (isset($_POST['xucomment']) and !empty($_POST['xucomment']) and ($_POST['xucomment'] == "on") and !file_exists("data/xucomment.txt")) {
touch("data/xucomment.txt");
}
@@ -1096,10 +1084,10 @@ a:active {
<tr><td>ping on content change</td><td><input autocomplete="off" class="input" type="text" name="ping" value="<?php readfile("data/ping.txt"); ?>"></td></tr>
<tr><td rowspan="<?php
if (file_exists("data/email.txt")) {
- echo "15";
+ echo "14";
}
else {
- echo "14";
+ echo "13";
}
?>">toggles</td><td><input type="checkbox" name="nocomment" <?php if (file_exists("data/nocomment.txt")) { echo checked; } ?>> Do not allow visitors to post comments.</td></tr>
<tr><td><input type="checkbox" name="memcomment" <?php if (file_exists("data/memcomment.txt")) { echo checked; } ?>> Do not prevent members from posting comments.</td></tr>
@@ -1109,7 +1097,6 @@ a:active {
<tr><td><input type="checkbox" name="xscreen" <?php if (file_exists("data/xscreen.txt")) { echo checked; } ?>> Do not screen comments. Automatically approve them.</td></tr>
<tr><td><input type="checkbox" name="nopdf" <?php if (file_exists("data/nopdf.txt")) { echo checked; } ?>> Do not allow PDF generation for all entries.</td></tr>
<tr><td><input type="checkbox" name="xrecent" <?php if (file_exists("data/xrecent.txt")) { echo checked; } ?>> Do not show recent entries panel to guests.</td></tr>
-<tr><td><input type="checkbox" name="xlcomment" <?php if (file_exists("data/xlcomment.txt")) { echo checked; } ?>> Do not show latest comments panel to guests.</td></tr>
<tr><td><input type="checkbox" name="xucomment" <?php if (file_exists("data/xucomment.txt")) { echo checked; } ?>> Do not show unread comments panel.</td></tr>
<tr><td><input type="checkbox" name="xrand" <?php if (file_exists("data/xrand.txt")) { echo checked; } ?>> Do not show random entries panel.</td></tr>
<tr><td><input type="checkbox" name="xarc" <?php if (file_exists("data/xarc.txt")) { echo checked; } ?>> Do not show archives panel.</td></tr>