test if SSL/https

Is there any way to write a smarty test script that will check if the page is secure or not and allow me to link to things differently if secure/non secure?



something like ??:

==========

if secure then

link image

else

link other image

end if

[quote name=‘RSW’]Is there any way to write a smarty test script that will check if the page is secure or not and allow me to link to things differently if secure/non secure?



something like ??:

==========

if secure then

link image

else

link other image

end if

==========[/quote]

Do you have a problem with your images on a https site?

I am using the swfobject.js hosted by google code, and want to change the path depending on the page state.

I could host my self, but this makes it easier to share the loading of the script between multiple sites that I run and share traffic between.

[quote name=‘RSW’]I am using the swfobject.js hosted by google code, and want to change the path depending on the page state.

I could host my self, but this makes it easier to share the loading of the script between multiple sites that I run and share traffic between.[/quote]

I guess you will have to exclude some flash things on your https pages or you must load the script from your installation folder.

another option for me would be to test if its the front page, since I am only using the script there. Unfortunately it needs to be in the head, and that template is used all over.

Has this issue been address yet?

I am trying to use the ADDthis social marketing button, and it causes a security warning if a secure page is loaded since it is loaded remotely via http.

Can't smarty determine if the page being loaded is HTTPS or http?

This is my biggest issue with templates in CS-cart.


if ($mode == 'view') {
yada yada yada
}
elseif ($mode == 'check_ssl') {
blah blah blah
}

solution!!



add this too your main.tpl



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

{assign var=“http_connection” value=“https”}

{else}

{assign var=“http_connection” value=“http”}

{/if}



then you can use these test on this or any included templates:





{if $http_connection != 'https'}

{/if}



{if $http_connection == 'https'}

{/if}



{if $http_connection != 'http'}

{/if}



{if $http_connection == 'http'}

{/if}



also if all you need to do is change the path on a href/src… you can use:

src=“{$http_connection}://www.website.com?param=var”