This commit has been accessed 309 times via Git panel.
commit d9af0b649fcad3cfe52ffc8c351f98cfbf5df7e8
tree f7ea5a1f85b1d2a0b4770d8e5c3e48492b090943
parent f5857046e48407a8e2a3763afb328bd5db1edcf4
author Engels Antonio <engels@majcms.org> 1277314208 +0800
committer Engels Antonio <engels@majcms.org> 1277314208 +0800
maj-1.0-20090114-bb.zip
diff --git a/index.php b/index.php
index 4f16022..cf34df9 100644
--- a/index.php
+++ b/index.php
@@ -326,6 +326,39 @@ if (isset($req_entry) and !empty($req_entry) and isset($_REQUEST['comment']) and
mkdir("data/comments/latest/$cmonth/$req_entry/{$_REQUEST['comment']}");
}
+ if (file_exists("data/members/active") and !file_exists("data/xucomment.txt")) {
+
+ if (!file_exists("data/comments/unread")) {
+ mkdir("data/comments/unread");
+ }
+
+ if (!file_exists("data/comments/unread/$req_entry")) {
+ mkdir("data/comments/unread/$req_entry");
+ }
+
+ if ($dh_unread_active_members = opendir("data/members/active")) {
+
+ while (($unread_active_member = readdir($dh_unread_active_members)) !== false) {
+
+ if ($unread_active_member != "." && $unread_active_member != "..") {
+
+ if (!file_exists("data/members/active/$unread_active_member/comments")) {
+ mkdir("data/members/active/$unread_active_member/comments");
+ }
+
+ if (!file_exists("data/members/active/$unread_active_member/comments/unread")) {
+ mkdir("data/members/active/$unread_active_member/comments/unread");
+ }
+
+ if (!file_exists("data/members/active/$unread_active_member/comments/unread/$req_entry")) {
+ mkdir("data/members/active/$unread_active_member/comments/unread/$req_entry");
+ }
+ }
+ }
+ closedir($dh_unread_active_members);
+ }
+ }
+
$private_categories = "0";
if (file_exists("data/items/$req_entry/categories")) {
@@ -4770,6 +4803,26 @@ foreach ($disp as $d) {
}
unset($show_comments);
echo '</td></tr></table>';
+
+ if (isset($_SESSION['logged_in'])) {
+
+ if (($_SESSION['logged_in'] == file_get_contents("data/username.txt")) and file_exists("data/comments/unread/$d")) {
+ rmdirr("data/comments/unread/$d");
+
+ if (count(glob("data/comments/unread/*")) < 1) {
+ rmdirr("data/comments/unread");
+ }
+ }
+ else {
+ if (file_exists("data/members/active/{$_SESSION['logged_in']}/comments/unread/$d")) {
+ rmdirr("data/members/active/{$_SESSION['logged_in']}/comments/unread/$d");
+
+ if (count(glob("data/members/active/{$_SESSION['logged_in']}/comments/unread/*")) < 1) {
+ rmdirr("data/members/active/{$_SESSION['logged_in']}/comments/unread");
+ }
+ }
+ }
+ }
}
if (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in']))) {
@@ -5768,6 +5821,72 @@ if (($count_latest > 0) and ($count_latest > $increase) and (!file_exists("data/
}
}
+if (!file_exists("data/xucomment.txt") and isset($_SESSION['logged_in'])) {
+
+ if ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) {
+
+ if (file_exists("data/comments/unread") and (count(glob("data/comments/unread/*")) > 0)) {
+
+ if ($dh_unread_comments = opendir("data/comments/unread")) {
+
+ while (($unread_comment = readdir($dh_unread_comments)) !== false) {
+
+ if ($unread_comment != "." && $unread_comment != "..") {
+ $unread_comments[] = $unread_comment;
+ }
+ }
+ closedir($dh_unread_comments);
+ }
+ }
+ }
+ else {
+ if (file_exists("data/members/active/{$_SESSION['logged_in']}")) {
+
+ if (file_exists("data/members/active/{$_SESSION['logged_in']}/comments/unread") and (count(glob("data/members/active/{$_SESSION['logged_in']}/comments/unread/*")) > 0)) {
+
+ if ($dh_unread_comments = opendir("data/members/active/{$_SESSION['logged_in']}/comments/unread")) {
+
+ while (($unread_comment = readdir($dh_unread_comments)) !== false) {
+
+ if ($unread_comment != "." && $unread_comment != "..") {
+ $unread_comments[] = $unread_comment;
+ }
+ }
+ closedir($dh_unread_comments);
+ }
+ }
+ }
+ }
+
+ sort($unread_comments);
+ reset($unread_comments);
+
+ if (count($unread_comments) > 0) {
+
+ 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 'Unread Comments</div><div id=panel_body><table border="0" cellspacing="0" cellpadding="0" width="100%">';
+
+ foreach ($unread_comments as $unread_comment) {
+
+ $unread_comment_title = file_get_contents("data/items/$unread_comment/title.txt");
+
+ echo "<tr><td><a class=\"navlink\" href=\"index.php?entry=$unread_comment&show=comments\">$unread_comment_title</a></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>';
+ }
+ }
+}
+
$count_latest_comments = 0;
$cmonth = date("Ym",time() + $offset);
diff --git a/rel.txt b/rel.txt
index 56d9d61..8b86c7f 100644
--- a/rel.txt
+++ b/rel.txt
@@ -1 +1 @@
-20090112
\ No newline at end of file
+20090114
\ No newline at end of file
diff --git a/settings.php b/settings.php
index ba176b4..16cc125 100644
--- a/settings.php
+++ b/settings.php
@@ -269,6 +269,18 @@ if (!isset($_POST['xlcomment']) or empty($_POST['xlcomment'])) {
}
}
+if (isset($_POST['xucomment']) and !empty($_POST['xucomment']) and ($_POST['xucomment'] == "on") and !file_exists("data/xucomment.txt")) {
+ touch("data/xucomment.txt");
+}
+
+if (!isset($_POST['xucomment']) or empty($_POST['xucomment'])) {
+ if (isset($_POST['edit']) and ($_POST['edit'] == "on")) {
+ if (file_exists("data/xucomment.txt")) {
+ unlink("data/xucomment.txt");
+ }
+ }
+}
+
if (isset($_POST['round']) and !empty($_POST['round']) and ($_POST['round'] == "on") and !file_exists("data/round.txt")) {
touch("data/round.txt");
}
@@ -1084,10 +1096,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 "14";
+ echo "15";
}
else {
- echo "13";
+ echo "14";
}
?>">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>
@@ -1098,6 +1110,7 @@ a:active {
<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>
<tr><td><input type="checkbox" name="xcat" <?php if (file_exists("data/xcat.txt")) { echo checked; } ?>> Do not show categories panel.</td></tr>
tree f7ea5a1f85b1d2a0b4770d8e5c3e48492b090943
parent f5857046e48407a8e2a3763afb328bd5db1edcf4
author Engels Antonio <engels@majcms.org> 1277314208 +0800
committer Engels Antonio <engels@majcms.org> 1277314208 +0800
maj-1.0-20090114-bb.zip
diff --git a/index.php b/index.php
index 4f16022..cf34df9 100644
--- a/index.php
+++ b/index.php
@@ -326,6 +326,39 @@ if (isset($req_entry) and !empty($req_entry) and isset($_REQUEST['comment']) and
mkdir("data/comments/latest/$cmonth/$req_entry/{$_REQUEST['comment']}");
}
+ if (file_exists("data/members/active") and !file_exists("data/xucomment.txt")) {
+
+ if (!file_exists("data/comments/unread")) {
+ mkdir("data/comments/unread");
+ }
+
+ if (!file_exists("data/comments/unread/$req_entry")) {
+ mkdir("data/comments/unread/$req_entry");
+ }
+
+ if ($dh_unread_active_members = opendir("data/members/active")) {
+
+ while (($unread_active_member = readdir($dh_unread_active_members)) !== false) {
+
+ if ($unread_active_member != "." && $unread_active_member != "..") {
+
+ if (!file_exists("data/members/active/$unread_active_member/comments")) {
+ mkdir("data/members/active/$unread_active_member/comments");
+ }
+
+ if (!file_exists("data/members/active/$unread_active_member/comments/unread")) {
+ mkdir("data/members/active/$unread_active_member/comments/unread");
+ }
+
+ if (!file_exists("data/members/active/$unread_active_member/comments/unread/$req_entry")) {
+ mkdir("data/members/active/$unread_active_member/comments/unread/$req_entry");
+ }
+ }
+ }
+ closedir($dh_unread_active_members);
+ }
+ }
+
$private_categories = "0";
if (file_exists("data/items/$req_entry/categories")) {
@@ -4770,6 +4803,26 @@ foreach ($disp as $d) {
}
unset($show_comments);
echo '</td></tr></table>';
+
+ if (isset($_SESSION['logged_in'])) {
+
+ if (($_SESSION['logged_in'] == file_get_contents("data/username.txt")) and file_exists("data/comments/unread/$d")) {
+ rmdirr("data/comments/unread/$d");
+
+ if (count(glob("data/comments/unread/*")) < 1) {
+ rmdirr("data/comments/unread");
+ }
+ }
+ else {
+ if (file_exists("data/members/active/{$_SESSION['logged_in']}/comments/unread/$d")) {
+ rmdirr("data/members/active/{$_SESSION['logged_in']}/comments/unread/$d");
+
+ if (count(glob("data/members/active/{$_SESSION['logged_in']}/comments/unread/*")) < 1) {
+ rmdirr("data/members/active/{$_SESSION['logged_in']}/comments/unread");
+ }
+ }
+ }
+ }
}
if (!file_exists("data/nocomment.txt") or (file_exists("data/memcomment.txt") and isset($_SESSION['logged_in']))) {
@@ -5768,6 +5821,72 @@ if (($count_latest > 0) and ($count_latest > $increase) and (!file_exists("data/
}
}
+if (!file_exists("data/xucomment.txt") and isset($_SESSION['logged_in'])) {
+
+ if ($_SESSION['logged_in'] == file_get_contents("data/username.txt")) {
+
+ if (file_exists("data/comments/unread") and (count(glob("data/comments/unread/*")) > 0)) {
+
+ if ($dh_unread_comments = opendir("data/comments/unread")) {
+
+ while (($unread_comment = readdir($dh_unread_comments)) !== false) {
+
+ if ($unread_comment != "." && $unread_comment != "..") {
+ $unread_comments[] = $unread_comment;
+ }
+ }
+ closedir($dh_unread_comments);
+ }
+ }
+ }
+ else {
+ if (file_exists("data/members/active/{$_SESSION['logged_in']}")) {
+
+ if (file_exists("data/members/active/{$_SESSION['logged_in']}/comments/unread") and (count(glob("data/members/active/{$_SESSION['logged_in']}/comments/unread/*")) > 0)) {
+
+ if ($dh_unread_comments = opendir("data/members/active/{$_SESSION['logged_in']}/comments/unread")) {
+
+ while (($unread_comment = readdir($dh_unread_comments)) !== false) {
+
+ if ($unread_comment != "." && $unread_comment != "..") {
+ $unread_comments[] = $unread_comment;
+ }
+ }
+ closedir($dh_unread_comments);
+ }
+ }
+ }
+ }
+
+ sort($unread_comments);
+ reset($unread_comments);
+
+ if (count($unread_comments) > 0) {
+
+ 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 'Unread Comments</div><div id=panel_body><table border="0" cellspacing="0" cellpadding="0" width="100%">';
+
+ foreach ($unread_comments as $unread_comment) {
+
+ $unread_comment_title = file_get_contents("data/items/$unread_comment/title.txt");
+
+ echo "<tr><td><a class=\"navlink\" href=\"index.php?entry=$unread_comment&show=comments\">$unread_comment_title</a></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>';
+ }
+ }
+}
+
$count_latest_comments = 0;
$cmonth = date("Ym",time() + $offset);
diff --git a/rel.txt b/rel.txt
index 56d9d61..8b86c7f 100644
--- a/rel.txt
+++ b/rel.txt
@@ -1 +1 @@
-20090112
\ No newline at end of file
+20090114
\ No newline at end of file
diff --git a/settings.php b/settings.php
index ba176b4..16cc125 100644
--- a/settings.php
+++ b/settings.php
@@ -269,6 +269,18 @@ if (!isset($_POST['xlcomment']) or empty($_POST['xlcomment'])) {
}
}
+if (isset($_POST['xucomment']) and !empty($_POST['xucomment']) and ($_POST['xucomment'] == "on") and !file_exists("data/xucomment.txt")) {
+ touch("data/xucomment.txt");
+}
+
+if (!isset($_POST['xucomment']) or empty($_POST['xucomment'])) {
+ if (isset($_POST['edit']) and ($_POST['edit'] == "on")) {
+ if (file_exists("data/xucomment.txt")) {
+ unlink("data/xucomment.txt");
+ }
+ }
+}
+
if (isset($_POST['round']) and !empty($_POST['round']) and ($_POST['round'] == "on") and !file_exists("data/round.txt")) {
touch("data/round.txt");
}
@@ -1084,10 +1096,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 "14";
+ echo "15";
}
else {
- echo "13";
+ echo "14";
}
?>">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>
@@ -1098,6 +1110,7 @@ a:active {
<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>
<tr><td><input type="checkbox" name="xcat" <?php if (file_exists("data/xcat.txt")) { echo checked; } ?>> Do not show categories panel.</td></tr>