本文整理匯總了PHP中Images::upload方法的典型用法代碼示例。如果您正苦於以下問題:PHP Images::upload方法的具體用法?PHP Images::upload怎麽用?PHP Images::upload使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Images
的用法示例。
在下文中一共展示了Images::upload方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: foreach
if (isset($_POST['removed_images'])) {
foreach ($_POST['removed_images'] as $k => $path) {
if ($Products->CheckPhotosOnModeration($path)) {
$Images->remove($GLOBALS['PATH_root'] . '..' . $path);
}
}
}
$Products->AddSupplierProduct($_POST);
}
$tpl->Assign('header', $header);
$list = $Products->GetProductOnModeration($id);
$Users->SetFieldsById($list['id_supplier']);
$supplier_email = $Users->fields['email'];
//Загрузка фото на сервер
if (isset($_GET['upload']) == true) {
$res = $Images->upload($_FILES, $GLOBALS['PATH_global_root'] . "files/" . $supplier_email . "/");
echo str_replace($GLOBALS['PATH_global_root'], '/', $res);
exit(0);
}
foreach ($list as $k => $l) {
$_POST[$k] = $l;
}
$parsed_res = array('issuccess' => true, 'html' => $tpl->Parse($GLOBALS['PATH_tpl'] . 'moderation_edit_product.tpl'));
if (true == $parsed_res['issuccess']) {
$tpl_center .= $parsed_res['html'];
}
// $tpl->Assign();
// }elseif(isset($cabinet_page) && $cabinet_page == "editproduct"){
// $GLOBALS['IERA_LINKS'] = array();
// $header = "Добавление товара";
// $GLOBALS['IERA_LINKS'][1]['title'] = $header;
示例2: die
<?php
if (!_acl::isAllow('post')) {
die("Access denied");
}
$Post = new Post();
unset($parsed_res);
$header = 'Добавление статьи';
$tpl->Assign('h1', $header);
$ii = count($GLOBALS['IERA_LINKS']);
$GLOBALS['IERA_LINKS'][$ii]['title'] = "Статьи";
$GLOBALS['IERA_LINKS'][$ii++]['url'] = $GLOBALS['URL_base'] . '/adm/posts/';
$GLOBALS['IERA_LINKS'][$ii]['title'] = $header;
$Images = new Images();
if (isset($_GET['upload']) == true) {
$res = $Images->upload($_FILES, $GLOBALS['PATH_post_img'] . 'temp/');
echo str_replace($GLOBALS['PATH_global_root'], '', $res);
exit(0);
}
if (isset($_POST['smb'])) {
require_once $GLOBALS['PATH_block'] . 't_fnc.php';
// для ф-ции проверки формы
list($err, $errm) = Post_form_validate();
if (!$err) {
if ($id = $Post->AddPost($_POST)) {
$_POST['id'] = $id;
$Post->UpdatePost($_POST);
$tpl->Assign('msg', 'Статья добавлена.');
unset($_POST);
} else {
$tpl->Assign('msg', 'Статья не добавлена.');
示例3: exit
}
}
}
// elseif(isset($_GET['remove']) == true){
// if($Products->CheckPhotosOnModeration($_POST['image'])){
// $Images->remove($GLOBALS['PATH_root']."files/".$_SESSION['member']['email']."/".$_POST['image']);
// }
// echo str_replace($GLOBALS['PATH_root'], '/', $GLOBALS['PATH_root']."files/".$_SESSION['member']['email']."/".$_POST['image']);
// exit(0);
// }
if (isset($_GET['validate']) == true) {
$Images->validate($_FILES, $GLOBALS['PATH_root'] . "files/" . $_SESSION['member']['email'] . "/");
exit(0);
} elseif (isset($_GET['upload']) == true) {
$path = isset($_REQUEST['path']) ? !strpos($_REQUEST['path'], $GLOBALS['PATH_global_root']) ? $_REQUEST['path'] : $GLOBALS['PATH_global_root'] . $_REQUEST['path'] : $GLOBALS['PATH_global_root'] . 'temp/';
echo str_replace($GLOBALS['PATH_global_root'], '/', $Images->upload($_FILES, $path));
exit(0);
} elseif (isset($_POST['editionsubmit']) == true) {
//Расчет обьема продукта
$_POST['volume'] = $_POST['height'] * $_POST['width'] * $_POST['length'] * 1.0E-6;
if ($Products->AddSupplierProduct($_POST)) {
header('Location: ' . _base_url . '/cabinet/productsonmoderation/');
}
exit(0);
}
if (isset($_GET['id']) == true && is_numeric($_GET['id']) && $_GET['type'] == 'moderation') {
$list = $Products->GetProductOnModeration($_GET['id']);
foreach ($list as $k => $l) {
$_POST[$k] = $l;
}
}
示例4: die
<?php
if (!_acl::isAllow('product')) {
die('Access denied');
}
// ---- center ----
unset($parsed_res);
// --------------------------------------------------------------------------------------
$dbtree = new dbtree(_DB_PREFIX_ . 'category', 'category', $db);
$Products = new Products();
$Unit = new Unit();
$Images = new Images();
$segmentation = new Segmentation();
if (isset($_GET['upload']) == true) {
$res = $Images->upload($_FILES, $GLOBALS['PATH_product_img'] . 'original/' . date('Y') . '/' . date('m') . '/' . date('d') . '/');
echo str_replace($GLOBALS['PATH_global_root'], '/', $res);
exit(0);
}
$tpl->Assign('h1', 'Добавление товара');
if (isset($_POST['smb'])) {
if (isset($_POST['images_visible'])) {
$_POST['images_visible'][0] = 1;
}
$_POST['art'] = $Products->CheckArticle((int) $_POST['art']);
require_once $GLOBALS['PATH_block'] . 't_fnc.php';
// для ф-ции проверки формы
if (isset($_POST['price']) && $_POST['price'] == '') {
$_POST['price'] = 0;
}
list($err, $errm) = Product_form_validate();
if (!$err) {