|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
zdig1 Smarty Rookie
Joined: 23 Sep 2013 Posts: 30
|
Posted: Sat Oct 19, 2013 7:19 pm Post subject: |
|
|
thanks admin for all your help
i will try to change jwplayer code |
|
Back to top |
|
zdig1 Smarty Rookie
Joined: 23 Sep 2013 Posts: 30
|
Posted: Sat Oct 26, 2013 12:31 pm Post subject: |
|
|
hello i did what you mention
all jwplayer variable on only one line so all /n was removed
but still got slash '/' with cpature
so any idea for how to remove them ??
Code: | <script> {capture assign="player"}{include file="player.tpl" page="detail"}{/capture} var player3 = '{$player|escape:javascript|escape:????}'; </script> |
Code: | <script>
var player3 = ' <div id=\"Playerholder\"> You need to have the <a href=\"http://www.macromedia.com/go/getflashplayer\">Flash Player<\/a> installed and a browser with JavaScript support. <\/div> <script type=\"text/javascript\"> var flashvars = { file: \'http://www.youtube.com/watch?v=gENJhPtg4FE\', enablejs: \'true\', backcolor: \'5e5e5e\', frontcolor: \'545454\', screencolor: \'000000\', repeat: \'false\', autostart: \'false\', logo: \'http://zdig1.biz/video/uploads/videos/01.jpg\', linktarget: \'_blank\', link: \'http://zdig1.biz\', image: \'http://i1.ytimg.com/vi/gENJhPtg4FE/mqdefault.jpg\', bufferlength: \'5\', controlbar: \'bottom\', \'shownavigation\':\'true\', \'skin\': \'http://zdig1.biz/video/skins/modieus.zip\', \'plugins\': \'http://zdig1.biz/video/drelated.swf,timeslidertooltipplugin-2,sharing-3\', \'sharing.link\': \'http://zdig1.biz/video/%d8%a8%d8%b1%d9%86%d8%a7%d9%85%d8%ac-%d9%85%d9%84%d9%81-%d8%a7%d9%84%d8%b3%d8%a7%d8%b9%d8%a9-25-10-13-video_653428b88.html\', \'sharing.code\': encodeURIComponent(\'<iframe width=\"545\" height=\"445\" src=\"http://zdig1.biz/video/embed/653428b88\" frameborder=\"0\" allowfullscreen seamless><\/iframe>\'), \'drelated.dxmlpath\': \'http://zdig1.biz/video/relatedclips.php?vid=653428b88\', \'drelated.dposition\': \'center\', \'drelated.dskin\': \'http://zdig1.biz/video/skins/grayskin2.swf\', \'drelated.dtarget\': \'_self\', plugins: \'ltas\', \'ltas.cc\': \'vmqfnalsacrslqz\' }; var params = { wmode: \'transparent\', allowfullscreen: \'true\', allowscriptaccess: \'always\', allownetworking: \'all\' }; var attributes = { name: \'653428b88\', id: \'653428b88\' }; swfobject.embedSWF(\'http://zdig1.biz/video/jwplayer.swf\', \'Playerholder\', \'640\', \'450\', \'9.0.115\', false, flashvars, params, attributes); <\/script> \n\n'; </script> |
|
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Sat Oct 26, 2013 5:25 pm Post subject: |
|
|
You need to at least escape quotes inside quotes yes? try escape:quotes and see what you get? |
|
Back to top |
|
zdig1 Smarty Rookie
Joined: 23 Sep 2013 Posts: 30
|
Posted: Sun Oct 27, 2013 11:02 pm Post subject: |
|
|
nothing change withe the escape:qoutes
but i notice that some code with '/n' and '/' work normal for example this one ( with the escape quotes)
Code: | <script type="text/javascript" >
var player3 = ' <div id=\"Playerholder\">\n <noscript>\n You need to have the <a href=\"http://www.macromedia.com/go/getflashplayer\">Flash Player<\/a> installed and\n a browser with JavaScript support.\n <\/noscript>\n <object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0\" width=\"640\" height=\"450\"> <param name=\"movie\" value=\"http://www.youtube.com/v/tmH3e2j_l64?hl=en_US&fs=1&hd=0&rel=0&autoplay=0&color2=0x5e5e5e&showsearch=0&showinfo=0&iv_load_policy=3\"> <\/param><param name=\"allowFullScreen\" value=\"true\"> <\/param><param name=\"allowscriptaccess\" value=\"never\"> <\/param><param name=\"allowNetworking\" value=\"internal\"> <\/param><param name=\"wmode\" value=\"opaque\"> <\/param> <embed src=\"http://www.youtube.com/v/tmH3e2j_l64?hl=en_US&fs=1&hd=0&rel=0&autoplay=0&color2=0x5e5e5e&showsearch=0&showinfo=0&iv_load_policy=3\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"never\" allowNetworking=\"internal\" allowfullscreen=\"true\" wmode=\"opaque\" width=\"640\" height=\"450\"> <\/embed> <\/object>\n <\/div>\n \n\n\n\n';
</script> |
but other don't work and need to be clean like this
Code: | <script type="text/javascript" >
var player3 = ' <div id=\"Playerholder\">\n You need to have the <a href=\"http://www.macromedia.com/go/getflashplayer\">Flash Player<\/a> installed and\n a browser with JavaScript support.\n <\/div>\n \n <script type=\"text/javascript\" src=\"http://zdig1.biz/video/jwplayer.js\"><\/script>\n <script type=\"text/javascript\">jwplayer.key=\"6Lb3WiGdgHHV+IAkQopT1sJds15P9RE8gQxBhQ==\";<\/script>\n <script type=\"text/javascript\">\n var flashvars = {\n \n \n file: \'http://www.youtube.com/watch?v=tmH3e2j_l64\',\n \n \n primary: \"flash\",\n width: \"100%\",\n height: \"450\",\n image: \'http://i1.ytimg.com/vi/tmH3e2j_l64/mqdefault.jpg\',\n logo: {\n file: \'http://zdig1.biz/video/uploads/videos/01.jpg\',\n link: \'http://zdig1.biz\',\n },\n autostart: \'false\', \n };\n \n jwplayer(\"Playerholder\").setup(flashvars);\n <\/script>\n \n\n \n\n\n\n';
</script> |
|
|
Back to top |
|
zdig1 Smarty Rookie
Joined: 23 Sep 2013 Posts: 30
|
Posted: Sun Oct 27, 2013 11:16 pm Post subject: |
|
|
Code: | i get something
$embed_code = str_replace( array("\n", "\r", "\t"), "", $embed_code); |
i found this line on my fuction.php
Code: | $embed_code .= '<div id="Playerholder"></div>';
$embed_code .= '<script type="text/javascript" src="'. _URL .'/jwplayer.js"></script>';
$embed_code .= '<script type="text/javascript">jwplayer.key="'.$config["jwplayerkey"].'";</script>';
$embed_code .= '<script type="text/javascript">';
$embed_code .= "
var flashvars = {
file : '". $jw_file ."',
primary: 'flash',
width: '". _PLAYER_W_EMBED ."',
height: '". _PLAYER_H_EMBED ."',
image: '". $video['preview_image'] ."',
logo: {file: '". _WATERMARKURL ."',link: '". _WATERMARKLINK ."'}
};
jwplayer('Playerholder').setup(flashvars);
</script>";
$embed_code = str_replace( array("\n", "\r", "\t"), "", $embed_code); |
but when i remove this line nothing change :- |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon Oct 28, 2013 1:21 am Post subject: |
|
|
in player.tpl, completely remove all newlines, tabs and extra spaces. see if that helps. Also you only want to run your text through escape modifier once, ie. not double escaped. |
|
Back to top |
|
zdig1 Smarty Rookie
Joined: 23 Sep 2013 Posts: 30
|
Posted: Wed Oct 30, 2013 7:54 pm Post subject: |
|
|
player.tpl -> done
Code: | <script type="text/javascript" >
{capture assign="player"}{include file="player.tpl" page="detail"}{/capture}
var player2 = '{$player|escape:javascript}';
var player3 = '{$player|escape:quotes}';
</script> |
of corse script not working ( player 3 must have the escpae javascript)
i got
Code: | <script type="text/javascript" >
var player2 = ' \n <div id=\"Playerholder\">\n You need to have the <a href=\"http://www.macromedia.com/go/getflashplayer\">Flash Player<\/a> installed and\n a browser with JavaScript support.\n <\/div>\n \n <script type=\"text/javascript\"> \n var flashvars = {\n \n \n file: \'http://www.youtube.com/watch?v=Msv0W7cSt7g\',\n \n \n enablejs: \'true\',backcolor: \'5e5e5e\',frontcolor: \'545454\',screencolor: \'000000\',repeat: \'false\',\n autostart: \'false\',logo: \'http://zdig1.biz/video/uploads/videos/01.jpg\',linktarget: \'_blank\',\n link: \'http://zdig1.biz\',image: \'http://i1.ytimg.com/vi/Msv0W7cSt7g/mqdefault.jpg\',bufferlength: \'5\',controlbar: \'bottom\',\'shownavigation\':\'true\',\'skin\': \'http://zdig1.biz/video/skins/modieus.zip\',\n \'plugins\': \'http://zdig1.biz/video/drelated.swf,timeslidertooltipplugin-2,sharing-3\',\n \'sharing.link\': \'http://zdig1.biz/video/%d9%85%d9%88%d8%b3%d9%85-%d8%a7%d9%84%d8%b1%d8%ac%d8%a7%d9%84-video_f9ddeb51a.html\',\n \'sharing.code\': encodeURIComponent(\'<iframe width=\"545\" height=\"445\" src=\"http://zdig1.biz/video/embed/f9ddeb51a\" frameborder=\"0\" allowfullscreen seamless><\/iframe>\'),\n \'drelated.dxmlpath\': \'http://zdig1.biz/video/relatedclips.php?vid=f9ddeb51a\',\n \'drelated.dposition\': \'center\', // center, bottom, top\n \'drelated.dskin\': \'http://zdig1.biz/video/skins/grayskin2.swf\',\'drelated.dtarget\': \'_self\',plugins: \'ltas\',\'ltas.cc\': \'vmqfnalsacrslqz\'};var params = {wmode: \'transparent\', allowfullscreen: \'true\',allowscriptaccess: \'always\',allownetworking: \'all\'};var attributes = {name: \'f9ddeb51a\',id: \'f9ddeb51a\'}; \n \n \n \n swfobject.embedSWF(\'http://zdig1.biz/video/jwplayer.swf\', \'Playerholder\', \'640\', \'450\', \'9.0.115\', false, flashvars, params, attributes);\n <\/script> \n \n \n\n\n\n';
var player3 = '
<div id="Playerholder">
You need to have the <a href="http://www.macromedia.com/go/getflashplayer">Flash Player</a> installed and
a browser with JavaScript support.
</div>
<script type="text/javascript">
var flashvars = {
file: \'http://www.youtube.com/watch?v=Msv0W7cSt7g\',
enablejs: \'true\',backcolor: \'5e5e5e\',frontcolor: \'545454\',screencolor: \'000000\',repeat: \'false\',
autostart: \'false\',logo: \'http://zdig1.biz/video/uploads/videos/01.jpg\',linktarget: \'_blank\',
link: \'http://zdig1.biz\',image: \'http://i1.ytimg.com/vi/Msv0W7cSt7g/mqdefault.jpg\',bufferlength: \'5\',controlbar: \'bottom\',\'shownavigation\':\'true\',\'skin\': \'http://zdig1.biz/video/skins/modieus.zip\',
\'plugins\': \'http://zdig1.biz/video/drelated.swf,timeslidertooltipplugin-2,sharing-3\',
\'sharing.link\': \'http://zdig1.biz/video/%d9%85%d9%88%d8%b3%d9%85-%d8%a7%d9%84%d8%b1%d8%ac%d8%a7%d9%84-video_f9ddeb51a.html\',
\'sharing.code\': encodeURIComponent(\'<iframe width="545" height="445" src="http://zdig1.biz/video/embed/f9ddeb51a" frameborder="0" allowfullscreen seamless></iframe>\'),
\'drelated.dxmlpath\': \'http://zdig1.biz/video/relatedclips.php?vid=f9ddeb51a\',
\'drelated.dposition\': \'center\', // center, bottom, top
\'drelated.dskin\': \'http://zdig1.biz/video/skins/grayskin2.swf\',\'drelated.dtarget\': \'_self\',plugins: \'ltas\',\'ltas.cc\': \'vmqfnalsacrslqz\'};var params = {wmode: \'transparent\', allowfullscreen: \'true\',allowscriptaccess: \'always\',allownetworking: \'all\'};var attributes = {name: \'f9ddeb51a\',id: \'f9ddeb51a\'};
swfobject.embedSWF(\'http://zdig1.biz/video/jwplayer.swf\', \'Playerholder\', \'640\', \'450\', \'9.0.115\', false, flashvars, params, attributes);
</script>
';
</script> |
i feel we are so close to the solution but still not seeing it :'( |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Thu Oct 31, 2013 2:41 pm Post subject: |
|
|
what happens if you do:
{$player|strip|escape:javascript} |
|
Back to top |
|
zdig1 Smarty Rookie
Joined: 23 Sep 2013 Posts: 30
|
Posted: Fri Nov 01, 2013 1:32 am Post subject: |
|
|
i get
Code: | <script type="text/javascript">
var player3 = ' <div id=\"Playerholder\"> You need to have the <a href=\"http://www.macromedia.com/go/getflashplayer\">Flash Player<\/a> installed and a browser with JavaScript support. <\/div> <script type=\"text/javascript\"> var flashvars = { file: \'http://www.youtube.com/watch?v=X0ioRgM8oyA\', enablejs: \'true\', backcolor: \'5e5e5e\', frontcolor: \'545454\', screencolor: \'000000\', repeat: \'false\', autostart: \'false\', logo: \'http://zdig1.biz/video/uploads/videos/01.jpg\', linktarget: \'_blank\', link: \'http://zdig1.biz\', image: \'http://i1.ytimg.com/vi/X0ioRgM8oyA/mqdefault.jpg\', bufferlength: \'5\', controlbar: \'bottom\', \'shownavigation\':\'true\', \'skin\': \'http://zdig1.biz/video/skins/modieus.zip\', \'plugins\': \'http://zdig1.biz/video/drelated.swf,timeslidertooltipplugin-2,sharing-3\', \'sharing.link\': \'http://zdig1.biz/video/%d9%88%d9%82%d9%80%d9%80%d8%aa-%d8%a5%d8%b6%d8%a7%d9%81%d9%8a-30-10-13-video_7aa5f0af3.html\', \'sharing.code\': encodeURIComponent(\'<iframe width=\"545\" height=\"445\" src=\"http://zdig1.biz/video/embed/7aa5f0af3\" frameborder=\"0\" allowfullscreen seamless><\/iframe>\'), \'drelated.dxmlpath\': \'http://zdig1.biz/video/relatedclips.php?vid=7aa5f0af3\', \'drelated.dposition\': \'center\', // center, bottom, top \'drelated.dskin\': \'http://zdig1.biz/video/skins/grayskin2.swf\', //link to the skin \'drelated.dtarget\': \'_self\', // where to open the related videos when clicked on plugins: \'ltas\', \'ltas.cc\': \'vmqfnalsacrslqz\' }; var params = { wmode: \'transparent\', allowfullscreen: \'true\', allowscriptaccess: \'always\', allownetworking: \'all\' }; var attributes = { name: \'7aa5f0af3\', id: \'7aa5f0af3\' }; swfobject.embedSWF(\'http://zdig1.biz/video/jwplayer.swf\', \'Playerholder\', \'640\', \'450\', \'9.0.115\', false, flashvars, params, attributes); <\/script> ';
</script> |
you can see the code source (http://zdig1.biz/video/watch.php?vid=7aa5f0af3)
i added again the old code (for many week ppl dont be able to see some video) {include file="player.tpl" page="detail"}
line 493 (using player 3) -> nothing dispaly
i think we have to use other thing than methode
it work for some cimple code but for complexe code like jwplayer with variable it is not practice
what do you think bro |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Nov 01, 2013 1:05 pm Post subject: |
|
|
I don't know... what is the reason that the player does not work? Do you have javascript errors in the console? Does the inspector not show what you expect to see?
Smarty is just displaying what it is programmed to display, and escaping what it is programmed to escape. You need to figure out exactly what the problem is syntax wise, then proceed how to fix it. |
|
Back to top |
|
zdig1 Smarty Rookie
Joined: 23 Sep 2013 Posts: 30
|
Posted: Fri Nov 01, 2013 2:00 pm Post subject: |
|
|
do you have any other idea Sir ??
by the way did you remember when we have
Code: |
var player3 = "{include file="player.tpl" page="detail"}"; |
the code repalcement was correct ( without /n ///// )
but script not working
now with capture code not 100% clean but he work only for some emebed code but not for jwpaler (hosted file, radio stream and youtube all using jwplayer etc ...)
i become crazy ((( i passed 2 week to do the script auto-sharing
but more than month and still not fixing the smarty variable |
|
Back to top |
|
zdig1 Smarty Rookie
Joined: 23 Sep 2013 Posts: 30
|
Posted: Fri Nov 01, 2013 2:07 pm Post subject: |
|
|
On http://zdig1.biz/video/watch.php?vid=18f0da067
the
Quote: | {include file="player.tpl" page="detail"} |
working give :
Code: |
<div id="Playerholder">
You need to have the <a href="http://www.macromedia.com/go/getflashplayer">Flash Player</a> installed and
a browser with JavaScript support.
</div>
<script type="text/javascript">
var flashvars = {
file: 'http://www.youtube.com/watch?v=VbP0Ycm7T2Q',
enablejs: 'true',
backcolor: '5e5e5e',
frontcolor: '545454',
screencolor: '000000',
repeat: 'false',
autostart: 'false',
logo: 'http://zdig1.biz/video/uploads/videos/01.jpg',
linktarget: '_blank',
link: 'http://zdig1.biz',
image: 'http://i.ytimg.com/vi/VbP0Ycm7T2Q/0.jpg',
bufferlength: '5',
controlbar: 'bottom',
'shownavigation':'true',
'skin': 'http://zdig1.biz/video/skins/modieus.zip',
'plugins': 'http://zdig1.biz/video/drelated.swf,timeslidertooltipplugin-2,sharing-3',
'sharing.link': 'http://zdig1.biz/video/documentaire-super-size-me-video_18f0da067.html',
'sharing.code': encodeURIComponent('<iframe width="545" height="445" src="http://zdig1.biz/video/embed/18f0da067" frameborder="0" allowfullscreen seamless></iframe>'),
'drelated.dxmlpath': 'http://zdig1.biz/video/relatedclips.php?vid=18f0da067',
'drelated.dposition': 'center', // center, bottom, top
'drelated.dskin': 'http://zdig1.biz/video/skins/grayskin2.swf', //link to the skin
'drelated.dtarget': '_self', // where to open the related videos when clicked on
plugins: 'ltas',
'ltas.cc': 'vmqfnalsacrslqz'
};
var params = {
wmode: 'transparent',
allowfullscreen: 'true',
allowscriptaccess: 'always',
allownetworking: 'all'
};
var attributes = {
name: '18f0da067',
id: '18f0da067'
};
swfobject.embedSWF('http://zdig1.biz/video/jwplayer.swf', 'Playerholder', '640', '450', '9.0.115', false, flashvars, params, attributes);
</script> |
but the
Code: |
<script>
{capture assign="player"}{include file="player.tpl" page="detail"}{/capture}
var player3 = '{$player|strip|escape:javascript}';
</script> |
give this not working code even we delte all table all new line !!
(by the way the strip is better than removing all new line )
Code: | <script type="text/javascript">
var player3 = ' <div id=\"Playerholder\"> You need to have the <a href=\"http://www.macromedia.com/go/getflashplayer\">Flash Player<\/a> installed and a browser with JavaScript support. <\/div> <script type=\"text/javascript\"> var flashvars = { file: \'http://www.youtube.com/watch?v=VbP0Ycm7T2Q\', enablejs: \'true\', backcolor: \'5e5e5e\', frontcolor: \'545454\', screencolor: \'000000\', repeat: \'false\', autostart: \'false\', logo: \'http://zdig1.biz/video/uploads/videos/01.jpg\', linktarget: \'_blank\', link: \'http://zdig1.biz\', image: \'http://i.ytimg.com/vi/VbP0Ycm7T2Q/0.jpg\', bufferlength: \'5\', controlbar: \'bottom\', \'shownavigation\':\'true\', \'skin\': \'http://zdig1.biz/video/skins/modieus.zip\', \'plugins\': \'http://zdig1.biz/video/drelated.swf,timeslidertooltipplugin-2,sharing-3\', \'sharing.link\': \'http://zdig1.biz/video/documentaire-super-size-me-video_18f0da067.html\', \'sharing.code\': encodeURIComponent(\'<iframe width=\"545\" height=\"445\" src=\"http://zdig1.biz/video/embed/18f0da067\" frameborder=\"0\" allowfullscreen seamless><\/iframe>\'), \'drelated.dxmlpath\': \'http://zdig1.biz/video/relatedclips.php?vid=18f0da067\', \'drelated.dposition\': \'center\', // center, bottom, top \'drelated.dskin\': \'http://zdig1.biz/video/skins/grayskin2.swf\', //link to the skin \'drelated.dtarget\': \'_self\', // where to open the related videos when clicked on plugins: \'ltas\', \'ltas.cc\': \'vmqfnalsacrslqz\' }; var params = { wmode: \'transparent\', allowfullscreen: \'true\', allowscriptaccess: \'always\', allownetworking: \'all\' }; var attributes = { name: \'18f0da067\', id: \'18f0da067\' }; swfobject.embedSWF(\'http://zdig1.biz/video/jwplayer.swf\', \'Playerholder\', \'640\', \'450\', \'9.0.115\', false, flashvars, params, attributes); <\/script> ';
</script> |
|
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Nov 01, 2013 3:00 pm Post subject: |
|
|
do you get any javascript errors in the console? |
|
Back to top |
|
zdig1 Smarty Rookie
Joined: 23 Sep 2013 Posts: 30
|
Posted: Fri Nov 01, 2013 5:42 pm Post subject: |
|
|
of corse no |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Nov 01, 2013 5:55 pm Post subject: |
|
|
that link gives me a parse error |
|
Back to top |
|
|
|
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
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|