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($_GET['s']) && $_GET['s'] < 3000) { // Disallow abusive size requests.
if ($_GET['s'] == "thumb") {
$thumb = true;
if ($_GET['f'] == "true") {
$thumb_crop = true;
$thumb_size = 230;
$thumb_crop_width = 210;
$thumb_crop_height = 60;};
}
else {
$thumb = false;
}
$size = $_GET['s'];
}
--------
you are adding the
if ($_GET['f'] == "true") {
$thumb_crop = true;
$thumb_size = 230;
$thumb_crop_width = 210;
$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($alt, $class=NULL, $id=NULL) {
echo "<img src=\"" . getAlbumThumb() . "&f=true\" alt=\"$alt\" width=\"210\" height=\"60\"" .
(($class) ? " class=\"$class\"" : "") .
(($id) ? " id=\"$id\"" : "") . " />";
}
Comments
What about the second modification (you are adding the
if ($_GET['f'] == "true") {), where is that going ?
Erik
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 ?
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
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 ;-)
$conf['image_size'] = 480;
$conf['image_use_longest_side'] = true;
$conf['thumb_crop'] = true;
$conf['thumb_crop_width'] = 80;
$conf['thumb_crop_height'] = 80;
$conf['thumb_size'] = 100;
Change line 37 of i.php to:
`$newfilename = "/{$album}_{$image}_{$size}" . ($_GET['f'] ? "_wide" : "") . ".jpg";`
I haven't tested this, but it should work great.
Should I add this code to the end of:
if ($_GET['f'] == "true") {
$thumb_crop = true;
$thumb_size = 230;
$thumb_crop_width = 210;
$thumb_crop_height = 60;
or right after:
} else {
$thumb = false;
Isn't it being overriden by:
$newfilename = "/{$album}_{$image}_{$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
around line 48: if (empty($newfilename)) { $newfilename = "/{$album}_{$image}_{$size}.jpg"; }
and
$newfilename = "/{$album}_{$image}_{$size}" . ($_GET['f'] ? "_wide" : "") . ".jpg";
was added right after
if ($_GET['f'] == "true") {
$thumb_crop = true;
$thumb_size = 230;
$thumb_crop_width = 210;
$thumb_crop_height = 60;
This now works for me.
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:
`$newfilename = "/{$album}_{$image}_{$size}.jpg";`
with the line:
`$newfilename = "/{$album}_{$image}_{$size}" . ($_GET['f'] ? "_wide" : "") . ".jpg";`
but what you have should work fine as well, just a little kludgy.
I had to add this one in to fix the images on the main image.php page being displayed.