PHP Web Host - Quality Web Hosting For All PHP Applications Just Great Software
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
pe5pvb
New Member
New Member


Joined: Oct 16, 2007
Posts: 19

PostPosted: Tue Apr 13, 2010 11:25 am Reply with quote Back to top

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>
View user's profile Send private message
nuken
RavenNuke(tm) Development Team


Joined: Mar 11, 2007
Posts: 1536
Location: North Carolina

PostPosted: Tue Apr 13, 2010 11:45 am Reply with quote Back to top

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.
View user's profile Send private message Send e-mail Visit poster's website
pe5pvb
New Member
New Member


Joined: Oct 16, 2007
Posts: 19

PostPosted: Tue Apr 13, 2010 2:41 pm Reply with quote Back to top

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.
View user's profile Send private message
spasticdonkey
RavenNuke(tm) Development Team


Joined: Dec 02, 2006
Posts: 1364
Location: Texas, USA

PostPosted: Tue Apr 13, 2010 4:49 pm Reply with quote Back to top

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.
View user's profile Send private message
jestrella
Moderator


Joined: Dec 01, 2005
Posts: 535
Location: Santiago, Dominican Republic

PostPosted: Tue Apr 13, 2010 6:41 pm Reply with quote Back to top

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.
View user's profile Send private message Visit poster's website
jestrella
Moderator


Joined: Dec 01, 2005
Posts: 535
Location: Santiago, Dominican Republic

PostPosted: Tue Apr 13, 2010 6:44 pm Reply with quote Back to top

When I arrive home I can tell you what I have exactly done myself to accomplish this
View user's profile Send private message Visit poster's website
pe5pvb
New Member
New Member


Joined: Oct 16, 2007
Posts: 19

PostPosted: Wed Apr 14, 2010 12:13 am Reply with quote Back to top

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
View user's profile Send private message
jestrella
Moderator


Joined: Dec 01, 2005
Posts: 535
Location: Santiago, Dominican Republic

PostPosted: Wed Apr 14, 2010 7:57 am Reply with quote Back to top

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&amp;rel=0&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=es_ES&amp;feature=player_embedded&amp;fs=1" type="application/x-shockwave-flash">
<param value="http://www.youtube.com/v/-cM9S2AzU28&amp;rel=0&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=es_ES&amp;feature=player_embedded&amp;fs=1" name="movie" />
<param value="true" name="allowFullScreen" />
<param value="always" name="allowScriptAccess" />


Behaves the same and do not break compliance
View user's profile Send private message Visit poster's website
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9136
Location: Arizona

PostPosted: Sat Apr 17, 2010 5:00 pm Reply with quote Back to top

worship
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum