***1.4.3-pl1 Popup instructions, yes 1.4.3-pl1***

RustedNail

Joined: 2004-05-19
Posts: 10
Posted: Thu, 2004-05-20 21:58

Yea finaly we can stop having 50 million posts asking for a popup for 1.4.3

First let me say BACKUP YOUR FILES I am not responsible for anything that goes wrong. With that out of the way lets get started.

PixelPoet's popup instructions work to some degree, but I wanted on that would auto resize the window. So I came up with this one.

**************
In util.php find
**************
require(dirname(__FILE__) . '/nls.php');
**************
and insert this java script after it.
**************

function pop_image($url, $url_is_complete=0) {
 	global $gallery, $index;
 
 	/* Separate the target from the arguments */
 	list($target, $arglist) = split("\?", $url);
 
 	/* Split the arguments into an associative array */
 	$tmpargs = split("&", $arglist);
 	foreach ($tmpargs as $arg) {
 		if (!$arg) {
 			continue;
 		}
 		list($key, $val) = split("\=", $arg);
 		$args[$key] = $val;
 	}
 
 	if (!$url_is_complete) {
 		$url = makeGalleryUrl($target, $args);
 		$url = "\"$url\"";
 	} 
 	
 	$photo = $gallery->album->getPhoto($index);
 	$image = $photo->image;
 	list($iWidth, $iHeight) = $image->getRawDimensions();
 
 	// maybee I should add the album name w/o spaces to winName
 	// solution for now is simply add time to name of window
 	$winName = time() . $index;
 	$winName = str_replace(" ", "", $winName);
 
 
 	return popup_js($url, $winName,
 		"height=" . $iHeight . ",width=" . $iWidth
 .",location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no");
 
 }

