index.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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. <?php
  46. if(file_exists('css/custom/avatars.css')) {
  47. echo '<link rel="stylesheet" type="text/css" href="css/custom/avatars.css" />';
  48. } else {
  49. echo '<link rel="stylesheet" type="text/css" href="css/avatars.css" />';
  50. }
  51. ?>
  52. <!--Compatibility Stylesheets-->
  53. <!--[if lte IE 8]>
  54. <link rel="stylesheet" type="text/css" href="css/compat/ie.css">
  55. <![endif]-->
  56. <!--[if lte IE 7]>
  57. <link rel="stylesheet" type="text/css" href="css/compat/ie6-7.css">
  58. <[endif]-->
  59. <!--[if IE 6]>
  60. <link rel="stylesheet" type="text/css" href="css/compat/ie6.css">
  61. <![endif]-->
  62. <?php
  63. if(file_exists('css/custom/screen.css')) {
  64. echo '<link rel="stylesheet" type="text/css" href="css/custom/screen.css" />';
  65. }
  66. if(file_exists('css/custom/print.css')) {
  67. echo '<link rel="stylesheet" type="text/css" href="css/custom/print.css" />';
  68. }
  69. if(file_exists('favicon.ico')) {
  70. echo '<link rel="icon" type="image/vnd.microsoft.icon" href="favicon.ico" />';
  71. } else {
  72. echo '<link rel="icon" type="image/vnd.microsoft.icon" href="img/icon/favicon.ico" />';
  73. }
  74. ?>
  75. <title>
  76. <?php
  77. echo $config['htmltitle'];
  78. ?>
  79. </title>
  80. </head>
  81. <body>
  82. <div id="topkek">
  83. <?php
  84. //Site's Titlebar comes in here
  85. include $config['toptitle'];
  86. ?>
  87. </div>
  88. <div id="littlemenu">
  89. </div>
  90. <div id="kontainer">
  91. <div id="leftbar" class="kontained">
  92. <?php
  93. include $config['leftbar'];
  94. ?>
  95. </div>
  96. <div id="kontent" class="kontained">
  97. <?php
  98. /*$kontent basically is just a handler for what PHP include needs to be loaded
  99. based on the context passed via GET params - if you wanna add another, add an
  100. elseif case then specify the next number in the nav index along with the
  101. corresponding file to include above.*/
  102. if (empty($nav)) {
  103. $kontent = $config['home'];
  104. }
  105. elseif ($nav == 1) {
  106. $kontent = $config['fileshare'];
  107. }
  108. elseif ($nav == 2) {
  109. $kontent = $config['microblog'];
  110. $editable = 0;
  111. }
  112. elseif ($nav == 3) {
  113. $kontent = $config['blog'];
  114. }
  115. elseif ($nav == 4) {
  116. $kontent = $config['about'];
  117. }
  118. elseif ($nav == 5) {
  119. $kontent = $config['postloader'];
  120. }
  121. elseif ($nav == 6) {
  122. $kontent = $config['codeloader'];
  123. }
  124. elseif ($nav == 7) {
  125. $kontent = $config['audioloader'];
  126. }
  127. elseif ($nav == 8) {
  128. $kontent = $config['videoloader'];
  129. }
  130. elseif ($nav == 9) {
  131. $kontent = $config['imgloader'];
  132. }
  133. elseif ($nav == 10) {
  134. $kontent = $config['docloader'];
  135. }
  136. //Main Content Display Frame goes below
  137. include $kontent;
  138. ?>
  139. </div>
  140. <div id="rightbar" class="kontained">
  141. <?php
  142. include $config['rightbar'];
  143. ?>
  144. </div>
  145. </div>
  146. <div id="footbar">
  147. <?php
  148. include $config['footbar'];
  149. ?>
  150. </div>
  151. </body>
  152. </html>