Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [JavaScript][XML][PHP]Problem z wyświetlaniem animacji używając Smarty
Forum PHP.pl > Forum > Przedszkole
Maker5
Witam
mój problem jest następujący. Na naszej stronie chciałem wrzucić animację cu3er, popularny slider obrazków.
Na stronie używamy silnika SMARTY i w nim pojawia się problem przy próbie odtworzenia animacji.

www.gokbabimost.pl (teraz usunąłem poniższe dwa warunki które tworzą problem)

Oto kod animacji
Kod
<script type="text/javascript">
        var flashvars = {};
        flashvars.xml = "Scripts/config_cu3er.xml";
        flashvars.font = "font.swf";
        var attributes = {};
        attributes.wmode = "transparent";
        attributes.id = "slider";
        swfobject.embedSWF("misc/cu3er.swf", "cu3er-container", "585", "356", "9", "misc/expressInstall.swf", flashvars, attributes);
</script>


a oto błąd który się pojawia

Fatal error: Smarty error: [in default_public/cu3er.php line 10]: syntax error: unrecognized tag: (Smarty_Compiler.class.php, line 446) in /home/srw_gokbabimost/gokbabimost.pl/lib/Smarty/Smarty.class.php on line 1092

jeśli usunę te dwa znaczniki

Kod
        var flashvars = {};
        var attributes = {};


to błędu nie ma ale wtedy nie działa animacja sad.gif a znów z tymi warunkami powyżej jest błąd jakby silnik SMARTY nie rozpoznawał takich warunków ?

oto część kodu SMARTY gdzie ma wpisane różne warunki, może tu jakoś trzeba byłoby dopisać te dwa co ?
Smarty_Compiler.class.php

Kod
class Smarty_Compiler extends Smarty {

    // internal vars
    /**#@+
     * @access private
     */
    var $_folded_blocks         =   array();    // keeps folded template blocks
    var $_current_file          =   null;       // the current template being compiled
    var $_current_line_no       =   1;          // line number for error messages
    var $_capture_stack         =   array();    // keeps track of nested capture buffers
    var $_plugin_info           =   array();    // keeps track of plugins to load
    var $_init_smarty_vars      =   false;
    var $_permitted_tokens      =   array('true','false','yes','no','on','off','null');
    var $_db_qstr_regexp        =   null;        // regexps are setup in the constructor
    var $_si_qstr_regexp        =   null;
    var $_qstr_regexp           =   null;
    var $_func_regexp           =   null;
    var $_reg_obj_regexp        =   null;
    var $_var_bracket_regexp    =   null;
    var $_num_const_regexp      =   null;
    var $_dvar_guts_regexp      =   null;
    var $_dvar_regexp           =   null;
    var $_cvar_regexp           =   null;
    var $_svar_regexp           =   null;
    var $_avar_regexp           =   null;
    var $_mod_regexp            =   null;
    var $_var_regexp            =   null;
    var $_parenth_param_regexp  =   null;
    var $_func_call_regexp      =   null;
    var $_obj_ext_regexp        =   null;
    var $_obj_start_regexp      =   null;
    var $_obj_params_regexp     =   null;
    var $_obj_call_regexp       =   null;
    var $_cacheable_state       =   0;
    var $_cache_attrs_count     =   0;
    var $_nocache_count         =   0;
    var $_cache_serial          =   null;
    var $_cache_include         =   null;

    var $_strip_depth           =   0;
    var $_additional_newline    =   "\n";

    /**#@-*/
    /**
     * The class constructor.
     */
    function Smarty_Compiler()
    {

proszę o pomoc
viking
Dawno nie korzystałem ze smarty ale jedno co się od razu rzuca w oczy to właśnie te klamry które są w nim wykorzystywane ze znaczeniem specjalnym.
http://www.smarty.net/docs/en/language.escaping.tpl
Maker5
Cytat(viking @ 21.12.2012, 07:30:07 ) *
Dawno nie korzystałem ze smarty ale jedno co się od razu rzuca w oczy to właśnie te klamry które są w nim wykorzystywane ze znaczeniem specjalnym.
http://www.smarty.net/docs/en/language.escaping.tpl


możesz rozwinąć swoją myśl tak abym rozwiązał ten problem ?
viking
Ale którą część? Masz dokładnie opisane w dokumentacji co zrobić, jak i ewentualnie jak alternatywnie zmienić zachowanie. Co jest niezrozumiałe?
d3ut3r
http://www.smarty.net/docs/en/language.function.literal.tpl

Nie zauważyłem, że odpowiedź już padła smile.gif w każdym razie {literal} rozwiąże problem
Maker5
Cytat(d3ut3r @ 22.12.2012, 10:09:58 ) *
http://www.smarty.net/docs/en/language.function.literal.tpl

Nie zauważyłem, że odpowiedź już padła smile.gif w każdym razie {literal} rozwiąże problem


a mógłbym prosić o przykład w tym konkretnym przypadku ?
nie jestem mega znawcą tego tematu dlatego proszę o wytłumaczenie jak przedszkolakowi sad.gif
d3ut3r
[JAVASCRIPT] pobierz, plaintext
  1. <script type="text/javascript">
  2. {literal}
  3. var flashvars = {};
  4. flashvars.xml = "Scripts/config_cu3er.xml";
  5. flashvars.font = "font.swf";
  6. var attributes = {};
  7. attributes.wmode = "transparent";
  8. attributes.id = "slider";
  9. swfobject.embedSWF("misc/cu3er.swf", "cu3er-container", "585", "356", "9", "misc/expressInstall.swf", flashvars, attributes);
  10. {/literal}
  11. </script>
[JAVASCRIPT] pobierz, plaintext
Maker5
Cytat(d3ut3r @ 22.12.2012, 10:59:42 ) *
[JAVASCRIPT] pobierz, plaintext
  1. <script type="text/javascript">
  2. {literal}
  3. var flashvars = {};
  4. flashvars.xml = "Scripts/config_cu3er.xml";
  5. flashvars.font = "font.swf";
  6. var attributes = {};
  7. attributes.wmode = "transparent";
  8. attributes.id = "slider";
  9. swfobject.embedSWF("misc/cu3er.swf", "cu3er-container", "585", "356", "9", "misc/expressInstall.swf", flashvars, attributes);
  10. {/literal}
  11. </script>
[JAVASCRIPT] pobierz, plaintext


niestety nie działa. nie ma już na szczęscie błędu ale nie pokazuje animacji sad.gif
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.