**************
Save and close util.php
**************
Open viewphoto.php find this
**************

         $adminCommands .= _('normal') . "&_nbsp;|&_nbsp;<a href=\"$link\">" . _('full') .'</a>&_nbsp;]'; 
      } else { 
         $adminCommands .= "<a href=\"$link\">" . _("normal") .'</a>&_nbsp;|&_nbsp;'. _('full') .'&_nbsp;]';

**************
Remove the _ from &_nbsp;
and replace it with this
**************

              $adminCommands .= _('normal') . "&_nbsp;|&_nbsp;<a href=\"$current_url\" onClick=\"'. pop_image(\"view_pimage.php?index=\" . $index).';\">" . _('full') .'</a>&_nbsp;]'; 
      } else { 
              $adminCommands .= "<a href=\"$current_url\" onClick=\"'. pop_image(\"view_popimage.php?index=\" . $index).';\">" . _("normal") .'</a>&_nbsp;|&_nbsp;'. _('full') .'&_nbsp;]';

**************
Remove the _ from between the &_nbsp;
In the same file (viewphoto.php) find this
**************
$href= makeAlbumUrl($gallery->session->albumName, $id, array("full" => 1));
**************
and replace it with this
**************
$href= '#" onClick='.pop_image("view_popimage.php?index=" . $index).';return false';
**************
Save and close viewphoto.php
**************
Open inline_imagewrap.inc and find this
**************

if (!empty($href) ) { 
  $href_tag= "<a href=\"$href\">$tag</a>"; 
} else { 
  $href_tag=$tag; 
}

**************
and replace it with this.
**************

if (!isset($full)) {
if (!empty($href) ) {
   $href_tag= "<a href=\"$href\">$tag</a>";
} else {
   $href_tag=$tag;
}
}else{

if (!empty($href) ) { 
   $href_tag= "<a href=\"$href\">$tag</a>"; 
} else { 
   $href_tag= '#" onClick='.pop_image("view_popimage.php?index=" . $index).';return false';	      
}
}

**************
Open your favorite text editor and create a new php file called view_popimage.php
Place the code below in it and save it to you gallery folder.
**************

<?php 
/* 2/01/2003 New file for popup window */ 

// Hack prevention. 
if (!empty($HTTP_GET_VARS["GALLERY_BASEDIR"]) || !empty($HTTP_POST_VARS["GALLERY_BASEDIR"]) || !empty($HTTP_COOKIE_VARS["GALLERY_BASEDIR"])) { 
print _("Security violation") ."\n"; 
exit; 
} 

require(dirname(__FILE__) . '/init.php'); 

// Hack check 
if (!$gallery->user->canReadAlbum($gallery->album) && (!$gallery->user->canViewFullImages($gallery->album))) { 
return; 
} 
?> 

<html> 
<head>  
<?php 
$photo = $gallery->album->getPhoto($index); 
$image = $photo->image; 
$photoURL = $gallery->album->getAlbumDirURL("full") . "/" . $image->name . "." . $image->type; 
echo "<title>" . $gallery->album->getCaption($index) . "</title>"; 
echo "</head>"; 
echo "<body background=\"" . $photoURL . "\">"; 
?> 
</body> 
</html>

I hope this helps it works great in mine. Let me know what you think.
Edited by floridave to use the code for better fromating and not loosing whitespace.

 
beniam

Joined: 2004-04-23
Posts: 20
Posted: Fri, 2004-05-21 03:57

I'm hoping you left a step out, because it just doesn't work in gallery 1.4.3. I know you have it going on a slightly later version but I thought I would give it a try. Sorry to say it didn't quite acheve the same result. My just results in a blanck window with the proper name but no picture what so ever. I would love to get this working, so if you , or pixel poet have any ideas, I would love to hear about them.

I was wondering, is the view_pimage.php below correct, or is it supposed to be view_popimage.php? I changed it and it didn't have any effect.

$adminCommands .= _('normal') . "&|&<a href=\"$current_url\" onClick=\"'. pop_image(\"view_pimage.php?index=\" . $index).';\">" . _('full') .'</a>&]'; 
} else { 
$adminCommands .= "<a href=\"$current_url\" onClick=\"'. pop_image(\"view_popimage.php?index=\" . $index).';\">" . _("normal") .'</a>&|&'. _('full') .'&]';

I was also wondering if I already have a background immage set, does this still work? Feel free to check it out at [url]www.bengm.com/gallery[/url]. It's just a test site and random pics but you will get the idea.

Any Ideas?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2004-05-21 05:23

RustedNail, Great job!
A few things that I can change on the above post if RustedNail does not do it. In the new file view_popimage.php remove some carriage returns: (whitespace) also to remove the css call

<?php 
/* 2/01/2003 New file for popup window */ 

// Hack prevention. 
if (!empty($HTTP_GET_VARS["GALLERY_BASEDIR"]) || !empty($HTTP_POST_VARS["GALLERY_BASEDIR"]) || !empty($HTTP_COOKIE_VARS["GALLERY_BASEDIR"])) { 
print _("Security violation") ."\n"; 
exit; 
} 

require(dirname(__FILE__) . '/init.php'); 

// Hack check 
if (!$gallery->user->canReadAlbum($gallery->album) && (!$gallery->user->canViewFullImages($gallery->album))) { 
return; 
} 
?> 

<html> 
<head>  
<?php 
$photo = $gallery->album->getPhoto($index); 
$image = $photo->image; 
$photoURL = $gallery->album->getAlbumDirURL("full") . "/" . $image->name . "." . $image->type; 
echo "<title>" . $gallery->album->getCaption($index) . "</title>"; 
echo "</head>"; 
echo "<body background=\"" . $photoURL . "\">"; 
?>
</body> 
</html>

I think there should be a double check to see if the user has permissions to view the full sized images:

// Hack check 
if (!$gallery->user->canReadAlbum($gallery->album) && (!$gallery->user->canViewFullImages($gallery->album))) { 
return; 
}

View_photo.php does the check already but there is way to prevent somebody from just typing in a URL.
And I should also mention that the forum does not like html spaces: &_nbsp; without the underscore. So when posting code that has html spaces use a underscore and tell the reader to remove the underscore.

Dave

PS if the code above gets changed then I can remove my post to prevent the thread from getting long and difficult to read.

 
beniam

Joined: 2004-04-23
Posts: 20
Posted: Fri, 2004-05-21 17:25

I can't seem to get it to work. I just get a blank window that looks like it could be the right size but it has my default background on it and not the picture.

Would love some help with this. Do you think I have to upgrade?

Ben

 
RustedNail

Joined: 2004-05-19
Posts: 10
Posted: Fri, 2004-05-21 21:22
beniam wrote:
I can't seem to get it to work. I just get a blank window that looks like it could be the right size but it has my default background on it and not the picture.

Would love some help with this. Do you think I have to upgrade?

Ben

When you goto your gallery and click a picture in the album to view does it show a javascript error on the bottom left of the browser. Try going to the properties of the album and find this

Offer visitors ability to specify preference for full-size or resized images

put it to no and it should work. I just checked mine and it did the same thing it would not work if I gave the user the option to view resized or full. but with the option off it works great.

floridave thanks for the help, I changed the post above to reflect what you changed.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2004-05-21 22:02

beniam,
In your view_popimage.php you are calling a style sheet. Try RustedNail's new code above and you shoule be good to go.

Dave

 
RustedNail

Joined: 2004-05-19
Posts: 10
Posted: Fri, 2004-05-21 22:41

yea remake the popimage.php file with the new code above you popup is using the css and is putting in a background and your image is not showing up

 
beniam

Joined: 2004-04-23
Posts: 20
Posted: Sat, 2004-05-22 04:57

It seems I am making progress! I got the full sized immage to show up in a new window but one problem remains. I get this:

Quote:
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/beniam/public_html/gallery/view_popimage.php:2) in /home/beniam/public_html/gallery/session.php on line 60

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/beniam/public_html/gallery/view_popimage.php:2) in /home/beniam/public_html/gallery/session.php on line 60

