激萌無法添加內容更新失敗
阿新 • • 發佈:2018-03-05
include mage 擴展函數 單獨 rep cto 返回結果 set 取圖
激萌網站出現以下問題
1.添加了自定義模型後添加內容既沒有提示成功,也沒有報錯,只是跳轉到一空白頁面(內容可以添加到數據庫);
2.一鍵更新網站不能沒有提示框彈出,既不報錯也沒成功,但是能夠單獨更新比如欄目頁,專題頁;
3.自定義模型內容頁訪問空白;
4.重新安裝後問題依然存在!問題困擾我幾天後終於找到解決方法
一般情況是程序損壞。找到對應的PHP直接覆蓋就好了。
模板中有錯誤,可能自己加了或修改了標簽方法,看看include/extend.func.php(織夢裏面使用擴展函數的方法)是不是加了新方法,沒上傳到服務器上!
<?php function litimgurls($imgid=0) { global $lit_imglist,$dsql; //獲取附加表 $row = $dsql->GetOne("SELECT c.addtable FROM #@__archives AS a LEFT JOIN #@__channeltype AS c ON a.channel=c.id where a.id=‘$imgid‘"); $addtable = trim($row[‘addtable‘]); //獲取圖片附加表imgurls字段內容進行處理$row = $dsql->GetOne("Select imgurls From `$addtable` where aid=‘$imgid‘"); //調用inc_channel_unit.php中ChannelUnit類 $ChannelUnit = new ChannelUnit(2,$imgid); //調用ChannelUnit類中GetlitImgLinks方法處理縮略圖 $lit_imglist = $ChannelUnit->GetlitImgLinks($row[‘imgurls‘]); //返回結果return $lit_imglist; } //上面系統自帶,下面新增 160716_lizhe function replaceurl($newurl) { $newurl=str_replace(‘src="/uploads/‘,‘src="http://nansha.com/uploads/‘,$newurl); return $newurl; } function get_ztzj($id){ global $dsql; $str=‘‘; $nams= str_replace(chr(44),chr(39).chr(44).chr(39),$id); if($id){ $sql="select * from #@__archives arc left join #@__experts b on arc.id=b.aid where arc.arcrank>-1 and arc.shorttitle in(‘".$nams."‘) limit 0,4 "; //echo $sql; exit; $dsql->SetQuery($sql); $dsql->Execute(‘tt‘); while($arr = $dsql->GetArray(‘tt‘)) { $rs=GetOneArchive($arr[‘id‘]); $str.= ‘<li> <div class="img"> <a href="‘.$rs[‘arcurl‘].‘" target="_blank"><img src="‘.GetOneImgUrl($arr[‘zj_ztimg‘],1).‘" width="557" height="380" /></a> </div> <div class="txt-zone"> <h3>‘.$arr[‘title‘].‘<small>‘.$arr[‘zj_zw‘].‘</small></h3> <div class="position"> · ‘.$arr[‘zj_tx1‘].‘<br /> · ‘.$arr[‘zj_tx2‘].‘ <br /> </div> <h4>擅長:</h4> <div class="goodat clearFix"> ‘.$arr[‘zj_ztsc‘].‘ </div> <div class="hxjs-link"> <a href="‘.$rs[‘arcurl‘].‘" target="_blank" class="a1">專家資料</a><a href="/swt/" target="_blank" class="a2">在線咨詢</a> </div> </div> </li>‘; } } return $str; } function get_ztal($id){ global $dsql; $str=‘‘; $nams= str_replace(chr(44),chr(39).chr(44).chr(39),$id); if($id){ $sql="select * from #@__archives arc left join #@__cases b on arc.id=b.aid where arc.arcrank>-1 and arc.shorttitle in(‘".$nams."‘) limit 0,2 "; //echo $sql; exit; $dsql->SetQuery($sql); $dsql->Execute(‘tt‘); $i = 0; while($arr = $dsql->GetArray(‘tt‘)) { $i++; $rs=GetOneArchive($arr[‘id‘]); if($i==1){ $str.= ‘<li class="fl">‘; } if($i==2){ $str.= ‘<li class="fr">‘; } if(strlen($arr[‘al_nl‘])==‘‘ ){ $arr[‘al_nl‘]=""; } else{ $arr[‘al_nl‘]="年齡:".$arr[‘al_nl‘]; } $str.= ‘<div class="img"> <img src="‘.GetOneImgUrl($arr[‘litpic‘],1).‘" width="485" height="139" /> <h3>‘.$rs[‘title‘].‘</h3> <p><span>姓名:‘.$arr[‘al_xm‘].‘</span><span>‘.$arr[‘al_nl‘].‘</span></p> <p><span>牙齒癥狀:‘.$arr[‘al_zz‘].‘</span><span>治療技術:‘.$arr[‘al_jz‘].‘</span></p> <div class="hxjs-cen-link "><span>你也有缺牙煩惱? </span><a href="/swt/" target="_blank">點擊咨詢專家</a></div> </div> </li>‘; } } return $str; } function get_tjzj($id){ global $dsql; $str=‘‘; $nams= str_replace(chr(44),chr(39).chr(44).chr(39),$id); if($id){ $sql="select * from #@__archives arc left join #@__experts b on arc.id=b.aid where arc.arcrank>-1 and arc.shorttitle in(‘".$nams."‘) limit 0,2 "; //echo $sql; exit; $dsql->SetQuery($sql); $dsql->Execute(‘tt‘); while($arr = $dsql->GetArray(‘tt‘)) { $rs=GetOneArchive($arr[‘id‘]); $str.= ‘<a href="‘.$rs[‘arcurl‘].‘" target="_blank">‘.$arr[‘title‘].‘</a> ‘; } } return $str; } function get_anli($id){ global $dsql; $str=‘‘; $nams= str_replace(chr(44),chr(39).chr(44).chr(39),$id); if($id){ $sql="select * from #@__archives arc left join #@__cases b on arc.id=b.aid where arc.arcrank>-1 and arc.shorttitle in(‘".$nams."‘) limit 0,6 "; //echo $sql; exit; $dsql->SetQuery($sql); $dsql->Execute(‘tt‘); while($arr = $dsql->GetArray(‘tt‘)) { $rs=GetOneArchive($arr[‘id‘]); $str.= ‘<li> <a href="‘.$rs[‘arcurl‘].‘" target="_blank"><img src="‘.GetOneImgUrl($arr[‘litpic‘],1).‘"></a> <strong>‘.$arr[‘title‘].‘</strong> <p><span>姓名:‘.$arr[‘al_xm‘].‘</span><span>年齡:‘.$arr[‘al_nl‘].‘</span></p> <p><span>牙齒癥狀:‘.$arr[‘al_zz‘].‘</span><span>治療技術:‘.$arr[‘al_jz‘].‘</span></p> <div class="hot"><a href="‘.$rs[‘arcurl‘].‘" target="_blank">了解更多</a><a class="a2" href="/swt/" target="_blank">咨詢專家</a></div></li>‘; } } return $str; } function get_doctor($id){ global $dsql; $str=‘‘; $nams= str_replace(chr(44),chr(39).chr(44).chr(39),$id); if($id){ $sql="select * from #@__archives arc left join #@__zhuanjia b on arc.id=b.aid where arc.arcrank>-1 and arc.shorttitle in(‘".$nams."‘) order by weight asc limit 0,4"; //echo $sql; exit; $dsql->SetQuery($sql); $dsql->Execute(‘tt‘); $i = 0; while($arr = $dsql->GetArray(‘tt‘)) { $i++; $rs=GetOneArchive($arr[‘id‘]); if($i==1 || $i==3){ $str.= ‘<li class="fl">‘; } if($i==2 || $i==4){ $str.= ‘<li class="fr">‘; } if($arr[‘zj_iszt‘]=="是" ){ $arr[‘zj_url‘]=$arr[‘zj_zturl‘]; } if($arr[‘zj_iszt‘]=="否" ){ $arr[‘zj_url‘]="/doctors/".$rs[‘filename‘].".html"; } $str.= ‘<img alt="‘.$arr[‘title‘].‘" height="160" src="http://nansha.com‘.GetOneImgUrl($arr[‘litpic‘],1).‘" width="161" /> <div class="txt"> <h3><span>‘.$arr[‘title‘].‘<small>‘.$arr[‘zj_zw‘].‘</small></span></h3> <p>‘.$arr[‘zj_ry‘].‘</p> <div class="link"><a class="a1" href="‘.$arr[‘zj_url‘].‘" target="_blank">詳細查看</a><a class="a2" href="/swt/" target="_blank">咨詢專家</a></div> </div></li>‘; } } return $str; } //DEDE自定義模型 上傳圖片字段 前端圖片顯示代碼 function GetOneImgUrl($img,$ftype=1){ if($img <> ‘‘){ $dtp = new DedeTagParse(); $dtp->LoadSource($img); if(is_array($dtp->CTags)){ foreach($dtp->CTags as $ctag){ if($ctag->GetName()==‘img‘){ $width = $ctag->GetAtt(‘width‘); $height = $ctag->GetAtt(‘height‘); $imgurl = trim($ctag->GetInnerText()); $img = ‘‘; if($imgurl != ‘‘){ if($ftype==1){ $img .= $imgurl; } else{ $img .= ‘<img src="‘.$imgurl.‘" width="‘.$width.‘" height="‘.$height.‘" />‘; } } } } } $dtp->Clear(); return $img; } }
最後成功解決問題
激萌無法添加內容更新失敗