_list as $j) array_push($scr_cats, $scrcatnums[$i->_catnum][$j['catnum']]); array_push($scr_cats, 0); } while ($curnum < $n) { if ($scr_cats[$idx] == 0) { $idx++; } if ($curnum + $scr_cats[$idx] <= $n) { $curnum += $scr_cats[$idx]; $cat1++; $idx++; } else { $cat2 = $n - $curnum; $curnum = $n; } if ($cat1 >= count($categories[$cat0]->_list)) { $cat1 = 0; $cat0++; } } return "scummvm_{$categories[$cat0]->_catnum}_{$categories[$cat0]->_list[$cat1]['catnum']}_{$cat2}.jpg"; } function screenshot_caption ($id) { global $file_root; return implode("", file($file_root."/screenshots/scummvm_".$id.".txt")); } // Grab list of images from screenshot dir // and loop through them and add to $screenshots array $screenshots = array(); $scrcatnums = array(); $tmp = get_files($file_root."/screenshots","png"); foreach ($tmp as $image) { array_push($screenshots,$image); $cats = explode("_", $image); $n = count($cats); $t = explode(".", $cats[$n - 1]); $num = $t[0]; if ($scrcatnums[$cats[$n - 3]][$cats[$n - 2]] < $num + 1) $scrcatnums[$cats[$n - 3]][$cats[$n - 2]] = $num + 1; } $screenshots_count = count($screenshots); $thumb_w = 256; $thumb_h = 192; ?>