It is displayed in the upper left side of the page over the immage. Any ideas? It is almost perfect...

Thanks again for the help!
Ben

 
beniam

Joined: 2004-04-23
Posts: 20
Posted: Sun, 2004-05-23 05:13

Anyone have any ideas? I re-did eveything and I'm still getting those warnings. I would really love it if someone could bail me out. You can check out my tiny little gallery at [url]www.bengm.com/gallery[/url].

Thanks.

Ben

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2004-05-23 05:38

beniam,
Try the steps over agian with your backup (you did a backup right?) You can get a error like that if util.php has a extra space or carriage returns. At the end is a common mistake. I suspect your util.php since the popup prtion works.

Dave

 
beniam

Joined: 2004-04-23
Posts: 20
Posted: Sun, 2004-05-23 17:27

I got it working!

It was infact the carriage returns. I had went throught the util.php and got rid of them, but it didn't do anything. I then went throught the view_popimage.php and got rid of them there and that solved it!

Thanks for sticking with me floridave! And thanks to RustedNail for doing the heavy lifting. I'm so excited to report that the hack works perfectly now.

Ben

 
Gaile

Joined: 2002-07-20
Posts: 1301
Posted: Mon, 2004-05-24 19:22
RustedNail wrote:
Yea finaly we can stop having 50 million posts asking for a popup for 1.4.3

