'; 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) { ?>
'; } else { printf($lang_util_php['error_rename'], $normal, $image); } } else { printf($lang_util_php['error_not_found'], $normal); print '
'; } ++$i; } } function deleteorphans() { global $picturetbl, $CONFIG, $lang_util_php; $phpself = $_SERVER['PHP_SELF']; $del = $_POST['del']; $single = $_POST['single']; $count = 0; if ($single) { $delone = db_query("DELETE FROM {$CONFIG['TABLE_COMMENTS']} WHERE msg_id=$single") or die ("failed to delete msgs - " . mysql_error()); } $result = db_query("SELECT pid,msg_id,msg_body FROM {$CONFIG['TABLE_COMMENTS']} WHERE 1"); while ($row = mysql_fetch_array($result)) { $pid = $row['pid']; $msg_id = $row['msg_id']; $msg_body = $row['msg_body']; $result2 = db_query("SELECT * FROM {$CONFIG['TABLE_PICTURES']} WHERE pid=$pid"); if (!mysql_num_rows($result2)) { if ($del == "all") { $Deletions = db_query("DELETE FROM {$CONFIG['TABLE_COMMENTS']} WHERE msg_id=$msg_id") or die ("failed to delete msgs - " . mysql_error()); } else { $count++; ?>
'.$count.' '.$lang_util_php['orphan_comment'].'

'; if ($count>=1) { ?>
Delete all orphans?
' . $lang_util_php['title'] . ' '; if ($action == 'thumbs') { global $picturetbl, $CONFIG; print '' . $lang_util_php['back'] . '
'; print '

' . $lang_util_php['thumbs_wait'] . '

'; updatethumbs(); echo '
' . $lang_util_php['back'] . ''; } else if ($action == 'continuethumbs') { print '' . $lang_util_php['back'] . '
'; print '

' . $lang_util_php['thumbs_continue_wait'] . '

'; updatethumbs(); echo '
' . $lang_util_php['back'] . ''; } else if ($action == 'title') { echo '' . $lang_util_php['back'] . '
'; print '

' . $lang_util_php['titles_wait'] . '

'; filenametotitle(0); echo '
' . $lang_util_php['back'] . ''; } else if ($action == 'deltit') { print '' . $lang_util_php['back'] . '
'; print '

' . $lang_util_php['delete_wait'] . '

'; filenametotitle(1); echo '
' . $lang_util_php['back'] . ''; } else if ($action == 'delnorm') { print '' . $lang_util_php['back'] . '
'; print '

' . $lang_util_php['replace_wait'] . '

'; deleteorig(); echo '
' . $lang_util_php['back'] . ''; } else if ($action == 'delorphans') { deleteorphans(); echo '
' . $lang_util_php['back'] . ''; } else { starttable('100%'); print ''; starttable('100%', $lang_util_php['title'] . ' (util.mod)', 2); print ''; print $lang_util_php['what_it_does'] . ': ' . $lang_util_php['instruction'] . ':
(1) ' . $lang_util_php['instruction_action'] . '
(2) ' . $lang_util_php['instruction_parameter'] . '
(3) ' . $lang_util_php['instruction_album'] . '
(4) '; printf($lang_util_php['instruction_press'], $lang_util_php['submit_form']); print ' '; print ''; endtable(); print '
'; starttable('100%', ' (1)'); print ' ' . $lang_util_php['update_what'] . ' (2):



' . $lang_util_php['update_number'] . '
' . $lang_util_php['update_option'] . '

'; endtable(); print '
'; starttable('100%', ' (1)'); print ' ' . $lang_util_php['filename_how'] . ' (2):





'; endtable(); print '
'; starttable('100%', ' (1)'); endtable(); print '
'; starttable('100%', ' (1)'); endtable(); print '
'; starttable('100%', ' (1)'); endtable(); print '
'; starttable('100%', '' . $lang_util_php['phpinfo'] . ' (1)'); endtable(); print '
'; starttable('100%', '' . $lang_util_php['update_db'] . ' (1)'); print ''.$lang_util_php['update_db_explanation'].''; endtable(); print '
'; print ' 
'; print '

'.$lang_util_php['select_album'].'

'; if (defined('UDB_INTEGRATION')) { udb_util_filloptions(); } else { filloptions(); } } print ''; endtable(); echo 'Util.mod 1.4 - Created by David Alberg Holm'; pagefooter(); ob_end_flush(); ?>