index.php 3.5 KB

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