Post by clinton4 » Fri Feb 27, 2015 6:51 pm

Hi,

Ref: http://forum.opencart.com/viewtopic.php?f=138&t=40573

I have done as described in the post above, but images is still served from my main domain and not the subdomain i have defined. Why?

I'am running 1.5.6.4

Spam blocking PHP script, use it!


Active Member

Posts

Joined
Sun Jan 17, 2010 11:54 am

Post by IP_CAM » Fri Feb 27, 2015 8:00 pm


My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by clinton4 » Fri Feb 27, 2015 8:10 pm

That did not solve my problem at all. If HTTP_IMAGE is removed, how can achive this http://forum.opencart.com/viewtopic.php?f=138&t=40573

Spam blocking PHP script, use it!


Active Member

Posts

Joined
Sun Jan 17, 2010 11:54 am

Post by IP_CAM » Fri Feb 27, 2015 10:53 pm

The advise, given on the Page you mentioned, is not complete, you have to check the ZIPPED images, as informed on the Page, linked above, to get what you are looking for. There is no other solution, I did it several times and it works, if done as advised.

Ernie
bigmax.ch
sample site, used with this kind of mod.

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by clinton4 » Fri Feb 27, 2015 11:01 pm

Hi,

I already understand the concept. What i do not understand is how to achieve this when define HTTP_IMAGE is removed from OC 1.5.X

How am i suppose to dynamically change URL source for just images when there is no place to define a custom URL for images?

Spam blocking PHP script, use it!


Active Member

Posts

Joined
Sun Jan 17, 2010 11:54 am

Post by IP_CAM » Sun Mar 01, 2015 2:34 am

>> how to achieve this when define HTTP_IMAGE is removed from OC 1.5.X <<
If I understud your question, you can't achieve it, if the definition of the HTTP_IMAGE is removed from the config file. How should you..., or better, why ?
Ernie

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by clinton4 » Wed Mar 11, 2015 2:01 am

Problem is solved.

Qphoria created a vqmod to add the HTTP_IPAGE back. You can find it at the bottom of the follwong post:
http://forum.opencart.com/viewtopic.php?f=138&t=40573

Thanks Qphoria :)

Spam blocking PHP script, use it!


Active Member

Posts

Joined
Sun Jan 17, 2010 11:54 am

Post by IP_CAM » Thu Mar 12, 2015 3:11 am

But just make sure, not to copy the Error from the VqMod and put the error line into your config.php's, it won't work.

>>bigmax.ch\shop\catalog\model\tool\image.php

Code: Select all

<!-- BEFORE USE, YOU MUST ADD THIS TO YOUR config.php FILE
-- START Error Line
    define('HTTP_IMAGE', 'http://www.yoursite.comimage/');
-- END Error Line
Should be:
    define('HTTP_IMAGE', 'http://www.yoursite.com/image/');
--
    define('HTTPS_IMAGE', 'http://www.yoursite.com/image/');
    -->
Additionally:

Code: Select all

<file name="catalog/*/*/*.php" error="skip">
        <operation error="skip">
        <search position="replace"><![CDATA[
        $this->config->get('config_url') . 'image/'
        ]]></search>
        <add><![CDATA[
	HTTP_IMAGE
SHOULD RATHER BE:
        HTTP_IMAGE . $new_image;
	]]></add>
        </operation>

	<operation error="skip">
        <search position="replace"><![CDATA[
        $this->config->get('config_ssl') . 'image/'
        ]]></search>
        <add><![CDATA[
	HTTPS_IMAGE
SHOULD RATHER BE:
        HTTPS_IMAGE . $new_image;
	]]></add>
acording to my informations and my working V.1.5.6.x System

Code: Select all

		if (isset($this->request->server['HTTPS']) && (($this->request->server['HTTPS'] == 'on') || ($this->request->server['HTTPS'] == '1'))) {
			// return $this->config->get('config_ssl') . 'image/' . $new_image;
			return HTTPS_IMAGE . $new_image;
		} else {
			// return $this->config->get('config_url') . 'image/' . $new_image;
			return HTTP_IMAGE . $new_image;
		}	
I am not so sure, if it makes a lot of sense, to use a VqMod, to scan the entire >?.php< Files in the catalog-Sub of a shop, just to 'find' the content in possibly two different places only, in my Case, in:
C:\JTI_Servers\bigmax.ch\shop\catalog\model\tool\image.php
C:\JTI_Servers\bigmax.ch\shop\catalog\model\openbay\ebay_product.php
but this is my personal Opinion only!

no offense!!
Ernie

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 98 guests