//发布分享
public function doPageFabufenxiang(){
global $_W,$_GPC;
$uniacid = $_W['uniacid'];
// $idarr =htmlspecialchars_decode($wekinfo);
// $array =json_decode($idarr);
// $object =json_decode(json_encode($array),true);
// $arr =serialize(数据库字段);
$f_slide = htmlspecialchars_decode($_REQUEST['f_slide']);
// $arr=substr($f_slide,1,strlen($f_slide)-1);
// echo "<pre>";print_r($arr);echo "</pre>";
// $array=substr($arr,0,-1);
// echo "<pre>";print_r($array);echo "</pre>";
$array =json_decode($f_slide);//转数组
$object =json_decode(json_encode($array),true);
// echo "<pre>";print_r($object);echo "</pre>";
// $obj = implode(",", $object);
$data = array(
"uniacid"=>$uniacid,
"f_neirong"=>$_REQUEST['f_neirong'],
"f_slide"=>serialize($object),
"f_time"=>strtotime(date("Y-m-d H:i:s")),
);
$openid = $_REQUEST['openid'];
$users = pdo_fetch("SELECT * FROM ".tablename("pinba_userinfo")." where uniacid=:uniacid and openid=:openid",array(":uniacid"=>$uniacid,":openid"=>$openid));
$data['f_xid'] = $users['u_id'];
$res = pdo_insert("pinba_fenxiang",$data);
}
public function doPageUrl()
{
global $_W;
echo $_W['siteroot'];
}
public function doPageUpload()
{
global $_W, $_GPC;
$uniacid = $_W['uniacid'];
$uptypes = array('image/jpg', 'image/jpeg', 'image/png', 'image/pjpeg', 'image/gif', 'image/bmp', 'image/x-png');
$max_file_size = 2000000;
$destination_folder = '../attachment/';
if (!is_uploaded_file($_FILES['upfile']['tmp_name'])) {
echo '图片不存在!';
die;
}
$file = $_FILES['upfile'];
if ($max_file_size < $file['size']) {
echo '文件太大!';
die;
}
if (!in_array($file['type'], $uptypes)) {
echo '文件类型不符!' . $file['type'];
die;
}
$filename = $file['tmp_name'];
$image_size = getimagesize($filename);
$pinfo = pathinfo($file['name']);
$ftype = $pinfo['extension'];
$destination = $destination_folder . str_shuffle(time() . rand(111111, 999999)) . '.' . $ftype;
if (file_exists($destination) && $overwrite != true) {
echo '同名文件已经存在了';
die;
}
if (!move_uploaded_file($filename, $destination)) {
echo '移动文件出错';
die;
}
$pinfo = pathinfo($destination);
$fname = $pinfo['basename'];
echo $_W['attachurl'].$fname;
@(require_once IA_ROOT . '/framework/function/file.func.php');
@($filename = $fname);
@file_remote_upload($filename);
}
主要修改格式服务器图片
$f_slide = htmlspecialchars_decode($_REQUEST['f_slide']);
$array =json_decode($f_slide);//转数组
$object =json_decode(json_encode($array),true);
$data = array(
"uniacid"=>$uniacid,
"f_slide"=>serialize($object),
);