[Working] Full size popup for G1.5
Surfdude_nl
Joined: 2005-04-25
Posts: 8 |
Posted: Mon, 2005-04-25 22:07 |
Hi, I was looking over the forum and I found the pop-up sollution for 1.4.3, but that didn't work for me so I started editing the files. Now I got it working for V1.5. It is a first version and I'm not sure if everything is good and nicely done. But all you gallery guru's out here will point me out on that! I just hope I can help some people here a bit further. Before we start backup the files you change ! Here we go than. I hope it will be clear for most of you and that I still now how I did it ;) In util.php find 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"); } ************** ************** <?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; } $temp=$index_id; require(dirname(__FILE__) . '/init.php'); // Hack check if (!$gallery->user->canReadAlbum($gallery->album) && (!$gallery->user->canViewFullImages($gallery->album))) { return; } ?> <html> <head> <?php $index=$temp; $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> ************** Quote:
Error: Requested index [0] out of bounds [55] In view_popimage.php, try changing I (fryfrog) found this info here. Briefly, it is due to a change in the way php works. Previously, if you passed a variable using the "?variable=value" method, you could access it in the php page using "$variable" but in newer versions of php this was changed for various reasons to "$_GET["variable"]". I would bet the "new" way also works for slightly older version *and* there is supposidly a way to alter your php.ini to keep using the old way (but that could present security issues). I hope it works for you to and that I didn't forget anything with my sleepy head. It works fine for me. Thanks to RustedNail, PixelPoet and Dave for the fix that made it a lot easyer to make this. 8) Have a good night I'm going for a sleep! Bye! *edit: I (fryfrog) fixed a few very minor typos. viewphoto.php should be view_photo.php and there was a double of some instructions. Nothing major. I also fixed the out of bounds errors and edited your post. I added a little info about turning the scroll bars on and making the popup an <img> instead of <body background>. |
|
Posts: 8
Everything is great, however my full size image doesnt open in a new window. It goes from thumbnail to full size (great) but in the same window.
http://zombiemedia.arcand.org
Posts: 1
Gallery 1.5
I'm having trouble as well... when I access my Gallery directly, all is well, although I can't seem to turn on scrollbars. When I access it from inside my PostNuke site though, I get the following 404:
The requested URL /hs/"modules.php was not found on this server.
It's interesting, it's trying to put a double-quote in the url... but it doesn't do that when I load up gallery on it's own, outside of PostNuke.
__________________________________________________________
Also, I tried changing scrollbars=no to scrollbars=yes in util.php but it had no effect. I hard coded the window dimensions because I want to limit the window size, and set it to resize, but those srollbars aren't cooperating. This is the line as I have it now:
return popup_js($url, $winName, "height=600,width=800,location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=yes");
Any ideas?
http://www.hecticstudios.com/hs/modules/gallery - direct to my gallery
http://www.hecticstudios.com/hs - PostNuke still in production, but check it out to see what I'm talking about, the link to the gallery is in the main menu.
Posts: 8
anyone have any ideas?
Posts: 10
I tried to do that. The problem is that when the popup appears, I only see a message saying :
I don't know what this means but its not good for sure hehe
Can someone help ?
Thanx a lot
Alex
Posts: 8
The error means that the picture ID isn't getting true...
Your sure your gallery is 1.5? And that you followed all the above steps?
If thats so can you put the next line at the top of view_popimage.php:
This will print a the picture id on the pop-up screen (and 2 header warnings/errors, ignore them). Can you post here what you see on your pop-up.
Posts: 8
HecticDMC:
Put the scrollbars on yes in util.php (like you allready did).
Than replace the code in view_popimage.php for this:
The scroll didn't work because the image was loaded as a background. This will fix that problem.
I don't work with Postnuke so can't help you with that.
safetybar:
I tryed to look for the sollution of your problem. But I couldn't find where the link to image is created. You probably have to edit the link in view_album.php. I couldn't find where. Maybe someone els knows?
Goodluck,
Surfdude_nl
Posts: 10
Here is the error message I get when I insert the line you ask me to put :
Do you know how to fix that ?
Thank you.
Alex
Posts: 8
All right, thats not good.
Lets see...
Your sure you have gallery 1.5?
Did you do this part?
If you did that... Let's do the next thing. Can u put location on yes in util.php. And that post here what the addressbar in the pop-up windows says.
Posts: 10
I am sure I have version 1.5 and that I dit the steps two times.
When I put the location "on" I get :
And still the error message :
Posts: 8
I still can't even get the pop up.
Posts: 10
Anyone as a solution ???????
Posts: 7
I followed the instructions given by Surfdude_nl and ended up with similar problem to that of mtlfever. The popup opens as an empty page with the following error:
I then included the following in the viewpop
and got this message:
Does anyone have any ideas on how to fix this?? I am running running 1.5 and I think I did everything as Surfdude_nl wrote.
Posts: 10
So what's happening with that ? Is there a solution ? Surfdude_nl ? Floridave ? Anyone ????
:S !?!?
Alex
Posts: 8
Yeah, I'm stuck with a broken gallery
Posts: 271
your gallery is broke ?
if so go back to the files you backed up this should put your gallery back in working order. you did back them up didnt you?
if not redownload gallery, and re-up the files that you changed in this post.
This will at least "fix" your broken gallery.
Posts: 8
`
Sorry for my late reaction. I wasn't near a computer for a week. That feels pretty good ;) Lets see...
The strange thing is that the variable (index_id) is put in the address but view_popimage.php can't read it. Thats very strange because it works for me.
Maybe this is a PHP setting? Somebody knows? I have no idea what else it can be...
Posts: 8
Well it's not that it's broken...i'm still trying to have it so when you click on a thumbnail .. a sized new window opens with the picture....still no luck.
Posts: 271
With XP and pop up blockers of the day, I have only ever found this desired feature to be an annoyance rather then a benefit, but i wish you guys the best of luck with it.
Posts: 10
Please guys ! Help me ! I need that !
Alex
Posts: 6
On my site (http://web.ctsionline.com/~railyard/),
I'm getting a pop-up window, but with a 404 error. When I look at the location, it has doubled the beginning of the URL, like:
"http://web.ctsionline.com/~railyard/%22/~railyard/index.php?index_id=2...etc"
Any ideas on what's causing this?
I'm really hoping to use the pop-up solution in Gall v1.5 because my layout only allows for a 400px wide intermediate image.
thanks,
Scott
Posts: 6
follow-up:
I can now get a pop-up window displaying my image, but it's loading it within my Mambo template, rather than just the image by itself.
Anyone else have this issue?
Is this a problem with using Gallery embedded in Mambo, and if so, any solution?
thanks,
Scott
Posts: 6
... the same here.
i even don't get the image just the plain mambo template in the popup-window.
oliver
Posts: 3236
I just started poking around with this and am getting the same error that many others are. The index out of bounds thing. I went and put some debug code EVERYWHERE, and everything is fine except for the view_popimage.php. For some reason, even though the page is loaded with "?index_id=XX" the page can't use index_id.
Posts: 3236
Fixed! The problem stems from a change in the way PHP handles GET/POST variables. Or something. I found out about it here
In view_popimage.php, change
$temp=$index_id;
to
$temp=$_GET["index_id"];
and I bet everything will be a-okay!
You can see it working on my gallery by clicking on the sized image here.
Posts: 8
Getting closer! With that new fix I'm able to get the pop -up, however I'm still looking to go directly from Thumbnail to pop-up....does anyone have any ideas?
Thanks!
www.arcand.org/gallery
Posts: 3236
safetybar, you will need to look into making the same sort of changes in view_albums.php instead of view_photo.php. You'll have to figure out a way to make it pop up for images and not albums though. Also, if you want to be able to click the pop up and get ANOTHER popup for the full size... you'll have to do more work.
Posts: 8
Hmm, thanks for your help. I looked at the Album file and can't find anything. I'm trying the same thing with Coppermine right now and am at the same point with no way to go directly to the popup.
Posts: 115
I followed the instructions but when I click on the intermediate image to see the full image I Get :
"You don't have permission to access /"modules.php on this server"
I run gallery as a postnuke module.
Any ideas?
Thanks
Giorgos
Posts: 27300
add modules.php to your safe to include list in index.php
Posts: 115
Dave,
I add modules.php to the safe to include list in index.php but still getting :
Forbidden
You don't have permission to access /"modules.php on this server.
Giorgos
Posts: 27300
URL?
Just guessing.... add view_popimage.php to the safe to include list?
Sorry don't do *nuke.
Dave
Posts: 115
Dave
Is not working either.
The URL that redirects to the Forbidden response is:
http://www.dailyalbum.com/"modules.php?index_id=4&op=modload&name=Gallery&file=index&include=view_popimage.php"
The double quotes confusing me. The url gets rejected because of these quotes. If I remove them I just open the view_popimage.php script.
Anyway thanks for your help. I 'll keep searching. Maybe I'll post it at the *nuke forum.
Giorgos
Posts: 3236
So what is throwing in the " " that don't look like they belong?
Posts: 115
This url is poping up and then redirects to a 403 error.
This is between the quotes.
""modules.php?index_id=4&op=modload&name=Gallery&file=index&include=view_popimage.php""
For one or another way the code in util.php is generating a url with quotes which is rejected.
looks like postnuke issue but have no idea what.
Posts: 25
I've tried to add this to my new gallery 1.5 but I get the following errors in the new window:
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/virtual/site75/fst/var/www/html/gallery/view_popimage.php on line 2
Parse error: parse error, unexpected T_STRING in /home/virtual/site75/fst/var/www/html/gallery/view_popimage.php on line 2
I have little experience coding php but am learning - what does these errors mean?
Thanks,
Paul
Posts: 3236
How bout a link to your site so we can see the error? Does that file have anything about debug in it btw? Its been a while since I looked.
Posts: 25
Here's the URL to the gallery: http://www.pnladventures.com/gallery/
We're just setting it up so not all the albums have pictures in them. The new window opens but it displays those two error messages. The view_popimage.php doesn't have anything in it with the code 'debug' - not sure if that is what you meant.
What is the link supposed to the new window supposed to be? I get the file name (no extension) with a "#" symbol after the image name. Not sure if this is the way it is supposed to be or not.
Sorry for being just a newbie
Posts: 20
I'm getting the same "safe_to_include" problem with my Mambo/Gallery integration. I have added it to the array list, but still get:
Security error! The file you tried to include is not on the approved file list. To include this file you must edit Gallery's index.php and add view_popimage.php\" to the $safe_to_include array
That backslash and quotes looks like the file url is setup wrong to me.
Posts: 20
Got it working, there were some extra quotes in the util.php function. It doesn't pop up as just a picture in the Mambo/G1 integration though, it's still a part of the template.
Posts: 25
Care to give more details?
I'm still having the same problem as I posted above. I'm hoping that someone can lead me in the right direction ... anyone?
Thanks
Posts: 1
Bump
Anybody have this fix for Postnuke?
Posts: 6
This image link does the business in the view_photo.php page:
$href= 'javascript:void(0);" onClick='.pop_image("view_popimage.php?index_id=" . $index).';return false';
I still cannot get the full image to appear without the Mambo theme. Anyone know how to make just the HTML in view_popimage.php come into view?
Posts: 6
In the meantime, I have found a very quick solution to all the integration problems with Mambo, PHP Nuke and the rest...
Edit: util.php
Nothing required
Create: view_popimage.php
Finally on the view_photo.php page, you will need to comment out or replace this:
$href= makeAlbumUrl($gallery->session->albumName, $id, array("full" => 1));
...with this:
Clearly, you may wish to change some of the window preferences here.
Not bad for post #2?
Posts: 158
Can someone post the whole edit to to? Instead of bits and pieces here and there? I would be very gratefull.
-Andreas
Posts: 5
Hi Guys,
This is exacly what I am looking for but I am having a problem. i followed the instructions as best I could but I got his error when i went to view my gallery:
Parse error: parse error, unexpected T_STRING in /home/genki42/public_html/graciebarracalgary/gallery/util.php on line 28
I am using gallery 1.5 with mambo 4.5.3 in a seperate database but as a component.
Could anyone help me out here?
Thanks alot.
Mizzy
Posts: 5
Anyone have any ideas
Cheers
Miz
Posts: 3
For those of us who are using Gallery 1.5 and NOT embedding it inside a CMS of some kind (like wordpress), This code works, but instead of changing this line:
You need to change, instead, this line:
$href= makeAlbumUrl($gallery->session->albumName, $id, array("full" => 1));
to:
$href= '#" onClick='.pop_image("view_popimage.php?index_id=" . $index).';return false';
in view_photo.php. I have embedded my gallery inside MT and big images broke my site. THis worked for me, however.
Posts: 3
This means there's a syntax error on line 28. You are probably missing a quote or a semicolon or something.
Posts: 17
I agree, this is something I've been looking to do since I installed Gallery. But am afraid to try this because of the edits here and fixes there. Then a fix for the fix, etc. It's cool to have that feature, but is there a fully working edit for this yet? (in one post please :wink: )
Posts: 17
Well, I crossed my fingers and tackled this. I got it to work, but not how I'd like. I think this was mentioned here somewhere, but what I'd like it to do is go from ALBUM ONE'S, ALBUM TWO'S, etc., thumbs directly to the pop-up.
The way it works now.. clicking the thumb takes you to the page that gives you the choices (normal or full), if on normal and you click the pic, it opens the pop-up. If it's on full, it's not clickable.
So, basically.. eliminating that page (view_photo.php) and applying the pop-up to view_album.php.
I'm assuming you cannot edit the view_album.php exactly like the view_photo.php, or am I wrong?