本文整理汇总了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();
}
示例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();
}
示例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();
}