Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24698
Modified Files:
Tag: branch-smarty
comment.php serendipity_admin_comments.inc.php
serendipity_functions.inc.php
Log Message:
- Move the ability to toggle comments out of _printComments and into the templates, where it belongs
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.419.2.38
retrieving revision 1.419.2.39
diff -u -d -r1.419.2.38 -r1.419.2.39
--- serendipity_functions.inc.php 3 Oct 2004 21:27:53 -0000 1.419.2.38
+++ serendipity_functions.inc.php 5 Oct 2004 19:40:39 -0000 1.419.2.39
@@ -966,6 +966,11 @@
$entry['rdf_ident'] = serendipity_archiveURL($entry['id'], $entry['title'], 'baseURL');
$entry['title'] = htmlspecialchars($entry['title']);
$entry['commURL'] = serendipity_archiveURL($entry['id'], $entry['title'], 'baseURL', false);
+ $entry['link_allow_comments'] = $serendipity['baseURL'] . 'comment.php?serendipity[switch]=enable&serendipity[entry]=' . $entry['id'];
+ $entry['link_deny_comments'] = $serendipity['baseURL'] . 'comment.php?serendipity[switch]=disable&serendipity[entry]=' . $entry['id'];
+
+
+ $entry['allow_comments'] = serendipity_db_bool($entry['allow_comments']);
if (strlen($entry['extended'])) {
$entry['has_extended'] = true;
@@ -1005,7 +1010,7 @@
serendipity_printTrackbacks(serendipity_fetchTrackbacks($entry['id']));
ob_start(); // TODO: Remove recursion and output buffering
- serendipity_printComments(serendipity_fetchComments($entry['id']),(isset($entry['allow_comments']) ? $entry['allow_comments'] : true), true, $viewmode);
+ serendipity_printComments(serendipity_fetchComments($entry['id']),(isset($entry['allow_comments']) ? $entry['allow_comments'] : true), $viewmode);
if (!empty($serendipity['POST']['preview'])) {
serendipity_printComments(
@@ -1020,7 +1025,6 @@
)
),
false,
- false,
$serendipity['POST']['replyTo']
);
}
@@ -1040,8 +1044,7 @@
'is_cview_linear' => ($serendipity['GET']['cview'] == VIEWMODE_LINEAR ? true : false),
'comments_messagestack' => (isset($serendipity['messagestack']['comments']) ? (array)$serendipity['messagestack']['comments'] : false),
'is_comment_added' => (isset($serendipity['GET']['csuccess']) && $serendipity['GET']['csuccess'] == 'true' ? true: false),
- 'is_comment_moderate' => (isset($serendipity['GET']['csuccess']) && $serendipity['GET']['csuccess'] == 'moderate' ? true: false),
- 'is_comment_closed' => (!serendipity_db_bool($entry['allow_comments']) ? true : false)
+ 'is_comment_moderate' => (isset($serendipity['GET']['csuccess']) && $serendipity['GET']['csuccess'] == 'moderate' ? true: false)
)
);
@@ -1225,7 +1228,7 @@
}
/*TODO: Don't know how to get recursion done with Smarty in a smarty way.*/
-function serendipity_printComments($comments, $allow_comments = true, $show_admin = true, $parentid = 0, $indent = '')
+function serendipity_printComments($comments, $allow_comments = true, $parentid = 0, $indent = '')
{
global $serendipity;
@@ -1301,7 +1304,7 @@
</div>
<?php
if ($comment['id'] && $parentid !== VIEWMODE_LINEAR ) {
- serendipity_printComments($comments, $allow_comments, $show_admin, $comment['id'], $indent . $i . '.');
+ serendipity_printComments($comments, $allow_comments, $comment['id'], $indent . $i . '.');
}
?>
</div>
@@ -1312,19 +1315,6 @@
if ($parentid != 0 && $parentid !== VIEWMODE_LINEAR) {
return true;
}
-
- if ($show_admin && $_SESSION['serendipityAuthedUser'] === true && ($_SESSION['serendipityUserlevel'] >= USERLEVEL_CHIEF || $_SESSION['serendipityAuthorid'] == $comment['authorid'])) {
- if (!isset($comment['entry_id'])) {
- $comment = array('entry_id' => (isset($serendipity['GET']['id']) ? $serendipity['GET']['id'] : $serendipity['GET']['entry_id']));
- }
-
- if (serendipity_db_bool($allow_comments)) {
- echo '<div class="serendipity_center">(<a href="' . $serendipity['baseURL'] . 'comment.php?serendipity[switch]=disable&serendipity[entry]=' . $comment['entry_id'] . '">' . COMMENTS_DISABLE . '</a>)</div>';
- } else {
- echo '<div class="serendipity_center">(<a href="' . $serendipity['baseURL'] . 'comment.php?serendipity[switch]=enable&serendipity[entry]=' . $comment['entry_id'] . '">' . COMMENTS_ENABLE . '</a>)</div>';
- }
- echo '<br />';
- }
}
function serendipity_printTrackbacks($comments)
Index: comment.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/comment.php,v
retrieving revision 1.44.2.3
retrieving revision 1.44.2.4
diff -u -d -r1.44.2.3 -r1.44.2.4
--- comment.php 24 Sep 2004 13:00:14 -0000 1.44.2.3
+++ comment.php 5 Oct 2004 19:40:39 -0000 1.44.2.4
@@ -141,7 +141,6 @@
'timestamp' => time()
)
),
- false,
false
);
}
Index: serendipity_admin_comments.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_comments.inc.php,v
retrieving revision 1.17.2.4
retrieving revision 1.17.2.5
diff -u -d -r1.17.2.4 -r1.17.2.5
--- serendipity_admin_comments.inc.php 24 Sep 2004 22:03:18 -0000 1.17.2.4
+++ serendipity_admin_comments.inc.php 5 Oct 2004 19:40:39 -0000 1.17.2.5
@@ -87,7 +87,6 @@
'timestamp' => time()
)
),
- false,
false
);
|