Desperadouz Posted October 2, 2016 Share Posted October 2, 2016 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 0 Quote Link to comment Share on other sites More sharing options...
twhiting9275 Posted October 3, 2016 Share Posted October 3, 2016 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. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.