本文整理汇总了PHP中Gallery::get_error方法的典型用法代码示例。如果您正苦于以下问题:PHP Gallery::get_error方法的具体用法?PHP Gallery::get_error怎么用?PHP Gallery::get_error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gallery
的用法示例。
在下文中一共展示了Gallery::get_error方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: url
}
} else {
$error = 'e_upload_invalid_format';
}
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);
示例2: retrieve
require_once '../kernel/begin.php';
require_once '../gallery/gallery_begin.php';
require_once '../kernel/header_no_display.php';
$g_idpics = retrieve(GET, 'id', 0);
if (!empty($g_idpics)) {
//Niveau d'autorisation de la catégorie
if (!GalleryAuthorizationsService::check_authorizations($id_category)->read()) {
$error_controller = PHPBoostErrors::user_not_authorized();
DispatchManager::redirect($error_controller);
}
//Mise à jour du nombre de vues.
PersistenceContext::get_querier()->inject("UPDATE " . GallerySetup::$gallery_table . " SET views = views + 1 WHERE idcat = :idcat AND id = :id", array('idcat' => $id_category, 'id' => $g_idpics));
$path = PersistenceContext::get_querier()->get_column_value(GallerySetup::$gallery_table, 'path', 'WHERE idcat = :idcat AND id = :id' . (AppContext::get_current_user()->check_level(User::ADMIN_LEVEL) ? '' : ' AND aprob = 1'), array('idcat' => $id_category, 'id' => $g_idpics));
if (empty($path)) {
$error_controller = PHPBoostErrors::unexisting_page();
DispatchManager::redirect($error_controller);
}
$Gallery = new Gallery();
list($width_s, $height_s, $weight_s, $ext) = $Gallery->Arg_pics('pics/' . $path);
$Gallery->Send_header($ext);
//Header image.
if ($Gallery->get_error() != '') {
die($Gallery->get_error());
}
$Gallery->incrust_pics('pics/' . $path);
// => logo.
} else {
die($LANG['no_random_img']);
//Echec paramètres images incorrects.
}
require_once '../kernel/footer_no_display.php';
示例3: elseif
} else {
$error = 'e_upload_invalid_format';
}
if ($error != '') {
//Erreur, on arrête ici
AppContext::get_response()->redirect('/gallery/admin_gallery_add.php?error=' . $error . ($idcat_post ? '&cat=' . $idcat_post : '') . '#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('/gallery/admin_gallery_add.php?error=' . $error . ($idcat_post ? '&cat=' . $idcat_post : '') . '#message_helper');
} else {
//Enregistrement de l'image dans la bdd.
$Gallery->Resize_pics($path);
if ($Gallery->get_error() != '') {
AppContext::get_response()->redirect('/gallery/admin_gallery_add.php?error=' . $Gallery->get_error() . ($idcat_post ? '&cat=' . $idcat_post : '') . '#message_helper');
}
$name = TextHelper::strprotect($request->get_postvalue('name', ''));
$idpic = $Gallery->Add_pics($idcat_post, $name, $Upload->get_filename(), AppContext::get_current_user()->get_id());
if ($Gallery->get_error() != '') {
AppContext::get_response()->redirect('/gallery/admin_gallery_add.php?error=' . $Gallery->get_error() . ($idcat_post ? '&cat=' . $idcat_post : '') . '#message_helper');
}
//Régénération du cache des photos aléatoires.
GalleryMiniMenuCache::invalidate();
}
}
AppContext::get_response()->redirect('/gallery/admin_gallery_add.php?add=' . $idpic . ($idcat_post ? '&cat=' . $idcat_post : ''));
} elseif ($valid && !empty($nbr_pics_post)) {
for ($i = 1; $i <= $nbr_pics_post; $i++) {
$activ = trim($request->get_postvalue($i . 'activ', ''));