tt-rss.php 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <?php
  2. require_once "functions.php";
  3. basic_nosid_redirect_check();
  4. require_once "sessions.php";
  5. require_once "sanity_check.php";
  6. require_once "version.php";
  7. require_once "config.php";
  8. require_once "db-prefs.php";
  9. $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
  10. login_sequence($link);
  11. $dt_add = get_script_dt_add();
  12. ?>
  13. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  14. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  15. <html>
  16. <head>
  17. <title>Tiny Tiny RSS</title>
  18. <link rel="stylesheet" type="text/css" href="tt-rss.css">
  19. <?php $user_theme = $_SESSION["theme"];
  20. if ($user_theme) { ?>
  21. <link rel="stylesheet" type="text/css" href="themes/<?php echo $user_theme ?>/theme.css">
  22. <?php } ?>
  23. <?php if ($user_theme) { $theme_image_path = "themes/$user_theme/"; } ?>
  24. <?php $user_css_url = get_pref($link, 'USER_STYLESHEET_URL'); ?>
  25. <?php if ($user_css_url) { ?>
  26. <link rel="stylesheet" type="text/css" href="<?php echo $user_css_url ?>"/>
  27. <?php } ?>
  28. <!--[if gte IE 5.5000]>
  29. <script type="text/javascript" src="pngfix.js"></script>
  30. <link rel="stylesheet" type="text/css" href="tt-rss-ie.css">
  31. <![endif]-->
  32. <link rel="shortcut icon" type="image/png" href="images/favicon.png">
  33. <script type="text/javascript" src="prototype.js"></script>
  34. <script type="text/javascript" src="tt-rss.js?<?php echo $dt_add ?>"></script>
  35. <script type="text/javascript" src="functions.js?<?php echo $dt_add ?>"></script>
  36. <script type="text/javascript" src="feedlist.js?<?php echo $dt_add ?>"></script>
  37. <script type="text/javascript" src="viewfeed.js?<?php echo $dt_add ?>"></script>
  38. <!--[if gte IE 5.5000]>
  39. <script type="text/javascript" src="pngfix.js"></script>
  40. <link rel="stylesheet" type="text/css" href="tt-rss-ie.css">
  41. <![endif]-->
  42. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  43. <script type="text/javascript">
  44. if (navigator.userAgent.match("Opera")) {
  45. document.write('<link rel="stylesheet" type="text/css" href="opera.css">');
  46. }
  47. if (navigator.userAgent.match("Gecko") && !navigator.userAgent.match("KHTML")) {
  48. document.write('<link rel="stylesheet" type="text/css" href="gecko.css">');
  49. }
  50. </script>
  51. </head>
  52. <body>
  53. <iframe id="backReqBox"></iframe>
  54. <div id="overlay">
  55. <div id="overlay_inner">
  56. <p><?php echo _("Loading, please wait...") ?></p>
  57. <noscript>
  58. <div class="error"><?php echo
  59. _("Your browser doesn't support Javascript, which is required
  60. for this application to function properly. Please check your
  61. browser settings.") ?></div>
  62. </noscript>
  63. </div>
  64. </div>
  65. <div id="notify" class="notify"><span id="notify_body">&nbsp;</span></div>
  66. <div id="fatal_error"><div id="fatal_error_inner">
  67. <h1>Fatal Error</h1>
  68. <div id="fatal_error_msg">Unknown Error</div>
  69. </div></div>
  70. <script type="text/javascript">
  71. if (document.addEventListener) {
  72. document.addEventListener("DOMContentLoaded", init, null);
  73. }
  74. window.onload = init;
  75. </script>
  76. <div id="noDaemonWarning">
  77. <?php echo _("<b>Warning:</b> Update daemon is enabled in configuration, but daemon
  78. process is not running, which prevents all feeds from updating. Please
  79. start the daemon process or contact instance owner.") ?>
  80. </div>
  81. <ul id="debug_output"></ul>
  82. <div id="infoBoxShadow"><div id="infoBox">&nbsp;</div></div>
  83. <div id="header">
  84. <?php if (!SINGLE_USER_MODE) { ?>
  85. <div style="float : right">
  86. <?php echo _('Hello,') ?> <b><?php echo $_SESSION["name"] ?></b>
  87. (<a href="logout.php">Logout</a>)
  88. </div>
  89. <?php } ?>
  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">
  123. <?php echo _('Search:') ?>
  124. <input name="query"
  125. onKeyPress="return filterCR(event, viewCurrentFeed)"
  126. onblur="javascript:enableHotkeys();" onfocus="javascript:disableHotkeys();">
  127. &nbsp;
  128. <?php echo _('View:') ?>
  129. <select name="view_mode" onchange="viewCurrentFeed(0, '')">
  130. <option selected value="adaptive"><?php echo _('Adaptive') ?></option>
  131. <option value="all_articles"><?php echo _('All Articles') ?></option>
  132. <option value="marked"><?php echo _('Starred') ?></option>
  133. <option value="unread"><?php echo _('Unread') ?></option>
  134. </select>
  135. &nbsp;
  136. <?php echo _('Limit:') ?>
  137. <?php
  138. $limits = array(15 => 15, 30 => 30, 60 => 60, 0 => "All");
  139. $def_art_limit = get_pref($link, 'DEFAULT_ARTICLE_LIMIT');
  140. if ($def_art_limit >= 0 && !array_key_exists($def_art_limit, $limits)) {
  141. $limits[$def_art_limit] = $def_art_limit;
  142. }
  143. asort($limits);
  144. if (!$def_art_limit) {
  145. $def_art_limit = 30;
  146. }
  147. print_select_hash("limit", $def_art_limit, $limits,
  148. 'onchange="viewCurrentFeed(0, \'\')"');
  149. ?>
  150. </form>
  151. <!-- &nbsp;<input class="button" type="submit"
  152. onclick="quickMenuGo('qmcSearch')" value="Search (tmp)"> -->
  153. &nbsp;<input class="button" type="submit"
  154. onclick="viewCurrentFeed('ForceUpdate')" value="<?php echo _('Update') ?>">
  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-2006 Andrew Dolgov
  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>