Zen Cart G2 Configuration error

j_car

Joined: 2011-01-03
Posts: 15
Posted: Mon, 2011-01-03 04:39

I am recieving "Your Zen Cart installation is not in a subdirectory of Gallery" when attempting to configure Zen Cart in G2.

I am using the 1.3.9g version of the Prepatched ZenCart fileset. My searchs of the forum shows that an update was done to ZC-G2 Bridge for this issue.

This site is not in production, so all options are open for resolving this problem.

I am have been working on integrating G2 and ZC for several days with at least 10 attempts (1st 5 or so attempts were my stupidity). I have been able to get G2 and ZC fully operational with separate installs, but have not gotten them talking yet.

The issue may be due to me misunderstanding the install instructions.
One confusing part of the instructions http://codex.gallery2.org/Gallery2:Modules:zencart) refers to the upload of the module files (step 1 in "Then, in Gallery 2"). Using the Prepatched Zencart 1.3.9g, I do not see the module files to load into my Gallery2 modules folder. I have copied the Zencart module from the ZC-G2 Bridge 3.3.1c (filename shows 3.3.2)into the Gallery2\modules folder. Was this what was implied?

This is my first real venture in working with websites outside of some Frontpage junk I did 5 years ago, so I'm sorry if I am reading the instructions incorrectly.

Thanks in advance
John

phpinfo link = http://www.carlinosweb.com/gallery2/phpinfo.php

Webhost is 1&1

Gallery URL = http://www.carlinosweb.com/gallery2/main.php
Gallery version = 2.3.1 core 1.3.0.1
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 4.4.9 cgi
Webserver = Apache
Database = mysqlt 5.0.91-log, lock.system=flock
Toolkits = ArchiveUpload, Exif, Getid3, jpegtran, LinkItemToolkit, NetPBM, Thumbnail, Gd
Acceleration = none, none
Operating system = Linux infong 2.4 #1 SMP Tue Dec 18 22:34:10 UTC 2007 i686 GNU/Linux
Default theme = matrix
gettext = enabled
Locale = en_US
Browser = Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
Rows in GalleryAccessMap table = 50
Rows in GalleryAccessSubscriberMap table = 6
Rows in GalleryUser table = 2
Rows in GalleryItem table = 4
Rows in GalleryAlbumItem table = 2
Rows in GalleryCacheMap table = 0

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Mon, 2011-01-03 04:52

Noted.

Been wrestling with fixing this bug and it works on my system.

I'll get back to you on this ... maybe I'll just disable the check.

--
dakanji.com

 
j_car

Joined: 2011-01-03
Posts: 15
Posted: Mon, 2011-01-03 05:16

Hi Dayo,
Thanks for the quick response.

Can you confirm that I still need to use the bridge even though I am using the prepacked ZC install from your site?

Also, the following message is being generated in the g2_EventLogMap table when attempting to configure the Zencart module:

Use of undefined constant __DIR__ - assumed '__DIR__' in file /homepages/17/d312440366/htdocs/gallery2/modules/zencart/AdminZenCart.inc on line 112";"Use of undefined constant __DIR__ - assumed '__DIR__'
Request variables: Array
(
[return] => /gallery2/main.php?g2_view=core.SiteAdmin&g2_subView=zencart.AdminZenCart
[formUrl] => /gallery2/main.php?g2_view=core.SiteAdmin&g2_subView=zencart.AdminZenCart
[authToken] => 580e2dbd830c
[controller] => zencart.AdminZenCart
[form] => Array
(
[formName] => AdminZenCart
[path] => /homepages/17/d312440366/htdocs/gallery2/store
[action] => Array
(
[save] => Save
)

)

)

Thanks again
John

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Mon, 2011-01-03 15:40

On with the files, bear in mind that we are talking about a bridge between two separate applications: ZC on one hand, and G2 on the other. To bridge them, some files have to be added to ZC and other files to G2.

Due to the fact that the files that should go into ZC need to be placed in a number of different folders within ZC, I was getting people getting mixed up and having installation issues so I decided to get a copy of ZC, place the files in the right locations and put it up for download so that people can get this and just put the G2 files in place and get going. So yes, you still need to have the files for G2 as the codex outlines.

