<?php $id=lsk::getpost('id'); $cid=lsk::getpost('cid');
if(empty($id)){ exit(json_encode(array('errcode'=>'errmsg'=>'di不能为空!'))); }
$row=lsk::getrow('phome_ecms_news',array('id'=>$id,'classid'=>$cid),'id,title,onclick'); $addon=lsk::getrow('phome_ecms_news_data1',array('id'=>$id,'classid'=>$cid),'newstext,classid,id'); $ra=array( 'id' => $row['id'], 'title' => $row['title'], 'content_json' => stripslashes($addon['newstext']), 'cid' => $addon['classid'] ); $click=intval($row['onclick'])+1; $ra['clicks']=$click; lsk::update('phome_ecms_news',$id,array('onclick'=>$click)); preg_match_all('/<img.*?src="(.*?)".*?>/is',$ra['content_json'],$array); if (!empty($array[1])) { foreach ($array[1] as $k => $rr) { $ra['content_json']=str_replace($rr, lsk::picurl($rr), $ra['content_json']); } } exit(json_encode(array('errcode'=>0,'errmsg'=>'okokokok','row'=>$ra))); ?>
|