<!--{if $login.regtime-$smarty.now >7200 }-->
                </div>
                <div class="search_cont_l">
                  <label  class="t">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
                  <button type="submit" id="btn_search_uid"><span>搜 索</span></button>
                </div>
             <!--{else}-->
    </div>
                <div class="search_cont_l">
                  <label  class="t">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
                  <button type="submit"  onClick="{if(confirm('确定要删除吗?一旦删除无法恢复。')){return true;} return false;}" id="btn_search_uid"><span>搜 索</span></button>
                </div>
                      <!--{/if}-->
上面这个判断语句运行报错:Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "E:\PHPnow-1.5.6\htdocs\tpl/templets/default/9izbdq_user_advsearch.tpl" on line 112 " &lt;!--{if $login.regtime-$smarty.now &gt;7200 }--&gt; " - Unexpected " }-->", expected one of: "|" , "}-->" , " " , "*" , "/" , "%" , "+" , "-" , ""&"" , ISIN , ISDIVBY , ISNOTDIVBY , ISEVEN , ISNOTEVEN , ISEVENBY , ISNOTEVENBY , ISODD , ISNOTODD , ISODDBY , ISNOTODDBY , "==" , "!=" , "(>,gt)" , "(<,lt)" , "(>=,ge)" , "(<=,le)" , "===" , "!==" , "(%,mod)" , "(&&,and)" , "(||,or)" , "xor"' in E:\PHPnow-1.5.6\htdocs\source\core\smarty\sysplugins\smarty_internal_templatecompilerbase.php:423 Stack trace: #0 E:\PHPnow-1.5.6\htdocs\source\core\smarty\sysplugins\smarty_internal_templateparser.php(2802): Smarty_Internal_TemplateCompilerBase->trigger_template_error() #1 E:\PHPnow-1.5.6\htdocs\source\core\smarty\sysplugins\smarty_internal_templateparser.php(2867): Smarty_Internal_Templateparser->yy_syntax_error(10, ' }-->') #2 E:\PHPnow-1.5.6\htdoc in E:\PHPnow-1.5.6\htdocs\source\core\smarty\sysplugins\smarty_internal_templatecompilerbase.php on line 423
求解错误原因在哪?

解决方案 »

  1.   

    <!--{if $login.regtime-$smarty.now >7200 }-->
    有问题!
    请用记事本打开 E:\PHPnow-1.5.6\htdocs\tpl/templets/default/9izbdq_user_advsearch.tpl 观察这个地方书写的是否正确
      

  2.   

     E:\PHPnow-1.5.6\htdocs\tpl/templets/default/9izbdq_user_advsearch.tpl记事本打开原文件如下:<!--{if $login.regtime-$smarty.now >7200 }-->
    <form method="post" action="<!--{$appfile}-->?c=user&a=list" id="search_high_level">
    <input type='hidden' id="s_searchtype" name="s_searchtype" value="adv" />
                    <div class="search_cont_l">
                      <label class="t">会员ID:</label>
      <input type="text" name="s_uid" id="s_uid" style="height:22px; padding:3px 5px;border:1px solid; border-color:#adadad #e0e0e0 #e0e0e0 #adadad;width:150px;margin-right:10px; background:#fcfcfc;vertical-align:middle;" /> (输入会员ID)
      
                    </div>
                    <div class="search_cont_l">
                      <label  class="t">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
                      <button type="submit" id="btn_search_uid"><span>搜 索</span></button>
                    </div>
                
    </form>
                    <!--{else}-->
    <form method="post" action="<!--{$appfile}-->?c=user&a=list" id="search_high_level">
    <input type='hidden' id="s_searchtype" name="s_searchtype" value="adv" />
                    <div class="search_cont_l">
                      <label class="t">会员ID:</label>
      <input type="text" name="s_uid" id="s_uid" style="height:22px; padding:3px 5px;border:1px solid; border-color:#adadad #e0e0e0 #e0e0e0 #adadad;width:150px;margin-right:10px; background:#fcfcfc;vertical-align:middle;" /> (输入会员ID)
      
                    </div>
        </div>
                    <div class="search_cont_l">
                      <label  class="t">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
                      <button type="submit"  onClick="{if(confirm('确定要删除吗?一旦删除无法恢复。')){return true;} return false;}" id="btn_search_uid"><span>搜 索</span></button>
                    </div>
              </form>
                          <!--{/if}-->
    求解错误在哪? 
      

  3.   


    <!--{if $login.regtime-$smarty.now >7200 }-->
    改成
    <!--{if $login.regtime-$smarty.now > 7200 }-->

    <!--{if $login.regtime-$smarty.now qt 7200 }-->可能是 >7200 未分开的原因
      

  4.   

    还是不行,是否是$login.regtime和$smarty.now 这个时间变量不能调用?
      

  5.   

    这段代码的作用是注册会员需等待2小时才能使用搜索功能,上面这段代码不行,用其它方式怎样表达,求代码,是smarty模板
      

  6.   

    不清楚,你大一出来看看不就知道了?
    :<!--{$login.regtime}-->
    :<!--{$smarty.now}-->不过错误信息表述的是:条件表达式有问题