ZenphotoCMS Forum
stoppeddesign, the upgrade, and you - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: stoppeddesign, the upgrade, and you (/thread-418.html)



stoppeddesign, the upgrade, and you - pearofducks - 2006-04-08

to continue using stoppdesign with the upgrade, add these lines to the corresponding files:

line 23 and on of i.php should look like this:
if(isset(&#36;_GET['s']) && &#36;_GET['s'] < 3000) { // Disallow abusive size requests.
if (&#36;_GET['s'] == "thumb") {
&#36;thumb = true;
if (&#36;_GET['f'] == "true") {
&#36;thumb_crop = true;
&#36;thumb_size = 230;
&#36;thumb_crop_width = 210;
&#36;thumb_crop_height = 60;};
}
else {
&#36;thumb = false;
}
&#36;size = &#36;_GET['s'];
}


you are adding the
if (&#36;_GET['f'] == "true") {
&#36;thumb_crop = true;
&#36;thumb_size = 230;
&#36;thumb_crop_width = 210;
&#36;thumb_crop_height = 60;};
}


and template-functions.php should have this block of code pasted in between functions, around line 534 (basically after the printAlbumThumbImage function):
function printAlbumThumbImageStopdesign(&#36;alt, &#36;class=NULL, &#36;id=NULL) {
echo "";
}




stoppeddesign, the upgrade, and you - trisweb - 2006-04-08

Ahhh... forgot about you hackers ;-) I meant to put this feature (custom-cropped/sized thumbnails) into this version. I guess it can wait til the next, which should take much less time than this one did.




stoppeddesign, the upgrade, and you - edasque - 2006-04-09

Which i.php and template.functions.php are we modifying ? The one in the theme or the main directory ?

What about the second modification (you are adding the
if (&#36;_GET['f'] == "true") {), where is that going ?

Erik




stoppeddesign, the upgrade, and you - edasque - 2006-04-09

So I made the modification to the files in the main directory and this is what I get:

http://www.generalmagic.org/gallery/

Everything seems to work ok but the images themselves do not show. Any idea ?

I was upgrading from 1.01beta so I didn't re-do any other modification since I had the theme working previously. Was that the wrong way to do it ? Should I re-install the theme ?




stoppeddesign, the upgrade, and you - edasque - 2006-04-09

please just ignore me at this point, it's just a comedy of errors on my part.




stoppeddesign, the upgrade, and you - edasque - 2006-04-09

Ok, now I think I got every thing right but as a consequence to the migration, it seems that the thumbnail image is either right for the gallery thumbnail or its attached photo thumbail.

Examples:
Animal & Face albums on : http://www.generalmagic.org/gallery/archive.php
and the photo thumbnail on:
http://www.generalmagic.org/gallery/index.php?album=Faces
and
http://www.generalmagic.org/gallery/index.php?album=Miscellaneous&image=Painting_1903_s.jpg
for example.

If I clear the album cache and reload a page with a thumbnail (let's say the gallery page), it'll get it right but the photo thumbnail will be wrong for the other entity (say the next photo thumbnail).

Erik




stoppeddesign, the upgrade, and you - trisweb - 2006-04-10

Yep, that's because it's a hack and doesn't save the wider images with different filenames...

I think 1.0.2 made this worse because it doesn't reprocess as much (a good thing). Once we make custom thumbs a part of the core, these problems should disappear (ntm we can include the stopdesign theme with the release ;-)




stoppeddesign, the upgrade, and you - pearofducks - 2006-04-10

shoot! i forgot something...edasque, try making these changes to your config.php, then clear any cache files for the images that are screwed up (or all)

&#36;conf['image_size'] = 480;
&#36;conf['image_use_longest_side'] = true;
&#36;conf['thumb_crop'] = true;
&#36;conf['thumb_crop_width'] = 80;
&#36;conf['thumb_crop_height'] = 80;
&#36;conf['thumb_size'] = 100;




stoppeddesign, the upgrade, and you - edasque - 2006-04-11

I already had all of this (I think those are the default). I cleared all the cache. It keeps making thumbnail either elongated for the highlighted photo or short for the album higlight depending on which you hit first.




stoppeddesign, the upgrade, and you - trisweb - 2006-04-11

What you see is the correct behavior for the code, edasque. The hack doesn't make a different filename for the two thumbnails when it should to keep them separate. To get it working, you can add something to the filename.

Change line 37 of i.php to:

&#36;newfilename = "/{&#36;album}_{&#36;image}_{&#36;size}" . (&#36;_GET['f'] ? "_wide" : "") . ".jpg";

I haven't tested this, but it should work great.




stoppeddesign, the upgrade, and you - edasque - 2006-04-11

sorry if I am being dense but with all the modifications, I don't know if I am looking at the right line.

Should I add this code to the end of:
if (&#36;_GET['f'] == "true") {
&#36;thumb_crop = true;
&#36;thumb_size = 230;
&#36;thumb_crop_width = 210;
&#36;thumb_crop_height = 60;

or right after:
} else {
&#36;thumb = false;

Isn't it being overriden by:
&#36;newfilename = "/{&#36;album}{&#36;image}{&#36;size}.jpg";
in any case (around line 48 or so ?) Or should we check if the newfilename varriable is empty before (re) assigning it ?

I do dab in code but don't know much about PHP.

Erik




stoppeddesign, the upgrade, and you - edasque - 2006-04-11

Answering my own post, this seems to have worked,

around line 48: if (empty(&#36;newfilename)) { &#36;newfilename = "/{&#36;album}{&#36;image}{&#36;size}.jpg"; }

and

&#36;newfilename = "/{&#36;album}{&#36;image}{&#36;size}" . (&#36;_GET['f'] ? "_wide" : "") . ".jpg";

was added right after

if (&#36;_GET['f'] == "true") {
&#36;thumb_crop = true;
&#36;thumb_size = 230;
&#36;thumb_crop_width = 210;
&#36;thumb_crop_height = 60;

This now works for me.




stoppeddesign, the upgrade, and you - trisweb - 2006-04-12

Excellent, thought so.

Like I said, I'll add native custom thumb sizes to a future release so we won't have to worry about hacking.

For future reference, I meant replace the line:

&#36;newfilename = "/{&#36;album}_{&#36;image}_{&#36;size}.jpg";

with the line:

&#36;newfilename = "/{&#36;album}_{&#36;image}_{&#36;size}" . (&#36;_GET['f'] ? "_wide" : "") . ".jpg";

but what you have should work fine as well, just a little kludgy.




stoppeddesign, the upgrade, and you - kenjabi - 2006-04-15

Just a heads up, I noticed define('OFFSET_PATH', true); is missing int he i.php distributed with stoppeddesign.

I had to add this one in to fix the images on the main image.php page being displayed.