index.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <!doctype html>
  2. <html dir="ltr" lang="en-US">
  3. <head>
  4. <?php
  5. //SRSBIZNUSS below - you probably shouldn't edit this unless you know what you are doing
  6. //GET validation/sanitation and parameter variable definitions below
  7. if (!empty($_SERVER["HTTPS"])) {
  8. $protocol = "http";
  9. } else {
  10. $protocol = "https";
  11. }
  12. if (empty($_GET['nav'])) {
  13. $nav = '';
  14. }
  15. else {
  16. $nav = $_GET['nav'];
  17. }
  18. if (empty($_GET['post'])) {
  19. $post = '';
  20. }
  21. else {
  22. $post = $_GET['post'];
  23. }
  24. //input sanitization - XXX Why is this in the index? Should only be include in stuff that needs it
  25. $pwd=$post;
  26. include 'sys/fileshare/sanitize.inc';
  27. if ($san == 1) {
  28. return(0);
  29. };
  30. if(file_exists('sys/admin/config/main.json')) {
  31. $config = json_decode(file_get_contents('sys/admin/config/main.json'),true);
  32. } else {
  33. # XXX Need to have manual be hosted in repo under sys/admin/manual
  34. echo "</head><body>tCMS has not gone through initial configuration.<br />";
  35. echo 'Please see the <a href="https://tcms.troglodyne.net/index.php?nav=5&post=fileshare/manual/Chapter%2000-Introduction.post">tCMS Manual</a> for how to accomplish this.';
  36. die("</body></html>");
  37. }
  38. ?>
  39. <meta charset="utf-8" />
  40. <meta name="description" content="A Simple CMS by teodesian.net"/>
  41. <meta name="viewport" content="width=device-width">
  42. <link rel="stylesheet" type="text/css" href="css/structure.css" />
  43. <link rel="stylesheet" type="text/css" href="css/screen.css" media="screen" />
  44. <link rel="stylesheet" type="text/css" href="css/print.css" media="print" />
  45. <link rel="stylesheet" type="text/css" href="css/avatars.css" />
  46. <!--Compatibility Stylesheets-->
  47. <!--[if lte IE 8]>
  48. <link rel="stylesheet" type="text/css" href="css/compat/ie.css">
  49. <![endif]-->
  50. <!--[if lte IE 7]>
  51. <link rel="stylesheet" type="text/css" href="css/compat/ie6-7.css">
  52. <[endif]-->
  53. <!--[if IE 6]>
  54. <link rel="stylesheet" type="text/css" href="css/compat/ie6.css">
  55. <![endif]-->
  56. <?php
  57. if(file_exists('css/custom/screen.css')) {
  58. echo '<link rel="stylesheet" type="text/css" href="css/custom/screen.css" />';
  59. }
  60. if(file_exists('css/custom/print.css')) {
  61. echo '<link rel="stylesheet" type="text/css" href="css/custom/print.css" />';
  62. }
  63. ?>
  64. <link rel="icon" type="image/vnd.microsoft.icon" href="img/icon/favicon.ico" />
  65. <title>
  66. <?php
  67. echo $config['htmltitle'];
  68. ?>
  69. </title>
  70. </head>
  71. <body>
  72. <div id="topkek">
  73. <?php
  74. //Site's Titlebar comes in here
  75. include $config['toptitle'];
  76. ?>
  77. </div>
  78. <div id="littlemenu">
  79. </div>
  80. <div id="kontainer">
  81. <div id="leftbar" class="kontained">
  82. <?php
  83. include $config['leftbar'];
  84. ?>
  85. </div>
  86. <div id="kontent" class="kontained">
  87. <?php
  88. /*$kontent basically is just a handler for what PHP include needs to be loaded
  89. based on the context passed via GET params - if you wanna add another, add an
  90. elseif case then specify the next number in the nav index along with the
  91. corresponding file to include above.*/
  92. if (empty($nav)) {
  93. $kontent = $config['home'];
  94. }
  95. elseif ($nav == 1) {
  96. $kontent = $config['fileshare'];
  97. }
  98. elseif ($nav == 2) {
  99. $kontent = $config['microblog'];
  100. $editable = 0;
  101. }
  102. elseif ($nav == 3) {
  103. $kontent = $config['blog'];
  104. }
  105. elseif ($nav == 4) {
  106. $kontent = $config['about'];
  107. }
  108. elseif ($nav == 5) {
  109. $kontent = $config['postloader'];
  110. }
  111. elseif ($nav == 6) {
  112. $kontent = $config['codeloader'];
  113. }
  114. elseif ($nav == 7) {
  115. $kontent = $config['audioloader'];
  116. }
  117. elseif ($nav == 8) {
  118. $kontent = $config['videoloader'];
  119. }
  120. elseif ($nav == 9) {
  121. $kontent = $config['imgloader'];
  122. }
  123. elseif ($nav == 10) {
  124. $kontent = $config['docloader'];
  125. }
  126. //Main Content Display Frame goes below
  127. include $kontent;
  128. ?>
  129. </div>
  130. <div id="rightbar" class="kontained">
  131. <?php
  132. include $config['rightbar'];
  133. ?>
  134. </div>
  135. </div>
  136. <div id="footbar">
  137. <?php
  138. include $config['footbar'];
  139. ?>
  140. </div>
  141. </body>
  142. </html>