返回顶部
关闭软件导航
位置:首页 > 资讯 > 帝国新闻>疑是帝国CMS(EmpireCMS v 6.0)最新BUG

  我是个茉鸟,在寻求建站系统时,找到了传说中灵活度最高,最好用的网站管理系统,也就是我要说的帝国cms,于是下载了个EmpireCMS v 6.0来研究一下,在学习帝国CMS的过程中,侧重了解了一下帝国的工作原理,大量的函数,耗了我几天时间才理清楚个来龙去脉。不经意间,发现一个疑是帝国CMS的bug,这个BUG不大不小,对平时的使用基本没什么影响,也就是在删除数据表的时候可能遇到。下面我就放出来吧,让高手们进一步确认。

  在/e/class/moddofun.php中有个删除副表分表函数

  function DelDataTable($add,$userid,$username){

  global $empire,$dbtbpre帝国cms软件采集,$emod_r;

  //操作权限

  CheckLevel($userid,$username,$classid,"table");

  $tid=(int)$add['tid'];

  $tbname=RepPostVar($add['tbname']);

  $datatb=(int)$add['datatb'];

  if(!$tid||!$tbname||!$datatb)

  {

  printerror("NotChangeDataTable","history.go(-1)");

  }

  $tr=$empire->fetch1("select tid,tbname,datatbs,deftb from {$dbtbpre}enewstable where tid='$tid'");

  if(!$tr['tid'])

  {

  printerror("NotChangeDataTable","history.go(-1)");

  }

  if(!strstr($tr['datatbs'],','.$datatb.'帝国cms采集软件,'))

  {

  printerror("NotChangeDataTable","history.go(-1)");

  }

帝国cms批量助手

  if($tr['deftb']==$datatb||$datatb==1)

  {

  printerror("NotDelDefDataTable","history.go(-1)");

  }

  $newdatatbs=str_replace(','.$datatb.',',',',$tr['datatbs']);

  $sql=$empire->query("update {$dbtbpre}enewstable set datatbs='$newdatatbs' where tid='$tid'");

  //删除信息

  $infosql=$empire->query("select * from {$dbtbpre}ecms_".$tr[tbname]." where stb='$datatb'");

帝国cms批量更新文章

  while($infor=$empire->fetch($infosql))

  {

  $mid=$emod_r[$infor[classid]]['modid'];

  $pf=$emod_r[$mid]['pagef'];

  $stf=$emod_r[$mid]['savetxtf'];

  //分页字段

  if($pf)

  {

  if(strstr($emod_r[$mid]['tbdataf'],','.$pf.','))

  {

  $finfor=$empire->fetch1("select ".$pf." from {$dbtbpre}ecms_".$tr[tbname]."_data_".$datatb." where id='$infor[id]'");

  $infor[$pf]=$finfor[$pf];

  }

  }

  //存文本

  if($stf)

  {

  $newstextfile=$infor[$stf];

  $infor[$stf]=GetTxtFieldText($infor[$stf]);

  DelTxtFieldText($newstextfile);//删除文件

  }

  //删除信息文件

  DelNewsFile($infor[filename],$infor[newspath],$infor[classid],$infor[$pf],$infor[groupid]);

  //删除其它表记录

  $empire->query("delete from {$dbtbpre}enewsqf where id='$infor[id]' and classid='$infor[classid]'");

  $empire->query("delete from {$dbtbpre}enewsinfovote where id='$infor[id]' and classid='$infor[classid]'");

  $empire->query("delete from {$dbtbpre}enewsdiggips where id='$infor[id]' and classid='$infor[classid]'");

  //删除附件

  DelNewsTheFile($infor['id'],$infor['classid']);

  }

  $deltb=$empire->query("delete from {$dbtbpre}ecms_".$tr[tbname]." where stb='$datatb'");

  //删除表

  $deltb=$empire->query("DROP TABLE IF EXISTS {$dbtbpre}ecms_".$tr[tbname]."_data_".$datatb.";");

  GetConfig(1);//更新缓存

  if($sql)

  {

  //操作日志

  insert_dolog("tid=".$tid."

  tbname=".$tr[tbname]."&datatb=$datatb");

  printerror("DelDataTableSuccess"帝国cms批量添加产品 ,"db/ListDataTable.php?tid=$tid&tbname=$tr[tbname]");

  }

  else

  {

  printerror("DbError","history.go(-1)");

  }

  }

  巴比站长

  红色部分,作者的意思应该是从模型缓存数组里获取当前要操作的栏目对应的模型ID,但本人通过输出emod_r的全部内容,发现这个数组里并没有以模型ID(modid元素),而其第一维下标应该是模板ID(newstempid),这条语句取出的mid可能是错误的。那么后续操作要么误操作帝国cms批量更新,要么失败。我翻开当时学习时的记录(现在已经记得不清楚了),写了个替代的语句。

如果您觉得 疑是帝国CMS(EmpireCMS v 6.0)最新BUG 这篇文章对您有用,请分享给您的好友,谢谢
文章地址:https://www.tianxianmao.com/article/diguo/ysdgCMSEmpireCMSvzxBUG.html
解放双手无尽可能,有问题添加天线猫微信