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


PHP Picture类代码示例

本文整理汇总了PHP中Picture的典型用法代码示例。如果您正苦于以下问题:PHP Picture类的具体用法?PHP Picture怎么用?PHP Picture使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: updatePicture

 /**
  * 
  * @param Picture $picture_
  * @throws InvalidArgumentException
  */
 public function updatePicture(Picture $picture_)
 {
     try {
         if (isset($this->table) && is_null($this->table)) {
             throw new InvalidArgumentException('Attribute "table" can\'t be NULL !');
         }
         if (isset($this->id) && !is_null($this->id)) {
             $where = 'id = ' . $this->id;
         }
         //Existance test
         $picture = $this->selectPicture();
         if (!emptyObjectMethod($picture)) {
             $picture = $this->selectPicture();
             $path = $picture->getPath();
             $title = $picture->getTitle();
             $ext = $picture->getExtension();
             if (file_exists(UPLOAD_PATH . $path . $title . '.' . $ext)) {
                 if (!is_null($picture_->getTitle()) && $title !== $picture_->getTitle()) {
                     if (!rename(UPLOAD_PATH . $path . $title . '.' . $ext, UPLOAD_PATH . $path . $picture_->getTitle() . '.' . $ext)) {
                         throw new Exception('A problem occurred when renaming !');
                     }
                 }
             }
         } else {
             throw new Exception('Picture doesn\'t exist !');
         }
         return parent::update($this->table, $picture_, $where);
     } catch (InvalidArgumentException $e) {
         print $e->getMessage();
         exit;
     } catch (Exception $e) {
         print $e->getMessage();
         exit;
     }
 }
开发者ID:noxa02,项目名称:REST_ANNONCE,代码行数:40,代码来源:PictureMapper.class.php

示例2: __construct

 function __construct($content, $title)
 {
     parent::__construct();
     define(GOOGLE_CODE_TRACKER_NOT_ACTIF, true);
     $this->render = new Table();
     $this->render->setWidth("100%");
     // Header
     if (defined('SITE_META_OPENGRAPH_IMAGE') && SITE_META_OPENGRAPH_IMAGE != "") {
         $logo = new Picture(SITE_META_OPENGRAPH_IMAGE);
     } else {
         $logo = new Picture("img/logo_128x400_" . $_SESSION['lang'] . ".png", 128, 400);
     }
     $logo->setTitle(__(SITE_NAME));
     $logo_link = new Link($this->getPage()->getBaseLanguageURL(), Link::TARGET_NONE, $logo);
     $img_obj = new Object($logo_link);
     $img_obj->add("<br/><br/>");
     $this->render->addRow($img_obj);
     $this->render->addRow();
     // Error message
     $small_img = new Picture("wsp/img/warning_16.png", 16, 16, 0, "absmiddle");
     $title_header = new Object($small_img, $title);
     $error_box = new Box($title_header, true, Box::STYLE_MAIN, Box::STYLE_MAIN, '', 'error_box', 700);
     $error_box->setContent($content);
     $this->render->addRow($error_box);
 }
开发者ID:kxopa,项目名称:WebSite-PHP,代码行数:25,代码来源:error-template.php

示例3: __construct

 function __construct()
 {
     // Header
     $logo = new Picture("img/logo_128x400_" . $_SESSION['lang'] . ".png", 128, 400);
     $logo->setTitle(__(SITE_NAME));
     $logo_link = new Link(BASE_URL . $_SESSION['lang'] . "/", Link::TARGET_NONE, $logo);
     $img_obj = new Object($logo_link);
     $img_obj->add("<br/><br/>");
     $this->render = $img_obj;
 }
开发者ID:kxopa,项目名称:WebSite-PHP,代码行数:10,代码来源:header.php

