forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Visuals => Topic started by: nickfzx on March 20, 2007, 08:21:49 am

Title: Full-Size opening in same window instead of Pop-Up
Post by: nickfzx on March 20, 2007, 08:21:49 am
Now i have searched and there is a load of stuff on the whole fullsize popup images but I couldn't find anywhere what I want to do.

which is when you click on the intermediate image the intermediate image goes and in it's place the full-size image, in the same displayimage.php screen.  It would be cool if the page didn't have to refresh either...but I can do without that.

Has a mod like this been done?

p.s.
I do not care if the full-size images are beyond the browser width and break my layout...this is what I want

[edit GauGau] renamed this thread from "I want fullsize images to load inside displayimage.php" to "Full-Size opening in same window instead of Pop-Up" [/edit]
Title: Re: I want fullsize images to load inside displayimage.php
Post by: nickfzx on April 23, 2007, 04:39:54 pm
So as I got no reply to this I wrote the mod myself  ;D

This mod makes it so when you click on the intermediate image the full size image loads in it's place in the same window.  And vise versa, when you click on the full size image the intermediate image comes back...if javascript is disabled nothing will happen when you click on the intermediate image.

Add this javascript somewhere.  I stuck it in the scripts.js file but you could also put it in your template file in the <head> section, or it's own file if you like (as long as you include it in the template head).

Code: [Select]
intImage = 2;
function swapImage(first, second) {
switch (intImage) {
 case 1:
    intImage = 2
 document.getElementById("img1").src = first
   return(false);
case 2:
   intImage = 1
 document.getElementById("img1").src = second
   return(false);
 }
}

The you need to (if you haven't already done so) copy the
Quote
// Displays a picture   function theme_html_picture()
  block from the sample theme to your theme.

Then find these lines:
Code: [Select]
$pic_html = "<a href=\"javascript:;\" onclick=\"MM_openBrWindow('displayimage.php?pid=$pid&amp;fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=yes,status=yes,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
$pic_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title;
$pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
$pic_html .= "</a>\n";

and replace with this:
Code: [Select]
$picfull_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
$pic_title = $CURRENT_PIC_DATA['title'];
$pic_html = "<img id=\"img1\" name=\"img1\" src=\"" . $picture_url . "\"Javascript:;\" onclick=\"swapImage('$picture_url', '$picfull_url')\">";

And your done, tested with FF, IE and Opera.  ;)
Title: Re: I want fullsize images to load inside displayimage.php
Post by: nickfzx on May 28, 2007, 10:21:45 pm
a valid mod surely?  ;D
Title: Re: Full-Size opening in same window instead of Pop-Up
Post by: csh69 on June 10, 2007, 08:54:17 pm
Are you sure about the bold section:

$pic_html = "<img id=\"img1\" name=\"img1\" src=\"" . $picture_url . "\"Javascript:;\" onclick=\"swapImage('$picture_url', '$picfull_url')\">";

This will surely just give you something like:

src="albums/userpics/normal_img.jpg"Javascript:; onclick="swapImage('albums/userpics/normal_img.jpg', 'albums/userpics/img.JPG')

It works fine without the Javascript:;\" - but was there meant to be something else there?
Title: Re: Full-Size opening in same window instead of Pop-Up
Post by: csh69 on June 10, 2007, 08:56:50 pm
I'd also be inclined to include  style=\"cursor: pointer\" on the line as well
Title: Re: Full-Size opening in same window instead of Pop-Up
Post by: nickfzx on June 10, 2007, 09:00:46 pm
you are right the bold bit is not necaserry at all.

as for the curser I have done that via external css.

glad someone is using the mod
Title: Re: Full-Size opening in same window instead of Pop-Up
Post by: nasirmulani on June 12, 2007, 07:03:38 am
instead of swapping the image cant there be a javascript link which loads the entire page in the same window.

i mean i just don't want  the popup window instead the popup window should load in the same window i am browsing.

i want this becasue i use google adsense to show ads and google does not allow ads in pop up windows. if i still show the ads my account will be blocked.

thats why i just want the entire popup window to load in the same browser

plz nickfzx help me with this. Thankyou.

my email nasirmulani@gmail.com

Title: Re: Full-Size opening in same window instead of Pop-Up
Post by: Hein Traag on June 12, 2007, 07:21:16 am
Nickfzx, do you have a demo of this mod somewhere ?
Title: Re: Full-Size opening in same window instead of Pop-Up
Post by: nickfzx on June 12, 2007, 11:54:08 am
only on my localhost, sorry

it is just a simple javascript swap image...if you search google for "javascript swap image" you will probably find an example.
Title: Re: Full-Size opening in same window instead of Pop-Up
Post by: nasirmulani on June 12, 2007, 12:14:42 pm
plz reply to my post

http://forum.coppermine-gallery.net/index.php?topic=42391.msg211296#msg211296
Title: Re: Full-Size opening in same window instead of Pop-Up
Post by: Hein Traag on June 12, 2007, 12:48:01 pm
plz reply to my post

http://forum.coppermine-gallery.net/index.php?topic=42391.msg211296#msg211296

Nasirmulani.. keep in mind that people who help out on the forum do NOT get paid for doing so. Patience is a virtue, give it some time (even days) before expecting a quick answer. Acting like this will not make supporters or contributors answer your questions any faster.
Title: Re: Full-Size opening in same window instead of Pop-Up
Post by: nickfzx on June 12, 2007, 12:59:22 pm
instead of swapping the image cant there be a javascript link which loads the entire page in the same window.

i mean i just don't want  the popup window instead the popup window should load in the same window i am browsing.

i want this becasue i use google adsense to show ads and google does not allow ads in pop up windows. if i still show the ads my account will be blocked.

thats why i just want the entire popup window to load in the same browser

plz nickfzx help me with this. Thankyou.

my email nasirmulani@gmail.com



There may be a way to do this but I don't know what it is...maybe try the greybox javascript to achieve what you want ( http://orangoo.com/labs/GreyBox/ )

I can't really help you anymore than this though sorry