changedata.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?php
  2. error_reporting(E_ALL ^ E_NOTICE);
  3. @set_time_limit(1000);
  4. if(file_exists("install.off"))
  5. {
  6. echo"《帝国网站管理系统》安装程序已锁定。如果要重新安装,请删除<b>/e/install/install.off</b>文件!";
  7. exit();
  8. }
  9. require("../class/connect.php");
  10. require("../class/db_sql.php");
  11. require("../class/functions.php");
  12. require LoadLang("pub/fun.php");
  13. require("../class/t_functions.php");
  14. require("../data/dbcache/class.php");
  15. $link=db_connect();
  16. $empire=new mysqlquery();
  17. $ecms=$_GET['ecms'];
  18. $defaultdata=$_GET['defaultdata'];
  19. //----------------生成表情JS
  20. function InstallGetPlfaceJs(){
  21. global $empire,$dbtbpre,$public_r;
  22. $r=$empire->fetch1("select plface,plfacenum from {$dbtbpre}enewspl_set limit 1");
  23. if(empty($r['plfacenum']))
  24. {
  25. return '';
  26. }
  27. $filename="../../d/js/js/plface.js";
  28. $facer=explode('||',$r['plface']);
  29. $count=count($facer);
  30. for($i=1;$i<$count-1;$i++)
  31. {
  32. if($i%$r['plfacenum']==0)
  33. {
  34. $br="<br>";
  35. }
  36. else
  37. {
  38. $br="&nbsp;";
  39. }
  40. $face=explode('##',$facer[$i]);
  41. $allface.="<a href='#eface' onclick=\\\"eaddplface('".$face[0]."');\\\"><img src='".$public_r[newsurl]."e/data/face/".$face[1]."' border=0></a>".$br;
  42. }
  43. $allface="document.write(\"<script src='".$public_r[newsurl]."e/data/js/addplface.js'></script>\");document.write(\"".$allface."\");";
  44. WriteFiletext_n($filename,$allface);
  45. }
  46. //更新其它数据
  47. if($ecms=='ChangeInstallOtherData')
  48. {
  49. //--- 删除缓存文件 ---
  50. DelListEnews();
  51. //--- 更新动态页面 ---
  52. GetPlTempPage();//评论列表模板
  53. GetPlJsPage();//评论JS模板
  54. ReCptemp();//控制面板模板
  55. GetSearch();//三搜索表单模板
  56. GetPrintPage();//打印模板
  57. GetDownloadPage();//下载地址页面
  58. ReGbooktemp();//留言板模板
  59. ReLoginIframe();//登陆状态模板
  60. ReSchAlltemp();//全站搜索模板
  61. //生成首页
  62. $indextemp=GetIndextemp();
  63. NewsBq(0,$indextemp,1,0);
  64. //--- 更新反馈表单 ---
  65. $sql=$empire->query("select bid,btemp from {$dbtbpre}enewsfeedbackclass order by bid");
  66. while($r=$empire->fetch($sql))
  67. {
  68. //替换公共变量
  69. $btemp=ReplaceTempvar($r['btemp']);
  70. $btemp=str_replace("[!--cp.header--]","<? include(\"../../data/template/cp_1.php\");?>",$btemp);
  71. $btemp=str_replace("[!--cp.footer--]","<? include(\"../../data/template/cp_2.php\");?>",$btemp);
  72. $btemp=str_replace("[!--member.header--]","<? include(\"../../template/incfile/header.php\");?>",$btemp);
  73. $btemp=str_replace("[!--member.footer--]","<? include(\"../../template/incfile/footer.php\");?>",$btemp);
  74. $file="../tool/feedback/temp/feedback".$r[bid].".php";
  75. $btemp="<?
  76. if(!defined('InEmpireCMS'))
  77. {exit();}
  78. ?>".$btemp;
  79. WriteFiletext($file,$btemp);
  80. }
  81. //--- 评论表情文件 ---
  82. InstallGetPlfaceJs();
  83. echo"更新文件完毕.<script>self.location.href='index.php?enews=success&f=6&defaultdata=$defaultdata';</script>";
  84. exit();
  85. }
  86. else//更新数据库缓存
  87. {
  88. GetConfig(1);//更新参数设置
  89. GetClass();//更新栏目
  90. GetMemberLevel();//更新会员组
  91. GetSearchAllTb();//更新全站搜索数据表
  92. echo"更新数据库缓存完毕.<script>self.location.href='changedata.php?ecms=ChangeInstallOtherData&defaultdata=$defaultdata';</script>";
  93. exit();
  94. }
  95. ?>