当前位置: 首页>>代码示例>>PHP>>正文


PHP Photo::upload方法代码示例

本文整理汇总了PHP中Photo::upload方法的典型用法代码示例。如果您正苦于以下问题:PHP Photo::upload方法的具体用法?PHP Photo::upload怎么用?PHP Photo::upload使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Photo的用法示例。


在下文中一共展示了Photo::upload方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _upload_form

 protected function _upload_form()
 {
     $this->addScript("js/functions.js");
     $this->addScript("js/behaviour.js");
     $this->addScript("js/advajax.js");
     $this->addScript("js/ajax.js");
     $this->addScript("js/category-tree.js");
     $this->addScript("js/upload-form.js");
     $this->setTemplateVar('upload_action', $this->url('upload-form'));
     if (!empty($_POST['submit'])) {
         $cids = Utils::pg('cid');
         if (!is_array($cids)) {
             $cids = explode(',', $cids);
         }
         $photo = new Photo();
         $photo->setDBData('photo_description', Utils::p('description'));
         $photo->setDBData('photo_title', Utils::p('title'));
         $photo->upload($_FILES['file'], $cids);
     }
 }
开发者ID:BackupTheBerlios,项目名称:phphoto-svn,代码行数:20,代码来源:Phphoto.php

示例2: fill_category_tree

require_once "includes/smarty.php";
require_once "includes/utils.php";
require_once "includes/photo.php";
$session = Session::singletone();
if ($session->requireLogin()) {
    exit;
}
HTML::startHTML();
HTML::head(_UPLOAD_PHOTO);
HTML::startBODY();
$smarty = new Phph_Smarty(_UPLOAD_PHOTO);
$ref = Utils::pg("ref");
if (isset($_POST['submit'])) {
    try {
        $photo = new Photo();
        $photo->upload($_FILES['file'], $_POST['title'], $_POST['description'], $_POST['cid']);
    } catch (Exception2 $e) {
        $smarty->assign('error', 1);
        $smarty->assign('error_title', $e->getMessage());
        $smarty->assign('error_description', $e->getDescription());
    }
}
$smarty->assign('l_upload', _UPLOAD);
$smarty->assign('l_file', _FILE);
$smarty->assign('l_title', _TITLE);
$smarty->assign('l_description', _DESCRIPTION);
$smarty->assign('l_category', _CATEGORY);
$smarty->assign('max_file_size', Config::get("max_file_size") * 1024);
$smarty->assign('ref', $ref);
function fill_category_tree(&$categories, $ccid, $level)
{
开发者ID:BackupTheBerlios,项目名称:phphoto-svn,代码行数:31,代码来源:upload.php

示例3: Photo

<?php

/**
 * Created by PhpStorm.
 * User: Engr. Naveed
 * Date: 2/6/2015
 * Time: 6:10 PM
 */
require_once __DIR__ . "/" . "../initialize.php";
if (isset($_FILES['photoInput']) & isset($_POST['person_id'])) {
    $inputFile = 'photoInput';
    $uploadDir = "../photos";
    $targetName = $_POST['person_id'] . ".jpg";
    $photo = new Photo();
    if ($photo->upload($inputFile, $targetName, $uploadDir)) {
        $photo->resizeImage($photo->destination, $photo->destination, 210, 260);
        echo "Photo uploaded successfully.";
    } else {
        echo $photo->error;
    }
}
开发者ID:nveeed,项目名称:ems,代码行数:21,代码来源:photoUploader.php


注:本文中的Photo::upload方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。