Log in

View Full Version : BBcode [code] tags not working


Ransack
09-25-2008, 06:52 AM
Hi,

I'm running 3.6 and my bbcode code tags are not working. The code is not displayed at all. (Just the empty box where the code should be)

Having trouble searching for this as terms like "bbcode" and "[code]" seem to give a lot of unrelated results in google.

Where is the best place to look to start debugging this?

Thanks for any help

Lynne
09-25-2008, 02:42 PM
It's hard to suggest something when I don't have a clear picture of what is going on. An image may help. Also, which bbcodes aren't working? All of them? Just the code tags? Only the img tags? Are they not working for all users or just admins? A bit more detail may help.

Ransack
09-25-2008, 11:50 PM
It is just the "code" tag. It is not the "img" tag or any other bbcode tag I am having problems with. It happens to both admins and regular users.

I have attached an example of a description of a template edit, which renders correctly on other boards but not on mine.

See codetag1.png composing the message.
See codetag2.png for the result. As you can see, the first code tag works, but that is a fairly simple bit of code. The second one does not. The "if" tag is not present. And the "a" (anchor) tag is interpreted and rendered as a link. That big long blank line (wherever that comes from, presumably the spaces I have indented in the code before "$post[...]" ) is one big link.

Thanks for any help.

Lynne
09-26-2008, 02:05 AM
Do you allow users to post html? I think I've seen this problem before when that is allowed.

Digital Jedi
09-26-2008, 02:11 AM
Do you have any versions of AME installed?

Ransack
09-26-2008, 03:29 AM
Do you allow users to post html? I think I've seen this problem before when that is allowed.

Yes I have html enabled. Is it required that I disable html in order for code tags to work properly? That would be rather disappointing.

Do you have any versions of AME installed?

Does this refer to Auto Media Embedding, such as the "youtube" tags I've seen on some forums? No I do not have any such plugin installed.

Digital Jedi
09-26-2008, 05:11 AM
Not quite tags, but yes, its a media embedding modification. Just checking, as a previous version used to strip out some tags in the CODE blocks.

How badly do you need HTML enabled on your forum, as it's a considerable security risk to have it on.

Ransack
09-26-2008, 05:41 AM
Not quite tags, but yes, its a media embedding modification. Just checking, as a previous version used to strip out some tags in the CODE blocks.

How badly do you need HTML enabled on your forum, as it's a considerable security risk to have it on.

I will consider disabling it. However, can I just disable it on a single post by post basis when I post a code tag and expect that to work? Does this require a plugin which would modify the "compose post" window to include a checkbox to uncheck HTML? I'm not seeing this currently.

There seems to be some plugin here which tells me what tags are on and what are off while I'm composing a post, but I don't see an option to modify them.


Also, if I want to enable this feature only for certain usergroups, can I set the permission to allow in the usergroup settings for tha tusergroup and then disable it for the forum in the forum manager? Or will that forum setting override the usergroup setting?

Thanks again for all of your.

Dismounted
09-26-2008, 05:53 AM
Yes I have html enabled. Is it required that I disable html in order for code tags to work properly? That would be rather disappointing.
You do know the implications (eg. security) with enabling HTML, right? Since not many people have HTML enabled - this was probably overlooked - try reporting it to the vBulletin bug tracker.

Ransack
09-26-2008, 07:04 AM
You do know the implications (eg. security) with enabling HTML, right? Since not many people have HTML enabled - this was probably overlooked - try reporting it to the vBulletin bug tracker.

Yes I know the implications, I just didn't care. If nobody uses this feature, maybe it shouldn't be there. But people like to cut and paste articles from webpages and this renders all the embedded content.

If I disable the html in the forums, and then enable it for a certain usergroup, will that allow users in that usergroup to post html in those forums or will the forum setting override that?

Also, if the above works, is there a quick SQL update statement I can use to disable html for all forums, so I don't have to do it one by one?

Thanks for your reply.

Digital Jedi
09-26-2008, 07:31 AM
What Dismounted is saying is it's seldom used, so it's probably an unknown bug. You should submit it to the Bug Tracker so it can be fixed, as there's no way to enable by Usergroup.

Lynne
09-26-2008, 03:29 PM
But people like to cut and paste articles from webpages and this renders all the embedded content.
If you are using the WSYWIG editor, usually you can copy/paste articles and it retains all the formating from the article.

Ransack
09-26-2008, 07:51 PM
What Dismounted is saying is it's seldom used, so it's probably an unknown bug. You should submit it to the Bug Tracker so it can be fixed, as there's no way to enable by Usergroup.

Do they still fix bugs for 3.6?

If you are using the WSYWIG editor, usually you can copy/paste articles and it retains all the formating from the article.

Even if HTML is disabled?

Lynne
09-26-2008, 07:58 PM
Even if HTML is disabled?
I don't have html enabled and have copy/pasted articles to my forum using this method. Try it and see. You need to make sure you are using the WSYWIG editor though. Tables won't work, but text formating and links and images will, if I recall correctly.

Digital Jedi
09-27-2008, 02:49 AM
Yeah, it will copy images, links, bold, italics, color and sometimes font size. It won't copy special formatting like floating images, iframes, tables, etc, but it copies all the basics. Unless I'm mistaken, it's the WYSIWYG editor that's allowing your members to paste in the articles in the first place.

