I just had a quick look into the available hooks for the weblog comments, but unfortunately both hooks are not suitable to use for modifying any bbcode style tags in the comment. the first hook (comment_entries_tagdata) just gives the templates with unchanged tags and the other hook (comment_entries_comment_format) returns only the stripped comment data with no more bbcode style tags in it, So I may have to look at the the hooks, which are available for the submit process of the comment. But I have no experience with that and I am a bit short in time right now. So will see when I can add this to the comments.
/lars
so, i installed the extension, and enabled it. that went fine. and when i click on the youtube button, the brackets appear in my post, however, when posted, the code just looks like this:
[youtube]http://www.youtube.com/watch?v=y_rIi_ee2XY[/youtube]
is there a setting that i’m missing somewhere in my forum? i’ve allowed all html, etc…
also - was i supposed to alter anything with the extension’s code? i don’t think so…
here is a link to the forum i am dealing with:
http://www.jaythejoke.com/index.php/forums/viewthread/192/
Ugh, I was afraid of this.
Recently I converted my blog to validating XHTML. The ‘embed’ tag was never a real tag. XHTML does not recognize it, so using the existing code will cause your pages to fail validation. More specifically, it will generate about 6 errors because there are other parameters that aren’t allowed.
Looking at the code (assuming I have the most recent) here is what the problem is:
<object width="425" height="350">
</param>
</param>
<embed src="http://www.youtube.com/v/' . $doc_id . '"
type="application/x-shockwave-flash"
wmode="transparent"
width="425"
height="350">
</embed>
</object>';
}
/**
* Render the google video object code.
*
* @param string $doc_id
*
* @return string $html_object_code
*
* @access private
*/
function _getGooglevideoCode($doc_id)
{
return '
<embed style="width:425px; height:350px;"
id="VideoPlayback"
type="application/x-shockwave-flash"
src="http://video.google.com/googleplayer.swf?docId=' . $doc_id . '&hl=en" flashvars="">
</embed>
There are multiple ways to present this correctly using different methods. Has anyone taken the time to correct this?
Or, better yet, is anyone interested in it? If not I’ll do it, but I am hoping the author of the mod might have this already done.
Thoughts?
Hey JT,
I haven’t it done yet. The code I used is just the code that youtube and google offer to include in your site. So I may have a look to make the plugin xhtml compatible, but this might not be valid in any case for the rest of the people. there are a lot of sites not using strict xhtml.
so maybe we need a switch 😉 also.
/lars
Hi lars,
thanks for the response. Actually it’s not strict. It fails in any XHTML capacity because of the embed.
Here’s what it fails on: each line is an error, as copied from w3c when validating the page:
there is no attribute “src”. there is no attribute “type” there is no attribute “type” there is no attribute “width” there is no attribute “height” element “embed” undefined element “embed” undefined
essentially they all stem from the problem with the ‘embed’ tag. I did some research and there are processes that resolve this.
From w3.org
Many Flash authoring tools recommend, or enforce, the usage of the <embed> element to include flash animations or applications in Web pages. <embed>, however, was never part of any standardized version of HTML, and this practice produces invalid markup.
There is a process written that works around this called the ‘satay’ method.
Here is a page explaining how to do this. I would have already sat down and generated some valid code but I’m still time strapped. I have a few minutes here and there but none at a lasting length long enough to re-structure it.
http://alistapart.com/articles/flashsatay
Here’s the first paragraph then it give explanations, and reoslutions:
The <embed> Element The <embed> element was created by Netscape as their method of embedding plug ins and players in web pages. It’s not part of the XHTML specification, and while some browsers other than Netscape support it, it’s not standards-compliant, so it’s out. Bye bye, <embed> … it’s been swell.
If i can find some time tomorrow I’ll see if I can sit down and re code it to work, but I don’t think i’ll have time. Keep in mind, I’m not a programmer. While I’m often able to hack my way through something, I don’t know the suggested procedures and in many cases it takes me 3 hours to figure out how to do something it would take a programmer 15 minutes to do. But I’ll see if I can do it tomorrow. (actually it’s today already).
Thanks again for taking the time to look into it.
Far cry from ‘tomorrow’ but I did get this working.
Replacing the current code with my example will allow you to post youtube videos and still have your pages validate.
Existing code: Starting at line 278:
<object width="425" height="350">
</param>
</param>
<embed src="http://www.youtube.com/v/' . $doc_id . '"
type="application/x-shockwave-flash"
wmode="transparent"
width="425"
height="350">
</embed>
</object>';
Replace with this:
<object type="application/x-shockwave-flash" style="width:425px; height:350px;" data="http://www.youtube.com/v/' . $doc_id . '">
</object>';
I have a couple youtube vids on my front page right now and the page still validates:
http://www.hillaryproject.com’
FYI a switch would be fantastic
Is this normal? :S
Edit:
Fixed it, sort of.
Changed this
<div class=\'htmlButtonOuterL\'><div class=\'htmlButtonInner\'><div class=\'htmlButtonOff\'><a ><youtube></a></div></div></div>
<div class=\'htmlButtonOuterL\'><div class=\'htmlButtonInner\'><div class=\'htmlButtonOff\'><a ><vimeo></a></div></div></div>
to this
<td class=\'htmlButtonOuterL\'><div class=\'htmlButtonInner\'><div class=\'htmlButtonOff\'><a ><youtube></a></div></div></td>
<td class=\'htmlButtonOuterL\'><div class=\'htmlButtonInner\'><div class=\'htmlButtonOff\'><a ><vimeo></a></div></div></td>
Has anyone else noticed that this extensions stips out HTML formatting from weblog comments? If I disable the extensions, comment formatting works perfectlty but with the extension enabled comments are simple text, with no P tags or anything!
I can’t choose between having my users post YouTube videos or having comment formatting. I really need both.
Any fix for this? Please?? Anyone…?
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.