Carl has created a wonderful drop down menues for my horizontal menu bar. The display of "New Entries" is beautiful, but the display of "Latest Comments" is not:
http://atlanticreview.org/
What is even more strange is that the exact same template works fine on my test blog, i.e. Carl's template is correct:
http://facts.atlanticreview.org/
My blog and my test blog use the comments plugin version 1.8. Regardless of whether I use the default settings of "word wrap" and "Maximum chars per comment" or put them on Zero, my blog always shows an abstract of the comments on my test blog never shows them.
I think an abstract of the comments would be nice. However my main interest is to have the drop down menue look good, thus the problem is the lack of line breaks in the "Latest Comments" drop down menu.
How can I get the line breaks in?
Another beauty problem is the width of some of the menues that drop down. If you move over "About", "Categories" or "Archives", then a menue drops down that is far too wide while for the other drop down menues the width is okay.
How can I set a different width for each drop down menue?
I would appreciate any help and ideas and suggestions you have. Thank you!
UPDATE: Following is the list of my event plugin in my blog. (The test blog does not have all of them)
Fix common XHTML errors
This plugin corrects common issues with XHTML markup in entries. It assists in keeping your blog XHTML compliant.
version: 1.4
Announce entries
Send notification of new entries to online services
version: 1.02
Highlight search queries
Highlights queries used in the referring search engine to locate your page
version: 1.1
Statistics
Adds a link to interesting statistics in your entries panel, including a visitors counter
version: 1.24
Spartacus
[S]erendipity [P]lugin [A]ccess [R]epository [T]ool [A]nd [C]ustomization/nification [S]ystem - Allows you to download plugins from our online repository
version: 2.7
GeoURL
GeoURL allocates URLs to locations. More Information at http://geourl.org/
version: 1.1
Google Sitemap Generator
Creates a sitemap.gz, which can be used by the the Googlebot.
version: 0.14
Links to next/previous entry
Allows viewing the next/previous entry when viewing
version: 1.31
Contact Form
Shows a email contactform on your blog as a static page. It can be accessed by either the custom permalink or by index.php?serendipity[subpage]=contactform. You can customize the look of the contact form by putting the plugin_contactform.tpl file into your template directory and modify it there. Captchas from the Spamblock plugin (if enabled) will be applied.
version: 1.7
HTML Link Metatags
Inserts <link rel="start|up|prev|next"> metatags into your frontend for better navigation.
version: 1.1
Trackback-Control
Allows granular control over how trackbacks are sent when creating entries
version: 1.7
Markup: NL2BR
Convert newlines to BR tags
version: 1.3
Uses FCKeditor as WYSIWYG editor
Utilizes the FCKeditor WYSIWYG editor. Requires Serendipity 0.9. After installation, read the installation guide in the configuration screen for this plugin.
version: 0.4
Tagging of entries
Allows freestyle tagging of entries
version: 2.56
Static Pages
Shows static pages inside your blog with your blogs design and all formattings. Adds a new menu item to the admin interface.
version: 3.35
Link List
Links manager - Shows your favorite links in the sidebar.
version: 1.7
Spam Protector (SURBL)
Reject comments that containt blacklisted URLs
version: 1.0
HTML Validator
Validates entries on their XML-conformity
version: 1.0
Send entries via E-Mail
Let you send a newly created entry via E-Mail to a specific address
version: 1.43
Markup: BBCode
Markup text using BBCode
version: 2.01
Properties/Templates of categories
This plugin allows you to change the template and some other properties depending on the selected category.
version: 0.6
top of the content
Puts an HTML nugget on top or bottom of the page, or inside the page's HEAD tag
version: 1.9
Spam Protector
A variety of methods to prevent comment spam
version: 1.51
Amazon end of page
Puts an HTML nugget on top or bottom of the page, or inside the page's HEAD tag
version: 1.9
Browser Compatibility
Uses different (CSS) methods to enforce maximum browser compatibility
version: 1.0
Extended properties for entries
(cache, non-public articles, sticky posts)
version: 1.8
Display of Comments in Drop Down Menu
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Display of Comments in Drop Down Menu
Hi!
The HTML output of your blog shows that there is a difference in plugin versions. You are missing the <span> classes in there, which is definitely present in version 1.8 of this plugin that is bundled with serendipity 1.0. Please compare your two plugin files and see if they're identical?
What could be is that the version number did not get incremented properly with the change of the HTML markup, so that two different files have the same version number.
Best regards
Garvin
The HTML output of your blog shows that there is a difference in plugin versions. You are missing the <span> classes in there, which is definitely present in version 1.8 of this plugin that is bundled with serendipity 1.0. Please compare your two plugin files and see if they're identical?
What could be is that the version number did not get incremented properly with the change of the HTML markup, so that two different files have the same version number.
Best regards
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Yes, it is identical. I have also deleted and reinstalled the comments plugin.
Besides I have deleted an old comments file, which I had renamed "OLD-serendipity..." Perhaps that was a problem. Anyway it is deleted now.
This is the serendipity_plugin_comments.php that is installed:
Besides I have deleted an old comments file, which I had renamed "OLD-serendipity..." Perhaps that was a problem. Anyway it is deleted now.
This is the serendipity_plugin_comments.php that is installed:
Code: Select all
<?php # $Id: serendipity_plugin_comments.php 1104 2006-04-17 18:55:02Z garvinhicking $
// Probe for a language include with constants. Still include defines later on, if some constants were missing
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
if (file_exists($probelang)) {
include $probelang;
}
include dirname(__FILE__) . '/lang_en.inc.php';
class serendipity_plugin_comments extends serendipity_plugin
{
var $title = COMMENTS;
function introspect(&$propbag)
{
global $serendipity;
$this->title = $this->get_config('title', $this->title);
$propbag->add('name', COMMENTS);
$propbag->add('description', PLUGIN_COMMENTS_BLAHBLAH);
$propbag->add('stackable', true);
$propbag->add('author', 'Garvin Hicking/Tadashi Jokagi/Judebert');
$propbag->add('version', '1.8');
$propbag->add('requirements', array(
'serendipity' => '0.8',
'smarty' => '2.6.7',
'php' => '4.1.0'
));
$propbag->add('groups', array('FRONTEND_VIEWS'));
$propbag->add('configuration', array(
'title',
'wordwrap',
'max_chars',
'max_entries',
'dateformat',
'viewmode'));
}
function introspect_config_item($name, &$propbag)
{
switch($name) {
case 'viewmode':
$types = array(
'comments' => COMMENTS,
'trackbacks' => TRACKBACKS,
'all' => COMMENTS . ' + ' . TRACKBACKS
);
$propbag->add('type', 'select');
$propbag->add('name', TYPE);
$propbag->add('description', '');
$propbag->add('select_values', $types);
$propbag->add('default', 'all');
break;
case 'title':
$propbag->add('type', 'string');
$propbag->add('name', TITLE);
$propbag->add('description', '');
$propbag->add('default', COMMENTS);
break;
case 'wordwrap':
$propbag->add('type', 'string');
$propbag->add('name', PLUGIN_COMMENTS_WORDWRAP);
$propbag->add('description', PLUGIN_COMMENTS_WORDWRAP_BLAHBLAH);
$propbag->add('default', 30);
break;
case 'max_chars':
$propbag->add('type', 'string');
$propbag->add('name', PLUGIN_COMMENTS_MAXCHARS);
$propbag->add('description', PLUGIN_COMMENTS_MAXCHARS_BLAHBLAH);
$propbag->add('default', 120);
break;
case 'max_entries':
$propbag->add('type', 'string');
$propbag->add('name', PLUGIN_COMMENTS_MAXENTRIES);
$propbag->add('description', PLUGIN_COMMENTS_MAXENTRIES_BLAHBLAH);
$propbag->add('default', 15);
break;
case 'dateformat':
$propbag->add('type', 'string');
$propbag->add('name', GENERAL_PLUGIN_DATEFORMAT);
$propbag->add('description', sprintf(GENERAL_PLUGIN_DATEFORMAT_BLAHBLAH, '%a, %d.%m.%Y %H:%M'));
$propbag->add('default', '%a, %d.%m.%Y %H:%M');
break;
default:
return false;
}
return true;
}
function generate_content(&$title)
{
global $serendipity;
$title = $this->get_config('title', $this->title);
$max_entries = $this->get_config('max_entries');
$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';
}
$viewtype = '';
if ($this->get_config('viewtype') == 'comments') {
$viewtype .= ' AND c.type = \'NORMAL\'';
} elseif ($this->get_config('viewtype') == 'trackbacks') {
$viewtype .= ' AND c.type = \'TRACKBACK\'';
}
$q = 'SELECT c.body AS comment,
c.timestamp AS stamp,
c.author AS user,
e.title AS subject,
e.timestamp AS entrystamp,
e.id AS entry_id,
c.id AS comment_id,
c.type AS comment_type,
c.url AS comment_url,
c.title AS comment_title,
c.email AS comment_email
FROM '.$serendipity['dbPrefix'].'comments AS c,
'.$serendipity['dbPrefix'].'entries AS e
WHERE e.id = c.entry_id
AND NOT (c.type = \'TRACKBACK\' AND c.author = \'' . serendipity_db_escape_string($serendipity['blogTitle']) . '\' AND c.title != \'\')
AND c.status = \'approved\'
' . $viewtype . '
ORDER BY c.timestamp DESC
LIMIT ' . $max_entries;
$sql = serendipity_db_query($q);
if ($sql && is_array($sql)) {
foreach($sql AS $key => $row) {
if ( $serendipity['lang'] == "ja" && function_exists( 'mb_strimwidth')) {
$comment = mb_strimwidth( strip_tags($row['comment']), 0, $max_chars, " [...]");
} else {
$comments = wordwrap(strip_tags($row['comment']), $max_chars, '@@@', 1);
$aComment = explode('@@@', $comments);
$comment = $aComment[0];
if (count($aComment) > 1) {
$comment .= ' [...]';
}
}
if ($row['comment_type'] == 'TRACKBACK' && $row['comment_url'] != '') {
$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']));
}
$user = trim($user);
if (empty($user))
{
$user = PLUGIN_COMMENTS_ANONYMOUS;
}
if ( $serendipity['lang'] == "ja" && function_exists( 'mb_strimwidth')) {
$pos = 0;
$parts = array();
$comment_len = mb_strlen( $comment);
while ( $pos < $comment_len) {
$part = mb_strimwidth( $comment, $pos, $wordwrap);
$pos += mb_strlen( $part);
$parts[] = $part;
}
$comment = implode( "\n", $parts);
} else {
$comment = wordwrap($comment, $wordwrap, "\n", 1);
}
$entry = array('comment' => $comment,
'email' => $row['comment_email']);
serendipity_plugin_api::hook_event('frontend_display', $entry);
printf(
'<div class="plugin_comment_wrap">' . PLUGIN_COMMENTS_ABOUT . '</div>',
'<span class="plugin_comment_author">' . $user . '</span>',
' <a class="highlight" href="' . serendipity_archiveURL($row['entry_id'], $row['subject'], 'baseURL', true, array('timestamp' => $row['entrystamp'])) .'#c' . $row['comment_id'] . '" title="' . htmlspecialchars($row['subject']) . '">'
. htmlspecialchars($row['subject'])
. '</a><br />' . "\n"
. '<span class="plugin_comment_date">' . htmlspecialchars(serendipity_strftime($dateformat, $row['stamp'])) . '</span><br />' . "\n"
. '<span class="plugin_comment_body">' . strip_tags($entry['comment'], '<br /><img>') . '</span>'
. '<br /><br /><br />' . "\n\n"
);
}
}
}
}
/* vim: set sts=4 ts=4 expandtab : */
My blog: http://AtlanticReview.org
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Seems that did the trick because now the markup is right!
As you can see in the sourcecode, there are no "br"s inside the file, because the sidebar plugin uses simply all place that is given to it.
You just need to make span.plugin_comment_body to "display: block; margin: 10px" or something like that in your CSS to create some spacing between the different blocks, I think.
Regards,
Garvin
Seems that did the trick because now the markup is right!
As you can see in the sourcecode, there are no "br"s inside the file, because the sidebar plugin uses simply all place that is given to it.
You just need to make span.plugin_comment_body to "display: block; margin: 10px" or something like that in your CSS to create some spacing between the different blocks, I think.
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/