Update of /cvsroot/php-blog/serendipity/plugins/serendipity_plugin_comments
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20254/plugins/serendipity_plugin_comments
Modified Files:
Tag: branch_0_6
serendipity_plugin_comments.php
Log Message:
MFH:
* Upgrader kills the current session for possible changes inside session
data on upgrade
* Fixed wrong comparison operator - bug reported by tom, where nl2br plugin
has "reversed" logic.
This is because (true != 'false') evaluates to true. Plugin config did not
evaluate radio values correctly.
* Fixed textile plugin not enabled by default after adding it as a plugin
* Comments plugin now correctly wordwraps
* Couple of linebreak fixes (*sigh*)
PLEASE TEST THE PLUGIN-STUFF! Needs to be verified working for rc2...
Index: serendipity_plugin_comments.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_plugin_comments/serendipity_plugin_comments.php,v
retrieving revision 1.16.4.1
retrieving revision 1.16.4.2
diff -u -d -r1.16.4.1 -r1.16.4.2
--- serendipity_plugin_comments.php 7 Apr 2004 12:38:19 -0000 1.16.4.1
+++ serendipity_plugin_comments.php 13 Apr 2004 10:01:14 -0000 1.16.4.2
@@ -11,7 +11,7 @@
@define('PLUGIN_COMMENTS_MAXENTRIES_BLAHBLAH', 'Wieviele Kommentare sollen gezeigt werden? (Standard: 15)');
@define('PLUGIN_COMMENTS_ABOUT', '%s zu%s');
break;
-
+
case 'en':
case 'es':
default:
@@ -31,10 +31,10 @@
function introspect(&$propbag)
{
global $serendipity;
-
+
$propbag->add('name', COMMENTS);
$propbag->add('description', PLUGIN_COMMENTS_BLAHBLAH);
-
+
$propbag->add('configuration', array(
'wordwrap',
'max_chars',
@@ -83,19 +83,19 @@
$max_chars = $this->get_config('max_chars');
$wordwrap = $this->get_config('wordwrap');
$dateformat = $this->get_config('dateformat');
-
+
if (!$max_entries || !is_numeric($max_entries) || $max_entries < 1) {
$max_entries = 15;
}
-
+
if (!$max_chars || !is_numeric($max_chars) || $max_chars < 1) {
$max_chars = 120;
}
-
+
if (!$wordwrap || !is_numeric($wordwrap) || $wordwrap < 1) {
$wordwrap = 30;
}
-
+
if (!$dateformat || strlen($dateformat) < 1) {
$dateformat = '%a, %d.%m.%Y %H:%M';
}
@@ -119,7 +119,7 @@
<div style="margin: 0px; padding: 0px; text-align: left;">
<?php
$sql = serendipity_db_query($q);
-
+
if ($sql && is_array($sql)) {
foreach($sql AS $key => $row) {
$comments = wordwrap(strip_tags($row['comment']), $max_chars, '@@@', 1);
@@ -128,19 +128,19 @@
if (count($aComment) > 1) {
$commentar .= ' [...]';
}
-
+
if ($row['comment_type'] == 'TRACKBACK' && $row['comment_url'] != '') {
$user = '<a class="highlight" href="' . strip_tags($row['comment_url']) . '" title="' . htmlspecialchars(strip_tags($row['comment_title'])) . '">' . htmlspecialchars(strip_tags($row['user'])) . '</a>';
} else {
$user = htmlspecialchars(strip_tags($row['user']));
}
- $entry = array('comment' => wordwrap($comment, $wordwrap, "\n"));
+ $entry = array('comment' => wordwrap($comment, $wordwrap, "\n", 1));
serendipity_plugin_api::hook_event('frontend_display', $entry);
-
+
printf(
PLUGIN_COMMENTS_ABOUT,
-
+
$user,
' <a class="highlight" href="' . serendipity_archiveURL($row['entry_id'], $row['subject']) .'#c' . $row['comment_id'] . '" title="' . htmlspecialchars($row['subject']) . '">'
. htmlspecialchars($row['subject'])
|