html:
//Backend code
//Keditor editor upload image processing
Public function ke_upimg(){
/* Return standard data*/
$return = array('error' => 0, 'info' => 'Upload successful', ' data '= & gt;' ');
$ img = $ this-& gt; upload ();
/* record attachment information*/
IF ($ img) {
$ return [' url '] = $ img [' fullpath'];
fullpath']; 'Upload_error');
}
/* Back json data*/
exit (json_encode ($ Return)); upload_error ' ); 'maxSize' => 3145728,
'savePath' => './news/',
'saveName' => array('uniqid',''),
'exts' => array('jpg', 'gif', 'png' , 'jpeg'),
'autoSub' => true,
' 'subName' => array('date','Ymd'),
' );
' $this->uploader = new ThinkUpload($config, 'Local');
$info = $this->uploader->upload($_FILES);
//Log::write(print_r($info));
if($info){
$url = '/Uploads'.$info['imgFile']['savepath'].$info['imgFile']['savename'];
$url = str_replace('./', '/', $url);
$info['fullpath'] = __ROOT__.$url;
Return $info;
}
/* *
* Upload pictures
*/
public function uploadpicTure () {
// TODO: User login detection
Back to standard data*/
$ Return = Array ('Status' = & GT; 1, 'Info' = & GT; ' Uploaded successfully', 'data' => '');
'saveName' => ; array('uniqid',''),
'exts' => array('jpg', 'gif', 'png', 'jpeg'),
'autoSub' => true,
'subName' => array('date','Ymd'),
);
$this->uploader = new ThinkUpload($config, 'Local');
$info = $this->uploader->upload ($_FILES);
$ Url = str_replace ('./', '/', $ url);
$ Return ['PATH'] = __ROOT __. $ Url;
$ Return ['ID'] = 111; '] = 1;
$return = array_merge($info['download'] , . >uploader->getError();
js script, extract the first picture:
//Get the first picture
$('#autolitpic').click(function (){
if($(this).attr('checked')){
$(this).attr('checked' ,false);
}else {
$(this).attr('checked',true); [^"]+"/g)==null){
‐ ’‐ ‐ ‐ ‐ ending out ts. /g)[0].replace("src="","");
var val=strcount.substring(0,strcount.length-1).replace("http://cb2013.tdedu.org", "");
//Cancel contraction Thumbnail
$('.qximg').click(function (){$("#thumb_img").attr('src',"");
$("#img").val("");});