| Author |
Message |
pe5pvb New Member


Joined: Oct 16, 2007 Posts: 19
|
Posted:
Tue Apr 13, 2010 11:25 am |
|
Hi,
I have installed a youtube addon for the FCKeditor. When using the submit_news module the line for youtube is stripped after the preview. I tried to solve this by changing the $allowedhtml but I can't get it to work.
In html this should be added into the news post (example):
| Code: | | <p><embed height="344" width="425" src="http://www.youtube.com/v/LnPh7cTnPcs%26hl=en%26fs=1%26rel=0" type="application/x-shockwave-flash"></embed></p> |
|
|
|
|
 |
nuken RavenNuke(tm) Development Team

Joined: Mar 11, 2007 Posts: 1536 Location: North Carolina
|
Posted:
Tue Apr 13, 2010 11:45 am |
|
You don't need any mods to embed Youtube videos in news. Just click the source button and insert the embed code youtube gives you where you want it to appear and click the source button to return to the editor mode.
example
| Code: | | <object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/JfQGV5lqUAc&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/JfQGV5lqUAc&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object> |
would be directly entered into the article after you have hit the source button. |
|
|
|
 |
pe5pvb New Member


Joined: Oct 16, 2007 Posts: 19
|
Posted:
Tue Apr 13, 2010 2:41 pm |
|
When I do this it is also removed after hitting the preview button. I'm talking about the submit_news module for users, not de admin possibility to add news. |
|
|
|
 |
spasticdonkey RavenNuke(tm) Development Team

Joined: Dec 02, 2006 Posts: 1364 Location: Texas, USA
|
Posted:
Tue Apr 13, 2010 4:49 pm |
|
giving users access to the <embed> tag is not a good idea from a security perspective.
If it were me, I would just have them include the URL to the video, and then add the embed code when I approve the submission. |
|
|
|
 |
jestrella Moderator

Joined: Dec 01, 2005 Posts: 535 Location: Santiago, Dominican Republic
|
Posted:
Tue Apr 13, 2010 6:41 pm |
|
Mmmmm. yet another reason to move on to HTML Purifier!
BTW, the embed tag is ot standard, I mean, not approved by the W3C and using it will result in not compliant code... Something like this code should be used instead...
| Code: | | <object type="application/x-shockwave-flash" style="width:425px; height:350px;" data="youtube-link-here"><param name="movie" value="youtube-link-here" /></object> |
Also, for this functionality be available to users you must change allowed htm array adding the desired tags and parameters. |
|
|
|
 |
jestrella Moderator

Joined: Dec 01, 2005 Posts: 535 Location: Santiago, Dominican Republic
|
Posted:
Tue Apr 13, 2010 6:44 pm |
|
When I arrive home I can tell you what I have exactly done myself to accomplish this |
|
|
|
 |
pe5pvb New Member


Joined: Oct 16, 2007 Posts: 19
|
Posted:
Wed Apr 14, 2010 12:13 am |
|
If someone can tell me what to add to the allowedhtml? I can change to original plugin for the right code, to be compliant with W3C |
|
|
|
 |
jestrella Moderator

Joined: Dec 01, 2005 Posts: 535 Location: Santiago, Dominican Republic
|
Posted:
Wed Apr 14, 2010 7:57 am |
|
Open... rnconfig.php
Find, somewhere close to line 152...
| Code: | | $AllowableHTML = array( |
at the end add...
| Code: |
'object' => array('type' => 1, 'data' => 1, 'width' => 1, 'height' => 1),
'param' => array('name' => 1, 'value' => 1),
|
And here's a real code example used in the news...
| Code: | <object width="425" height="344" data="http://www.youtube.com/v/-cM9S2AzU28&rel=0&color1=0xb1b1b1&color2=0xcfcfcf&hl=es_ES&feature=player_embedded&fs=1" type="application/x-shockwave-flash">
<param value="http://www.youtube.com/v/-cM9S2AzU28&rel=0&color1=0xb1b1b1&color2=0xcfcfcf&hl=es_ES&feature=player_embedded&fs=1" name="movie" />
<param value="true" name="allowFullScreen" />
<param value="always" name="allowScriptAccess" /> |
Behaves the same and do not break compliance |
|
|
|
 |
montego Site Admin

Joined: Aug 29, 2004 Posts: 9136 Location: Arizona
|
Posted:
Sat Apr 17, 2010 5:00 pm |
|
|
|
 |
|
|
|
|