index.php 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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/ui.notify.css" rel="stylesheet" type="text/css"/>
  82. <!-- <link href="css/style.css" rel="stylesheet" type="text/css"/> -->
  83. <link href="css/action_menu.css" rel="stylesheet"></link>
  84. <link href="css/buttons.css" rel="stylesheet"></link>
  85. <link href="css/confirm.css" rel="stylesheet"></link>
  86. <link href="css/edit_mode.css" rel="stylesheet"></link>
  87. <link href="css/headers.css" rel="stylesheet"></link>
  88. <link href="css/input_areas.css" rel="stylesheet"></link>
  89. <link href="css/status.css" rel="stylesheet"></link>
  90. <link href="css/switches.css" rel="stylesheet"></link>
  91. <link href="css/drawer.css" rel="stylesheet"></link>
  92. <link href="css/lists.css" rel="stylesheet"></link>
  93. <link href="css/progress_activity.css" rel="stylesheet"></link>
  94. <link href="css/scrolling.css" rel="stylesheet"></link>
  95. <link href="css/seekbars.css" rel="stylesheet"></link>
  96. <link href="css/tabs.css" rel="stylesheet"></link>
  97. <link href="css/toolbars.css" rel="stylesheet"></link>
  98. <link href="css/icons/styles/action_icons.css" rel="stylesheet"></link>
  99. <link href="css/icons/styles/media_icons.css" rel="stylesheet"></link>
  100. <link href="css/icons/styles/comms_icons.css" rel="stylesheet"></link>
  101. <link href="css/icons/styles/settings_icons.css" rel="stylesheet"></link>
  102. <link href="css/transitions.css" rel="stylesheet"></link>
  103. <link href="css/util.css" rel="stylesheet"></link>
  104. <link href="css/cross_browser.css" rel="stylesheet"></link>
  105. <link href="css/app.css" rel="stylesheet"></link>
  106. <title>Bugs</title>
  107. <script src="js/modernizr.js"></script>
  108. <script>
  109. (function(window,Modernizr){
  110. Modernizr.mediaquery = Modernizr.mq('only all');
  111. var checks = [
  112. 'csscalc',
  113. 'cookies',
  114. 'localstorage',
  115. 'history',
  116. 'rgba',
  117. 'applicationcache',
  118. 'mediaquery',
  119. 'fontface'
  120. ],i,
  121. msg = '';
  122. for(i in checks){
  123. if(!Modernizr[checks[i]]){
  124. msg += (msg==''?'':', ')+checks[i];
  125. }
  126. }
  127. if(msg != ''){
  128. alert("Your browser is unable to support all the features this site needs.\nChecks failed: "+msg);
  129. }
  130. window.applicationCache.addEventListener('updateready',function(){
  131. location.reload();
  132. });
  133. if(typeof window.screen.lockOrientation != 'undefined'){
  134. window.screen.lockOrientation('portrait');
  135. }
  136. })(window,Modernizr);
  137. </script>
  138. <style>
  139. @viewport{
  140. orientation: portrait;
  141. }
  142. </style>
  143. <script src="js/jquery.min.js"></script>
  144. <script src="js/jquery-ui.min.js"></script>
  145. <script src="js/handlebars.js"></script>
  146. <script src="js/jquery.history.js"></script>
  147. <script src="js/jquery.storage.js"></script>
  148. <script src="js/jquery.cookie.js"></script>
  149. <script src="js/jquery.nicescroll.js"></script>
  150. <script src="js/jquery.timeago.js"></script>
  151. <script src="js/jquery.notify.js"></script>
  152. <script src="js/shortcut.js"></script>
  153. <script src="js/index.js"></script>
  154. </head>
  155. <body lang="en" role="application">
  156. <section id="index" data-position="current">
  157. <section id="sidebar" data-type="sidebar"></section>
  158. <section id="drawer" role="region">
  159. <header class="fixed" id="topbar"></header>
  160. <article id="content" class="scrollable header"></article>
  161. <article class="content scrollable header fade-out">
  162. <div id="toolbar" role="toolbar">
  163. <ul>
  164. <!-- Left -->
  165. </ul>
  166. <ul>
  167. <!-- Right -->
  168. </ul>
  169. </div>
  170. </article>
  171. </section>
  172. </section>
  173. <section id="action-menu" data-position="back" class="fade-out">
  174. <form role="dialog" data-type="action">
  175. <header>
  176. Title
  177. </header>
  178. <menu></menu>
  179. </form>
  180. </section>
  181. <div id="loading"></div>
  182. <div id="dialog"></div>
  183. <div id="comment" style="display:none;">
  184. <form>
  185. <input type="hidden" name="comment_type"/>
  186. <input type="hidden" name="comment_id"/>
  187. <textarea name="message"></textarea>
  188. </form>
  189. </div>
  190. <div id="notification-container" class="top" style="display:none;">
  191. <div id="basic-template">
  192. <a class="ui-notify-cross ui-notify-close" href="#">
  193. x
  194. </a>
  195. <h1>
  196. #{title}
  197. </h1>
  198. <p>
  199. #{text}
  200. </p>
  201. </div>
  202. </div>
  203. <script src="js/status.js" defer="" type="text/javascript"></script>
  204. <script src="js/seekbars.js" defer="" type="text/javascript"></script>
  205. <script src="js/app.js" defer="" type="text/javascript"></script>
  206. </body>
  207. </html>