plugin_comments: URLs of writers may now be shown in the sitebar. This only worked for trackbacks formaly, now it works for trackbacks, pingbacks and human writers. You may configure, in what type of comment the URLs should be added.

This commit is contained in:
Grischa Brockhaus 2008-01-12 13:47:16 +00:00
parent 81506febd0
commit 3e491633b6
5 changed files with 33 additions and 4 deletions

View File

@ -3,6 +3,11 @@
Version 1.3 ()
------------------------------------------------------------------------
* Sitebar plugin comments: URLs of writers now are shown for all
entries not only for trackbacks. You may configure if they should
be shown for all, none, normal writers or trackback/pingbacks.
(brockhaus)
* Pingback/Trackback textfetching: HTML Entities are now converted
to characters. Character encoding defaults to UTF-8 but can be
configured via $serendipity['pingbackEntityEncoding'] = "UTF-8"

View File

@ -8,3 +8,5 @@
@define('PLUGIN_COMMENTS_MAXENTRIES', 'Anzahl an Kommentaren');
@define('PLUGIN_COMMENTS_MAXENTRIES_BLAHBLAH', 'Wieviele Kommentare sollen gezeigt werden? (Standard: 15)');
@define('PLUGIN_COMMENTS_ABOUT', '%s zu%s');
@define('PLUGIN_COMMENTS_ADDURL', 'Kommentatoren URL anzeigen bei');

View File

@ -8,3 +8,5 @@
@define('PLUGIN_COMMENTS_MAXENTRIES', 'Anzahl an Kommentaren');
@define('PLUGIN_COMMENTS_MAXENTRIES_BLAHBLAH', 'Wieviele Kommentare sollen gezeigt werden? (Standard: 15)');
@define('PLUGIN_COMMENTS_ABOUT', '%s zu%s');
@define('PLUGIN_COMMENTS_ADDURL', 'Kommentatoren URL anzeigen bei');

View File

@ -15,4 +15,6 @@
@define('PLUGIN_COMMENTS_MAXENTRIES_BLAHBLAH', 'How many comments will be shown? (Default: 15)');
@define('PLUGIN_COMMENTS_ABOUT', '%s about%s');
@define('PLUGIN_COMMENTS_ANONYMOUS', 'anon');
?>
@define('PLUGIN_COMMENTS_ADDURL', 'Add writers URL to');

View File

@ -35,12 +35,27 @@ class serendipity_plugin_comments extends serendipity_plugin
'max_chars',
'max_entries',
'dateformat',
'viewmode'));
'viewmode',
'showurls'));
}
function introspect_config_item($name, &$propbag)
{
switch($name) {
case 'showurls':
$urltypes = array(
'none' => NONE,
'comments' => COMMENTS,
'trackbacks' => TRACKBACKS,
'all' => COMMENTS . ' + ' . TRACKBACKS
);
$propbag->add('type', 'select');
$propbag->add('name', PLUGIN_COMMENTS_ADDURL);
$propbag->add('description', '');
$propbag->add('select_values', $urltypes);
$propbag->add('default', 'trackbacks');
break;
case 'viewmode':
$types = array(
'comments' => COMMENTS,
@ -160,8 +175,11 @@ class serendipity_plugin_comments extends serendipity_plugin
$comment .= ' [...]';
}
}
if ($row['comment_type'] == 'TRACKBACK' && $row['comment_url'] != '') {
$showurls = $this->get_config('showurls','trackbacks');
$isTrackBack = $row['comment_type'] == 'TRACKBACK' || $row['comment_type'] == 'PINGBACK';
if ($row['comment_url'] != '' && ( ($isTrackBack && ($showurls =='trackbacks' || $showurls =='all') || !$isTrackBack && ($showurls =='comments' || $showurls =='all')))) {
$user = '<a class="highlight" href="' . htmlspecialchars(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']));