Ransack
09-27-2008, 04:54 AM
Yeah, it will copy images, links, bold, italics, color and sometimes font size. It won't copy special formatting like floating images, iframes, tables, etc, but it copies all the basics. Unless I'm mistaken, it's the WYSIWYG editor that's allowing your members to paste in the articles in the first place.

I guess this makes sense. I've disabled html and that fixed my "code" tags. But now a copy pasted article looks like this. It includes javascript.

See attachment javascript.png

Lynne
09-27-2008, 03:07 PM
http://www.pittsburghlive.com/images/head_gtr.gif (http://www.pittsburghlive.com/x/tribune-review/westmoreland/) Back to headlines (http://javascript%3Cb%3E%3C/b%3E:history.back%28%29)
http://www.pittsburghlive.com/images/larger_text.gifLarger text (http://javascript%3Cb%3E%3C/b%3E:ts%28%27storyBody%27,1%29) http://www.pittsburghlive.com/images/smaller_text.gifSmaller text (http://javascript%3Cb%3E%3C/b%3E:ts%28%27storyBody%27,-1%29) Taser ends emu scamper on Pennsylvania Turnpike

By Jennifer Reeger (jreeger@tribweb.com)
TRIBUNE-REVIEW
Wednesday, September 3, 2008

Buzz up! (http://buzz.yahoo.com/article/pittsburgh_tribu/http%253A%252F%252Fwww.pittsburghlive.com%252Fx%25 2Fpittsburghtrib%252Fs_586162.html)

http://www.pittsburghlive.com/images/delicious.med.gif (http://del.icio.us/post)
http://x.myspace.com/images/myspace_logo_16.gif (http://javascript%3Cb%3E%3C/b%3E:GetThis%28%27Taser%20ends%20emu%20scamper%20o n%20Pennsylvania%20Turnpike%27,%20%27An%20emu%20--%20a%20large,%20flightless%20bird%20native%20to%20 Australia%20--%20clogged%20the%20Pennsylvania%20Turnpike%20for%2 0about%20two%20hours%20and%20sent%20state%20police %20scrambling%20to%20capture%20it.%27,%20%27http://www.pittsburghlive.com/x/pittsburghtrib/news/breaking/s_586162.html%27,%201%29)
http://www.pittsburghlive.com/images/facebook.icon.jpg (http://www.facebook.com/share.php?u=http://www.pittsburghlive.com/x/pittsburghtrib/news/breaking/s_586162.html)
http://www.pittsburghlive.com/images/stumbleupon.gif (http://www.stumbleupon.com/submit?url=http://www.pittsburghlive.com/x/pittsburghtrib/news/breaking/s_586162.html&title=Taser%20ends%20emu%20scamper%20on%20Pennsylv ania%20Turnpike)



Kathy Rooney was heading east on the Pennsylvania Turnpike Monday when traffic came to a halt near the New Stanton exit.
She immediately thought construction was at the heart of the backlog, until she saw a large, gangly bird loping straight down the center of the highway.
"It was coming towards us, but it was on the white lines," said Rooney, of Mt. Lebanon. "It was like it knew to stay on the white lines. It stayed right down the middle."
story continues below

http://ads.pittsburghlive.com/RealMedia/ads/Creatives/OasDefault/BAMP_Sept08/BAMP_300x250.gif (http://ads.pittsburghlive.com/RealMedia/ads/click_lx.ads/pittsburghlive.com/pittsburghtrib/news/breaking/s_586162.html/2097847286/Position1/OasDefault/BAMP_Sept08/BAMP_300x250.gif/34343762323831653438646535613030)

The turnpike interloper was an emu -- a large, flightless bird native to Australia -- that clogged the turnpike Monday for about two hours and sent state police scrambling to capture it.
"It created a backlog of traffic," said Sgt. Anthony DeLuca at the barracks in New Stanton. "Vehicles almost wrecked into each other, into the bird. We tried to chase it down and tried to catch it."
The bird -- bred for its meat and oil from its fat -- was trapped in traffic lanes surrounded by 5-foot high barriers on each side.
"Once it got in there it got stuck, and it didn't know what to do," DeLuca said


--------------- Added 27 Sep 2008 at 09:09 ---------------

I just copy/pasted that from this link: http://www.pittsburghlive.com/x/pittsburghtrib/news/breaking/s_586162.html and I show no javascript. I would probably take a moment to delete out all that stumbleupon/digg crap though.

Are you users not willing to take a second to do a little bit of 'prettying up' the page before posting it?

Ransack
09-28-2008, 05:07 AM
Are you users not willing to take a second to do a little bit of 'prettying up' the page before posting it?

This makes me lol.

The members of this particular forum are hardly willing to do anything, except that they are quite content to exspend energy complaining.

Is there a quick place to do some kind of regex replacement like s/<script[\\w]*<\/script>//g that should at least help the majority of these cases. (Can I hook this in a plugin? Edit a .php file? I'd prefer a plugin hook but either way, where would I do this?)

Thanks again for the replies. Sorry for all of the dumb questions.

Lynne
09-28-2008, 03:29 PM
I know I use a plugin to do word replacement in posts for my mods. I use the "postbit_display_complete" hook to output the post: $this->post['message'] = whatever;