Peter M Dodge Posted May 20, 2012 Share Posted May 20, 2012 Basically, I'm doing this now using a PHP hack, and I'm wondering if there's a way I can do it "better" with Smarty. For secure status right now I have: {php} $https = isset($_SERVER['HTTPS']); if ($https) { {/php} <secure code> {php} } else { {/php} <insecure code> {php} } {/php} Is there a better way to do that? Likewise, is there a way to capture the current base domain without a similar PHP hack, in Smarty? I have .ca and .net names for my site and I basically want to output a base tag with the proper TLD. I tried poking around in the documentation but it's .. pretty thin unforuntately. 0 Quote Link to comment Share on other sites More sharing options...
k1ng440 Posted May 20, 2012 Share Posted May 20, 2012 you can do this with a hook "ClientAreaPage" http://docs.whmcs.com/Hooks:System 0 Quote Link to comment Share on other sites More sharing options...
disgruntled Posted May 20, 2012 Share Posted May 20, 2012 or you can just set whmcs to serve only secure pages and stop the need to check at the source. also its bad practice to use php in templates, the idea of a template lay out is to seperate the logic from the style. using hooks as suggested might be the best way if you really must perform this check 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted May 20, 2012 Share Posted May 20, 2012 {if $smarty.server.HTTPS} <!-- secure code here --> {else} <!-- non-secure code --> {/if} 0 Quote Link to comment Share on other sites More sharing options...
Peter M Dodge Posted May 20, 2012 Author Share Posted May 20, 2012 Thanks Frank, that looks like the best way to get it. Is there a way to get the domain serving the page without hooks? I experimented with it but the overhead was poor compared to just PHP code. 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.