Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Full-Size opening in same window instead of Pop-Up  (Read 23892 times)

0 Members and 2 Guests are viewing this topic.

nickfzx

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 285
Full-Size opening in same window instead of Pop-Up
« 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]
« Last Edit: May 29, 2007, 06:56:47 am by GauGau »
Logged

nickfzx

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 285
Re: I want fullsize images to load inside displayimage.php
« Reply #1 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.  ;)
« Last Edit: May 29, 2007, 06:21:18 pm by nickfzx »
Logged

nickfzx

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 285
Re: I want fullsize images to load inside displayimage.php
« Reply #2 on: May 28, 2007, 10:21:45 pm »

a valid mod surely?  ;D
Logged

csh69

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Full-Size opening in same window instead of Pop-Up
« Reply #3 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?
Logged

csh69

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Full-Size opening in same window instead of Pop-Up
« Reply #4 on: June 10, 2007, 08:56:50 pm »

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

nickfzx

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 285
Re: Full-Size opening in same window instead of Pop-Up
« Reply #5 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
« Last Edit: June 10, 2007, 09:33:40 pm by nickfzx »
Logged

nasirmulani

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
  • *Banned*
Re: Full-Size opening in same window instead of Pop-Up
« Reply #6 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

Logged

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Full-Size opening in same window instead of Pop-Up
« Reply #7 on: June 12, 2007, 07:21:16 am »

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

nickfzx

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 285
Re: Full-Size opening in same window instead of Pop-Up
« Reply #8 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.
Logged

nasirmulani

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
  • *Banned*
Logged

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Full-Size opening in same window instead of Pop-Up
« Reply #10 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.
Logged

nickfzx

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 285
Re: Full-Size opening in same window instead of Pop-Up
« Reply #11 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
Logged
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 20 queries.