admin.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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=(int)$lur['groupid'];
  15. $loginadminstyleid=(int)$lur['adminstyleid'];
  16. //ehash
  17. $ecms_hashur=hReturnEcmsHashStrAll();
  18. $r=ReturnLeftLevel($loginlevel);
  19. //模板组
  20. $gid=(int)$_GET['gid'];
  21. if(!$gid)
  22. {
  23. if($ecms_config['sets']['deftempid'])
  24. {
  25. $gid=$ecms_config['sets']['deftempid'];
  26. }
  27. elseif($public_r['deftempid'])
  28. {
  29. $gid=$public_r['deftempid'];
  30. }
  31. else
  32. {
  33. $gid=1;
  34. }
  35. }
  36. $tempgroup="";
  37. $tgname="";
  38. $tgsql=$empire->query("select gid,gname,isdefault from {$dbtbpre}enewstempgroup order by gid");
  39. while($tgr=$empire->fetch($tgsql))
  40. {
  41. $tgselect="";
  42. if($tgr['gid']==$gid)
  43. {
  44. $tgname=$tgr['gname'];
  45. $tgselect=" selected";
  46. }
  47. $tempgroup.="<option value='".$tgr['gid']."'".$tgselect.">".$tgr['gname']."</option>";
  48. }
  49. if(empty($tgname))
  50. {
  51. printerror("ErrorUrl","");
  52. }
  53. if(!file_exists("../adminstyle/".$loginadminstyleid."/AdminTemp.php"))
  54. {
  55. exit();
  56. }
  57. require("../adminstyle/".$loginadminstyleid."/AdminTemp.php");
  58. db_close();
  59. $empire=null;
  60. ?>