index.php 3.9 KB

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