Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Hide graphic if page is unsecure

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 01-26-2005, 07:12 AM
 
gfiebich gfiebich is offline
 

Senior Member
  
Join Date: Feb 2003
Location: St. Paul, MN
Posts: 108
 

Default 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
__________________
NO LONGER USING X-CART - NOT ACTIVE IN THESE FORUMS
Reply With Quote
  #2  
Old 01-26-2005, 07:16 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

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}
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #3  
Old 01-26-2005, 07:31 AM
 
gfiebich gfiebich is offline
 

Senior Member
  
Join Date: Feb 2003
Location: St. Paul, MN
Posts: 108
 

Default

Wow - that was a fast response! Works perfectly!
-Glen
__________________
NO LONGER USING X-CART - NOT ACTIVE IN THESE FORUMS
Reply With Quote
  #4  
Old 01-26-2005, 07:35 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #5  
Old 08-23-2005, 02:21 PM
 
gravel gravel is offline
 

Senior Member
  
Join Date: Mar 2004
Posts: 156
 

Default

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?
__________________
X-Cart version 4.0.17
X-Cart version 4.0.18
Web servers = Apache
OS = Linux
Reply With Quote
  #6  
Old 10-24-2005, 06:24 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

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}
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #7  
Old 07-06-2006, 06:23 AM
 
mmonger mmonger is offline
 

Member
  
Join Date: May 2004
Location: CA
Posts: 28
 

Default

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}
__________________
X-Cart Pro v3.5.12 (FreeBSD), Apache 1.3.31, X-Conf, X-AOM, X-FancyCat, Rec. Viewed, MM Pro, Stock Not., News Module, Recently Viewed, Banner/Ad, PHP 4.3.9, MySQL server 3.23.54, Perl 5.00503
Reply With Quote
  #8  
Old 07-06-2006, 06:28 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

yeh
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #9  
Old 07-06-2006, 06:37 AM
 
mmonger mmonger is offline
 

Member
  
Join Date: May 2004
Location: CA
Posts: 28
 

Default

Excellent. Thank you very much for the quick reply!
__________________
X-Cart Pro v3.5.12 (FreeBSD), Apache 1.3.31, X-Conf, X-AOM, X-FancyCat, Rec. Viewed, MM Pro, Stock Not., News Module, Recently Viewed, Banner/Ad, PHP 4.3.9, MySQL server 3.23.54, Perl 5.00503
Reply With Quote
  #10  
Old 09-11-2006, 08:20 AM
 
TTS Telecom TTS Telecom is offline
 

Member
  
Join Date: Dec 2003
Location: SW, UK
Posts: 17
 

Default 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
__________________
X-cart: 4.0.17
PHP: 4.3.11
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:03 AM.

   

 
X-Cart forums © 2001-2020