![]() |
if statement for excluding an item from https pages
I dislplay the shopping.com rating gif on my site, which is hard coded (http://www.shopping.com/etc.), but dynamically generated off of their site. In other words, we have 4 1/2 check marks now, but if we get a better rating, we'll have 5 for a worse rating and we'll have 4, and the .gif will update itself. The problem is, that it's throwing a secure/nonsecure warning on the registration pages. Disableing https for the registration page is not an option.
Does anybody know the if statement to use to exclude this image from secure pages? have tried: {if $smarty.server.HTTPS eq "on"} What I want to go on the secure page {else} What I want to go on all the rest {/if} No-go, unfortunately.:( TIA |
Re: if statement for excluding an item from https pages
Strange, I have that same code in my home.tpl file and it works fine. Do you have a link, also, what page are you trying to put the code on?
|
Re: if statement for excluding an item from https pages
Thanks for taking a look. The link is:
https://www.heirloomwoodentoys.com/register.php since I use ezcheckout, which breaks the cart out of home.tpl, I don't have this issue anywhere else. Yes, a small issue, but I consider any security error on my site to be a bad thing. All the stuff on the lower right - shopping.com rating, BBB, and Geotrust images are all called from a .tpl I made called trust.tpl, which is called in home.tpl. I was trying to make it so only the shopping.com was omitted from the https pages. trust.tpl: Code:
<p align="center"> |
Re: if statement for excluding an item from https pages
Just tried a slightly different tack:
Code:
Didn't work either. I do believe I'm going nuts. :lol: |
Re: if statement for excluding an item from https pages
Here's the code that should work:
Code:
{if $smarty.server.HTTPS ne "on"} If it doesn't work, which it sounds like it's not, try this: Open auth.php At the very end, but before ?> put: Code:
$smarty->assign("wcmServerport",$HTTP_SERVER_VARS['SERVER_PORT']); Then in your smarty template use: Code:
{if $wcmServerport eq "80"} |
Re: if statement for excluding an item from https pages
A million thanks Jon! Your solution to use the if statement works like a charm.
I'll restate it in case anybody wonders which solution I used. Put the following code in the template where the problem occurs. {if $smarty.server.HTTPS ne "on"} Here goes the script you want left out under https {/if} Don't forget the {/if} ! With this I was able to remove all the affiliate links, banners etc from showing on my secure pages (cart, checkout etc), causing the pop-up warning about secure and unsecure elements. My https pages now proudly show the golden lock up top of the new IE 7 browser and opens the https page without problems. Happy New Year! |
All times are GMT -8. The time now is 06:05 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.