On the error, thanks for posting the actual error message from the logs. I had just been getting complaints and never had the opportunity to check the logs. I had been as confused as hell since the code works just fine on my setup. Having seen the error message, it appears it is because you are not on PHP 5.3 (post link to phpinfo to confirm).

If this is the case, then wait for a while and check for v3.3.2a. You don't need to change the prepatched zencart files.

BTW, you must have nipped in within a short window as I only had 3.3.1c up for a little bit before updating it. Anyway, wait until the link on my site reads 3.3.2a and then download that set.

Maybe I'll ultimately make the module PHP 5.3 only and set it up to refuse to install otherwise. This particular issue is minor though if it is just a case of the '__DIR__' magic constant causing the problem.

Need the phpinfo to confirm.

--
dakanji.com

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Mon, 2011-01-03 16:01

Confirmed that specific error is PHP 5.3 related.

So go into gallery2/modules/zencart/AdminZenCart.inc on line 112 and change $g2dir = substr(__DIR__, 0, -16); to $g2dir = substr(dirname(__FILE__), 0, -16);

Let me know if that fixes the configuaration error so I can update the 3.3.2 files after which you should upgrade to 3.3.2a.

--
dakanji.com

 
j_car

Joined: 2011-01-03
Posts: 15
Posted: Mon, 2011-01-03 16:12

Thanks for the explanation.

Here is the phpinfo link.

phpinfo link = http://www.carlinosweb.com/gallery2/phpinfo.php

Looks like 1&1 is on version 4.4.9.

To test my understanding of my problem, G2 and ZC can run independently on PHP v4.4.9, but they can't talk to each other since the ZC integration module in G2 requires v5.3. Is this a correct? If correct, I either need to get 1&1 to upgrade to php 5.3, find a new web host, or find another gallery and/or cart solution.

I realy appreciate your help with this. Nice to see I had a basic understanding of what I was doing :)
John

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Mon, 2011-01-03 16:27

Just apply the edit I posted above and you should be fine.

Let me know how it goes.

--
dakanji.com

 
j_car

Joined: 2011-01-03
Posts: 15
Posted: Mon, 2011-01-03 16:36

I copied and pasted the new code and I am still getting the same error.

It does not appear that it is generating an error message in the EventLogMap table this time.

John

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Mon, 2011-01-03 16:40

I can send you a php file to place on your server and I'll need you to send me a link to that file.

Please know that this file will give me full access to your webserver.
Basically, I'll be able to see and manipulate anything on your webserver php has access to.

You should ensure the file has been deleted, that I haven't sneaked another copy in and that you change any passwords after I am done.

If you are comfortable with this, pm me your email address.

--
dakanji.com

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Mon, 2011-01-03 18:25

OK. A few things.

You should not be having the error as everything looks fine on your site (noticed you actually had v3.3.2 which I have changed to read v3.3.2a)
I uploaded a file to your zencart module folder and if you navigate to it at http://www.carlinosweb.com/gallery2/modules/zencart/pathtest.php, you will see that it confirms that your ZC's parent directory is that same as your G2 location. The code run by that file is the same as in AdminZenCart.inc where it does the checks.

So, the code looks perfectly fine to me and perhaps the error you saw the second time is from a cache. Try clearing your browser cache and have another go.

A few things of note:

  • I forgot to remove the Mac resource files when I packed the ZC prepatched files so your ZC is full of "._xyz" files. You can go and delete the lot. The only files that should have a '.' in front of them are '.htaccess' files. Note that this are different to '._htaccess' which can be deleted. Sorry!
  • You seem to have every G2 module going on the server. You might want to consider getting rid of those you don't use.
  • I used the self destruct feature of the shell script to delete it. Please verify.
  • Change your passwords stored in clear text e.g in config.php on G2 and similarly in ZC. I didn't look but I could have looked
  • Ask 1&1 to move you to a server with PHP 5 as default (not one where you need to poodle about to get it working). Demand Apache2 while you are at it. There is no reason why they should be running such old software and you will be facing issues as careless coders like me start to only code based on 5.3 etc.

