Full-Size opening in same window instead of Pop-Up Full-Size opening in same window instead of Pop-Up
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Full-Size opening in same window instead of Pop-Up

Started by nickfzx, March 20, 2007, 08:21:49 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nickfzx

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]

nickfzx

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).

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:
$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:
$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.  ;)

nickfzx


csh69

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?

csh69

I'd also be inclined to include  style=\"cursor: pointer\" on the line as well

nickfzx

#5
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

nasirmulani

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


Hein Traag

Nickfzx, do you have a demo of this mod somewhere ?

nickfzx

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.


Hein Traag

Quote from: 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

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.

nickfzx

Quote from: 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



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