Advertisement
I3luefir3

hgth index

Jul 12th, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. <?php
  2. include "./content/nav.php";
  3. include "./content/header.php";
  4. include "./content/content.php";
  5. include "./content/helper.php";
  6. // debug
  7. ini_set("display_errors", 1);
  8. error_reporting(E_ALL);
  9. // output
  10. function output(&$output)
  11. {
  12. echo "$output";
  13. }
  14. // main
  15. function main()
  16. {
  17. // öffne html
  18. $output = "%HTML_START";
  19. // hole header
  20. $output = "$output%HEAD_START";
  21. $output = "$output%HEAD_CONTENT";
  22. $output = "$output%HEAD_END";
  23. // öffne body
  24. $output = "$output%BODY_START";
  25. // hole overlay
  26. $output = "$output%OVERLAY";
  27. // hole nav
  28. $output = "$output%DESIGNE_NAV";
  29. $output = "$output%NAV";
  30. // hole header
  31. $output = "$output%DESIGNE_HEADER";
  32. $output = "$output%HEADER";
  33. // hole content
  34. $output = "$output%DESIGNE_CONTENT";
  35. $output = "$output%CONTENT";
  36. // schliesse body
  37. $output = "$output%BODY_END";
  38. // schliesse html
  39. $output = "$output%HTML_END";
  40.  
  41. // work GET
  42. $nav=-1;
  43. if(isset($_GET["nav"]))
  44. {
  45. $nav = $_GET["nav"];
  46. }
  47.  
  48. // fill variable
  49. $NAV = get_nav();
  50. $HEADER = get_header();
  51. $CONTENT = get_content($nav);
  52. $DESIGNE_NAV = get_dnav();
  53. $DESIGNE_HEADER = get_dheader();
  54. $DESIGNE_CONTENT = get_dcontent();
  55.  
  56. //replace main
  57. $mysearch = array();
  58. $mysearch[] = "/%HTML_START/";
  59. $mysearch[] = "/%HEAD_START/";
  60. $mysearch[] = "/%HEAD_CONTENT/";
  61. $mysearch[] = "/%HEAD_END/";
  62. $mysearch[] = "/%BODY_START/";
  63. $mysearch[] = "/%OVERLAY/";
  64. $mysearch[] = "/%NAV/";
  65. $mysearch[] = "/%DESIGNE_NAV/";
  66. $mysearch[] = "/%HEADER/";
  67. $mysearch[] = "/%DESIGNE_HEADER/";
  68. $mysearch[] = "/%CONTENT/";
  69. $mysearch[] = "/%DESIGNE_CONTENT/";
  70. $mysearch[] = "/%BODY_END/";
  71. $mysearch[] = "/%HTML_END/";
  72.  
  73. $myreplace = array();
  74. $myreplace[] = "<html>";
  75. $myreplace[] = "\n\t<head>";
  76. $myreplace[] = "\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"designe/designe.css\">";
  77. $myreplace[] = "\n\t</head>";
  78. $myreplace[] = "\n\t<body>";
  79. $myreplace[] = "\n\t\t<div class=\"overlay\">\n\t\t</div>";
  80. $myreplace[] = "$NAV";
  81. $myreplace[] = "$DESIGNE_NAV";
  82. $myreplace[] = "$HEADER";
  83. $myreplace[] = "$DESIGNE_HEADER";
  84. $myreplace[] = "$CONTENT";
  85. $myreplace[] = "$DESIGNE_CONTENT";
  86. $myreplace[] = "\n\t</body>";
  87. $myreplace[] = "\n</html>\r\n";
  88.  
  89. ksort($mysearch);
  90. ksort($myreplace);
  91.  
  92. $output = preg_replace($mysearch, $myreplace, $output);
  93.  
  94. output($output);
  95. }
  96. // start script
  97. main();
  98. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement