lib/diary/diary.class.php
找到
- $diary = $diaryService->getDiaryDbView($diaryTemp);
下加
- //add by zhaojun
- if(!$diary['pic'] && $diary['aid']){
- $query_aid = $db->query("SELECT * FROM pw_attachs WHERE did=$did");
- while ($rt_aid = $db->fetch_array($query_aid)) {
- //print_r($rt_aid);//exit;
- $rt_aid['img']="<img src=http://img3.iqilu.com/newbbs/attachments/photo/".$rt_aid['attachurl'].">";
- if(strpos($diary['content'],'[attachment='.$rt_aid['aid'].']')!==false){
- $diary['content'] = str_replace('[attachment='.$rt_aid['aid'].']',$rt_aid['img'],$diary['content']);
- }
- unset($rt_aid['aid']);
- $diary['pic'][$rt_aid['aid']] = $rt_aid;
- }
- }
- //add by zhaojun