index.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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($settings));
  49. break;
  50. case 'captcha':
  51. generate_captcha();
  52. break;
  53. }
  54. }
  55. ?>
  56. <!doctype html>
  57. <html>
  58. <head>
  59. <meta charset=utf-8>
  60. <meta name="viewport" content="width=device-width, user-scalable=false, initial-scale=1, maximum-scale=1.0, user-scalable=0, user-scalable=no">
  61. <meta name="apple-mobile-web-app-capable" content="yes" />
  62. <link rel="shortcut icon" href="img/favicon.ico" />
  63. <link rel="icon" type="image/png" href="img/bug.png" />
  64. <title>Bugs</title>
  65. <script src="js/modernizr.js"></script>
  66. <script>
  67. (function(window,Modernizr){
  68. Modernizr.mediaquery = Modernizr.mq('only all');
  69. var checks = [
  70. 'csscalc',
  71. 'cookies',
  72. 'localstorage',
  73. 'history',
  74. 'rgba',
  75. 'applicationcache',
  76. 'mediaquery',
  77. 'fontface'
  78. ],i,
  79. msg = '';
  80. for(i in checks){
  81. if(!Modernizr[checks[i]]){
  82. msg += (msg==''?'':', ')+checks[i];
  83. }
  84. }
  85. if(msg != ''){
  86. alert("Your browser is unable to support all the features this site needs.\nChecks failed: "+msg);
  87. }
  88. })(window,Modernizr);
  89. </script>
  90. <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
  91. <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
  92. <script src="js/handlebars.js"></script>
  93. <script src="js/jquery.history.js"></script>
  94. <script src="js/jquery.storage.js"></script>
  95. <script src="js/jquery.cookie.js"></script>
  96. <script src="js/jquery.nicescroll.js"></script>
  97. <script src="js/shortcut.js"></script>
  98. <script src="js/index.js"></script>
  99. <link href="http://code.jquery.com/ui/1.10.3/themes/black-tie/jquery-ui.css" rel="stylesheet" type="text/css"/>
  100. <link href="css/style.css" rel="stylesheet" type="text/css"/>
  101. </head>
  102. <body lang="en">
  103. <div id="topbar"></div>
  104. <div id="content" class="container"></div>
  105. <div id="loading"></div>
  106. </body>
  107. </html>