Jump to content

Smarty Problem in 6.3.1


Desperadouz

Recommended Posts

Hello Guys,

 

I Have Smarty problem in WHMCS 6.3.1

 

My Module Use php tags {php} in .TPL Files, So i used SmartyBC Insted of Smarty,

 

But Now I Get This Error :

 

Fatal error: Using $this when not in object context in D:\xampp\htdocs\whmcs\vendor\smarty\smarty\libs\SmartyBC.class.php(464) : eval()'d code on line 1

 

My Code :

 

<div id="tabs">
   <ul>
       <li class="tab tabselected" id="tab0"><a href="javascript:;">{php}echo sprintf($this->_tpl_vars['_lang']['discount_tab_title'],$this->_tpl_vars['_lang']['hostingaccount']);{/php}</a></li>
       <li class="tab" id="tab1"><a href="javascript:;">{php}echo sprintf($this->_tpl_vars['_lang']['discount_tab_title'],$this->_tpl_vars['_lang']['reselleraccount']);{/php}</a></li>
       <li class="tab" id="tab2"><a href="javascript:;">{php}echo sprintf($this->_tpl_vars['_lang']['discount_tab_title'],$this->_tpl_vars['_lang']['server']);{/php}</a></li>
       <li class="tab" id="tab3"><a href="javascript:;">{php}echo sprintf($this->_tpl_vars['_lang']['discount_tab_title'],$this->_tpl_vars['_lang']['domains']);{/php}</a></li>
   </ul>
</div>

 

And :

 

                    {php}
                   for($this->_tpl_vars['page']=1;$this->_tpl_vars['page']<=$this->_tpl_vars['totalpages'];$this->_tpl_vars['page']++){
                       {/php}<option value="{$page}"{if $page==$pagenumber} selected="selected"{/if}>{$page}</option>{php}
                   }
                   {/php}

 

Can You Help Me To Fix Problem ? :|

 

Like This Topic : https://forum.whmcs.com/showthread.php?104675-whmcs-v6-0-1-template-php-problem

Link to comment
Share on other sites

Fatal error: Using $this when not in object context in D:\xampp\htdocs\whmcs\vendor\smarty\smarty\libs\SmartyBC.class.php(464) : eval()'d code on line 1

 

Can You Help Me To Fix Problem ? :|

Don't use Windows. Problem solved

I'm not sure if that'll solve all of your problems, but that's one huge issue. WHMCS no longer supports Windows servers, hasn't for a year or so now.

Aside from that, since you're using smartybc, you will likely have to consult with their support. Using {php} tags in smarty is pretty taboo, however, it has been for years. You need to find a way to incorporate action hooks, instead of direct php calls.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated