Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16305
Modified Files:
serendipity_config.inc.php serendipity_functions.inc.php
Log Message:
- Move control for comment flow out of the _commentTitle class
- Better overview of comment flow control
- Renamed "Chronological" flow to "Linear"
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.413
retrieving revision 1.414
diff -u -d -r1.413 -r1.414
--- serendipity_functions.inc.php 2 Sep 2004 10:46:42 -0000 1.413
+++ serendipity_functions.inc.php 5 Sep 2004 19:14:56 -0000 1.414
@@ -1273,15 +1273,6 @@
false
);
- $comment_viewmode = 'threaded';
- $comment_viewmode_switch = 'chronological';
- if (isset($serendipity['GET']['cview']) && $serendipity['GET']['cview'] == $comment_viewmode_switch) {
- $temp_viewmode = $comment_viewmode;
- $comment_viewmode = $comment_viewmode_switch;
- $comment_viewmode_switch = $temp_viewmode;
- }
- $comment_viewmode_url = $serendipity['serendipityHTTPPath'] . $serendipity['indexFile'] . '?url=' . $comm_url . '&serendipity[cview]=' . $comment_viewmode_switch;
-
/********** MESSAGES *********/
if (defined('DATA_UNSUBSCRIBED')) {
echo '<br /><div class="serendipity_center serendipity_msg_notice">'. sprintf(UNSUBSCRIBE_OK, DATA_UNSUBSCRIBED) .'</div><br />';
@@ -1320,7 +1311,21 @@
<div class="serendipity_comments">
<br />
<a id="comments"></a>
- <div class="serendipity_commentsTitle"><?php echo COMMENTS; ?> (<a href="<?php echo $comment_viewmode_url; ?>"><?php echo constant('VIEWMODE_' . strtoupper($comment_viewmode_switch)); ?></a>)</div>
+ <div class="serendipity_commentsTitle"><?php echo COMMENTS; ?></div>
+ <?php
+ $comment_viewmode_url = $serendipity['serendipityHTTPPath'] . $serendipity['indexFile'] . '?url=' . $comm_url . '&serendipity[cview]=';
+ if ( $serendipity['GET']['cview'] == VIEWMODE_LINEAR ) {
+ $linearLink = COMMENTS_VIEWMODE_LINEAR;
+ $threadLink = '<a href="'. $comment_viewmode_url . VIEWMODE_THREADED .'#comments">'. COMMENTS_VIEWMODE_THREADED .'</a>';
+ $viewmode = VIEWMODE_LINEAR;
+ } else {
+ $linearLink = '<a href="'. $comment_viewmode_url . VIEWMODE_LINEAR .'#comments">'. COMMENTS_VIEWMODE_LINEAR .'</a>';
+ $threadLink = COMMENTS_VIEWMODE_THREADED;
+ $viewmode = VIEWMODE_THREADED;
+ }
+
+ ?>
+ <div class="serendipity_center"><?php echo DISPLAY_COMMENTS_AS ?> (<?php echo $linearLink ?> | <?php echo $threadLink ?>)</div>
<?php
serendipity_printComments(
serendipity_fetchComments(
@@ -1328,7 +1333,7 @@
),
(isset($entry['allow_comments']) ? $entry['allow_comments'] : true),
true,
- $comment_viewmode
+ $viewmode
);
if (!empty($serendipity['POST']['preview'])) {
@@ -1559,7 +1564,7 @@
{
global $serendipity;
- if ($parentid === 'threaded') {
+ if ($parentid === VIEWMODE_THREADED) {
$parentid = 0;
}
@@ -1572,7 +1577,7 @@
$i = 0;
foreach ($comments as $comment) {
- if ($parentid === 'chronological' || !isset($comment['parent_id']) || $comment['parent_id'] == $parentid) {
+ if ($parentid === VIEWMODE_LINEAR || !isset($comment['parent_id']) || $comment['parent_id'] == $parentid) {
$i++;
$comment['comment'] = htmlspecialchars(strip_tags($comment['body']));
@@ -1629,7 +1634,7 @@
?>
</div>
<?php
- if ($comment['id'] && $parentid !== 'chronological') {
+ if ($comment['id'] && $parentid !== VIEWMODE_LINEAR ) {
serendipity_printComments($comments, $allow_comments, $show_admin, $comment['id'], $indent . $i . '.');
}
?>
@@ -1638,7 +1643,7 @@
}
}
- if ($parentid != 0 && $parentid !== 'chronological') {
+ if ($parentid != 0 && $parentid !== VIEWMODE_LINEAR) {
return true;
}
Index: serendipity_config.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_config.inc.php,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- serendipity_config.inc.php 24 Aug 2004 17:32:46 -0000 1.91
+++ serendipity_config.inc.php 5 Sep 2004 19:14:55 -0000 1.92
@@ -90,6 +90,10 @@
@define('USERLEVEL_CHIEF', 1);
@define('USERLEVEL_EDITOR', 0);
+@define('VIEWMODE_THREADED', 'threaded');
+@define('VIEWMODE_LINEAR', 'linear');
+
+
/*
* Kill the script if we are not installed, and not inside the installer
*/
|