$value) { if ( strpos($key, 'check') !== false && $value == 'on' ) { $objectID = (int) substr( $key, 5 ); $objectIDs .= strlen($objectIDs) ? ",{$objectID}" : $objectID; } } if ( strlen($objectIDs) ) { $query = "UPDATE `GalleryObjects` SET `Approved` = 1 WHERE `ID` IN ({$objectIDs})"; //echo $query; db_res( $query ); } } elseif ( isset($_POST['delete']) ) { foreach ($_POST as $key => $value) { if ( strpos($key, 'check') !== false && $value == 'on' ) { $objectID = (int) substr( $key, 5 ); $objectArr = db_arr( "SELECT `IDAlbum`, `Filename`, `ThumbFilename`, `OrderInAlbum` FROM `GalleryObjects` WHERE `ID` = {$objectID}" ); db_res( "DELETE FROM `GalleryObjects` WHERE `ID` = {$objectID}" ); db_res( "UPDATE `GalleryObjects` SET `OrderInAlbum` = `OrderInAlbum` - 1 WHERE `IDAlbum` = {$objectArr['IDAlbum']} AND `OrderInAlbum` > {$objectArr['OrderInAlbum']}" ); @unlink( "{$dir['gallery']}{$objectArr['Filename']}" ); if ( strlen($objectArr['ThumbFilename']) && file_exists("{$dir['gallery']}{$objectArr['ThumbFilename']}") ) @unlink( "{$dir['gallery']}{$objectArr['ThumbFilename']}" ); } } } $page = isset($_REQUEST['page']) ? ((int)$_REQUEST['page'] > 0 ? (int)$_REQUEST['page'] : 1) : 1; $p_per_page = isset($_REQUEST['p_per_page']) ? ((int)$_REQUEST['p_per_page'] > 0 ? (int)$_REQUEST['p_per_page'] : 10) : 10; $totalQuery = "SELECT COUNT(*) FROM `GalleryObjects` WHERE `GalleryObjects`.`Approved` = 0"; $totalArr = db_arr( $totalQuery ); $totalObjects = $totalArr[0]; $p_num = $totalObjects; $pages_num = ceil( $p_num / $p_per_page ); $real_first_p = (int)($page - 1) * $p_per_page; $page_first_p = $real_first_p + 1; $approveQuery = " SELECT `GalleryObjects`.`ID`, `GalleryObjects`.`Filename`, `GalleryObjects`.`ThumbFilename`, `GalleryObjects`.`ObjectType`, `GalleryObjects`.`Comment`, LEFT(`GalleryObjects`.`Comment`, 20) AS `CommentCut`, DATE_FORMAT(`GalleryObjects`.`Modified`, '$date_format' ) AS 'Modified', `GalleryAlbums`.`IDMember` FROM `GalleryObjects` LEFT JOIN `GalleryAlbums` ON `GalleryObjects`.`IDAlbum` = `GalleryAlbums`.`ID` WHERE `GalleryObjects`.`Approved` = 0 LIMIT {$real_first_p}, {$p_per_page};"; $approveRes = db_res( $approveQuery ); TopCodeAdmin(); ContentBlockHead("Unapproved gallery objects"); ?> No objects to approve'; } else { echo '
'. ResNavigationRet( 'ObjectsUpper', 0 ) .'
'; ?>
" method="post"> strlen($objectArr['CommentCut']) ) $objectTitle .= '...'; $objectTitle = "{$objectTitle}"; ?>
);">
'; ?>
Check all  /  Uncheck all
Selected objects:  | 
'. ResNavigationRet( 'ObjectsLower', 0 ) .''; } ?>