Back to the issue at hand, I am sorry but I can't figure out why you should be having those errors.

If all fails, you can disable the check by changing...

$error[] = 'form[error][path][badDir]';
GalleryCoreApi::removePluginParameter('module', 'zencart', 'path');

to

/* Disable folder consistency check */
//$error[] = 'form[error][path][badDir]';
//GalleryCoreApi::removePluginParameter('module', 'zencart', 'path');

... in AdminZenCart.inc.

--
dakanji.com

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Mon, 2011-01-03 18:42

make that changing...

if ($parentdir != $g2dir) {
$error[] = 'form[error][path][badDir]';
GalleryCoreApi::removePluginParameter('module', 'zencart', 'path');
} else {

to

if ($form['path']) {

--
dakanji.com

 
j_car

Joined: 2011-01-03
Posts: 15
Posted: Mon, 2011-01-03 19:17

I cleared my cache but still no dice. Will try the disable option you suggested.

I am not sure if this has any bearing on the problem, but I cannot get to ZC's admin module with the current install. All that appears is a blank page. During one of my prior troubleshooting attempts, I did a clean install of ZC from their download and was able to get to the admin page.

I did confirm that the self destruct removed the file.
Other items appreciated and noted. I will be clean up once I work through this problem.

I will post the results of disabling the checks.

 
j_car

Joined: 2011-01-03
Posts: 15
Posted: Mon, 2011-01-03 19:25

I was able to get through the configuration. When attempting to activate, I received the following:

Quote:
Error Detail -
Error (ERROR_STORAGE_FAILURE)
in modules/zencart/classes/GalleryZenCart.class at line 865 (gallerycoreapi::error)
in modules/zencart/module.inc at line 133 (galleryzencart::addalbumascategory)
in modules/core/PluginCallback.inc at line 180 (zencartmodule::activate)
in modules/core/PluginCallback.inc at line 67 (plugincallbackview::handlecallback)
in main.php at line 450 (plugincallbackview::renderimmediate)
in main.php at line 104
in main.php at line 88
System Information
Gallery version 2.3.1
PHP version 4.4.9 cgi
Webserver Apache
Database mysqlt 5.0.91-log
Toolkits ImageMagick, Thumbnail, NetPBM, Gd
Operating system Linux infong 2.4 #1 SMP Tue Dec 18 22:34:10 UTC 2007 i686 GNU/Linux
Browser Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Mon, 2011-01-03 20:33

OK a few things.

On my site, I have just been able to create a test album and it was added to ZC as a category (where your install is falling down) without any issues. However, looking at the code in modules/zencart/classes/GalleryZenCart.class at line 865, I can see it doesn't make sense and will always crash (it is testing for a variable that has not been created before then).

So there are a few queries to answer.

I have gone back to the first version of the module as written by the original developer and that function has not changed from then. As it looks on the surface that the code should always crash at that point, I need to figure out why after several installations I have done over the years I have been working on this, I have yet to have a crash at that point.

I have however not installed for a while (been editing existing files) so I will do so and see what gives. However the same code should run when adding a new album and I just did that successfully.

Apart from this, you have an issue with you overall installation (blank page).

I suggest you do the following
1. delete the zc module from within your g2 admin
2. Drop the zc database, delete your zc folder, grab a copy of the prepatched fileset (sorry about the ._xyz files) and reinstall zencart. Once that is done, just leave it alone ... well you can busy yourself deleting the ._xyz files.
3. use the script attached here to search your G2 db for any references to zencart and delete them using phpmyadmin

Leave things alone at that while I look into this.

I am afraid I can't say when I will be done but will try to get to the bottom of it ... starting by installing fresh copies of g2 and zc and seeing if I hit any issues trying to install the module.

Gotta run. Good luck!

--
dakanji.com

 
j_car

Joined: 2011-01-03
Posts: 15
Posted: Mon, 2011-01-03 20:42

Will get started on this. Rather than just deleting ZC, I will blow away G2 and drop all db tables as well. With me poking around the install for several days, I might have messed something up by mistake and rule out any tinkering errors.

Thanks

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Mon, 2011-01-03 20:45

Sounds like a good idea since you haven't yet put much on it.

Give it about an hour or so while I repackage the ZC files to exclude the Mac stuff.

--
dakanji.com

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Mon, 2011-01-03 20:51

Actually, I'll leave the repackaging till tomorrow and do it on the latest version of ZC (1.3.9h) so look out for the download link about 1900 GMT tomorrow.

Goodnight!
--
dakanji.com

 
j_car

Joined: 2011-01-03
Posts: 15
Posted: Mon, 2011-01-03 20:54

Will do. Thanks again.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Fri, 2011-01-07 19:56

v3.3.3 released which, together with the prepatched Zencart 1.3.9h files, should address these issues.

On the ERROR_STORAGE_FAILURE issue, a review of the code shows that it is valid code and should not generate a crash in a properly installed G2.

--
dakanji.com

 
j_car

Joined: 2011-01-03
Posts: 15
Posted: Sat, 2011-01-08 05:55

Hi Dayo
I did a complete reinstall of both Gallery and ZC using the prepackaged files. All went perfectly until I reached the Activate Module step in Gallery Admin. Clicking activate does nothing. The following error is generated in the g2_EventLogMap table

Any ideas?

Quote:
4 6 PHP Error [Notice] Undefined index: bypass in file /homepages/17/d312440366/htdocs/gallery2/modules/zencart/classes/GalleryZenCart.class on line 1659 "Undefined index: bypass
Request variables: Array
(
[view] => core.PluginCallback
[pluginId] => zencart
[pluginType] => module
[command] => activate
[authToken] => 5be80c5c6591
)
" http://www.carlinosweb.com/gallery2/main.php?g2_view=core.PluginCallback&g2_pluginId=zencart&g2_pluginType=module&g2_command=activate&g2_authToken=5be80c5c6591&rnd=0.7501719220124309 99.119.190.66 1294464759 http://www.carlinosweb.com/gallery2/main.php?g2_view=core.SiteAdmin&g2_subView=core.AdminModules

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sat, 2011-01-08 06:23

That error is getting triggered by a check for the image firewall bypass module I use. I do this check so I don't have to write two versions of the code (for me and for public release).
There is definitely something screwy going on with your installation as that should not be triggering an error. I ran the installation on a fresh G2 install (without the bypass module) several times yesterday.

There is a quick fix but if you don't mind, I'll like to try out a catch all option for other that may have a similar setup as you have.

In function makeThumbnailUrl of gallery2/modules/zencart/classes/GalleryZenCart.class, change ...

	if (isset($thumbnail[$itemId])) {
		list ($ret, $pluginStatus) = GalleryCoreApi::fetchPluginStatus('module');
		if ($ret) {
			return array($ret, null);
		}
		if ($pluginStatus['bypass']['active'] == 0) {
			/* use default image firewall process */
			$urlGenerator =& $gallery->getUrlGenerator();
			$url = $urlGenerator->generateUrl(
				array('view' => 'core.DownloadItem', 'itemId' => $thumbnail[$itemId]->getId()),
				array('forceFullUrl' => true, 'forceSessionId' => false));
		} else {
			/* bypass image firewall process and return direct links to g2data */

to

	if (isset($thumbnail[$itemId])) {
		list ($ret, $pluginStatus) = GalleryCoreApi::fetchPluginStatus('module');
		if ($ret) {
			return array($ret, null);
		}
		if (isset($pluginStatus['bypass']['active'])) {
			if ($pluginStatus['bypass']['active'] == 0) {
				/* use default image firewall process */
				$urlGenerator =& $gallery->getUrlGenerator();
				$url = $urlGenerator->generateUrl(
					array('view' => 'core.DownloadItem', 'itemId' => $thumbnail[$itemId]->getId()),
					array('forceFullUrl' => true, 'forceSessionId' => false));
			}
		}
		if (!isset($url)) {
			/* bypass image firewall process and return direct links to g2data */

--
dakanji.com

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sat, 2011-01-08 06:27

If that still crashes, then change your function makeThumbnailUrl to ...

    function makeThumbnailUrl($itemId) {
	global $gallery;

	list ($ret, $thumbnail) = GalleryCoreApi::fetchThumbnailsByItemIds(array($itemId));
	if ($ret) {
	    return array($ret, null);
	}
	if (isset($thumbnail[$itemId])) {
		/* use default image firewall process */
		$urlGenerator =& $gallery->getUrlGenerator();
		$url = $urlGenerator->generateUrl(
			array('view' => 'core.DownloadItem', 'itemId' => $thumbnail[$itemId]->getId()),
			array('forceFullUrl' => true, 'forceSessionId' => false));
	    $urlParts = parse_url($url);
	    $zenPath = trim($this->_zenCart->getZenConstant('DIR_FS_CATALOG') . $this->_zenCart->getZenConstant('DIR_WS_IMAGES'), '/');
	    $relativeUrl = '';
	    /* Take it back to the root... */
	    foreach (explode('/', $zenPath) as $part) {
		$relativeUrl .= '../';
	    }
	    /* ...and travel to the target from there. */
	    $url = rtrim($relativeUrl, '/') . $urlParts['path'];

	    /* Add query string if not using URL rewrite. */
	    if (!empty($urlParts['query'])) {
			$url .= '?' . $urlParts['query'];
	    }
	} else {
	    $url = '';
	}

	return array(null, $url);
    }

Let me know which one works out
--
dakanji.com

 
j_car

Joined: 2011-01-03
Posts: 15
Posted: Sat, 2011-01-08 17:11

WOOT!!!!
1st one worked!!!

Thank you so much for your contribution as well as your help in resolving this issue.

John

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sat, 2011-01-08 18:11

Nice.

Glad the first one worked as that was the preferred option.

Now, looking at your site, I see the thumbnails are not showing up on the ZC side. Are you sure you are using the prepatched Zencart 1.3.9h files? This should not be happening if the Zencart installation was from those files. Can you confirm?

***** EDIT****
There is a bug in the code fix which is breaking your thumbnails.

Please change the fix from ...

	if (isset($thumbnail[$itemId])) {
		list ($ret, $pluginStatus) = GalleryCoreApi::fetchPluginStatus('module');
		if ($ret) {
			return array($ret, null);
		}
		if (isset($pluginStatus['bypass']['active'])) {
			if ($pluginStatus['bypass']['active'] == 0) {
				/* use default image firewall process */
				$urlGenerator =& $gallery->getUrlGenerator();
				$url = $urlGenerator->generateUrl(
					array('view' => 'core.DownloadItem', 'itemId' => $thumbnail[$itemId]->getId()),
					array('forceFullUrl' => true, 'forceSessionId' => false));
			}
		}
		if (!isset($url)) {
			/* bypass image firewall process and return direct links to g2data */

to

	if (isset($thumbnail[$itemId])) {
		list ($ret, $pluginStatus) = GalleryCoreApi::fetchPluginStatus('module');
		if ($ret) {
			return array($ret, null);
		}
		if (isset($pluginStatus['bypass']['active'])) {
			if ($pluginStatus['bypass']['active'] == 0) {
				$firewall = true;
			}
		}
		if ($firewall) {
			/* use default image firewall process */
			$urlGenerator =& $gallery->getUrlGenerator();
			$url = $urlGenerator->generateUrl(
				array('view' => 'core.DownloadItem', 'itemId' => $thumbnail[$itemId]->getId()),
				array('forceFullUrl' => true, 'forceSessionId' => false));
		} else {
			/* bypass image firewall process and return direct links to g2data */

Deactivate and reactivate the module to rebuild the thumbnail links.

You may also want to go into module.inc and change $this->setVersion('3.3.3'); to $this->setVersion('3.3.3a'); afterwards

--
dakanji.com

 
j_car

Joined: 2011-01-03
Posts: 15
Posted: Sat, 2011-01-08 18:11

Thanks. I did notice the thumbnail issue. I will walk through your instructions (run queries, etc) and advise.

URL Rewrite was activated prior to installing ZC.
I downloaded the 1.3.9h from your site yesterday.

Thanks
John

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sat, 2011-01-08 18:13

Ignore the queries ... see bug notice above.
--
dakanji.com

 
j_car

Joined: 2011-01-03
Posts: 15
Posted: Sat, 2011-01-08 19:37

Hi Dayo,
I changed the code but the thumbbails are still not appearing in the cart.

I activated and inactivated the module before and after. I also deleted the album and added new picts but still nothing.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sat, 2011-01-08 19:49

This should finally sort it out ...

	if (isset($thumbnail[$itemId])) {
		list ($ret, $pluginStatus) = GalleryCoreApi::fetchPluginStatus('module');
		if ($ret) {
			return array($ret, null);
		}
		if (isset($pluginStatus['bypass']['active'])) {
			if ($pluginStatus['bypass']['active'] == 0) {
				$firewall = true;
			}
		} else {
			$firewall = true;
		}
		if ($firewall) {
			/* use default image firewall process */
			$urlGenerator =& $gallery->getUrlGenerator();
			$url = $urlGenerator->generateUrl(
				array('view' => 'core.DownloadItem', 'itemId' => $thumbnail[$itemId]->getId()),
				array('forceFullUrl' => true, 'forceSessionId' => false));
		} else {
			/* bypass image firewall process and return direct links to g2data */

Been a bit lax with following the logic through
--
dakanji.com

 
j_car

Joined: 2011-01-03
Posts: 15
Posted: Sat, 2011-01-08 20:07

Awesome. Works perfectly.
Playing around with it now.
Thanks again for everything.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sat, 2011-01-08 20:19

Can you please test this more succinct version and let me know if it works?

	if (isset($thumbnail[$itemId])) {
		list ($ret, $pluginStatus) = GalleryCoreApi::fetchPluginStatus('module');
		if ($ret) {
			return array($ret, null);
		} else if (isset($pluginStatus['bypass']['active'])) {
			$firewall = $pluginStatus['bypass']['active'];
		}
		if ($firewall) {
			/* use default image firewall process */
			$urlGenerator =& $gallery->getUrlGenerator();
			$url = $urlGenerator->generateUrl(
				array('view' => 'core.DownloadItem', 'itemId' => $thumbnail[$itemId]->getId()),
				array('forceFullUrl' => true, 'forceSessionId' => false));
		} else {
			/* bypass image firewall process and return direct links to g2data */

--
dakanji.com

 
j_car

Joined: 2011-01-03
Posts: 15
Posted: Sat, 2011-01-08 20:30

Applied the new code, inactivated then reactivated. Thumbnails no longer appear in the cart.
Changed back to the working version, inactivated then reactivated, and they now work.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sat, 2011-01-08 20:38

OK. I would have expected the shorter one to also work but let's stick with the previous.

Now, remember to change the module.inc to 3.3.3a as outlined earlier and edit the ZC look. I put a big "Designed by Dayo Akanji" there to motivate people but it seems many can't be bothered lol.

Enjoy!

--
dakanji.com

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sat, 2011-01-08 21:50

One final test if you don't mind ...

	if (isset($thumbnail[$itemId])) {
		list ($ret, $pluginStatus) = GalleryCoreApi::fetchPluginStatus('module');
		if ($ret) {
			return array($ret, null);
		} elseif (isset($pluginStatus['bypass']['active'])) {
			$firewall = $pluginStatus['bypass']['active'];
		}
		if (!$firewall) {
			/* use default image firewall process */
			$urlGenerator =& $gallery->getUrlGenerator();
			$url = $urlGenerator->generateUrl(
				array('view' => 'core.DownloadItem', 'itemId' => $thumbnail[$itemId]->getId()),
				array('forceFullUrl' => true, 'forceSessionId' => false));
		} else {
			/* bypass image firewall process and return direct links to g2data */

--
dakanji.com

 
j_car

Joined: 2011-01-03
Posts: 15
Posted: Sat, 2011-01-08 21:58

Works fine.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sun, 2011-01-09 04:30

Thanks. That's the pick.
--
dakanji.com