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


PHP adminUpdateBase::upload_indexpic方法代码示例

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


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

示例1: upload_indexpic

 /**
  * 上传外链索引图片
  */
 public function upload_indexpic()
 {
     //外链索引图片
     $material = parent::upload_indexpic();
     if (!empty($material)) {
         $material['pic'] = json_encode(array('host' => $material['host'], 'dir' => $material['dir'], 'filepath' => $material['filepath'], 'filename' => $material['filename']));
         $this->addItem($material);
     } else {
         $return = array('error' => '文件上传失败');
         $this->addItem($return);
     }
     $this->output();
 }
开发者ID:h3len,项目名称:Project,代码行数:16,代码来源:program_plan_update.php

示例2: upload_indexpic

 /**
  * 上传外链索引图片
  */
 public function upload_indexpic()
 {
     //外链索引图片
     $material = parent::upload_indexpic();
     if (!empty($material) && is_array($material)) {
         $material['pic'] = array('host' => $material['host'], 'dir' => $material['dir'], 'filepath' => $material['filepath'], 'filename' => $material['filename']);
         $data = array('material_id' => $material['id'], 'name' => $material['name'], 'pic' => serialize($material['pic']), 'host' => $material['host'], 'dir' => $material['dir'], 'filepath' => $material['filepath'], 'filename' => $material['filename'], 'type' => $material['type'], 'mark' => $material['mark'], 'imgwidth' => $material['imgwidth'], 'imgheight' => $material['imgheight'], 'filesize' => $material['filesize'], 'create_time' => $material['create_time'], 'ip' => $material['ip'], 'remote_url' => $material['remote_url']);
         $this->obj->insert_data($data, 'material');
         $material['filesize'] = hg_bytes_to_size($material['filesize']);
         $material['success'] = true;
         $material['material_id'] = $material['id'];
         $this->addItem($material);
     } else {
         $return = array('error' => '文件上传失败');
         $this->addItem($return);
     }
     $this->output();
 }
开发者ID:h3len,项目名称:Project,代码行数:21,代码来源:news_update.php

示例3: array

 function upload_indexpic()
 {
     //外链索引图片
     if (!$_FILES['indexpic']['error'] && is_array($_FILES['indexpic'])) {
         $material = parent::upload_indexpic();
         if (!empty($material)) {
             /*$sql = "REPLACE INTO " . DB_PREFIX ."material SET ";
             	 $material['material_id'] = $material['id'];
             	 $material['pic'] = array(
             		'host' => $material['host'],
             		'dir' => $material['dir'],
             		'filepath' => $material['filepath'],
             		'filename' => $material['filename'],
             		);
             		$material['pic'] = serialize($material['pic']);
             		unset($material['bundle_id'], $material['mid'], $material['id'], $material['url']);
             		$sql_extra = $space ='';
             		foreach($material as $k => $v)
             		{
             		$sql_extra .= $space . $k . "='" . $v . "'";
             		$space = ',';
             		}
             		$this->db->query($sql . $sql_extra);
             		*/
             $material['filesize'] = hg_bytes_to_size($material['filesize']);
             $material['success'] = true;
             $material['id'] = $material['material_id'];
             $this->addItem($material);
         } else {
             $return = array('success' => false, 'error' => '文件上传失败');
             $this->addItem($return);
         }
     } else {
         $return = array('success' => false, 'error' => '文件上传失败');
         $this->addItem($return);
     }
     $this->output();
 }
开发者ID:h3len,项目名称:Project,代码行数:38,代码来源:tuji_update.php


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