';
my_flush();
$query = "UPDATE $picturetbl SET title='$newtitle' WHERE pid='$pid' ";
db_query($query);
++$i;
}
}
function filloptions()
{
global $albumtbl, $picturetbl, $categorytbl, $usertbl, $lang_util_php;
$query = "SELECT aid, category, IF(user_name IS NOT NULL, CONCAT('(', user_name, ') ',title), CONCAT(' - ', title)) AS title " . "FROM $albumtbl AS a " . "LEFT JOIN $usertbl AS u ON category = (" . FIRST_USER_CAT . " + user_id) " . "ORDER BY category, title";
$result = db_query($query);
// $num=mysql_numrows($result);
echo ' (3)';
print ' (4)';
print '';
}
function updatethumbs()
{
global $picturetbl, $CONFIG, $lang_util_php;
$phpself = $_SERVER['PHP_SELF'];
$albumid = $_POST['albumid'];
$updatetype = $_POST['updatetype'];
$numpics = $_POST['numpics'];
$startpic = 0;
$startpic = $_POST['startpic'];
$query = "SELECT * FROM $picturetbl WHERE aid = '$albumid'";
$result = db_query($query);
$totalpics = mysql_numrows($result);
if ($startpic == 0) {
// 0 - numpics
$num = $totalpics;
// Over picture limit
if ($totalpics > $numpics) $num = $startpic + $numpics;
} else {
// startpic - numpics
$num = $startpic + $numpics;
if ($num > $totalpics) $num = $totalpics;
}
$i = $startpic;
while ($i < $num) {
$image = $CONFIG['fullpath'] . mysql_result($result, $i, "filepath") . mysql_result($result, $i, "filename");
if ($updatetype == 0 || $updatetype == 2) {
$thumb = $CONFIG['fullpath'] . mysql_result($result, $i, "filepath") . $CONFIG['thumb_pfx'] . mysql_result($result, $i, "filename");
if (resize_image($image, $thumb, $CONFIG['thumb_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use'])) {
print $thumb .' '. $lang_util_php['updated_succesfully'] . '!
';
my_flush();
} else {
print $lang_util_php['error_create'] . ':$thumb
';
my_flush();
}
}
if ($updatetype == 1 || $updatetype == 2) {
$normal = $CONFIG['fullpath'] . mysql_result($result, $i, "filepath") . $CONFIG['normal_pfx'] . mysql_result($result, $i, "filename");
$imagesize = getimagesize($image);
if (max($imagesize[0], $imagesize[1]) > $CONFIG['picture_width'] && $CONFIG['make_intermediate']) {
if (resize_image($image, $normal, $CONFIG['picture_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use'])) {
print $normal . $lang_util_php['updated_succesfully'] . '!
';
my_flush();
} else {
print $lang_util_php['error_create'] . ':$normal
';
my_flush();
}
}
}
++$i;
}
$startpic = $i;
if ($startpic < $totalpics) {
?>