Hurray! Now maybe I'll stop getting email asking when I'll fix the code I wrote for the earlier version! (cuz I hadn't looked at it since I wrote the original instructions, to be totally honest...)

Thanks, RustedNail - you've made millions (okay, so maybe just hundreds) of people happy! :D :) :wink:

Gaile

 
TheMartian

Joined: 2004-03-17
Posts: 13
Posted: Sat, 2004-05-29 19:40

RustedNail (or anyone), do you have a site where i can see the finished product of these mods?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2004-05-29 20:09

TheMartian,
Not my site but beniam's. It is implemented:
http://www.bengm.com/pictures/

Dave

 
RustedNail

Joined: 2004-05-19
Posts: 10
Posted: Sat, 2004-05-29 21:26

I have it on my site but I don't use it I made it for everyone else that wants popups.

 
TheMartian

Joined: 2004-03-17
Posts: 13
Posted: Sun, 2004-05-30 19:18

cool... do you think that there is an easy way to change this code to make the thumbnails open a new window... then have a mid sized version of the pic in a new window then the user could click that and see the full sized version in the same window?

 
TheMartian

Joined: 2004-03-17
Posts: 13
Posted: Tue, 2004-06-01 20:38

...bump... ...anyone?

 
allyse

Joined: 2003-09-29
Posts: 18
Posted: Wed, 2004-06-02 23:34

Im getting a script error when I run this hack. It refers to this line:

<td class="admin" align="right" valign="middle" width="3000" height="18">&<span class="admin">&Vis bilder:&[&normal&|&<a href="" onClick="'. pop_image("view_pimage.php?index=" . 3).';">full</a>&]<br></span>&</td>

Any ideas?

http://galleri.automotor.no/valerbanen_210504-230504/DSCF0440

 
RustedNail

Joined: 2004-05-19
Posts: 10
Posted: Fri, 2004-06-04 04:09
allyse wrote:
Im getting a script error when I run this hack. It refers to this line:

<td class="admin" align="right" valign="middle" width="3000" height="18">&<span class="admin">&Vis bilder:&[&normal&|&<a href="" onClick="'. pop_image("view_pimage.php?index=" . 3).';">full</a>&]<br></span>&</td>

Any ideas?

http://galleri.automotor.no/valerbanen_210504-230504/DSCF0440

Try going to the properties of the album and find this

Offer visitors ability to specify preference for full-size or resized images

put it to no and it should work. I just checked mine and it did the same thing it would not work if I gave the user the option to view resized or full. but with the option off it works great

If your using popups why do you give the user the option of view normal or full this saves you bandwidth.

 
Gaile

Joined: 2002-07-20
Posts: 1301
Posted: Tue, 2004-06-08 02:02

My turn for a question - I have this working on v1.4.3 pl2 except for the following message which shows up in the popup in Opera:

Quote:
Fatal error: Call to a member function on a non-object in /home/xxxxxx/xxxxx/xxxx/classes/User.php on line 141

Line 141 - 143:

if ($album->canRead($this->uid)) {
			return true;
		}

Ideas on how to fix this?

Thanks,

Gaile

 
Gaile

Joined: 2002-07-20
Posts: 1301
Posted: Wed, 2004-06-09 00:25

Here I am what I said I wouldn't do ... bumping this topic up.

I have another question too - how hard would it be to put the link to the popup under the intermediate image instead of having that image clickable? (lazy me, I know...) :P

Gaile

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2004-06-11 02:52

PixelPoet,
Nice to know that the 'teacher' needs help once in a while. :-)

You can add a link under the image in view_photo by renaming this to /html_wrap/inline_photo.frame

<?php
/* $Id: inline_photo.frame.default,v 1.5 2004/03/02 14:10:38 jenst Exp $ */
?>

	<?php
	include (dirname(__FILE__) . '/inline_imagewrap.inc');
	?>
<?php 
global $gallery; 
$photo = $gallery->album->getPhoto($GLOBALS["index"]); 
if ($GLOBALS['full']) { 
$photoURL = $gallery->album->getAlbumDirURL("full") . "/" . $gallery->album->getPhotoId($GLOBALS['index']) . "." . $photo->image->type; 
} 
else { 
$photoURL = $gallery->album->getAlbumDirURL("full") . "/" . $gallery->album->getPhotoId($GLOBALS['index']) . "." . $photo->image->type; 
} 
echo "<br><a href=\"javascript:void window.open('$photoURL','pop','menubar=yes,scrollbars=auto')\">inline-photo-frameFull javascrip popup</a>"; 
echo "<br><a href=\"$href\">inline-photo-frame-Full popimg</a>";
?>

There is 2 echo statements at the bottom that you can remove the one that you don't like.

One uses JavaScript popup window - you can add window properties to it like the size, toolbar etc.

The second uses the link to the new pop_image file.
Edit the names of the links to your desires.
Remove the one you don't want.

Dave

 
Gaile

Joined: 2002-07-20
Posts: 1301
Posted: Fri, 2004-06-11 03:12

So Dave... :lol:

floridave wrote:
PixelPoet,
Nice to know that the 'teacher' needs help once in a while. :-)

How 'bout that eh? :wink: (actually, the more features that get added the more code there is to wade thru, so help is good)!

As I mentioned in my PM... (check your mail) - a thousand thanks to you! It is very much appreciated.

Gaile

 
sandervd

Joined: 2004-07-16
Posts: 1
Posted: Fri, 2004-07-16 15:08

