// Category Notification $tags['CATEGORY_TITLE'] = $cat_title; $tags['PHOTO_URI'] = $mod_url . "/index.php?lid=" . $lid . "&cid=" . $cid; gnavi_trigger_event('category', $cid, 'new_item', $tags); } redirect_header('index.php?page=admission', 2, _MD_A_GNAVI_ADMITTING); exit; } else { if (!empty($_POST['action']) && $_POST['action'] == 'delete' && isset($_POST['ids']) && is_array($_POST['ids'])) { // remove records // Ticket Check if (!$xoopsGTicket->check()) { redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors()); } foreach ($_POST['ids'] as $lid) { gnavi_delete_photos("lid=" . intval($lid)); } redirect_header("index.php?page=admission", 2, _MD_GNAV_SMT_DELETINGITEM); exit; } } // extracting by free word $whr = "l.status<=0 "; if ($txt != "") { $keywords = explode(" ", $txt); foreach ($keywords as $keyword) { $whr .= "AND (CONCAT( l.title , l.ext , c.title ) LIKE '%" . addslashes($keyword) . "%') "; } } // query for listing $rs = $xoopsDB->query("SELECT count(l.lid) FROM {$table_photos} l LEFT JOIN {$table_cat} c ON l.cid=c.cid WHERE {$whr}");
} else { @chmod($thumbs_dir, 0777); } } if (!empty($_POST['submit'])) { ob_start(); $result = $xoopsDB->query("SELECT lid , ext , res_x , res_y ,ext1 , res_x1 , res_y1 ,ext2 , res_x2 , res_y2 FROM {$table_photos} ORDER BY lid LIMIT {$start} , {$size}") or die("DB Error"); $record_counter = 0; while (list($lid, $ext, $w, $h, $ext1, $w1, $h1, $ext2, $w2, $h2) = $xoopsDB->fetchRow($result)) { $record_counter++; echo "---<strong> " . ($record_counter + $start - 1) . " </strong>---<br />\n"; // Check if the main image exists if (!is_readable("{$photos_dir}/{$lid}.{$ext}") && !is_readable($photos_dir . "/" . $lid . "_1." . $ext1) && !is_readable($photos_dir . "/" . $lid . "_2." . $ext2)) { echo _MD_A_GNAVI_MB_PHOTONOTEXISTS . " "; if ($removerec) { gnavi_delete_photos("lid='{$lid}'"); echo _MD_A_GNAVI_MB_RECREMOVED . "<br />\n"; } else { echo _MD_A_GNAVI_MB_SKIPPED . "<br />\n"; } continue; } gnavi_exeResize($lid, 0, $ext, $w, $h, 1); gnavi_exeResize($lid, 1, $ext1, $w1, $h1, 1); gnavi_exeResize($lid, 2, $ext2, $w2, $h2, 1); } $result_str = ob_get_contents(); ob_end_clean(); $start += $size; } function gnavi_exeResize($lid, $fileNo, $ext, $w, $h, $makethumbs)
// Ticket Check if (!$xoopsGTicket->check()) { redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors()); } // Delete $cid = intval($_POST['delcat']); //get all categories under the specified category $children = $cattree->getAllChildId($cid); $whr = "cid IN ("; foreach ($children as $child) { $whr .= "{$child},"; xoops_notification_deletebyitem($gnavi_mid, 'category', $child); } $whr .= "{$cid})"; xoops_notification_deletebyitem($gnavi_mid, 'category', $cid); gnavi_delete_photos($whr); $xoopsDB->query("DELETE FROM {$table_cat} WHERE {$whr}") or die("DB error: DELETE cat table"); redirect_header('index.php?page=category', 2, _MD_A_GNAVI_CATDELETED); exit; } else { if (!empty($_POST['batch_update'])) { // Batch update } } } } // // Form Part // xoops_cp_header(); include dirname(__FILE__) . '/mymenu.php';