index.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?php
  2. $protocol = ( !empty($_SERVER["HTTPS"] ) ) ? 'https' : 'http';
  3. $nav = ( !empty($_GET['nav'] ) ) ? $_GET['nav'] : '';
  4. $post = ( !empty($_GET['post'] ) ) ? $_GET['post'] : '';
  5. if(file_exists('sys/admin/config/main.json')) {
  6. $config = json_decode(file_get_contents('sys/admin/config/main.json'),true);
  7. } else {
  8. # XXX Need to have manual be hosted in repo under sys/admin/manual
  9. include( "templates/default/notconfigured.tmpl" );
  10. die();
  11. }
  12. ?>
  13. <!doctype html>
  14. <html dir="ltr" lang="en-US">
  15. <head>
  16. <meta charset="utf-8" />
  17. <meta name="description" content="A Simple CMS by teodesian.net"/>
  18. <meta name="viewport" content="width=device-width">
  19. <link rel="stylesheet" type="text/css" href="css/structure.css" />
  20. <link rel="stylesheet" type="text/css" href="css/screen.css" media="screen" />
  21. <link rel="stylesheet" type="text/css" href="css/print.css" media="print" />
  22. <?php
  23. if(file_exists('css/custom/avatars.css')) {
  24. echo '<link rel="stylesheet" type="text/css" href="css/custom/avatars.css" />';
  25. } else {
  26. echo '<link rel="stylesheet" type="text/css" href="css/avatars.css" />';
  27. }
  28. ?>
  29. <!--Compatibility Stylesheets-->
  30. <!--[if lte IE 8]>
  31. <link rel="stylesheet" type="text/css" href="css/compat/ie.css">
  32. <![endif]-->
  33. <!--[if lte IE 7]>
  34. <link rel="stylesheet" type="text/css" href="css/compat/ie6-7.css">
  35. <[endif]-->
  36. <!--[if IE 6]>
  37. <link rel="stylesheet" type="text/css" href="css/compat/ie6.css">
  38. <![endif]-->
  39. <?php
  40. if(file_exists('css/custom/screen.css')) {
  41. echo '<link rel="stylesheet" type="text/css" href="css/custom/screen.css" />';
  42. }
  43. if(file_exists('css/custom/print.css')) {
  44. echo '<link rel="stylesheet" type="text/css" href="css/custom/print.css" />';
  45. }
  46. if(file_exists('favicon.ico')) {
  47. echo '<link rel="icon" type="image/vnd.microsoft.icon" href="favicon.ico" />';
  48. } else {
  49. echo '<link rel="icon" type="image/vnd.microsoft.icon" href="img/icon/favicon.ico" />';
  50. }
  51. ?>
  52. <title>
  53. <?php
  54. echo $config['htmltitle'];
  55. ?>
  56. </title>
  57. </head>
  58. <body>
  59. <div id="topkek">
  60. <?php
  61. //Site's Titlebar comes in here
  62. include $config['toptitle'];
  63. ?>
  64. </div>
  65. <div id="littlemenu">
  66. </div>
  67. <div id="kontainer">
  68. <div id="leftbar" class="kontained">
  69. <?php
  70. include $config['leftbar'];
  71. ?>
  72. </div>
  73. <div id="kontent" class="kontained">
  74. <?php
  75. /*$kontent basically is just a handler for what PHP include needs to be loaded
  76. based on the context passed via GET params - if you wanna add another, add an
  77. elseif case then specify the next number in the nav index along with the
  78. corresponding file to include above.*/
  79. $destinations = [
  80. $config['home'], $config['fileshare'], $config['microblog'], $config['blog'], $config['about'],
  81. $config['postloader'], $config['codeloader'], $config['audioloader'], $config['videoloader'],
  82. $config['imgloader'], $config['docloader']
  83. ];
  84. if ( empty($nav) ) $nav = 0;
  85. if ( $nav === 1 || $nav > 5 ) {
  86. $pwd = $post;
  87. include 'sys/fileshare/sanitize.inc';
  88. }
  89. $kontent = $destinations[$nav];
  90. //Main Content Display Frame goes below
  91. include $kontent;
  92. ?>
  93. </div>
  94. <div id="rightbar" class="kontained">
  95. <?php
  96. include $config['rightbar'];
  97. ?>
  98. </div>
  99. </div>
  100. <div id="footbar">
  101. <?php
  102. include $config['footbar'];
  103. ?>
  104. </div>
  105. </body>
  106. </html>