tt-rss.php 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. <?
  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. <html>
  14. <head>
  15. <title>Tiny Tiny RSS</title>
  16. <link rel="stylesheet" type="text/css" href="tt-rss.css">
  17. <? $user_theme = $_SESSION["theme"];
  18. if ($user_theme) { ?>
  19. <link rel="stylesheet" type="text/css" href="themes/<?= $user_theme ?>/theme.css">
  20. <? } ?>
  21. <? $user_css_url = get_pref($link, 'USER_STYLESHEET_URL'); ?>
  22. <? if ($user_css_url) { ?>
  23. <link type="text/css" href="<?= $user_css_url ?>"/>
  24. <? } ?>
  25. <? if (get_pref($link, 'USE_COMPACT_STYLESHEET')) { ?>
  26. <link rel="stylesheet" href="tt-rss_compact.css" type="text/css">
  27. <? } else { ?>
  28. <link title="Compact Stylesheet" rel="alternate stylesheet"
  29. type="text/css" href="tt-rss_compact.css"/>
  30. <? } ?>
  31. <script type="text/javascript" src="tt-rss.js?<?= $dt_add ?>"></script>
  32. <script type="text/javascript" src="functions.js?<?= $dt_add ?>"></script>
  33. <!--[if gte IE 5.5000]>
  34. <script type="text/javascript" src="pngfix.js"></script>
  35. <link rel="stylesheet" type="text/css" href="tt-rss-ie.css">
  36. <![endif]-->
  37. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  38. <script type="text/javascript">
  39. if (navigator.userAgent.match("Opera")) {
  40. document.write('<link rel="stylesheet" type="text/css" href="opera.css">');
  41. }
  42. </script>
  43. </head>
  44. <body>
  45. <div id="overlay"><div id="overlay_inner">Loading, please wait...</div></div>
  46. <div id="fatal_error"><div id="fatal_error_inner">
  47. <h1>Fatal Error</h1>
  48. <pre id="fatal_error_msg">Unknown Error</pre>
  49. </div></div>
  50. <script type="text/javascript">
  51. if (document.addEventListener) {
  52. document.addEventListener("DOMContentLoaded", init, null);
  53. }
  54. window.onload = init;
  55. </script>
  56. <? if (ENABLE_UPDATE_DAEMON && !file_is_locked("update_daemon.lock")) { ?>
  57. <div class="warning">
  58. <b>Warning:</b> Update daemon is enabled in configuration, but daemon
  59. process is not running, which prevents all feeds from updating. Please
  60. start the daemon process or contact instance owner.
  61. </div>
  62. <? } ?>
  63. <ul id="debug_output"></ul>
  64. <table width="100%" height="100%" cellspacing="0" cellpadding="0" class="main">
  65. <? if (get_pref($link, 'DISPLAY_HEADER')) { ?>
  66. <tr>
  67. <td colspan="2" class="headerBox" id="mainHeader">
  68. <table cellspacing="0" cellpadding="0" width="100%"><tr>
  69. <td rowspan="2" class="header" valign="middle">
  70. <img src="images/ttrss_logo.png" alt="logo">
  71. </td>
  72. <td valign="top" class="notifyBox">
  73. <div id="notify"><span id="notify_body">&nbsp;</span></div>
  74. </td>
  75. <div id="userDlgShadow"><div id="userDlg">&nbsp;</div></div>
  76. </tr><tr><td class="welcomePrompt">
  77. <? if (!SINGLE_USER_MODE) { ?>
  78. Hello, <b><?= $_SESSION["name"] ?></b>
  79. (<a href="logout.php">Logout</a>)
  80. <? } ?>
  81. </td>
  82. </tr></table>
  83. </td>
  84. </tr>
  85. <? } else { ?>
  86. <tr>
  87. <td class="small" id="mainHeader">
  88. <div id="notify"><span id="notify_body">&nbsp;</span></div>
  89. <div id="userDlgShadow"><div id="userDlg">&nbsp;</div></div>
  90. </td><td class="welcomePrompt">
  91. <? if (!SINGLE_USER_MODE) { ?>
  92. Hello, <b><?= $_SESSION["name"] ?></b>
  93. (<a href="logout.php">Logout</a>)
  94. <? } ?>
  95. </td></tr>
  96. <? } ?>
  97. <tr>
  98. <? if (get_pref($link, 'COMBINED_DISPLAY_MODE'))
  99. $feeds_rowspan = 2;
  100. else
  101. $feeds_rowspan = 3; ?>
  102. <td valign="top" rowspan="<?= $feeds_rowspan ?>" class="feeds">
  103. <table class="innerFeedTable"
  104. cellspacing="0" cellpadding="0" height="100%" width="100%">
  105. <tr><td>
  106. <div id="dispSwitch">
  107. <a id="dispSwitchPrompt" href="javascript:toggleTags()">display tags</a>
  108. </div>
  109. </td></tr>
  110. <tr><td height="100%" width="100%" valign="top">
  111. <iframe frameborder="0"
  112. src="backend.php?op=error&msg=Loading,%20please wait..."
  113. id="feeds-frame" name="feeds-frame" class="feedsFrame"> </iframe>
  114. </td></tr></table>
  115. </td>
  116. <td valign="top" class="headlinesToolbarBox">
  117. <table width="100%" cellpadding="0" cellspacing="0">
  118. <tr><td class="headlinesToolbar" id="headlinesToolbar">
  119. <? if (get_pref($link, 'ENABLE_SEARCH_TOOLBAR')) { ?>
  120. <input id="searchbox"
  121. onblur="javascript:enableHotkeys();" onfocus="javascript:disableHotkeys();">
  122. <select id="searchmodebox">
  123. <option>This feed</option>
  124. <? if (get_pref($link, 'ENABLE_FEED_CATS')) { ?>
  125. <option>This category</option>
  126. <? } ?>
  127. <option>All feeds</option>
  128. </select>
  129. <input type="submit"
  130. class="button" onclick="javascript:search()" value="Search">
  131. &nbsp;
  132. <? } ?>
  133. View:
  134. <select id="viewbox" onchange="javascript:viewCurrentFeed(0, '')">
  135. <option selected>Adaptive</option>
  136. <option>All Articles</option>
  137. <option>Starred</option>
  138. <option>Unread</option>
  139. </select>
  140. &nbsp;Limit:
  141. <select id="limitbox" onchange="javascript:viewCurrentFeed(0, '')">
  142. <?
  143. $limits = array(15 => 15, 30 => 30, 60 => 60);
  144. $def_art_limit = get_pref($link, 'DEFAULT_ARTICLE_LIMIT');
  145. if ($def_art_limit >= 0 && !array_key_exists($def_art_limit, $limits)) {
  146. $limits[$def_art_limit] = $def_art_limit;
  147. }
  148. asort($limits);
  149. array_push($limits, 0);
  150. if (!$def_art_limit) {
  151. $def_art_limit = 30;
  152. }
  153. foreach ($limits as $key) {
  154. print "<option";
  155. if ($key == $def_art_limit) { print " selected"; }
  156. print ">";
  157. if ($limits[$key] == 0) { print "All"; } else { print $limits[$key]; }
  158. print "</option>";
  159. } ?>
  160. </select>
  161. <!-- &nbsp;Selection:
  162. <select id="headopbox">
  163. <option id="hopToggleRead">Toggle (un)read</option>
  164. </select>
  165. <input class="button" type="submit" onclick="headopGo()" value="Go"> -->
  166. &nbsp;Feed: <input class="button" type="submit"
  167. onclick="javascript:viewCurrentFeed(0, 'ForceUpdate')" value="Update">
  168. <input class="button" type="submit" id="btnMarkFeedAsRead"
  169. onclick="javascript:viewCurrentFeed(0, 'MarkAllRead')" value="Mark as read">
  170. </td>
  171. <td align="right">
  172. <select id="quickMenuChooser" onchange="quickMenuChange()">
  173. <option id="qmcDefault" selected>Actions...</option>
  174. <option id="qmcPrefs">Preferences</option>
  175. <option id="qmcSearch">Search</option>
  176. <option disabled>--------</option>
  177. <option style="color : #5050aa" disabled>Feed actions:</option>
  178. <option id="qmcAddFeed">&nbsp;&nbsp;Add new feed</option>
  179. <option id="qmcRemoveFeed">&nbsp;&nbsp;Remove this feed</option>
  180. <!-- <option>Edit this feed</option> -->
  181. <option disabled>--------</option>
  182. <option style="color : #5050aa" disabled>All feeds:</option>
  183. <? if (!ENABLE_UPDATE_DAEMON) { ?>
  184. <option id="qmcUpdateFeeds">&nbsp;&nbsp;Update</option>
  185. <? } ?>
  186. <option id="qmcCatchupAll">&nbsp;&nbsp;Mark as read</option>
  187. <option id="qmcShowOnlyUnread">&nbsp;&nbsp;Show only unread</option>
  188. <option disabled>--------</option>
  189. <option style="color : #5050aa" disabled>Other actions:</option>
  190. <option id="qmcAddFilter">&nbsp;&nbsp;Add filter</option>
  191. </select>
  192. </td>
  193. </tr>
  194. </table>
  195. </td>
  196. </tr>
  197. <? if (get_pref($link, 'COMBINED_DISPLAY_MODE')) { ?>
  198. <tr>
  199. <td id="headlines" class="headlines2" valign="top">
  200. <iframe frameborder="0" name="headlines-frame"
  201. id="headlines-frame" class="headlinesFrame"
  202. src="backend.php?op=error&msg=No%20feed%20selected."></iframe>
  203. </td>
  204. </tr>
  205. <? } else { ?>
  206. <tr>
  207. <td id="headlines" class="headlines" valign="top">
  208. <iframe frameborder="0" name="headlines-frame"
  209. id="headlines-frame" class="headlinesFrame"
  210. src="backend.php?op=error&msg=No%20feed%20selected."></iframe>
  211. </td>
  212. </tr><tr>
  213. <td class="content" id="content" valign="top">
  214. <iframe frameborder="0" name="content-frame"
  215. id="content-frame" class="contentFrame"> </iframe>
  216. </td>
  217. </tr>
  218. <? } ?>
  219. <? if (get_pref($link, 'DISPLAY_FOOTER')) { ?>
  220. <tr>
  221. <td colspan="2" class="footer" id="mainFooter">
  222. <a href="http://tt-rss.spb.ru/">Tiny-Tiny RSS</a> v<?= VERSION ?> &copy; 2005-2006 Andrew Dolgov
  223. <? if (WEB_DEMO_MODE) { ?>
  224. <br>Running in demo mode, some functionality is disabled.
  225. <? } ?>
  226. </td>
  227. </td>
  228. <? } ?>
  229. </table>
  230. <? db_close($link); ?>
  231. <script type="text/javascript">
  232. /* for IE */
  233. function statechange() {
  234. if (document.readyState == "interactive") init();
  235. }
  236. if (document.readyState) {
  237. if (document.readyState == "interactive" || document.readyState == "complete") {
  238. init();
  239. } else {
  240. document.onreadystatechange = statechange;
  241. }
  242. }
  243. </script>
  244. </body>
  245. </html>