Page 1 of 2
Comments sidebar / BBCode fix?
Posted: Tue Jul 18, 2006 8:53 pm
by clafferty
is there a way to apply the markup BBCode formatting to the Comments sidebar content as well?
currently it only works with body, extended body, comments and html nugget.
i only use BBCode on my comments section... but in the sidebar plugin that lists the most recent comments, all the bbcode shows up unformatted.
example here --
http://www.cyberschnauzer.com
thanks!
Posted: Thu Jul 20, 2006 7:02 am
by judebert
Ugly. I can see why you want this, and what you want.
Unfortunately, I'm not capable of fixing this immediately. I'll have to ask a few questions, first.
The bbcode plugin only applies markup for the frontend_display hook. It's possible the Recent Comments plugin just isn't calling that hook. Do any other markup plugins work?
What's the name of the plugin you're using to get the recent comments? And what version is it?
Do you have any other event plugins installed? Which ones, and in what order?
I think that'll be enough to get me started for now.
Posted: Thu Jul 20, 2006 12:27 pm
by garvinhicking
Hi!
Yes, the problem is that strip_tags strips out all HTML that is transformed by BBCode. Plus, bbcode can be arbaged by the wordwrap()ing that occurs.
The strip_tags only allows the <br> and <img> tags to occur...
Best regards,
Garvin
Posted: Thu Jul 20, 2006 4:22 pm
by clafferty
judebert wrote:
What's the name of the plugin you're using to get the recent comments? And what version is it?
Do you have any other event plugins installed? Which ones, and in what order?
I think that'll be enough to get me started for now.
the 'recent comments' plugin is this one --
Comments
Displays the last comments to your entries
Author: Garvin Hicking/Tadashi Jokagi/Judebert; version: 1.8
here is my list of events plugins, in order. all should be the latest versions.
Markup: Serendipity
Markup: Emoticate
Browser Compatibility
Spam Protector
Spartacus
My Mood
Statistics
Searches comments on quicksearch
Backup Interface ()
Markup: BBCode
Gravatar / Favatar
Markup: NL2BR
Extended properties for entries
hope this helps... i saw garvin's comment, but given my rather poor programming knowledge, i can't tell if he's saying "here's how to fix it" or
"here's why what you want is impossible."
i don't believe any other markup plugins work on the sidebar (altho i could be wrong). gravatar/favatars do seem to be applied there just like in the normal comments section, but i disabled them in the sidebar through a little CSS trickery.
Posted: Fri Jul 21, 2006 10:09 am
by garvinhicking
Hi!
Sorry for sounding a bit confusing
Emoticons should be translated in the sidebar, but actually all other HTML markup is stripped to avoid formatting problems on the sidebars. Thus my statement was more meant to be as "what you want to have is currently not possible, the plugin would need to be modified to suit your needs". The easiest thing would be to edit that plugin file, search for:
commands, and remove that.
So a strip_tags($entry['comment'], '<br /><img>') would bekome just $entry['comment']. You might want to try that and check the results?
Best regards,
Garvin
Posted: Fri Jul 21, 2006 4:09 pm
by clafferty
i took out all strip_tags commands in the sidebar comments plugin, to no effect.
if it's not clear... all i'm trying to do is get the comments in the sidebar to not look like this.
this is a [url="
http://www.google.com"]test[/url]
in the actual comments, it doesn't look like that (as the bbcode is applied). i'd readily accept either stripping out the bbcode altogether in the sidebar, or making it actually work like it does in the normal comments section. either way would be great...
thanks!
Posted: Fri Jul 21, 2006 4:12 pm
by garvinhicking
Hi!
In that case the line splitting seems to be causing your trouble, the wordwrap() code splits the BB markup as I indicated.
I have no time left to offer you a fix for this until next week; maybe judbert will join in on the weekend...
Best regards,
Garvin
Posted: Fri Jul 21, 2006 5:21 pm
by clafferty
i tried taking out all the wordwrap code as well (at least as best as i could, given what i know). it did make it so long lines like the BBCode don't break and now stretch out past the margins... but the code still exists (i.e., it still displays as [url="..."]).
thanks for the quick reply... and have a great weekend.

Posted: Mon Jul 24, 2006 1:04 pm
by garvinhicking
Hi!
Hm, could you tell me your URL or tell me what exact comment you entered to get this display?
I'll then try to reproduce this on my page and see how to work around that somehow.
...after some time...
Oh boy, I think that just your user entered wrong BBCode. Instead of:
The format \[url="
http:..."] is invalid. It should read \[url=http://] instead, wihtout the quotes. This is also explained in the docs of BBCode; no Quotes shall be expected there, since it really disturbs the parser.
Best regards,
Garvin
Posted: Mon Jul 24, 2006 11:27 pm
by clafferty
i took out the quotes... still no dice. i just added a new test comment for you to look at.
"this is a [url=
http://www.test.com]test[/url] comment" is the content.
thanks!
http://www.cyberschnauzer.com/
Posted: Tue Jul 25, 2006 11:10 am
by garvinhicking
Hi!
Could you please try this updated plugin file:
http://nopaste.php-q.net/227841
Replace your serendipity_plugin_comments.php file with that. It seems to work on my installation...?
Best regards,
Garvin
Posted: Tue Jul 25, 2006 4:27 pm
by clafferty
garvinhicking wrote:Hi!
Could you please try this updated plugin file:
http://nopaste.php-q.net/227841
Replace your serendipity_plugin_comments.php file with that. It seems to work on my installation...?
that completely worked! thanks!
i suppose the question then is why it wasn't working before... i have the latest serendipity installed and had updated the plugin to the latest version (through the spartacus interface).
thanks again.

Posted: Tue Jul 25, 2006 11:29 pm
by judebert
Sorry, Garvin; I may not be having the heat troubles you are, but I'm sweating myself to death trying to finish my electric car. I want to use it to drive the kids to school on their first day.
I have decided I officially have too many projects. I think I'll elminate sleeping. That'll be a big help. Loads of wasted time, there.
Posted: Wed Jul 26, 2006 1:03 pm
by garvinhicking
Hi!
Yes indeed, sleeping is a terrible, unproductive timekiller!
Best regards,
Garvin
Posted: Wed Jul 26, 2006 5:14 pm
by clafferty
*sigh*
the 1.9 version of the plugin seemed to work -- however it only appears to parse the first bbcode tag.
"update:
http://myspace.com/coreylafferty
http://myspace.com/actofbetrayal"
that will show the first as a link, but lists the [url] tags in the second one. i've played around with it a bit, and found some odd behavior...
if i remove the word 'update:' from the beginning, both links show up, regardless of how high i set "Maximum chars per comment"
if i change the "wordwrap" number from 30 to 60, both links show up. however, if i move it further up to 80, it goes back to only doing the first one.
currently i'm leaving it at 60...