index.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <?php
  2. if(!file_exists('config.default.json')){
  3. header('Location: install');
  4. die();
  5. }elseif(file_exists('install')){
  6. $files = scandir('install');
  7. if(empty($files)){
  8. @rmdir('install');
  9. }
  10. }
  11. require_once('php/include.php');
  12. $salt = salt();
  13. if(isset($_GET['get'])){
  14. $get = $_GET['get'];
  15. unset($_GET['get']);
  16. if(!isset($_GET['type']) || !isset($_GET['id'])){
  17. $type = 'page';
  18. $id = 'index';
  19. }else{
  20. $type = $_GET['type'];
  21. $id = $_GET['id'];
  22. }
  23. switch($get){
  24. case 'state':
  25. die(
  26. json_encode(
  27. Array(
  28. 'state'=>stateObj($type,$id)
  29. )
  30. )
  31. );
  32. break;
  33. case 'api':
  34. require_once('api.php');
  35. break;
  36. case 'settings':
  37. $settings = Array();
  38. $keys = Array('expire');
  39. foreach($keys as $key){
  40. $settings[$key] = get($key);
  41. }
  42. die(json_encode(Array(
  43. 'settings'=>$settings,
  44. 'version'=>file_get_contents(PATH_DATA.'version')
  45. )));
  46. break;
  47. case 'captcha':
  48. generate_captcha();
  49. break;
  50. case 'error':
  51. die(
  52. json_encode(
  53. Array(
  54. 'error'=>isset($_GET['error'])?$_GET['error']:'Error'
  55. )
  56. )
  57. );
  58. break;
  59. }
  60. }
  61. if(!isset($_GET['type'])||!isset($_GET['id'])){
  62. header('Location: page-index');
  63. die();
  64. }
  65. ?>
  66. <!doctype html>
  67. <html manifest="bugs.appcache">
  68. <head>
  69. <meta charset=utf-8>
  70. <meta name="viewport" content="width=device-width, user-scalable=false, initial-scale=1, maximum-scale=1.0, user-scalable=0, user-scalable=no">
  71. <meta name="apple-mobile-web-app-capable" content="yes" />
  72. <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  73. <link rel="apple-touch-icon" sizes="128-128" href="img/favicon-128.png" />
  74. <link rel="apple-touch-icon" sizes="120x120" href="img/favicon-120.png" />
  75. <link rel="apple-touch-icon" sizes="90x90" href="img/favicon-90.png" />
  76. <link rel="apple-touch-icon" sizes="60x60" href="img/favicon-60.png" />
  77. <link rel="apple-touch-startup-image" href="img/startup.png">
  78. <link rel="shortcut icon" href="img/favicon.ico" />
  79. <link rel="icon" type="image/png" href="img/favicon-60.png" />
  80. <link href="css/jquery-ui.css" rel="stylesheet" type="text/css"/>
  81. <link href="css/style.css" rel="stylesheet" type="text/css"/>
  82. <title>Bugs</title>
  83. <script src="js/modernizr.js"></script>
  84. <script>
  85. (function(window,Modernizr){
  86. Modernizr.mediaquery = Modernizr.mq('only all');
  87. var checks = [
  88. 'csscalc',
  89. 'cookies',
  90. 'localstorage',
  91. 'history',
  92. 'rgba',
  93. 'applicationcache',
  94. 'mediaquery',
  95. 'fontface'
  96. ],i,
  97. msg = '';
  98. for(i in checks){
  99. if(!Modernizr[checks[i]]){
  100. msg += (msg==''?'':', ')+checks[i];
  101. }
  102. }
  103. if(msg != ''){
  104. alert("Your browser is unable to support all the features this site needs.\nChecks failed: "+msg);
  105. }
  106. window.applicationCache.addEventListener('updateready',function(){
  107. location.reload();
  108. });
  109. if(typeof window.screen.lockOrientation != 'undefined'){
  110. window.screen.lockOrientation('portrait');
  111. }
  112. })(window,Modernizr);
  113. </script>
  114. <script src="js/jquery.min.js"></script>
  115. <script src="js/jquery-ui.min.js"></script>
  116. <script src="js/handlebars.js"></script>
  117. <script src="js/jquery.history.js"></script>
  118. <script src="js/jquery.storage.js"></script>
  119. <script src="js/jquery.cookie.js"></script>
  120. <script src="js/jquery.nicescroll.js"></script>
  121. <script src="js/jquery.timeago.js"></script>
  122. <script src="js/shortcut.js"></script>
  123. <script src="js/index.js"></script>
  124. </head>
  125. <body lang="en">
  126. <div id="topbar" class="overflow-hide"></div>
  127. <div id="content" class="container"></div>
  128. <div id="loading"></div>
  129. <div id="dialog"></div>
  130. <div id="comment" style="display:none;">
  131. <form>
  132. <input type="hidden" name="comment_type"/>
  133. <input type="hidden" name="comment_id"/>
  134. <textarea name="message"></textarea>
  135. </form>
  136. </div>
  137. </body>
  138. </html>