index.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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. }
  51. }
  52. if(!isset($_GET['type'])||!isset($_GET['id'])){
  53. header('Location: page-index');
  54. die();
  55. }
  56. ?>
  57. <!doctype html>
  58. <html manifest="bugs.appcache">
  59. <head>
  60. <meta charset=utf-8>
  61. <meta name="viewport" content="width=device-width, user-scalable=false, initial-scale=1, maximum-scale=1.0, user-scalable=0, user-scalable=no">
  62. <meta name="apple-mobile-web-app-capable" content="yes" />
  63. <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  64. <link rel="apple-touch-icon" sizes="128-128" href="img/favicon-128.png" />
  65. <link rel="apple-touch-icon" sizes="120x120" href="img/favicon-120.png" />
  66. <link rel="apple-touch-icon" sizes="90x90" href="img/favicon-90.png" />
  67. <link rel="apple-touch-icon" sizes="60x60" href="img/favicon-60.png" />
  68. <link rel="apple-touch-startup-image" href="img/startup.png">
  69. <link rel="shortcut icon" href="img/favicon.ico" />
  70. <link rel="icon" type="image/png" href="img/favicon-60.png" />
  71. <link href="css/jquery-ui.css" rel="stylesheet" type="text/css"/>
  72. <link href="css/style.css" rel="stylesheet" type="text/css"/>
  73. <title>Bugs</title>
  74. <script src="js/modernizr.js"></script>
  75. <script>
  76. (function(window,Modernizr){
  77. Modernizr.mediaquery = Modernizr.mq('only all');
  78. var checks = [
  79. 'csscalc',
  80. 'cookies',
  81. 'localstorage',
  82. 'history',
  83. 'rgba',
  84. 'applicationcache',
  85. 'mediaquery',
  86. 'fontface'
  87. ],i,
  88. msg = '';
  89. for(i in checks){
  90. if(!Modernizr[checks[i]]){
  91. msg += (msg==''?'':', ')+checks[i];
  92. }
  93. }
  94. if(msg != ''){
  95. alert("Your browser is unable to support all the features this site needs.\nChecks failed: "+msg);
  96. }
  97. window.applicationCache.addEventListener('updateready',function(){
  98. location.reload();
  99. });
  100. window.screen.lockOrientation('portrait');
  101. })(window,Modernizr);
  102. </script>
  103. <script src="js/jquery.min.js"></script>
  104. <script src="js/jquery-ui.min.js"></script>
  105. <script src="js/handlebars.js"></script>
  106. <script src="js/jquery.history.js"></script>
  107. <script src="js/jquery.storage.js"></script>
  108. <script src="js/jquery.cookie.js"></script>
  109. <script src="js/jquery.nicescroll.js"></script>
  110. <script src="js/jquery.timeago.js"></script>
  111. <script src="js/shortcut.js"></script>
  112. <script src="js/index.js"></script>
  113. </head>
  114. <body lang="en">
  115. <div id="topbar" class="overflow-hide"></div>
  116. <div id="content" class="container"></div>
  117. <div id="loading"></div>
  118. <div id="dialog"></div>
  119. <div id="comment">
  120. <form>
  121. <input type="hidden" name="comment_type"/>
  122. <input type="hidden" name="comment_id"/>
  123. <textarea name="message"></textarea>
  124. </form>
  125. </div>
  126. </body>
  127. </html>