Shadowbox: Use original image instead of large thumbnail

Phoca Gallery plugins - plugins for Phoca Gallery extension
Fotoschmied
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 17 May 2010, 09:20
Location: Germany
Contact:

Shadowbox: Use original image instead of large thumbnail

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Shadowbox: Use original image instead of large thumbnail

Post 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
If you find Phoca extensions useful, please support the project
Fotoschmied
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 17 May 2010, 09:20
Location: Germany
Contact:

Re: Shadowbox: Use original image instead of large thumbnail

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Shadowbox: Use original image instead of large thumbnail

Post 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
If you find Phoca extensions useful, please support the project
Fotoschmied
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 17 May 2010, 09:20
Location: Germany
Contact:

Re: Shadowbox: Use original image instead of large thumbnail

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Shadowbox: Use original image instead of large thumbnail

Post 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
If you find Phoca extensions useful, please support the project
Fotoschmied
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 17 May 2010, 09:20
Location: Germany
Contact:

Re: Shadowbox: Use original image instead of large thumbnail

Post 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?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Shadowbox: Use original image instead of large thumbnail

Post by Jan »

Ok
If you find Phoca extensions useful, please support the project
Post Reply