當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。