All, I have tried to tweak my install this morning -- unfortunately I have version 1.4.4 RC1 and I can't get it to work... I'm not too familiar with php and am not able to figure out myself if the problem has been caused by the version or a type somewhere.

This is the error when clicking on the intermediate image: "Parse error: parse error, unexpected $ in /xxx/xxx/www/plmtest/gallery/view_photo.php on line 732" Line 732 is the last line of the file.

Thanks for your help!
Sander.

 
Atealtha

Joined: 2004-07-14
Posts: 6
Posted: Fri, 2004-07-16 15:36

First thanks to Floridave for pointing me to this thread. And Rustednail for the hack.

If you want to add a click-then-close function to the popup, put this in the view_popimage.php instead:

<?php
/* 2/01/2003 New file for popup window */

// Hack prevention.
if (!empty($HTTP_GET_VARS["GALLERY_BASEDIR"]) || !empty($HTTP_POST_VARS["GALLERY_BASEDIR"]) || !empty($HTTP_COOKIE_VARS["GALLERY_BASEDIR"])) {
print _("Security violation") ."\n";
exit;
}

require(dirname(__FILE__) . '/init.php');

// Hack check
if (!$gallery->user->canReadAlbum($gallery->album) && (!$gallery->user->canViewFullImages($gallery->album))) {
return;
}
?>

<html>
<head> 
<?php
$photo = $gallery->album->getPhoto($index);
$image = $photo->image;
$photoURL = $gallery->album->getAlbumDirURL("full") . "/" . $image->name . "." . $image->type;
echo "<title>" . $gallery->album->getCaption($index) . " [click to close]</title>";
echo "</head>";
echo "<body leftmargin=\"0\" topmargin=\"0\" marginheight=\"0\" marginwidth=\"0\" onBlur=\"self.close()\" onClick=\"self.close()\" background=\"" . $photoURL . "\">";
?>
</body>
</html>

But if you already made changes and don't want to replace anything, all you have to do is add this into your <body> tag:

leftmargin=\"0\" topmargin=\"0\" marginheight=\"0\" marginwidth=\"0\" onBlur=\"self.close()\" onClick=\"self.close()\"

One question I still have, how can I get it so that clicking a thumbnail brings the popup?

 
Atealtha

Joined: 2004-07-14
Posts: 6
Posted: Fri, 2004-07-16 15:57

Also, after I installed this, the [print this photo with "select service"] pulldown shows up even when I disabled it. That goes for click counts as well.

 
Atealtha

Joined: 2004-07-14
Posts: 6
Posted: Fri, 2004-07-16 20:07

This is regarding the thumbnail -> popup. I'm getting close.

In view_album.php I replaced

$gallery->html_wrap['imageHref'] =   makeAlbumUrl($gallery->session->albumName, $id);

with

require_once ('util.php');
$gallery->html_wrap['imageHref'] = " onClick=\"". pop_image("view_popimage.php?index=" . $index) . ";\">";

But I get this message

Quote:
ERROR: requested index [] out of bounds [6]
Fatal error: Call to a member function on a non-object in /home/atealtha/public_html/util.php on line 56

Line 56 is regarding the width and height needed to for the javascript popup code. Can anyone help me out here? Much thanks.

 
Atealtha

Joined: 2004-07-14
Posts: 6
Posted: Fri, 2004-07-16 20:35

ok news flash, I did it! It feels like a real quick and dirty hack and there might be chances where the full picture might repeat in the popup (if the image is real small, say 50x50 pixels). If anyone has fixes to add, please do.

in view_album.php find:
require(dirname(__FILE__) . '/init.php');

under it, add:
require_once('util.php');

still in view_album.php find:
$gallery->html_wrap['imageHref'] = makeAlbumUrl($gallery->session->albumName, $id);

replace with:

$index = $gallery->album->getPhotoIndex($id);
$gallery->html_wrap['imageHref'] = "#\" onClick=". pop_image("view_popimage.php?index=" . $index);

That is it! So simple but hard to figure out (for me anyways). This type of setup is very useful for a minimalistic style, or for portfolios (which is why I went through the trouble figuring this out). Hope you guys find this useful.

 
Herr.Vorragend
Herr.Vorragend's picture

