SetRewrite.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <?php
  2. define('EmpireCMSAdmin','1');
  3. require("../../class/connect.php");
  4. require("../../class/db_sql.php");
  5. require("../../class/functions.php");
  6. $link=db_connect();
  7. $empire=new mysqlquery();
  8. $editor=1;
  9. //验证用户
  10. $lur=is_login();
  11. $logininid=$lur['userid'];
  12. $loginin=$lur['username'];
  13. $loginrnd=$lur['rnd'];
  14. $loginlevel=$lur['groupid'];
  15. $loginadminstyleid=$lur['adminstyleid'];
  16. //ehash
  17. $ecms_hashur=hReturnEcmsHashStrAll();
  18. //验证权限
  19. CheckLevel($logininid,$loginin,$classid,"public");
  20. //设置伪静态参数
  21. function SetRewrite($add,$userid,$username){
  22. global $empire,$dbtbpre;
  23. CheckLevel($userid,$username,$classid,"public");//验证权限
  24. $sql=$empire->query("update {$dbtbpre}enewspublic set rewriteinfo='".eaddslashes($add[rewriteinfo])."',rewriteclass='".eaddslashes($add[rewriteclass])."',rewriteinfotype='".eaddslashes($add[rewriteinfotype])."',rewritetags='".eaddslashes($add[rewritetags])."',rewritepl='".eaddslashes($add[rewritepl])."' limit 1");
  25. if($sql)
  26. {
  27. GetConfig();
  28. //操作日志
  29. insert_dolog("");
  30. printerror("SetRewriteSuccess","SetRewrite.php".hReturnEcmsHashStrHref2(1));
  31. }
  32. else
  33. {printerror("DbError","history.go(-1)");}
  34. }
  35. $enews=$_POST['enews'];
  36. if(empty($enews))
  37. {$enews=$_GET['enews'];}
  38. if($enews)
  39. {
  40. hCheckEcmsRHash();
  41. }
  42. if($enews=="SetRewrite")//设置伪静态参数
  43. {
  44. SetRewrite($_POST,$logininid,$loginin);
  45. }
  46. $r=$empire->fetch1("select rewriteinfo,rewriteclass,rewriteinfotype,rewritetags,rewritepl from {$dbtbpre}enewspublic limit 1");
  47. db_close();
  48. $empire=null;
  49. ?>
  50. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  51. <html>
  52. <head>
  53. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  54. <title>设置伪静态</title>
  55. <link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  56. </head>
  57. <body>
  58. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  59. <tr>
  60. <td><p>位置:<a href="SetRewrite.php<?=$ecms_hashur['whehref']?>">伪静态设置</a></p>
  61. </td>
  62. </tr>
  63. </table>
  64. <form name="setpublic" method="post" action="SetRewrite.php">
  65. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  66. <?=$ecms_hashur['form']?>
  67. <tr class="header">
  68. <td height="25" colspan="4">伪静态参数设置
  69. <input name="enews" type="hidden" value="SetRewrite"></td>
  70. </tr>
  71. <tr>
  72. <td width="135" height="25">页面</td>
  73. <td width="302" height="25">标记</td>
  74. <td width="554">格式</td>
  75. <td width="323">对应页面</td>
  76. </tr>
  77. <tr bgcolor="#FFFFFF">
  78. <td height="25">信息内容页</td>
  79. <td height="25">[!--classid--],[!--id--],[!--page--]</td>
  80. <td>/
  81. <input name="rewriteinfo" type="text" id="rewriteinfo" value="<?=$r[rewriteinfo]?>" size="55">
  82. [<a href="#empirecms" onclick="document.setpublic.rewriteinfo.value='showinfo-[!--classid--]-[!--id--]-[!--page--].html';">默认</a>]</td>
  83. <td>/e/action/ShowInfo.php?classid=栏目ID&amp;id=信息ID&amp;page=分页号</td>
  84. </tr>
  85. <tr bgcolor="#FFFFFF">
  86. <td height="25">信息列表页</td>
  87. <td height="25">[!--classid--],[!--page--]</td>
  88. <td>/
  89. <input name="rewriteclass" type="text" id="rewriteclass" value="<?=$r[rewriteclass]?>" size="55">
  90. [<a href="#empirecms" onclick="document.setpublic.rewriteclass.value='listinfo-[!--classid--]-[!--page--].html';">默认</a>]</td>
  91. <td>/e/action/ListInfo/index.php?classid=栏目ID&amp;page=分页号</td>
  92. </tr>
  93. <tr bgcolor="#FFFFFF">
  94. <td height="25">标题分类列表页</td>
  95. <td height="25">[!--ttid--],[!--page--]</td>
  96. <td>/
  97. <input name="rewriteinfotype" type="text" id="rewriteinfotype" value="<?=$r[rewriteinfotype]?>" size="55">
  98. [<a href="#empirecms" onclick="document.setpublic.rewriteinfotype.value='infotype-[!--ttid--]-[!--page--].html';">默认</a>]</td>
  99. <td>/e/action/InfoType/index.php?ttid=标题分类ID&amp;page=分页号</td>
  100. </tr>
  101. <tr bgcolor="#FFFFFF">
  102. <td height="25">TAGS信息列表页</td>
  103. <td height="25">[!--tagname--],[!--page--]</td>
  104. <td>/
  105. <input name="rewritetags" type="text" id="rewritetags" value="<?=$r[rewritetags]?>" size="55">
  106. [<a href="#empirecms" onclick="document.setpublic.rewritetags.value='tags-[!--tagname--]-[!--page--].html';">默认</a>]</td>
  107. <td>/e/tags/index.php?tagname=TAGS名称&amp;page=分页号</td>
  108. </tr>
  109. <tr bgcolor="#FFFFFF">
  110. <td height="25">评论列表页</td>
  111. <td height="25">[!--doaction--],[!--classid--],[!--id--],<br>
  112. [!--page--],[!--myorder--],[!--tempid--]</td>
  113. <td>/
  114. <input name="rewritepl" type="text" id="rewritepl" value="<?=$r[rewritepl]?>" size="55">
  115. [<a href="#empirecms" onclick="document.setpublic.rewritepl.value='comment-[!--doaction--]-[!--classid--]-[!--id--]-[!--page--]-[!--myorder--]-[!--tempid--].html';">默认</a>]</td>
  116. <td>/e/pl/index.php?doaction=事件&amp;classid=栏目ID&amp;id=信息ID&amp;page=分页号&amp;myorder=排序&amp;tempid=评论模板ID</td>
  117. </tr>
  118. <tr bgcolor="#FFFFFF">
  119. <td height="25">&nbsp;</td>
  120. <td height="25" colspan="3"><input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重置"></td>
  121. </tr>
  122. <tr bgcolor="#FFFFFF">
  123. <td height="25" colspan="4">说明:采用静态页面时不需要设置,只有当采用动态页面时可通过设置伪静态来提高SEO优化,如果不启用请留空。注意:伪静态会增加服务器负担,修改伪静态格式后你需要修改服务器的 Rewrite 规则设置。</td>
  124. </tr>
  125. </table>
  126. </form>
  127. </body>
  128. </html>