Forums » Customize

Problem with editing and "&"

vmulot
FRANCE
2009-08-05 19:22:06
Permalink Post
 

hello,

I m inserting some html code like div and object & param
for inserting a flv player in the textarea of the "exposition". but i need to use the "&" caracter i tried & then save, then open the edit page again. the & became &.
if i close it and open it again, the & becomes a strange character.
i can"t find why. any help ? :)

Vaska A
UNITED STATES
2009-08-05 19:23:16
Permalink Post
 

Yep...it's an odd problem I've seen. The way I've gotten around this is to make a plugin that carries the object/param code so things are not double encoded.

vmulot
FRANCE
2009-08-05 19:24:10
Permalink Post
 

hmm in fact it seems that the pb appears only when i'm using for example &image =
&image becomes a strange character similar to the &

Vaska A
UNITED STATES
2009-08-05 19:28:40
Permalink Post
 

Yep...exactly. I've never understood why...I just found a way around it.

vmulot
FRANCE
2009-08-05 19:34:01
Permalink Post
 

can you explain me how you managed to do this plugin.?
in fact, i did something bad, i change the "core" so i can upload FLV files and generate html code (in asset/js/modEdit.js) and use a flv player like jplayer.

i'd like to do this but only with a plugin i can call from the textarea or something like that

Vaska A
UNITED STATES
2009-08-05 20:19:44
Permalink Post
 

ouch...there is no reason for you to edit core...seriously...totally wrong place to edit.

this is my super fast way of explaining this...you will need to tell me the parts you don't understand. but first off, there is a basic plugin tutorial in the help/tutorials section.

make a file and call it 'plugin.myflv.php'...

in this file do something like...

  1. function myflv($filename, $width='400', $height='300', $prv_img='')
  2. {
  3. ¬†¬†¬†¬†$prv_img = ($prv_img != '') ? $prv_img : '';
  4. ¬†¬†¬†¬†$no = rand(1, 1000);¬†¬†¬†¬†
  5. ¬†¬†¬†¬†$out = ($wrap == 'inline') ? "<div id="player-$no" class='flash-flv'></div>n" : "<p id="player-$no"></p>n";
  6. ¬†¬†¬†¬†$out .= "<script type="text/javascript">n";
  7. ¬†¬†¬†¬†$out .= "var so = new SWFObject('" . BASEURL . "/files/player.swf', 'mpl', '$width', '$height', '7');n";
  8. ¬†¬†¬†¬†$out .= "so.addParam('allowfullscreen', 'true');n";
  9. ¬†¬†¬†¬†$out .= "so.addParam('allowscriptaccess', 'always');n";
  10. ¬†¬†¬†¬†$out .= "so.addVariable('displayheight', '$height');n";
  11. ¬†¬†¬†¬†$out .= "so.addVariable('file', '" . BASEURL . "/files/$filename');n";
  12. ¬†¬†¬†¬†$out .= "so.addVariable('height', '$height');n";
  13. ¬†¬†¬†¬†$out .= "so.addVariable('image', '" . BASEURL . "/files/$prv_img');n";
  14. ¬†¬†¬†¬†$out .= "so.addVariable('width', '$width');n";
  15. ¬†¬†¬†¬†$out .= "so.write('player-$no');n";
  16. ¬†¬†¬†¬†$out .= "</script>n";
  17. ¬†¬†¬†¬†return $out;
  18. }

this is assuming you are using the JW Player...and swfobject but the idea is the same for anything else.

in your textarea then you would call this up as...

  1. <plug:myflv 'filename.mov', '600', '400', 'preview_image.jpg' />

;)

vmulot
FRANCE
2009-08-05 21:01:35
Permalink Post
 

Ho thanks a lot for help! gonna check that :)

vmulot
FRANCE
2009-08-06 09:47:19
Permalink Post
 

Yeaaaah ! it works really great !
i don"t understand why i didn"t think to that before :-)

thanks a lot for help !

hrstuks
DENMARK
2009-08-28 14:50:17
Permalink Post
 

I've followed the steps and checked that there are no errors, but my site just stops working when copying the plugin to the plugins folder.

I get this error
Parse error: syntax error, unexpected T_STRING in plugin.myflv.php on line 7

  1. which is the line: $out = ($wrap == 'inline') ? "<div id="player-$no" class='flash-flv'></div>n" : "<p id="player-$no"></p>n";
papillonsouslalune
ITALY
2010-04-28 14:05:48
Permalink Post
 

est-ce que qu'un quelqu'un peut me le dire en français
comment installer une video sur le site ?
merci

pour le moment on a trouvé le moyem de copier le lin you toube
mais ce n'est pas très "pro"
merci
carine

lemathieu A
FRANCE
2010-04-28 15:29:05
Permalink Post
 

il faut uploader ta video quicktime via flash

cherche sur le forum "flash player" ou "JW Player"

marioguerson
ARGENTINA
2011-02-15 13:51:22
Permalink Post
 
  1. Hello, I tried this but it doesn't work...
  2. Here's my plugin:
  3. function myflv($filename, $width='400', $height='300', $prv_img='')
  4. {
  5. $prv_img = ($prv_img != '') ? $prv_img : '';
  6. $no = rand(1, 1000);    
  7. $out = ($wrap == 'inline') ? "<div id="player-$no" class='flash-flv'></div>n" : "<p id="player-$no"></p>n";
  8. $out .= "<script type="text/javascript">n";
  9. $out .= "var so = new SWFObject('www.maqe.com.ar/M/animation/animation.swf', 'mpl', '$width', '$height', '7');n";
  10. $out .= "so.addParam('allowfullscreen', 'true');n";
  11. $out .= "so.addParam('allowscriptaccess', 'always');n";
  12. $out .= "so.addVariable('displayheight', '$height');n";
  13. $out .= "so.addVariable('file', '" . BASEURL . "/files/$filename');n";
  14. $out .= "so.addVariable('height', '$height');n";
  15. $out .= "so.addVariable('image', '" . BASEURL . "/files/$prv_img');n";
  16. $out .= "so.addVariable('width', '$width');n";
  17. $out .= "so.write('player-$no');n";
  18. $out .= "</script>n";
  19. return $out;
  20. }

Wait! I can't paste the complete code. Why?

marioguerson
ARGENTINA
2011-02-15 13:53:36
Permalink Post
 

Oh... the code didnt show right inthe preview... well...

The only line I changed is line 9.

Should I change anything else?

  1. And in my text area I wrote:
  2. <plug:myflv 'www.maqe.com.ar/M/animation/MAQE REEL 2008.flv', '800', '600', 'preview_image.jpg' />
marioguerson
ARGENTINA
2011-02-15 13:54:10
Permalink Post
 

my page

marioguerson
ARGENTINA
2011-02-15 15:03:11
Permalink Post
 

At first the plugin was named plugin.etc...
and I was getting the code displayed at the top of the page.
Then, I changed the file's name to exhibit.etc...
And now the exhibit is empty!

geraldo
SPAIN
2011-07-04 13:42:58
Permalink Post
 

Just packed a simple plugin based on Vaska's code posted above. Download and follow the instructions to install plugin.

Showing 1 - 16 of 16 posts in Forum > Customize > Problem with editing and "&"
 

You need to be logged in to post.