Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues
Author Message
pe5pvb
New Member
New Member



Joined: Oct 16, 2007
Posts: 19

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

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: 2024
Location: North Carolina

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

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.

_________________
Tricked Out News 
View user's profile Send private message Send e-mail Visit poster's website
pe5pvb







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

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: 1693
Location: Texas, USA

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

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 Visit poster's website
jestrella
Moderator



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

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

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.

_________________
"For those whom have not reach the sky... Every mountain seems high"

Best Regards
Jonathan Estrella [ Only registered users can see links on this board! Get registered or login! ] 
View user's profile Send private message Visit poster's website
jestrella







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

When I arrive home I can tell you what I have exactly done myself to accomplish this
 
pe5pvb







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

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







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

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
 
montego
Site Admin



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

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

worship

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
semperaye
Worker
Worker



Joined: Oct 31, 2011
Posts: 100
Location: North Carolina

PostPosted: Sat Jan 19, 2013 9:46 am Reply with quote

jestrella wrote:
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


what does "add at the end" mean? Bottom or end? Should it look like this:

$AllowableHTML = array(
'object' => array('type' => 1, 'data' => 1, 'width' => 1, 'height' => 1),
'param' => array('name' => 1, 'value' => 1),

and for the "real code" example is that something you customized or is that what will default from what I copy and paste from Youtube?

Thanx..
 
View user's profile Send private message
semperaye







PostPosted: Sat Jan 19, 2013 10:37 am Reply with quote

real code example must be the key because I added those two extra lines and it didnt' work. do i need to delete what was already there under allowablehtml, then add what you have, or just add that code below? I added it below, with no luck
 
nuken







PostPosted: Sat Jan 19, 2013 10:52 am Reply with quote

On youtube, if you click the share tab and the embed tab, you will get the code you need. Adding the object and param at the top of the list should be fine.
 
semperaye







PostPosted: Sat Jan 19, 2013 5:06 pm Reply with quote

$AllowableHTML = array(
'object' => array('type' => 1, 'data' => 1, 'width' => 1, 'height' => 1),
'param' => array('name' => 1, 'value' => 1),

So thats how it should look ^?
 
jestrella







PostPosted: Sat Jan 19, 2013 5:48 pm Reply with quote

That's exactly how first 3 lines should look, don't change anything in there just add the specified lines on top on whats there.
 
semperaye







PostPosted: Sat Jan 19, 2013 5:50 pm Reply with quote

but...there were not any 3 lines before. I added those last two..., so what your saying is it should look like this:

'object' => array('type' => 1, 'data' => 1, 'width' => 1, 'height' => 1),
'param' => array('name' => 1, 'value' => 1),
$AllowableHTML = array(
 
semperaye







PostPosted: Sat Jan 19, 2013 5:55 pm Reply with quote

This is what I currently have

// To override the default uploads/ folder used for storing files uploaded
// through nukeWYSIWYG via FCKeditor's filemanager.
// This should have a slash at the beginning and a slash at the end (e.g. '/files/') and is relative to the URL without subdirectories
$uploadpath = '';

$AllowableHTML = array(
'object' => array('type' => 1, 'data' => 1, 'width' => 1, 'height' => 1),
'param' => array('name' => 1, 'value' => 1),
'a' => array('class' => 1, 'style' => 1, 'id' => 1, 'href' => 1, 'target' => 1, 'title' => array('minlen' => 4, 'maxlen' => 120)),
'b' => array(),
 
jestrella







PostPosted: Sat Jan 19, 2013 6:04 pm Reply with quote

This is the default

Code:
$AllowableHTML = array(

   'a' => array('class' => 1, 'style' => 1, 'id' => 1, 'href' => 1, 'target' => 1, 'title' => array('minlen' => 4, 'maxlen' => 120)),
   'b' => array(),
   'blockquote' => array('class' => 1, 'style' => 1, 'id' => 1),
   'br' => array(),
   'center' => array(),
   'div' => array('class' => 1, 'style' => 1, 'id' => 1, 'align' => 1),
   'em' => array('class' => 1, 'style' => 1, 'id' => 1),
   'font' => array('face' => 1, 'style' => 1, 'color' => 1, 'size' => array('minval' => 1, 'maxval' => 7)),
   'h1'=>array('class' => 1, 'style' => 1, 'id' => 1),
   'h2'=>array('class' => 1, 'style' => 1, 'id' => 1),
   'h3'=>array('class' => 1, 'style' => 1, 'id' => 1),
   'h4'=>array('class' => 1, 'style' => 1, 'id' => 1),
   'h5'=>array('class' => 1, 'style' => 1, 'id' => 1),
   'h6'=>array('class' => 1, 'style' => 1, 'id' => 1),
   'hr' => array(),
   'i' => array(),
   'img' => array('class' => 1, 'style' => 1, 'id' => 1, 'alt' => 1, 'src' => 1, 'hspace' => 1, 'vspace' => 1, 'width' => 1, 'height' => 1, 'border' => 1, 'align' => 1),
   'li' => array('class' => 1, 'style' => 1, 'id' => 1),
   'ol' => array('class' => 1, 'style' => 1, 'id' => 1),
   'p' => array('class' => 1, 'style' => 1, 'id' => 1, 'align' => 1),
   'pre' => array('style' => 1, 'id' => 1, 'align' => 1, 'class' => 1, 'title' => array('minlen' => 4, 'maxlen' => 120)),
   'span' =>array('id' => 1, 'class' => 1, 'style' => array('font-family' => 1, 'color' => 1)),
   'strong' => array(),
   'strike'=>array(),
   'sub'=>array(),
   'sup'=>array(),
   'table' => array('class' => 1, 'style' => 1, 'id' => 1, 'align' => 1, 'border' => 1, 'cell' => 1, 'width' => 1, 'cellspacing' => 1, 'cellpadding' => 1),
   'tbody'=>array('class' => 1, 'style' => 1, 'id' => 1),
   'td' => array('class' => 1, 'style' => 1, 'id' => 1, 'align' => 1, 'width' => 1, 'valign' => 1, 'height' => 1, 'rowspan' => 1, 'colspan' => 1 ),
   'tfoot'=>array('class' => 1, 'style' => 1, 'id' => 1),
   'th' => array('class' => 1, 'style' => 1, 'id' => 1, 'align' => 1, 'scope' => 1, 'width' => 1, 'valign' => 1, 'height' => 1, 'rowspan' => 1, 'colspan' => 1),
   'thead'=>array('class' => 1, 'style' => 1, 'id' => 1),
   'tr' => array('class' => 1, 'style' => 1, 'id' => 1, 'align' => 1),
   'tt'=>array(),
   'u' => array(),
   'ul' => array('class' => 1, 'style' => 1, 'id' => 1),
);



You should add the specified lines on top or at the bottom, adding it at the bottom you should end up with something like this

Code:
$AllowableHTML = array(

   'a' => array('class' => 1, 'style' => 1, 'id' => 1, 'href' => 1, 'target' => 1, 'title' => array('minlen' => 4, 'maxlen' => 120)),
   'b' => array(),
   'blockquote' => array('class' => 1, 'style' => 1, 'id' => 1),
   'br' => array(),
   'center' => array(),
   'div' => array('class' => 1, 'style' => 1, 'id' => 1, 'align' => 1),
   'em' => array('class' => 1, 'style' => 1, 'id' => 1),
   'font' => array('face' => 1, 'style' => 1, 'color' => 1, 'size' => array('minval' => 1, 'maxval' => 7)),
   'h1'=>array('class' => 1, 'style' => 1, 'id' => 1),
   'h2'=>array('class' => 1, 'style' => 1, 'id' => 1),
   'h3'=>array('class' => 1, 'style' => 1, 'id' => 1),
   'h4'=>array('class' => 1, 'style' => 1, 'id' => 1),
   'h5'=>array('class' => 1, 'style' => 1, 'id' => 1),
   'h6'=>array('class' => 1, 'style' => 1, 'id' => 1),
   'hr' => array(),
   'i' => array(),
   'img' => array('class' => 1, 'style' => 1, 'id' => 1, 'alt' => 1, 'src' => 1, 'hspace' => 1, 'vspace' => 1, 'width' => 1, 'height' => 1, 'border' => 1, 'align' => 1),
   'li' => array('class' => 1, 'style' => 1, 'id' => 1),
   'ol' => array('class' => 1, 'style' => 1, 'id' => 1),
   'p' => array('class' => 1, 'style' => 1, 'id' => 1, 'align' => 1),
   'pre' => array('style' => 1, 'id' => 1, 'align' => 1, 'class' => 1, 'title' => array('minlen' => 4, 'maxlen' => 120)),
   'span' =>array('id' => 1, 'class' => 1, 'style' => array('font-family' => 1, 'color' => 1)),
   'strong' => array(),
   'strike'=>array(),
   'sub'=>array(),
   'sup'=>array(),
   'table' => array('class' => 1, 'style' => 1, 'id' => 1, 'align' => 1, 'border' => 1, 'cell' => 1, 'width' => 1, 'cellspacing' => 1, 'cellpadding' => 1),
   'tbody'=>array('class' => 1, 'style' => 1, 'id' => 1),
   'td' => array('class' => 1, 'style' => 1, 'id' => 1, 'align' => 1, 'width' => 1, 'valign' => 1, 'height' => 1, 'rowspan' => 1, 'colspan' => 1 ),
   'tfoot'=>array('class' => 1, 'style' => 1, 'id' => 1),
   'th' => array('class' => 1, 'style' => 1, 'id' => 1, 'align' => 1, 'scope' => 1, 'width' => 1, 'valign' => 1, 'height' => 1, 'rowspan' => 1, 'colspan' => 1),
   'thead'=>array('class' => 1, 'style' => 1, 'id' => 1),
   'tr' => array('class' => 1, 'style' => 1, 'id' => 1, 'align' => 1),
   'tt'=>array(),
   'u' => array(),
   'ul' => array('class' => 1, 'style' => 1, 'id' => 1),
  'object' => array('type' => 1, 'data' => 1, 'width' => 1, 'height' => 1),
   'param' => array('name' => 1, 'value' => 1),
);
 
semperaye







PostPosted: Sat Jan 19, 2013 6:10 pm Reply with quote

wow interesting when i first pulled the rnconfig file up all I had was:

$AllowableHTML =array(
blockquote....etc etc

So naturally I pasted those provided lines under array(


Thanx alot i'll try what you have and let you know my results
 
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1122

PostPosted: Sat Jan 19, 2013 6:17 pm Reply with quote

I agree with you about the new code jestrella

Quote:
<object type="application/x-shockwave-flash" style="width:425px; height:350px;" data="youtube-link-here"><param name="movie" value="youtube-link-here" /></object>


OLD and not validated

Code:
<param name="movie" value="youtube-link-here">


New and Validated

Code:
<param name="movie" value="youtube-link-here" />


Very Happy
 
View user's profile Send private message
semperaye







PostPosted: Sat Jan 19, 2013 6:20 pm Reply with quote

Alrighty...so...

I have exactly what you have now Smile But youtube videos still do not show up in news.

<iframe width="420" height="315" src="http://www.youtube.com/embed/BbZGwTpZ4zo" frameborder="0" allowfullscreen></iframe>

My code is much smaller then yours, so I feel like there must be something else I'm supposed to add to it to make it work. They used to work on the old version of RN, but this one with tweaked news it doesn't. Yes I am using the source button, and the videos show up just fine while you are editing them, however, as soon as you submit the news the videos disappear.
 
jestrella







PostPosted: Sat Jan 19, 2013 6:33 pm Reply with quote

Well seems like Youtube updated the code, not a big deal, now you will just need to add a single line to the allowadable html array.

this one

Code:
'iframe' => array('width' => 1, 'height' => 1, 'src' => 1, 'frameborder' => 1, 'allowfullscreen' => 1),


same thing, add it at the top or at the bottom.

Edit: updated code as per unicornio correction. Confused


Last edited by jestrella on Sat Jan 19, 2013 6:45 pm; edited 1 time in total 
hicuxunicorniobestbuildpc







PostPosted: Sat Jan 19, 2013 6:40 pm Reply with quote

jestrella, I guess this line

Quote:
'iframe' => array('width' => 1, 'height' => 1, 'src' => 1, 'frameborder' => 1, allowfullscreen => 1),


Should be

Code:
'iframe' => array('width' => 1, 'height' => 1, 'src' => 1, 'frameborder' => 1, 'allowfullscreen' => 1),



Wink
 
jestrella







PostPosted: Sat Jan 19, 2013 6:42 pm Reply with quote

Yeah, you're so right, missed the single quotes on last part Bang Head
 
semperaye







PostPosted: Sat Jan 19, 2013 6:51 pm Reply with quote

jestrella wrote:
Well seems like Youtube updated the code, not a big deal, now you will just need to add a single line to the allowadable html array.

this one

Code:
'iframe' => array('width' => 1, 'height' => 1, 'src' => 1, 'frameborder' => 1, 'allowfullscreen' => 1),


same thing, add it at the top or at the bottom.

Edit: updated code as per unicornio correction. Confused



IT WORKS!!!!! HAAHAHAHAHA THANX! :clap: :clap: :clap: :clap:
 
hicuxunicorniobestbuildpc







PostPosted: Sat Jan 19, 2013 7:29 pm Reply with quote

Very Happy It doesn't matter jestrella. We are not perfect! That's why we have a forum to help each other but let me give u a hint why I found it so fast.

1. Because I am a very precisely tester. I test 5 times or more if it necessary.
2. I use the same editor for years. ( a decent free editor u must try jestrella)

Link
[ Only registered users can see links on this board! Get registered or login! ]

I'm glad it worked for you semperaye but becareful with flash. It is very dangerous and can compromise your site.
Wink

Notepad++ is a nice one too
[ Only registered users can see links on this board! Get registered or login! ]


Last edited by hicuxunicorniobestbuildpc on Mon Jan 21, 2013 2:44 am; edited 1 time in total 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues

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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©