Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8964
Modified Files:
NEWS serendipity_functions.inc.php
Log Message:
* Show trackbacks on the full-entry page if popups are disabled
* If popups are disabled, link to the full-page entry, with comments and trackbacks as page-anchors
* Use DIV tags for trackback layout, just like comments
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.351
retrieving revision 1.352
diff -u -d -r1.351 -r1.352
--- serendipity_functions.inc.php 20 Jul 2004 10:19:22 -0000 1.351
+++ serendipity_functions.inc.php 20 Jul 2004 17:02:29 -0000 1.352
@@ -1226,19 +1226,30 @@
if (serendipity_db_bool($entry['allow_comments']) || !isset($entry['allow_comments']) || $entry['comments'] > 0) {
if (!isset($serendipity['GET']['id'])) {
$label = $entry['comments'] == 1 ? COMMENT : COMMENTS;
- echo ' | <a href="' . $serendipity['serendipityHTTPPath'] . 'comment.php?serendipity[entry_id]=' . $entry['id'] . '&serendipity[type]=comments"';
- if ($serendipity['enablePopup'])
- echo ' onclick="window.open(this.href, \'comments\', \'width=480,height=480,scrollbars=yes\'); return false;"';
- echo '>' . $label . ' (' . $entry['comments'] . ')</a>';
+ if ($serendipity['enablePopup']) {
+ $uriExtra = ' onclick="window.open(this.href, \'comments\', \'width=480,height=480,scrollbars=yes\'); return false;"';
+ $commentUri = $serendipity['serendipityHTTPPath'] . 'comment.php?serendipity[entry_id]=' . $entry['id'] . '&serendipity[type]=comments"';
+ } else {
+ $uriExtra = '';
+ $commentUri = $entryLink .'#comments';
+ }
+ echo ' | <a href="' . $commentUri . '"' . $uriExtra . '>' . $label . ' (' . $entry['comments'] . ')</a>';
}
}
- if (serendipity_db_bool($entry['allow_comments']) || !isset($entry['allow_comments']) || $entry['trackbacks'] > 0) {
- $label = $entry['trackbacks'] == 1 ? TRACKBACK : TRACKBACKS;
- echo ' | <a href="' . $serendipity['serendipityHTTPPath'] . 'comment.php?serendipity[entry_id]=' . $entry['id'] . '&serendipity[type]=trackbacks"';
- if ($serendipity['enablePopup'])
- echo ' onclick="window.open(this.href, \'comments\', \'width=480,height=480,scrollbars=yes\'); return false;"';
- echo '>' . $label . ' (' . $entry['trackbacks'] . ')</a>';
+ if (serendipity_db_bool($entry['allow_comments']) || !isset($entry['allow_comments']) || $entry['trackbacks'] > 0 ) {
+ if ( $serendipity['enablePopup'] || !isset($serendipity['GET']['id'])) {
+ $label = $entry['trackbacks'] == 1 ? TRACKBACK : TRACKBACKS;
+ if ($serendipity['enablePopup']) {
+ $uriExtra = ' onclick="window.open(this.href, \'comments\', \'width=480,height=480,scrollbars=yes\'); return false;"';
+ $trackbackUri = $serendipity['serendipityHTTPPath'] . 'comment.php?serendipity[entry_id]=' . $entry['id'] . '&serendipity[type]=trackbacks"';
+ } else {
+ $uriExtra = '';
+ $trackbackUri = $entryLink .'#trackbacks';
+ }
+
+ echo ' | <a href="' . $trackbackUri .'"'. $uriExtra . '>' . $label . ' (' . $entry['trackbacks'] . ')</a>';
+ }
}
if ($_SESSION['serendipityAuthedUser'] === true && ($_SESSION['serendipityUserlevel'] >= USERLEVEL_CHIEF || $_SESSION['serendipityAuthorid'] == $entry['authorid'])) {
@@ -1269,9 +1280,23 @@
?>
<?php
if (isset($serendipity['GET']['id'])) {
+ if (!$serendipity['enablePopup']) {
+ $tbu = $serendipity['baseURL'] . 'comment.php?type=trackback&entry_id=' . $entry['id'];
?>
<div class="serendipity_comments">
<br />
+ <a id="trackbacks"></a>
+ <div class="serendipity_commentsTitle"><?php echo TRACKBACKS; ?></div>
+ <em><?php echo TRACKBACK_SPECIFIC; ?>:</em><br />
+ <?php echo $tbu; ?><br /><br />
+
+
+ <?php serendipity_printTrackbacks(serendipity_fetchTrackbacks($entry['id'])); ?>
+ </div>
+<?php } ?>
+ <div class="serendipity_comments">
+ <br />
+ <a id="comments"></a>
<div class="serendipity_commentsTitle"><?php echo COMMENTS; ?></div>
<?php
if (defined('DATA_UNSUBSCRIBED')) {
@@ -1596,17 +1621,10 @@
function serendipity_printTrackbacks($comments)
{
global $serendipity;
-?>
-<table width="100%" border="0">
-<?php
if (!count($comments)) {
?>
- <tr>
- <td>
- <i><?php echo NO_TRACKBACKS; ?></i>
- </td>
- </tr>
+ <div class="serendipity_center"><?php echo NO_TRACKBACKS; ?></div>
<?php
}
@@ -1615,8 +1633,7 @@
$name = empty($comment['author']) ? 'Anonymous' : $comment['author'];
$title= strip_tags($comment['title']);
?>
- <tr>
- <td class="serendipity_comment">
+ <div class="serendipity_comment">
<a href="<?php echo strip_tags($link); ?>" <?php echo serendipity_xhtml_target('_blank'); ?>><?php echo $title; ?></a><br />
<b><?php echo EXCERPT; ?>: </b>
<?php echo htmlspecialchars(strip_tags($comment['body'])); ?><br />
@@ -1629,13 +1646,10 @@
}
?>
</div>
- </td>
- </tr>
+ </div>
+ <br />
<?php
}
-?>
-</table>
-<?php
}
Index: NEWS
===================================================================
RCS file: /cvsroot/php-blog/serendipity/NEWS,v
retrieving revision 1.180
retrieving revision 1.181
diff -u -d -r1.180 -r1.181
--- NEWS 19 Jul 2004 09:44:11 -0000 1.180
+++ NEWS 20 Jul 2004 17:02:29 -0000 1.181
@@ -3,6 +3,14 @@
Version 0.7 ()
------------------------------------------------------------------------
+ * Show trackbacks on the full-entry page if popups are disabled
+ (tomsommer)
+
+ * If popups are disabled, link to the full-page entry, with comments
+ and trackbacks as page-anchors (tomsommer)
+
+ * Use DIV tags for trackback layout, just like comments (tomsommer)
+
* Make sure that the file/image manager can never remove the upload
directory, but all files in it (garvinhicking)
|