Joined: 2004-07-16
Posts: 120
Posted: Sat, 2004-08-07 13:25

Question:
I am using gallery embedded into postnuke.

If I click on an image the browser will load the following URL:
w?w.carsten-volmer.de/"modules.php?index=1&op=modload&name=gallery&file=index&include=view_popimage.php"

Take a look at the " (i don't know the english name for it)

I included the "view_popimage" file in my index.php

So If I manually enter the following URL without the " everything is fine.

w?w.carsten-volmer.de/modules.php?index=1&op=modload&name=gallery&file=index&include=view_popimage.php

Any idea? Thanks?

My inline_imagewrap.inc changes (from the first post in this thread):

if (!empty($href) ) { 
   $href_tag= "<a href=\"$href\">$tag</a>"; 
} else { 
   $href_tag= '#" onClick='.pop_image("view_popimage.php?index=" . $index).';return false';         
} 
}
 
Herr.Vorragend
Herr.Vorragend's picture

Joined: 2004-07-16
Posts: 120
Posted: Mon, 2004-08-09 16:36

Oops. I thought that it was a smaller problem to get rid of the " sign. ;-)

Anyone there, who can help me?

 
bificypdog

Joined: 2004-03-15
Posts: 26
Posted: Wed, 2004-08-11 16:35

Is there a coder out there?
Is it difficult to change the code.
I am using gallery embedded in postnuke, too. And I get the same URL-problem.

 
Herr.Vorragend
Herr.Vorragend's picture

Joined: 2004-07-16
Posts: 120
Posted: Tue, 2004-08-17 17:48
function pop_image($url, $url_is_complete=0) { 
   global $gallery, $index; 

   /* Separate the target from the arguments */ 
   list($target, $arglist) = split("\?", $url); 

   /* Split the arguments into an associative array */ 
   $tmpargs = split("&", $arglist); 
   foreach ($tmpargs as $arg) { 
      if (!$arg) { 
         continue; 
      } 
      list($key, $val) = split("\=", $arg); 
      $args[$key] = $val; 
   } 

   if (!$url_is_complete) { 
      $url = makeGalleryUrl($target, $args); 
//      $url = "\"$url\""; 
   } 
    
   $photo = $gallery->album->getPhoto($index); 
   $image = $photo->image; 
   list($iWidth, $iHeight) = $image->getRawDimensions(); 

   // maybee I should add the album name w/o spaces to winName 
   // solution for now is simply add time to name of window 
   $winName = time() . $index; 
   $winName = str_replace(" ", "", $winName); 


   return popup_js($url, $winName, 
      "height=" . $iHeight . ",width=" . $iWidth 
.",location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no"); 

} 

Simple remark or delete this entry:

//      $url = "\"$url\""; 

No more changes neccesary

 
mbryner

Joined: 2004-08-18
Posts: 7
Posted: Wed, 2004-08-18 21:46

This popup mod. is great! This was just what I needed, almost......

What if the popup image is larger than the screen size? On Mozilla, Safari, Konquerer, and IE the popup has no scroll bars! Is there a simple fix?

Thanks in advance.

 
mbryner

Joined: 2004-08-18
Posts: 7
Posted: Thu, 2004-08-19 19:00

Here's how to fix not being able to scroll images in the popup window (solved my own question):
Apparently using "<body background=....> doesn't allow scrolling (because the background is tiled if necessary?). The solution is use "<body><img src=...>".

In view_popimage.php, change:

echo "<body background=\"" . $photoURL . "\">";

to:

echo "<body bgcolor=\"#000000\"><img src=\"" . $photoURL . "\" border=0>";

Then, in util.php, you can set the scrollbars=yes toward the bottom of the pop_image function.

See http://www.jimwuerstlin.com for a working example (though only a few images on this test site are large enough to even have pop-ups after the intermediate size image).

Marcus

 
jin410

Joined: 2004-09-05
Posts: 5
Posted: Sun, 2004-09-05 04:11

hey guys

im running Gallery v1.4.4-pl2 and i've tried to edit the files like the tutorial said. when i click on the image to get a full view i get a popup window the size of the image, but i get and error page "page can not be found"

any ideas? it seems to be half working

thanks

 
imation

