激萌网站出现以下问题
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; } }
最后成功解决问题