sql-ize backend.php

This commit is contained in:
Andrew Dolgov 2005-11-16 18:37:45 +01:00
parent 75c56ed7d7
commit 4769ddaf72
6 changed files with 16 additions and 16 deletions

View File

@ -136,7 +136,7 @@
<title>Tiny Tiny RSS : Feedlist</title>
<link rel=\"stylesheet\" href=\"tt-rss.css\" type=\"text/css\">";
if (USE_COMPACT_STYLESHEET) {
if (get_pref($link, 'USE_COMPACT_STYLESHEET')) {
print "<link rel=\"stylesheet\" type=\"text/css\"
href=\"tt-rss_compact.css\"/>";
} else {
@ -166,7 +166,7 @@
printFeedEntry(-1, $class, "Starred articles", $num_starred,
"images/mark_set.png");
if (ENABLE_LABELS) {
if (get_pref($link, 'ENABLE_LABELS')) {
$result = db_query($link, "SELECT id,sql_exp,description FROM
ttrss_labels ORDER by description");
@ -494,7 +494,7 @@
<title>Tiny Tiny RSS : Feed $feed</title>
<link rel=\"stylesheet\" href=\"tt-rss.css\" type=\"text/css\">";
if (USE_COMPACT_STYLESHEET) {
if (get_pref($link, 'USE_COMPACT_STYLESHEET')) {
print "<link rel=\"stylesheet\"
type=\"text/css\" href=\"tt-rss_compact.css\"/>";
@ -845,9 +845,11 @@
foreach ($ids as $id) {
db_query($link, "DELETE FROM ttrss_feeds WHERE id = '$id'");
$icons_dir = get_pref($link, 'ICONS_DIR');
if (file_exists(ICONS_DIR . "/$id.ico")) {
unlink(ICONS_DIR . "/$id.ico");
if (file_exists($icons_dir . "/$id.ico")) {
unlink($icons_dir . "/$id.ico");
}
}
}
@ -930,11 +932,11 @@
print "<tr class=\"$class\" id=\"FEEDR-$feed_id\">";
$icon_file = ICONS_DIR . "/$feed_id.ico";
$icon_file = get_pref($link, 'ICONS_DIR') . "/$feed_id.ico";
if (file_exists($icon_file) && filesize($icon_file) > 0) {
$feed_icon = "<img width=\"16\" height=\"16\"
src=\"" . ICONS_URL . "/$feed_id.ico\">";
src=\"" . get_pref($link, 'ICONS_URL') . "/$feed_id.ico\">";
} else {
$feed_icon = "&nbsp;";
}
@ -1032,7 +1034,7 @@
<input type=\"submit\" class=\"button\"
onclick=\"javascript:removeSelectedFeeds()\" value=\"Remove\">";
if (ENABLE_PREFS_CATCHUP_UNCATCHUP) {
if (get_pref($link, 'ENABLE_PREFS_CATCHUP_UNCATCHUP')) {
print "
<input type=\"submit\" class=\"button\"
onclick=\"javascript:readSelectedFeeds()\" value=\"Mark as read\">

View File

@ -32,7 +32,7 @@
function update_all_feeds($link, $fetch) {
if (get_pref($link, 'WEB_DEMO_MODE')) return;
if (WEB_DEMO_MODE) return;
if (get_pref($link, 'DAEMON_REFRESH_ONLY')) {
if (!$_GET["daemon"]) {
@ -104,7 +104,7 @@
function update_rss_feed($link, $feed_url, $feed) {
if (get_pref($link, 'WEB_DEMO_MODE')) return;
if (WEB_DEMO_MODE) return;
$feed = db_escape_string($feed);

View File

@ -95,7 +95,7 @@
<body><h1>Importing OPML...</h1>
<div>";
if (get_pref($link, 'WEB_DEMO_MODE')) {
if (WEB_DEMO_MODE) {
print "OPML import is disabled in demo-mode.";
print "<p><a class=\"button\" href=\"prefs.php\">
Return to preferences</a></div></body></html>";

View File

@ -61,7 +61,7 @@
<tr>
<td class="footer" colspan="2">
<a href="http://bah.spb.su/~fox/tt-rss/">Tiny-Tiny RSS</a> v<?= VERSION ?> &copy; 2005 Andrew Dolgov
<? if (get_pref($link, 'WEB_DEMO_MODE')) { ?>
<? if (WEB_DEMO_MODE) { ?>
<br>Running in demo mode, some functionality is disabled.
<? } ?>
</td>

View File

@ -115,13 +115,12 @@ create table ttrss_prefs (pref_name varchar(250) primary key,
insert into ttrss_prefs (pref_name,type_id,value,def_value) values('CONTENT_CHECK_MD5', 1, 'false', 'false');
insert into ttrss_prefs (pref_name,type_id,value,def_value) values('MIN_UPDATE_TIME', 3, '1800', '1800');
insert into ttrss_prefs (pref_name,type_id,value,def_value) values('WEB_DEMO_MODE', 1, 'false', 'false');
insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ENABLE_FEED_ICONS', 1, 'true', 'true');
insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ICONS_DIR', 2, 'icons', 'icons');
insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ICONS_URL', 2, 'icons', 'icons');
insert into ttrss_prefs (pref_name,type_id,value,def_value) values('PURGE_OLD_DAYS', 3, '60', '60');
insert into ttrss_prefs (pref_name,type_id,value,def_value) values('UPDATE_POST_ON_CHECKSUM_CHANGE', 1, 'true', 'true');
insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ENABLE_PREFS_CATCHUP_UNCATCHUP', 1, 'true', 'true');
insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ENABLE_PREFS_CATCHUP_UNCATCHUP', 1, 'false', 'false');
insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ENABLE_LABELS', 1, 'false', 'false');
insert into ttrss_prefs (pref_name,type_id,value,def_value) values('DEFAULT_UPDATE_INTERVAL', 3, '30', '30');
insert into ttrss_prefs (pref_name,type_id,value,def_value) values('DISPLAY_HEADER', 1, 'true', 'true');

View File

@ -110,13 +110,12 @@ create table ttrss_prefs (pref_name varchar(250) primary key,
insert into ttrss_prefs (pref_name,type_id,value,def_value) values('CONTENT_CHECK_MD5', 1, 'false', 'false');
insert into ttrss_prefs (pref_name,type_id,value,def_value) values('MIN_UPDATE_TIME', 3, '1800', '1800');
insert into ttrss_prefs (pref_name,type_id,value,def_value) values('WEB_DEMO_MODE', 1, 'false', 'false');
insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ENABLE_FEED_ICONS', 1, 'true', 'true');
insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ICONS_DIR', 2, 'icons', 'icons');
insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ICONS_URL', 2, 'icons', 'icons');
insert into ttrss_prefs (pref_name,type_id,value,def_value) values('PURGE_OLD_DAYS', 3, '60', '60');
insert into ttrss_prefs (pref_name,type_id,value,def_value) values('UPDATE_POST_ON_CHECKSUM_CHANGE', 1, 'true', 'true');
insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ENABLE_PREFS_CATCHUP_UNCATCHUP', 1, 'true', 'true');
insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ENABLE_PREFS_CATCHUP_UNCATCHUP', 1, 'false', 'false');
insert into ttrss_prefs (pref_name,type_id,value,def_value) values('ENABLE_LABELS', 1, 'false', 'false');
insert into ttrss_prefs (pref_name,type_id,value,def_value) values('DEFAULT_UPDATE_INTERVAL', 3, '30', '30');
insert into ttrss_prefs (pref_name,type_id,value,def_value) values('DISPLAY_HEADER', 1, 'true', 'true');