示例4: actionPicture

 /**
  * Displays a single Picture model.
  * @param integer $id
  * @return mixed
  */
 public function actionPicture($id, $size = 'full')
 {
     if (($model = Picture::findOne($id)) === null) {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
     if (!$model) {
         $model = new Picture();
     }
     $this->redirect($model->directlink($size), 301);
 }
开发者ID:simplator,项目名称:medialib,代码行数:15,代码来源:-FileController.php

示例5: run

 public function run()
 {
     DB::statement("TRUNCATE TABLE images");
     $image = new Picture();
     $image->image_path = 'asset/upload/D4C21840-5F68-48EA-A63E-7AC4C3D9B43A.JPG';
     $image->created_at = new DateTime();
     $image->updated_at = new DateTime();
     $image->big_path = 'asset/upload/D4C21840-5F68-48EA-A63E-7AC4C3D9B43A.JPG';
     $image->save();
 }
开发者ID:EricBui0512,项目名称:FYP,代码行数:10,代码来源:ImageTableSeeder.php

示例6: display

 function display()
 {
     $p = new Picture();
     if (!$p->get($this->user->getLogin())) {
         $this->view->assign('getavatar', $this->call('ajaxGetAvatar'));
         $this->view->assign('form', $this->prepareForm(new \modl\Contact()));
     } else {
         $this->view->assign('getavatar', '');
     }
 }
开发者ID:christine-ho-dev,项目名称:movim,代码行数:10,代码来源:Avatar.php

示例7: load

 /**
  * Load image
  *
  * @access private
  * @param Picture $picture
  */
 private function load(Picture $picture)
 {
     $this->width = $picture->width;
     $this->height = $picture->height;
     $this->mime_type = $picture->mime_type;
     $this->image = $this->open($picture->get_path());
     if ($this->image === false) {
         throw new \Exception('Is not a valid picture');
     }
 }
开发者ID:tigron,项目名称:skeleton-file-picture,代码行数:16,代码来源:Manipulation.php

示例8: getList

 function getList($params = NULL, $proyection = '*', $order = '1', $limit = '')
 {
     if ($this->db != NULL) {
         $this->db->read($this->table, $proyection, $params);
         $r = array();
         while ($param = $this->db->getRow()) {
             $picture = new Picture();
             $picture->set($param);
             $r[] = $picture;
         }
         return $r;
     }
     return NULL;
 }
开发者ID:developdms,项目名称:Practica-5,代码行数:14,代码来源:ManagerPicture.php

示例9: handle

 public function handle($stanza, $parent = false)
 {
     $jid = current(explode('/', (string) $parent->attributes()->from));
     $evt = new \Event();
     $cd = new \modl\ContactDAO();
     $c = $cd->get($jid);
     if ($c == null) {
         $c = new \modl\Contact();
     }
     $p = new \Picture();
     $p->fromBase((string) $stanza->items->item->data);
     $p->set($jid);
     $evt->runEvent('vcard', $c);
 }
开发者ID:Hywan,项目名称:moxl,代码行数:14,代码来源:Avatar.php

示例10: run

 public function run()
 {
     Picture::create(['album_id' => 1, 'title' => '戏剧人生', 'picture' => 'http://7xk6xh.com1.z0.glb.clouddn.com/album_03.png']);
     Picture::create(['album_id' => 1, 'title' => '戏剧人生', 'picture' => 'http://7xk6xh.com1.z0.glb.clouddn.com/album_03.png']);
     Picture::create(['album_id' => 1, 'title' => '戏剧人生', 'picture' => 'http://7xk6xh.com1.z0.glb.clouddn.com/album_03.png']);
     Picture::create(['album_id' => 1, 'title' => '戏剧人生', 'picture' => 'http://7xk6xh.com1.z0.glb.clouddn.com/album_03.png']);
     Picture::create(['album_id' => 5, 'title' => '戏剧人生', 'picture' => 'http://7xk6xh.com1.z0.glb.clouddn.com/album_05.png']);
     Picture::create(['album_id' => 5, 'title' => '戏剧人生', 'picture' => 'http://7xk6xh.com1.z0.glb.clouddn.com/album_05.png']);
     Picture::create(['album_id' => 5, 'title' => '戏剧人生', 'picture' => 'http://7xk6xh.com1.z0.glb.clouddn.com/album_05.png']);
     Picture::create(['album_id' => 5, 'title' => '戏剧人生', 'picture' => 'http://7xk6xh.com1.z0.glb.clouddn.com/album_05.png']);
     Picture::create(['album_id' => 9, 'title' => '戏剧人生', 'picture' => 'http://7xk6xh.com1.z0.glb.clouddn.com/album_05.png']);
     Picture::create(['album_id' => 9, 'title' => '戏剧人生', 'picture' => 'http://7xk6xh.com1.z0.glb.clouddn.com/album_05.png']);
     Picture::create(['album_id' => 9, 'title' => '戏剧人生', 'picture' => 'http://7xk6xh.com1.z0.glb.clouddn.com/album_05.png']);
     Picture::create(['album_id' => 9, 'title' => '戏剧人生', 'picture' => 'http://7xk6xh.com1.z0.glb.clouddn.com/album_05.png']);
     Picture::create(['album_id' => 13, 'title' => '戏剧人生', 'picture' => 'http://7xk6xh.com1.z0.glb.clouddn.com/album_05.png']);
     Picture::create(['album_id' => 13, 'title' => '戏剧人生', 'picture' => 'http://7xk6xh.com1.z0.glb.clouddn.com/album_05.png']);
     Picture::create(['album_id' => 13, 'title' => '戏剧人生', 'picture' => 'http://7xk6xh.com1.z0.glb.clouddn.com/album_05.png']);
     Picture::create(['album_id' => 13, 'title' => '戏剧人生', 'picture' => 'http://7xk6xh.com1.z0.glb.clouddn.com/album_05.png']);
     Picture::create(['album_id' => 13, 'title' => '戏剧人生', 'picture' => 'http://7xk6xh.com1.z0.glb.clouddn.com/album_05.png']);
     Picture::create(['album_id' => 13, 'title' => '戏剧人生', 'picture' => 'http://7xk6xh.com1.z0.glb.clouddn.com/album_05.png']);
     Picture::create(['album_id' => 13, 'title' => '戏剧人生', 'picture' => 'http://7xk6xh.com1.z0.glb.clouddn.com/album_05.png']);
     Picture::create(['album_id' => 13, 'title' => '戏剧人生', 'picture' => 'http://7xk6xh.com1.z0.glb.clouddn.com/album_05.png']);
     Picture::create(['album_id' => 13, 'title' => '戏剧人生', 'picture' => 'http://7xk6xh.com1.z0.glb.clouddn.com/album_05.png']);
     Picture::create(['album_id' => 13, 'title' => '戏剧人生', 'picture' => 'http://7xk6xh.com1.z0.glb.clouddn.com/album_05.png']);
     Picture::create(['album_id' => 13, 'title' => '戏剧人生', 'picture' => 'http://7xk6xh.com1.z0.glb.clouddn.com/album_05.png']);
     Picture::create(['album_id' => 13, 'title' => '戏剧人生', 'picture' => 'http://7xk6xh.com1.z0.glb.clouddn.com/album_05.png']);
 }
开发者ID:Jv-Juven,项目名称:opera-1,代码行数:27,代码来源:PicturesTableSeeder.php

示例11: getIndex

 public function getIndex()
 {
     if (Auth::guest() || Auth::user()->isAdmin == 0) {
         return Redirect::secure('/');
     }
     // layouts variables
     $this->layout->title = 'Админ панел | Нещо Шантаво';
     $this->layout->canonical = 'https://neshto.shantavo.com/admin/';
     $this->layout->robots = 'noindex,nofollow,noodp,noydir';
     $users = count(User::all());
     $admins = count(User::where('isAdmin', ">", 0)->get());
     $categories = count(Category::all());
     $albums = count(Album::all());
     $votes = count(DB::table('votes')->get());
     $pictures = count(Picture::all());
     $pictureSize = 0;
     foreach (Picture::all() as $p) {
         $pictureSize += $p->size;
     }
     // get disqus stats
     include app_path() . '/config/_disqus.php';
     $disqus = new DisqusAPI(getDisqusKey());
     $disqus->setSecure(false);
     $comments = $disqus->posts->list(array('forum' => 'shantavo'));
     // nesting the view into the layout
     $this->layout->nest('content', 'admin.index', array('users' => $users, 'admins' => $admins, 'votes' => $votes, 'categories' => $categories, 'albums' => $albums, 'pictures' => $pictures, 'pictureSize' => $pictureSize, 'comments' => $comments));
 }
开发者ID:straho99,项目名称:NeshtoShantavo,代码行数:27,代码来源:AdminController.php

示例12: compile

 protected function compile()
 {
     if ($this->defineRoot) {
         $objPage = \PageModel::findByPk($this->rootPage);
     } else {
         global $objPage;
     }
     if (null === $objPage) {
         return;
     }
     $intOffset = (int) $this->levelOffset;
     // Random image
     if ($this->randomPageImage) {
         $intOffset = -1;
     }
     $arrImage = PageImage::getOne($objPage, $intOffset, (bool) $this->inheritPageImage);
     if (null === $arrImage) {
         return;
     }
     $arrSize = deserialize($this->imgSize);
     $arrImage['src'] = $this->getImage($arrImage['path'], $arrSize[0], $arrSize[1], $arrSize[2]);
     $this->Template->setData($arrImage);
     $picture = \Picture::create($arrImage['path'], $arrSize)->getTemplateData();
     $picture['alt'] = specialchars($arrImage['alt']);
     $this->Template->picture = $picture;
     if (($imgSize = @getimagesize(TL_ROOT . '/' . rawurldecode($arrImage['src']))) !== false) {
         $this->Template->size = ' ' . $imgSize[3];
     }
     // Add page information to template
     global $objPage;
     $this->Template->currentPage = $objPage->row();
 }
开发者ID:terminal42,项目名称:contao-pageimage,代码行数:32,代码来源:ModulePageImage.php

示例13: isLiked

 public function isLiked($user_id)
 {
     $picture = $this;
     return Picture::whereHas('likes', function ($q) use($picture, $user_id) {
         $q->whereRaw('user_id = ? and picture_id = ?', array($user_id, $picture->id));
     })->exists();
 }
开发者ID:netfox01,项目名称:exprime,代码行数:7,代码来源:Picture.php

示例14: loadModel

 public function loadModel($id)
 {
     if (($model = Picture::model()->findByPk($id)) === null) {
         throw new CHttpException(404, 'Страница не найдена');
     }
     return $model;
 }
开发者ID:kuzmina-mariya,项目名称:gallery,代码行数:7,代码来源:PictureBackendController.php

示例15: gallary

 public function gallary()
 {
     $album_id = Input::get("album_id");
     $user_id = Input::get("user_id");
     $photos = Picture::where("album_id", "=", $album_id)->get();
     return View::make('userCenter.gallary')->with(array("photos" => $photos, "user_id" => $user_id, "album_id" => $album_id));
 }
开发者ID:Jv-Juven,项目名称:opera-1,代码行数:7,代码来源:UserPageController.php


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