Page 1 of 1

Shadowbox: Use original image instead of large thumbnail

Posted: 17 May 2010, 10:02
by Fotoschmied
Good morning, everyone.

I have a question regarding the use of Shadowbox in the phoca gallery. After searching through the web in general and also through this forum, I now know that there are quite some people who have similar problems, but I didn't find any useable solution yet.

My problem is: When I upload images, they are already correctly resized, suitably sharpened for viewing and they also have a logo embedded in them. Because of this, I would highly prefer to have the original image displayed instead of the large thumbnail. The "thumbnail" is of the same size as my original image, yet of lesser quality, and the only thing it actually does is to eat up my webspace...

Now, the question is: What can I do to make Shadowbox display the original image instead of the large thumbnail? If there is a way to do this, then I could simply configure Phoca Gallery to create the "large thumbnail" in a very small size, so it doesn't use up so much space - It is never displayed anyway, so it doesn't matter. I'm pretty sure that it will be a quite simple change to one of the scripts, to point shadowbox to the originals instead of the thumbnails...Unfortunately, I'm an absolute beginner when it comes to PHP and JS, so I don't have a clue on how to change this.

If there anyone out there who can help me with this?

Thanks and best regards - Mike

Re: Shadowbox: Use original image instead of large thumbnail

Posted: 17 May 2010, 13:42
by Jan
Hi, you need to change the path from path to large thumbnail to original image, in this file:

cca line 1102:

components\com_phocagallery\views\category\view.html.php

Re: Shadowbox: Use original image instead of large thumbnail

Posted: 17 May 2010, 14:15
by Fotoschmied
Hello, Jan.
Jan wrote:Hi, you need to change the path from path to large thumbnail to original image, in this file:
cca line 1102:
components\com_phocagallery\views\category\view.html.php
Allright - I had hoped that there would be some kind of simple solution for this problem :)

Now, the only remaining problem is: I have looked through the file at the given location, but without proper knowledge about how this thing works and what it actually DOES, I don't even know what to change. Beginning with line 1102, I find the following block of code:

Code: Select all

			} else if ( $tmpl['detailwindow'] == 3 ) {
			
				$items[$iS]->link 		= $imgLink;
				$items[$iS]->link2 		= $imgLink;
				$items[$iS]->linkother	= $siteLink;
				$items[$iS]->linkorig	= $imgLinkOrig;
I suppose that ['detailwindow'] selects which viewer script is to be used for displaying the image...But I'm not even sure about this detail. Would it be much work for you to give me some hints on what to change where, to get this script to do what I want from it? I know that this kind of support can be quite frustrating - I work in 3rd level support of a software company myself, but as I said, PHP is really some kind of "undiscovered country" for me, as embarassing as it is.

Thanks for your help so far!

Best regards - Mike

Re: Shadowbox: Use original image instead of large thumbnail

Posted: 17 May 2010, 19:01
by Jan
Hi, it is not about php, it is about finding the variables in the code:

Yes, the 3 means shadowbox.

$items[$iS]->link -> link to detail window (image)
$items[$iS]->link2 -> link to detail window (icon under image)
$items[$iS]->linkother -> link to e.g. map, info, and different views in detail window
$items[$iS]->linkorig -> link to original image - is used by highslide JS

So the shadowbox uses the link and link2 - this should be changed to original image:

Code: Select all

$items[$iS]->link 		= $imgLinkOrig;
$items[$iS]->link2 		= $imgLinkOrig;
Jan

Re: Shadowbox: Use original image instead of large thumbnail

Posted: 17 May 2010, 20:45
by Fotoschmied
Jan wrote:Yes, the 3 means shadowbox.
Great - This means I understood something :)
So the shadowbox uses the link and link2 - this should be changed to original image:

Code: Select all

$items[$iS]->link 		= $imgLinkOrig;
$items[$iS]->link2 		= $imgLinkOrig;
Allright, if it's so simple, then there's hope! But alas, I have tried it, and it doesn't work: I have changed the mentioned lines in the file components/com_phocagallery/views/category/view.html.php as you suggested it, but Shadowbox still shows the large thumbnail. The problem is that I have no idea how to debug this. Either it's the wrong place, or some other setting overrides the change in the .php file...Do you have any idea where to look and how to debug this?

Thanks a lot and best regards - Mike

Re: Shadowbox: Use original image instead of large thumbnail

Posted: 30 May 2010, 15:37
by Jan
Hi, no idea there :-( you need to e.g. print the variable and see the html code to see if the url path is OK.

Jan

Re: Shadowbox: Use original image instead of large thumbnail

Posted: 30 May 2010, 15:56
by Fotoschmied
Jan wrote:Hi, no idea there :-( you need to e.g. print the variable and see the html code to see if the url path is OK.

Jan
Good afternoon, Jan.

I was actually just preparing to write my "solved" entry while your posting arrived!

The solution was simple: The change was in the wrong place, and I'm quite sure that this was because I didn't exactly describe what I am doing here. I use the content plugin to display a category in an article. Because of this, the file that needs to be changed is not "components\com_phocagallery\views\category\view.html.php" but instead "plugins\content\phocagallery.php". After I applied the changes there, everything was fine and now ShadowBox displays the original file instead of the large thumbnail.

Thank you very much - NOW everything works as I hoped it would :D

Best regards - Mike

P.S. How can I add the [solved] Tag to a topic?

Re: Shadowbox: Use original image instead of large thumbnail

Posted: 31 May 2010, 13:35
by Jan
Ok