Joined: 2004-09-07
Posts: 5
Posted: Wed, 2004-09-15 19:48

i have the same problem like jin410!

any ideas?!

 
silhouette00

Joined: 2004-09-17
Posts: 2
Posted: Fri, 2004-09-17 06:03

Ok, I have it working, but need help. Since the link is href="#", when you click on a photo and the larger image pops up the album page refreshes and goes back to the top. How can I easily remove the href="#" or have the album page not refresh at all? I tried and for the life of me I can't get it to where I want it.

Site in question: http://www.kathymccarthy.com/portfolio/fashion

 
silhouette00

Joined: 2004-09-17
Posts: 2
Posted: Fri, 2004-09-17 17:17

Would also like to add a title tag (such as "Click to Enlarge") to the thumbnail image.

Can any one assist for the problem in the above post and for this one?

 
highestblue

Joined: 2004-09-26
Posts: 1
Posted: Sun, 2004-09-26 23:03

Hello,

I got the popup window to work in a standalone gallery. And the popup windows shows the proper url address when opened such as below,

But when gallery is embeded under mambo, popup window takes me to address as below,

I've tried everything posted in the forums, and tried fixing some things myself, but could not reach a solution.

I figure I have to tweak the coding so that popup window gets redirected to the proper url address, but this is over my head.

I would much appreciate some help.

Thanks :)

 
khsjr1970

Joined: 2004-04-24
Posts: 271
Posted: Wed, 2004-11-10 23:21

anyone with this working in 1.4.4 pl4 ?

 
chet
chet's picture

Joined: 2004-11-29
Posts: 10
Posted: Mon, 2004-11-29 07:36

yes i have it working with PHP nuke save the file on the link below and replace your existing ones.

you will also need to edit your index.php file to include
"view_popimage.php",
Chet

Dont forget to backup your originals
:-?
http://www.vicpics.com/gallery1_4_4popupfiles.zip

Edit: Fixed broken link

 
khsjr1970

Joined: 2004-04-24
Posts: 271
Posted: Mon, 2004-11-29 23:37

I am not using nuke, I am using the standalone. therefore are, the files you are giving me, still usable ?

 
chet
chet's picture

Joined: 2004-11-29
Posts: 10
Posted: Tue, 2004-11-30 08:40
khsjr1970 wrote:
I am not using nuke, I am using the standalone. therefore are, the files you are giving me, still usable ?

yes they are original gallery files from 1.4.4

show me your site when you get it done...

Take care
Chet

just give me a shout if you have any problems

 
khsjr1970

Joined: 2004-04-24
Posts: 271
Posted: Tue, 2004-11-30 22:54
chet wrote:
yes i have it working with PHP nuke save the file on the link below and replace your existing ones.

you will also need to edit your index.php file to include
"view_popimage.php",
Chet

Thanks chet, ok ive downloaded the files, you say to edit my index.php to include view_popimage.php.

A) where am I putting that code.
B) view_popimage.php is not included in your files ?

 
chet
chet's picture

Joined: 2004-11-29
Posts: 10
Posted: Wed, 2004-12-01 03:55

go to your index.php file around line 102 you will see a list like this

	$safe_to_include =
		 array(
		       "add_comment.php",
		       "add_photos.php",
		       "add_photos_frame.php",
		       "album_permissions.php",
		       "albums.php",
		       "block-random.php",
		       "captionator.php",
		       "copy_photo.php",
		       "create_user.php",
		       "delete_album.php",
		       "delete_photo.php",
		       "delete_user.php",
		       "do_command.php",
		       "edit_appearance.php",
		       "edit_caption.php",
		       "edit_field.php",
		       "edit_thumb.php",
		       "edit_watermark.php",
		       "extra_fields.php",
		       "gallery_remote.php",
		       "gallery_remote2.php",
		       "highlight_photo.php",
		       "login.php",
		       "manage_users.php",
		       "modify_user.php",
		       "move_album.php",
		       "move_photo.php",
		       "multi_create_user.php",
		       "photo_owner.php",
		       "poll_properties.php",
		       "poll_results.php",
		       "progress_uploading.php",
		       "publish_xp.php",
		       "publish_xp_docs.php",
		       "register.php",
		       "rename_album.php",
		       "reset_votes.php",
		       "resize_photo.php",
		       "rotate_photo.php",
		       "save_photos.php",
		       "search.php",
		       "slideshow.php",
		       "slideshow_high.php",
		       "slideshow_low.php",
		       "sort_album.php",
		       "tools/find_orphans.php",
		       "upgrade_album.php",
		       "upgrade_users.php",
		       "user_preferences.php",
		       "view_album.php",
		       "view_comments.php",
		       "view_photo.php",
		       "view_photo_properties.php",
		       "watermark_album.php",
		       );
	
	if (!in_array($include, $safe_to_include)) {
	    $include = htmlentities($include);
	    print sprintf(_("Security error!  The file you tried to include is not on the <b>approved file list</b>.  To include this file you must edit %s's index.php and add <b>%s</b> to the <i>\$safe_to_include</i> array"), 
			    'Gallery', $include);
	    exit;
	}

