X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Hide graphic if page is unsecure (https://forum.x-cart.com/showthread.php?t=11727)

gfiebich 01-26-2005 07:12 AM

Hide graphic if page is unsecure
 
I want to hide a Thawte SSL badge when looking at a HTTP page and show the badge when looking at HTTPS pages.

This would be something like:

Code:

{if $secure}
<script src="https://siteseal.thawte.com/cgi/server/thawte_seal_generator.exe">
{/if}


So far, I haven't found a Smarty tag to use as the trigger. Any help would be much appreciated!
-Glen

shan 01-26-2005 07:16 AM

heres how i did it

Code:

{if $smarty.server.HTTPS eq "on"}
<center>
{literal}

<!--
TrustLogo Html Builder Code:
Shows the logo at URL http://ukdvdr.co.uk/trustssltrustlogo.gif
Logo type is Secure Site Seal - For SSL Certificate holders ("WWARE")
Not Floating
//-->
<script type="text/javascript">TrustLogo("https://ukdvdr.co.uk/trustssltrustlogo.gif", "WWARE", "none");</script>

{/literal}
</center>

{/if}


gfiebich 01-26-2005 07:31 AM

Wow - that was a fast response! Works perfectly!
-Glen

shan 01-26-2005 07:35 AM

:wink:

gravel 08-23-2005 02:21 PM

Really excellent, Shan. Thanks. I used the following code:

Code:

{if $smarty.server.HTTPS eq "on"}
<p align="center">
{literal}
<script src="https://siteseal.thawte.com/cgi/server/thawte_seal_generator.exe">
</script>
{/literal}
</p>
{/if}


A further question: Thawte will let me load a SecondTier Seal image on the other pages. (We could also have it hyperlinked to our "secure pages" but since they only happen when someone logs in, I don't think that is possible.) Is it possible to modify your code so that if it isn't https, it will load an image in the same spot?

shan 10-24-2005 06:24 AM

Quote:

Originally Posted by gravel
Really excellent, Shan. Thanks. I used the following code:

Code:

{if $smarty.server.HTTPS eq "on"}
<p align="center">
{literal}
<script src="https://siteseal.thawte.com/cgi/server/thawte_seal_generator.exe">
</script>
{/literal}
</p>
{/if}


A further question: Thawte will let me load a SecondTier Seal image on the other pages. (We could also have it hyperlinked to our "secure pages" but since they only happen when someone logs in, I don't think that is possible.) Is it possible to modify your code so that if it isn't https, it will load an image in the same spot?


just do this

Code:

{if $smarty.server.HTTPS eq "on"}

add https image here
 
{else}

Add http image here

{/if}


or just use

Code:

{if $smarty.server.HTTPS ne "on"}

add http image here
{/if}


mmonger 07-06-2006 06:23 AM

We have the opposite problem. We want to run a small chunk of code only under HTTP. Could we change the "on" variable in the first line to "off" and that would resolve my problem?

What we're having problems with is HTML banners that are being called by a PHP script. In any HTTPS areas of the site we get that annoying pop-up.

Quote:

{if $smarty.server.HTTPS eq "on"}
<center>
{literal}

<!--

PHP script code goes here...

//-->
<script type="text/javascript">TrustLogo("https://ukdvdr.co.uk/trustssltrustlogo.gif", "WWARE", "none");</script>

{/literal}
</center>

{/if}

shan 07-06-2006 06:28 AM

yeh

mmonger 07-06-2006 06:37 AM

Excellent. Thank you very much for the quick reply!

TTS Telecom 09-11-2006 08:20 AM

Re: Hide graphic if page is unsecure
 
Great tip, we use this to display invocation code from adsense on non secure pages (which obviously needs to be stopped on https delivery),and to display info about secure pages when secure.



Cheers


All times are GMT -8. The time now is 04:34 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.