PDA

View Full Version : Return of odd thumbnail problem, plus quirky categories


derevaun
04-15-2005, 05:44 AM
I took the opportunity to totally redo my site (http://asiftosay.com) with the 1.4 upgrade. Mostly I wanted to better organize my categories so I could use the IMAGE_CATEGORY tag to give basic camera info (e.g. "Brownie Starflex, Velvia, Cross processed"). And I wanted to shake off the weird behavior of my thumbnails in which there were fewer of them with some images.

1.4 is like a dream come true, but the thumbnail problem is back :cry:

I thought it was because I'd originally uploaded a bunch of images and then rearranged them back in time. But this time I just uploaded them a few hours apart and left them with their initial dates, but the problem persists. The third-to-last image only shows 8 (of 9) thumbnails, and the previous one only shows 7.

And, I'm having a hard time figuring out how to list the categories in their numerical order. I purposely made some unused categories (named "-") for future use amid the current categories so that all the cameras are before the lenses which are before the films. But when they're displayed, they're not in that order. In fact, I can't tell what order they're in. I've looked over the part of index.php that seems to retrieve them, but I don't know enough SQL to recognize any sorting going on.

These are minor problems that I can live with, but I'd appreciate any help just the same. :D

raminia
04-15-2005, 06:25 AM
categories are ordered to their index id.

about thumbnails. :)) I found it at last! I think it is inside the code where Punk has tried to calculate the number of thums ahead and before of the current image. I'll check this.

I move this Topic to v1.4 Bug report.

raminia
04-15-2005, 06:57 AM
change line 207-214 of index.php to this

if($aheadnumb <= $aheadlimit) {
$behindlimit = ($cfgrow['thumbnumber']-1)-$aheadnumb;
$aheadlimit = $aheadnumb;
}
if($behindnumb <= $behindlimit) {
$aheadlimit = ($cfgrow['thumbnumber']-1)-$behindnumb;
$behindlimit = $behindnumb;
}


the old bugged code was

if($aheadnumb <= "1") {
$behindlimit = ($cfgrow['thumbnumber']-1)-$aheadnumb;
$aheadlimit = $aheadnumb;
}
if($behindnumb <= "1") {
$aheadlimit = ($cfgrow['thumbnumber']-1)-$behindnumb;
$behindlimit = $behindnumb;
}


thank you for bug report I'll send this to Connie too to update the official release. ( I think it could be v1.4.01 now ;) )

Anonymous
04-15-2005, 03:24 PM
Categories aren't ordered by id. They're ordered depending on which category you edited last, or however MySQL sees fit since there is no order by specified in the select.

Do a search for the string "Modified from Mark Lewin's hack" around line 790 of index.php and change the $querystr to look like this:


$querystr = "select t1.cat_id,t2.name from ".$pixelpost_db_prefix."catassoc as t1 inner join ".$pixelpost_db_prefix."categories t2 on t1.cat_id = t2.id where t1.image_id = '$image_id' order by t1.cat_id";

Anonymous
04-15-2005, 07:52 PM
Success on both counts :D Wow! That was incredibly fast. Thanks guys!!!