本文整理匯總了PHP中Gallery::Add_pics方法的典型用法代碼示例。如果您正苦於以下問題:PHP Gallery::Add_pics方法的具體用法?PHP Gallery::Add_pics怎麽用?PHP Gallery::Add_pics使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Gallery
的用法示例。
在下文中一共展示了Gallery::Add_pics方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: redirect
if ($_FILES['gallery']['size'] > 0) {
$Upload->file('gallery', '`([a-z0-9()_-])+\\.(jpg|gif|png)+$`i', UNIQ_NAME, $CONFIG_GALLERY['weight_max']);
if (!empty($Upload->error)) {
redirect(HOST . DIR . '/gallery/admin_gallery_add.php?error=' . $Upload->error . '#errorh');
} else {
$path = $dir . $Upload->filename['gallery'];
$error = $Upload->validate_img($path, $CONFIG_GALLERY['width_max'], $CONFIG_GALLERY['height_max'], DELETE_ON_ERROR);
if (!empty($error)) {
redirect(HOST . DIR . '/gallery/admin_gallery_add.php?error=' . $error . '#errorh');
} else {
$Gallery->Resize_pics($path);
if (!empty($Gallery->error)) {
redirect(HOST . DIR . '/gallery/admin_gallery_add.php?error=' . $Gallery->error . '#errorh');
}
$name = !empty($_POST['name']) ? strprotect($_POST['name']) : '';
$idpic = $Gallery->Add_pics($idcat_post, $name, $Upload->filename['gallery'], $User->get_attribute('user_id'));
if (!empty($Gallery->error)) {
redirect(HOST . DIR . '/gallery/admin_gallery_add.php?error=' . $Gallery->error . '#errorh');
}
$Cache->Generate_module_file('gallery');
}
}
}
}
redirect(HOST . DIR . '/gallery/admin_gallery_add.php?add=' . $idpic);
} elseif (!empty($_POST['valid']) && !empty($nbr_pics_post)) {
for ($i = 1; $i <= $nbr_pics_post; $i++) {
$activ = !empty($_POST[$i . 'activ']) ? trim($_POST[$i . 'activ']) : '';
$uniq = !empty($_POST[$i . 'uniq']) ? strprotect($_POST[$i . 'uniq']) : '';
if ($activ && !empty($uniq)) {
$name = !empty($_POST[$i . 'name']) ? strprotect($_POST[$i . 'name']) : 0;
示例2: url
}
if ($error != '') {
AppContext::get_response()->redirect(GalleryUrlBuilder::get_link_cat_add($id_category, $error) . '#message_helper');
} else {
$path = $dir . $Upload->get_filename();
$error = $Upload->check_img($config->get_max_width(), $config->get_max_height(), Upload::DELETE_ON_ERROR);
if (!empty($error)) {
//Erreur, on arrête ici
AppContext::get_response()->redirect(GalleryUrlBuilder::get_link_cat_add($id_category, $error) . '#message_helper');
} else {
//Enregistrement de l'image dans la bdd.
$Gallery->Resize_pics($path);
if ($Gallery->get_error() != '') {
AppContext::get_response()->redirect(GalleryUrlBuilder::get_link_cat_add($id_category, $Upload->get_error()) . '#message_helper');
}
$idpic = $Gallery->Add_pics($idcat_post, $name_post, $Upload->get_filename(), AppContext::get_current_user()->get_id());
if ($Gallery->get_error() != '') {
AppContext::get_response()->redirect(GalleryUrlBuilder::get_link_cat_add($id_category, $Upload->get_error()) . '#message_helper');
}
//Régénération du cache des photos aléatoires.
GalleryMiniMenuCache::invalidate();
}
}
AppContext::get_response()->redirect(Url::to_absolute('/gallery/gallery' . url('.php?add=1&cat=' . $idcat_post . '&id=' . $idpic, '-' . $idcat_post . '-' . $idpic . '.php?add=1', '&')));
} elseif ($g_add) {
if (AppContext::get_current_user()->is_readonly()) {
$controller = PHPBoostErrors::user_in_read_only();
DispatchManager::redirect($controller);
}
$categories = GalleryService::get_categories_manager()->get_categories_cache()->get_categories();
$tpl = new FileTemplate('gallery/gallery_add.tpl');