X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Securing images (https://forum.x-cart.com/showthread.php?t=33952)

OpheliaPayne 09-15-2007 05:20 PM

Securing images
 
Have a couple questions on how to do this.

1. I am pulling an image for my background via the css. What code do I put in it to make the background secure? Currently I have:

Code:

HTML,BODY {
    HEIGHT: 100%;
    MARGIN: 0px;
    PADDING: 0px;
    background: #FFEA7B url(http://www.mysite.net/store/skin1/background.jpg) repeat;
}


2. I'm trying to add an image to the txt_welcome area of the template. I place this code

Code:

                <IMG src="{$ImagesDir}/rewards_points.jpg" width="150" height="150" border="0">

It is showing up as a broken image. The image is there... double checked several times. How do I add an image to the txt_welcome area and make it secure?

3. Is there a way to make topsite images incorporated into the secure way of doing things? The code we have to use (an example) is as follows (we have this code in /main/prnotice.tpl):

Code:

<a href="http://www.site.com/topsites/"><img src="http://www.site.com/topsites/button.php?u=username" alt="Topsite" border="0" />

Is there any way we can alter this or will we need to remove the topsite code?

Thank you.

somekindahate 09-15-2007 05:29 PM

Re: Securing images
 
Quote:

Have a couple questions on how to do this.
1. I am pulling an image for my background via the css. What code do I put in it to make the background secure?


Don't put an absolute path in the url portion. Assuming the CSS file is located in the skin1 directory, you should use:

background: #FFEA7B url(background.jpg);


Quote:

2. I'm trying to add an image to the txt_welcome area of the template. I place this code

Code:

                <IMG src="{$ImagesDir}/rewards_points.jpg" width="150" height="150" border="0">

It is showing up as a broken image. The image is there... double checked several times. How do I add an image to the txt_welcome area and make it secure?


Language variables don't parse the Smarty syntax normally used in the tpl files. You need to double escape it and remove the dollar sign. Try replacing {$ImagesDir} with {{ImagesDir}}

ARW VISIONS 09-15-2007 05:36 PM

Re: Securing images
 
What is topsite?

OpheliaPayne 09-15-2007 05:42 PM

Re: Securing images
 
Quote:

Originally Posted by somekindahate
Don't put an absolute path in the url portion. Assuming the CSS file is located in the skin1 directory, you should use:

background: #FFEA7B url(background.jpg);


This still makes the background image unsecure.

css file = skin1 directory
background = skin1 directory

I also tried it in the skin1/images directory

Still listing as unsecure.

Quote:

Language variables don't parse the Smarty syntax normally used in the tpl files. You need to double escape it and remove the dollar sign. Try replacing {$ImagesDir} with {{ImagesDir}}

I changed it to this:

Code:

                <IMG src="{{ImagesDir}}/rewards_points.jpg" width="150" height="150" border="0">

Still not working.

OpheliaPayne 09-15-2007 05:43 PM

Re: Securing images
 
Quote:

Originally Posted by Ashley
What is topsite?


A Web page that contains a list of links to other Web sites. The order of the list is based on the number of clicks users make to each site. The more clicks, the higher up the list the link to the site moves. Webmasters use topsites as a way of attracting visitors and collecting per-click revenue. Typically written in PHP, although other languages are used, there are free topsite scripts available as well as commercial products.

somekindahate 09-15-2007 06:13 PM

Re: Securing images
 
Quote:

Originally Posted by OpheliaPayne
This still makes the background image unsecure.

css file = skin1 directory
background = skin1 directory

I also tried it in the skin1/images directory

Still not working.


Maybe, I mis-interpretated your question. Why would you want to hard-code an image as https (secured) all the time? There is an overhead when serving pages, assets, etc with https versus http. The solution I posted is changing the link to a relative link. When the site is accessed via http, it will load the image via http. If it's accessed via https, it will load via https. If you want it to always load from https, just change the prefix to https.

somekindahate 09-15-2007 06:22 PM

Re: Securing images
 
Quote:

Originally Posted by OpheliaPayne
I changed it to this:

Code:

                <IMG src="{{ImagesDir}}/rewards_points.jpg" width="150" height="150" border="0">

Still not working.


Sorry, forgot the other step. In the tpl that this is being called from, you need to call it with the following:

{$lng.txt_welcome|substitute:"ImagesDir":$ImagesDi r}

OpheliaPayne 09-15-2007 07:13 PM

Re: Securing images
 
Quote:

Originally Posted by somekindahate
Maybe, I mis-interpretated your question. Why would you want to hard-code an image as https (secured) all the time? There is an overhead when serving pages, assets, etc with https versus http. The solution I posted is changing the link to a relative link. When the site is accessed via http, it will load the image via http. If it's accessed via https, it will load via https. If you want it to always load from https, just change the prefix to https.


In our store, when you log in, it prompts that some information is not secure. If you say "do not load the stuff that is unsecure" what is not loading is these images. Because members can and are newbies, any reference to "unsecure" scares them, which leads to them not purchasing things in our store. So.. I am trying to find a way to make it so this message doesn't appear, and the only way to do that is to make our images secure as well.

If I'm doing something wrong, please let me know. If there is an easier way of doing things .. too let me know.

balinor 09-15-2007 07:15 PM

Re: Securing images
 
Why not allow the content to be shown, and then view the source to see what is being called via http?

OpheliaPayne 09-15-2007 07:29 PM

Re: Securing images
 
I know what is being called. It's the images... hense me asking how do I make them secure.

Here... My Site

Images that are not secure: home & contact icon in top nav bar. Bottom topsite footer images. Background image. I did make the logo so it wouldn't throw up the error.

I just want it to NOT throw up "This page contains both secure and insecure items..."

But then again... I just realized that it's telling me that the cart isn't secure either, even though everything appears to be working correctly. :sigh One more thing to add to my to do list.

balinor 09-15-2007 07:39 PM

Re: Securing images
 
Ok, so if it is all of those images, how do you know fixing the background image worked? To call images in the stylesheet, you need to put them in the skin1/images directory and call them like this:

background: url(images/imagename.jpg);

To call images in the templates, you use:

<img src="{$ImagesDir}/imagename.jpg">

If you do that, they won't give you that warning. If they do, something is either incorrect with your http/https setup, or you have an absolute path called somewhere.

OpheliaPayne 09-15-2007 08:37 PM

Re: Securing images
 
Quote:

Originally Posted by balinor
Ok, so if it is all of those images, how do you know fixing the background image worked? To call images in the stylesheet, you need to put them in the skin1/images directory and call them like this:

background: url(images/imagename.jpg);


Again... This still makes the background image unsecure.

css file = skin1 directory
background = skin1 directory

I also tried it in the skin1/images directory

Still listing as unsecure.

Quote:

To call images in the templates, you use:

<img src="{$ImagesDir}/imagename.jpg">

If you do that, they won't give you that warning. If they do, something is either incorrect with your http/https setup, or you have an absolute path called somewhere.

I can not put the topsite images into my images/ directory.. so what do I do with those? I need to test out the information w/ the txt_welcome that somekindahate forgot to add originally, and will do that later.

ARW VISIONS 09-15-2007 09:01 PM

Re: Securing images
 
the backgroud image is fine... I only see the ones at the bottom as unsecure.

vahidnia 09-16-2007 11:22 AM

Re: Securing images
 
Is there a way to call images from another website without getting a security worning? I know it is not recommended. I get the worning even when my website is in "http" mode!
Can anyone help please
Thanks

balinor 09-16-2007 04:19 PM

Re: Securing images
 
You need to call them via https, but that will slow down your site, and you risk having empty images when/if the third party moves/removes/edits their images. Plus, most sites don't allow you to link to their images.

vahidnia 09-16-2007 04:51 PM

Re: Securing images
 
Balinor,
I am calling the pictures from my dropshiper dedicated website. They wouldnt move the pictures. (about 20000 pictures, I can not download them one by one)
How would i call them via https? just by replacing http with https? but the problem is when i put an "s" in the url it wouldnt open the page
http://website.com/images/abc.jpg
I can see the picture when I put the url in browser link bar but with https I cant open the page:
https://website.com/images/abc.jpg
their website is not set up for https.
IS there a way to call http urls via https?
Thanks, Balinor. Your contribution in this forum is really appriciated

balinor 09-16-2007 04:56 PM

Re: Securing images
 
If your dropshipper doesn't have https setup then no, you can't call them securely :(

vahidnia 09-16-2007 05:03 PM

Re: Securing images
 
If they had https set up. what it would require to call the images securely is to replace the http in the url with https is that correct?

balinor 09-16-2007 05:08 PM

Re: Securing images
 
Correct

OpheliaPayne 09-17-2007 10:09 AM

Re: Securing images
 
Quote:

Originally Posted by OpheliaPayne
I can not put the topsite images into my images/ directory.. so what do I do with those?


Any ideas on this?


All times are GMT -8. The time now is 10:01 AM.

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