tt-rss.php 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <?php
  2. error_reporting(E_ERROR | E_WARNING | E_PARSE);
  3. require_once "functions.php";
  4. startup_gettext();
  5. require_once "sessions.php";
  6. require_once "sanity_check.php";
  7. require_once "version.php";
  8. require_once "config.php";
  9. require_once "db-prefs.php";
  10. $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
  11. login_sequence($link);
  12. $dt_add = get_script_dt_add();
  13. no_cache_incantation();
  14. ?>
  15. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  16. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  17. <html>
  18. <head>
  19. <title>Tiny Tiny RSS</title>
  20. <link rel="stylesheet" type="text/css" href="tt-rss.css">
  21. <?php $user_theme = $_SESSION["theme"];
  22. if ($user_theme) { ?>
  23. <link rel="stylesheet" type="text/css" href="themes/<?php echo $user_theme ?>/theme.css">
  24. <?php } ?>
  25. <?php if ($user_theme) { $theme_image_path = "themes/$user_theme/"; } ?>
  26. <?php $user_css_url = get_pref($link, 'USER_STYLESHEET_URL'); ?>
  27. <?php if ($user_css_url) { ?>
  28. <link rel="stylesheet" type="text/css" href="<?php echo $user_css_url ?>"/>
  29. <?php } ?>
  30. <!--[if gte IE 5.5000]>
  31. <script type="text/javascript" src="pngfix.js"></script>
  32. <link rel="stylesheet" type="text/css" href="tt-rss-ie.css">
  33. <![endif]-->
  34. <link rel="shortcut icon" type="image/png" href="images/favicon.png">
  35. <script type="text/javascript" src="prototype.js"></script>
  36. <script type="text/javascript" src="tt-rss.js?<?php echo $dt_add ?>"></script>
  37. <script type="text/javascript" src="functions.js?<?php echo $dt_add ?>"></script>
  38. <script type="text/javascript" src="feedlist.js?<?php echo $dt_add ?>"></script>
  39. <script type="text/javascript" src="viewfeed.js?<?php echo $dt_add ?>"></script>
  40. <!--[if gte IE 5.5000]>
  41. <script type="text/javascript" src="pngfix.js"></script>
  42. <link rel="stylesheet" type="text/css" href="tt-rss-ie.css">
  43. <![endif]-->
  44. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  45. <script type="text/javascript">
  46. if (navigator.userAgent.match("Opera")) {
  47. document.write('<link rel="stylesheet" type="text/css" href="opera.css">');
  48. }
  49. if (navigator.userAgent.match("Gecko") && !navigator.userAgent.match("KHTML")) {
  50. document.write('<link rel="stylesheet" type="text/css" href="gecko.css">');
  51. }
  52. </script>
  53. </head>
  54. <body>
  55. <iframe id="backReqBox"></iframe>
  56. <div id="overlay">
  57. <div id="overlay_inner">
  58. <p><?php echo __("Loading, please wait...") ?></p>
  59. <noscript>
  60. <div class="error"><?php echo
  61. __("Your browser doesn't support Javascript, which is required
  62. for this application to function properly. Please check your
  63. browser settings.") ?></div>
  64. </noscript>
  65. </div>
  66. </div>
  67. <div id="notify" class="notify"><span id="notify_body">&nbsp;</span></div>
  68. <div id="fatal_error"><div id="fatal_error_inner">
  69. <h1>Fatal Error</h1>
  70. <div id="fatal_error_msg">Unknown Error</div>
  71. </div></div>
  72. <script type="text/javascript">
  73. if (document.addEventListener) {
  74. document.addEventListener("DOMContentLoaded", init, null);
  75. }
  76. window.onload = init;
  77. </script>
  78. <ul id="debug_output"></ul>
  79. <div id="infoBoxShadow"><div id="infoBox">&nbsp;</div></div>
  80. <div id="header">
  81. <div style="float : right">
  82. <?php if (!SINGLE_USER_MODE) { ?>
  83. <?php echo __('Hello,') ?> <b><?php echo $_SESSION["name"] ?></b>
  84. (<a href="logout.php">Logout</a>)
  85. <?php } ?>
  86. <img id="newVersionIcon" onclick="javascript:explainError(2)"
  87. src="images/new_version.png" title="New version is available!"
  88. alt="new_version_icon">
  89. </div>
  90. <img src="<?php echo $theme_image_path ?>images/ttrss_logo.png" alt="Tiny Tiny RSS"/>
  91. </div>
  92. <div id="feeds-holder">
  93. <div id="dispSwitch">
  94. <a id="dispSwitchPrompt" href="javascript:toggleTags()">display tags</a>
  95. </div>
  96. <div id="feeds-frame">&nbsp;</div>
  97. </div>
  98. <div id="toolbar">
  99. <div style="float : right">
  100. <select id="quickMenuChooser" onchange="quickMenuChange()">
  101. <option value="qmcDefault" selected><?php echo __('Actions...') ?></option>
  102. <option value="qmcSearch"><?php echo __('Search') ?></option>
  103. <option value="qmcPrefs"><?php echo __('Preferences') ?></option>
  104. <option disabled>--------</option>
  105. <option style="color : #5050aa" disabled><?php echo __('Feed actions:') ?></option>
  106. <option value="qmcAddFeed"><?php echo __('&nbsp;&nbsp;Subscribe to feed') ?></option>
  107. <option value="qmcEditFeed"><?php echo __('&nbsp;&nbsp;Edit this feed') ?></option>
  108. <option value="qmcRemoveFeed"><?php echo __('&nbsp;&nbsp;Unsubscribe') ?></option>
  109. <!-- <option>Edit this feed</option> -->
  110. <option disabled>--------</option>
  111. <option style="color : #5050aa" disabled><?php echo __('All feeds:') ?></option>
  112. <?php if (!ENABLE_UPDATE_DAEMON && !DAEMON_REFRESH_ONLY) { ?>
  113. <option value="qmcUpdateFeeds"><?php echo __('&nbsp;&nbsp;Update') ?></option>
  114. <?php } ?>
  115. <option value="qmcCatchupAll"><?php echo __('&nbsp;&nbsp;Mark as read') ?></option>
  116. <option value="qmcShowOnlyUnread"><?php echo __('&nbsp;&nbsp;(Un)hide read feeds') ?></option>
  117. <option disabled>--------</option>
  118. <option style="color : #5050aa" disabled><?php echo __('Other actions:') ?></option>
  119. <option value="qmcAddFilter"><?php echo __('&nbsp;&nbsp;Create filter') ?></option>
  120. </select>
  121. </div>
  122. <form id="main_toolbar_form" onsubmit='return false'>
  123. <?php echo __('Search:') ?>
  124. <input name="query"
  125. onKeyPress="return filterCR(event, viewCurrentFeed)"
  126. onblur="javascript:enableHotkeys();" onfocus="javascript:disableHotkeys();">
  127. <?php echo __('View:') ?>
  128. <select name="view_mode" onchange="viewCurrentFeed(0, '')">
  129. <option selected value="adaptive"><?php echo __('Adaptive') ?></option>
  130. <option value="all_articles"><?php echo __('All Articles') ?></option>
  131. <option value="marked"><?php echo __('Starred') ?></option>
  132. <option value="unread"><?php echo __('Unread') ?></option>
  133. </select>
  134. <?php echo __('Limit:') ?>
  135. <?php
  136. $limits = array(15 => 15, 30 => 30, 60 => 60, 0 => "All");
  137. $def_art_limit = get_pref($link, 'DEFAULT_ARTICLE_LIMIT');
  138. if ($def_art_limit >= 0 && !array_key_exists($def_art_limit, $limits)) {
  139. $limits[$def_art_limit] = $def_art_limit;
  140. }
  141. asort($limits);
  142. if (!$def_art_limit) {
  143. $def_art_limit = 30;
  144. }
  145. print_select_hash("limit", $def_art_limit, $limits,
  146. 'onchange="viewCurrentFeed(0, \'\')"');
  147. ?>
  148. &nbsp;
  149. <input class="button" type="submit"
  150. onclick="return viewCurrentFeed('ForceUpdate')"
  151. value="<?php echo __('Update') ?>">
  152. </form>
  153. <!-- &nbsp;<input class="button" type="submit"
  154. onclick="quickMenuGo('qmcSearch')" value="Search (tmp)"> -->
  155. <!-- <input class="button" type="submit"
  156. onclick="catchupCurrentFeed()" value="Mark as read"> -->
  157. </div>
  158. <?php if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
  159. <div id="headlines-frame" class="headlines_normal">
  160. <div class="whiteBox"><?php echo __('No feed selected.') ?></div></div>
  161. <div id="content-frame"><div class="whiteBox">&nbsp;</div></div>
  162. <?php } else { ?>
  163. <div id="headlines-frame" class="headlines_cdm">
  164. <div class="whiteBox"><?php echo __('No feed selected.') ?></div></div>
  165. <?php } ?>
  166. <div id="footer">
  167. <?php if (defined('_DEBUG_USER_SWITCH')) { ?>
  168. <select id="userSwitch" onchange="userSwitch()">
  169. <?php
  170. foreach (array('admin', 'fox', 'test') as $u) {
  171. $op_sel = ($u == $_SESSION["name"]) ? "selected" : "";
  172. print "<option $op_sel>$u</option>";
  173. }
  174. ?>
  175. </select>
  176. <?php } ?>
  177. <a href="http://tt-rss.spb.ru/">Tiny Tiny RSS</a> v<?php echo VERSION ?> &copy; 2005-2007 <a href="http://bah.org.ru/">Andrew Dolgov</a>
  178. </div>
  179. <?php db_close($link); ?>
  180. <script type="text/javascript">
  181. /* for IE */
  182. function statechange() {
  183. if (document.readyState == "interactive") init();
  184. }
  185. if (document.readyState) {
  186. if (document.readyState == "interactive" || document.readyState == "complete") {
  187. init();
  188. } else {
  189. document.onreadystatechange = statechange;
  190. }
  191. }
  192. </script>
  193. </body>
  194. </html>