global.php
上传用户:yttaitong
上传日期:2009-05-10
资源大小:128k
文件大小:3k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

PHP

  1. <?PHP
  2. /*
  3.     [BBWPS!] (C)2006-2010 小蜜蜂版权所有.
  4. This is NOT a freeware, use is subject to license terms
  5.     时间:2007年12月
  6.     描述:打印公共模板
  7. */
  8. error_reporting(0);
  9. require_once("../class/template_class.php");
  10. require_once("../class/mysql_class.php");
  11. require_once("../class/ParsePermit_class.php");
  12. require_once("../config.php");
  13. require_once("../function/function.php");
  14. require_once("../function/func_global.php");
  15. require_once("../function/checkModuleSession.php");
  16. require_once("../config/module.php");
  17. require_once("../config/baseCheckCode.php");
  18. $author=$loginArray["bbwps_user"];
  19. $prefixGlobal=$prefix;
  20. $status=$ischeck;
  21. $db=new DB($hostname,$username,$password,$database);
  22. $p=new Template("template/");
  23. $p->set_file("handle_header","index_header.html");
  24. $p->parse("header","handle_header");
  25. $p->set_file("handle_footer","index_footer.html");
  26. $p->set_var("version",$parameterArray["version"]);
  27. $p->parse("footer","handle_footer");
  28. $p->set_file("handleUserModule","user_module.html");
  29. $p->set_block("handleUserModule","user_module_menu_row","row");
  30. $bbwps_user  =$_COOKIE["bbwps_user"];
  31. $bbwps_pwd   =$_COOKIE["bbwps_pwd"];
  32. $bbwps_check =$_COOKIE["bbwps_check"];
  33. $bbwps_ip    =$_COOKIE["bbwps_ip"];
  34. $authortype  =$_COOKIE['bbwps_regctrl'];
  35. $bbwps_permit=$_COOKIE["bbwps_permit"];
  36. $bbwps_uid   =$_COOKIE["bbwps_uid"];
  37. $bbwps_module=$_COOKIE["bbwps_module"];
  38. $userModuleArray=unserialize(base64_decode($_COOKIE["bbwps_module"]));
  39. foreach ($userModuleArray as $key=>$value){
  40. $userModuleArray[$key]="bbwps_module_".$value;
  41. }
  42. foreach ($moduleArray as $key=>$module){
  43. if($module["isstart"]=="1"&&$module["isshow"]=="1"){
  44. if(in_array($key,$userModuleArray)){
  45. if(file_exists("../config/".md5($module["idns"].$authortype).".php")){
  46. include_once("../config/".md5($module["idns"].$authortype).".php");
  47. }
  48. else{
  49. $permitURL=$module["idns"]."user/permit.php?bbwps_regctrl=$authortype&bbwps_user=$bbwps_user&bbwps_permit=$bbwps_permit";
  50. $permitObj=new PermitParse($permitURL);
  51. $permitArray=$permitObj->GetItems();
  52. if($permitArray){
  53. $permitArrStr.="<?PHPn";
  54. foreach ($permitArray as $permit){
  55. $permitArrStr.="$permitArray[]=array('title'=>'{$permit["title"]}','link'=>'{$permit["link"]}');n";
  56. }
  57. $fp=fopen("../config/".md5($module["idns"].$authortype).".php","w");
  58. fwrite($fp,$permitArrStr);
  59. fclose($fp);
  60. }
  61. unset($permitArrStr);
  62. }
  63. $p->set_var("row",null);
  64. foreach ($permitArray as $permit){
  65. $p->set_var($permit);
  66. $p->parse("row","user_module_menu_row",true);
  67. }
  68. $p->set_var("module_id",$module["id"]);
  69. $p->set_var("moduleName",$module["name"]);
  70. $p->parse("user_module","handleUserModule",true);
  71. unset($permitArray);
  72. }
  73. }
  74. }
  75. $p->set_file("handleBase","user_base_menu.html");
  76. $p->set_block("handleBase","user_base_menu_row","ubmr");
  77. $permitURL=$baseIdns."/user/permit.php";
  78. $permitObj=new PermitParse($permitURL);
  79. $permitArray=$permitObj->GetItems();
  80. foreach ($permitArray as $permit){
  81. $p->set_var($permit);
  82. $p->parse("ubmr","user_base_menu_row",true);
  83. }
  84. $p->parse("baseMenu_show","handleBase");
  85. $p->set_var("templatePath","template");
  86. $p->set_var("basePath",$basePath);
  87. $p->set_var("baseGetPath","http://$host".$installPath."/user/usermenu.php?ModuleID=");
  88. ?>