just add it to that list

Chet

 
khsjr1970

Joined: 2004-04-24
Posts: 271
Posted: Wed, 2004-12-01 06:24

Thanks for that reply, I think you missed my second question.

its calling view_popimage.php, this file is not included in your files that are zipped. I take it that I should be getting this from somewhere elese earlier in the thread ?

Thanks for your help with this. I really appreciate it.

 
chet
chet's picture

Joined: 2004-11-29
Posts: 10
Posted: Wed, 2004-12-01 06:33

sorry i missed that

just copy and paste this into your editor and save it as view_popimage.php

<?php 
/* 2/01/2003 New file for popup window */ 

// Hack prevention. 
if (!empty($HTTP_GET_VARS["GALLERY_BASEDIR"]) || !empty($HTTP_POST_VARS["GALLERY_BASEDIR"]) || !empty($HTTP_COOKIE_VARS["GALLERY_BASEDIR"])) { 
print _("Security violation") ."\n"; 
exit; 
} 

require(dirname(__FILE__) . '/init.php'); 

// Hack check 
if (!$gallery->user->canReadAlbum($gallery->album) && (!$gallery->user->canViewFullImages($gallery->album))) { 
return; 
} 
?> 

<html> 
<head>  
<?php 
$photo = $gallery->album->getPhoto($index); 
$image = $photo->image; 
$photoURL = $gallery->album->getAlbumDirURL("full") . "/" . $image->name . "." . $image->type; 
echo "<title>" . $gallery->album->getCaption($index) . "</title>"; 
echo "</head>"; 
echo "<body background=\"".$photoURL."\">"; 
?> 
</body> 
</html>

then place it in your main gallery directory
yes long day and i am kind of slow sometimes :-?

 
khsjr1970

Joined: 2004-04-24
Posts: 271
Posted: Wed, 2004-12-01 18:35

ok, thanks for the education.

Unfortunately it doesnt work. I've done everything exactly as you say, yet the image will not pop in a new window.

you can see @ http://gallery.verymisunderstood.com

there is a javascript error on the page , this i know, I know what is causing that, as your view photo.php doesnt have my mod in it for my menu at the top of my screen. Ive chosen not to fix it, since, its looking like i will have to revert back to my original files.

have a look.
your guess is my best means of attack.

 
tmothy

Joined: 2004-03-06
Posts: 53
Posted: Wed, 2004-12-01 23:44

Does anyone have the latest gallery v1.4.4-pl4 version?

And if it isn't too much trouble can someone attach the edited stock files.

thx!

 
khsjr1970

Joined: 2004-04-24
Posts: 271
Posted: Thu, 2004-12-02 00:05

I have yet to get it working in 1.4.4. Still in process of working with it.

the files above were stated to work in 1.4.4 pl4 but I can't seem to get em running, Im about to revert back to my originals and just wait for Gallery 2 to hit production release.

I suppose this mod isnt that important to me , as most of my pictures are left within the confines of a 320 x 240 ratio. and fit on the screen anyway.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2004-12-02 00:54

khsjr1970, It uses javascript to open the new window so you have to fix your javascript error first then I bet it would work.

tmothy, have you read the thread? chet did it for you and has the files: http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&p=105797#105797

Dave