From 4769ddaf7204bf096f8e0e6204a26f3ad328c71a Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 16 Nov 2005 18:37:45 +0100 Subject: [PATCH] sql-ize backend.php --- backend.php | 18 ++++++++++-------- functions.php | 4 ++-- opml.php | 2 +- prefs.php | 2 +- schema/ttrss_schema_mysql.sql | 3 +-- schema/ttrss_schema_pgsql.sql | 3 +-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/backend.php b/backend.php index 958ca26f..06563e68 100644 --- a/backend.php +++ b/backend.php @@ -136,7 +136,7 @@ Tiny Tiny RSS : Feedlist "; - if (USE_COMPACT_STYLESHEET) { + if (get_pref($link, 'USE_COMPACT_STYLESHEET')) { print ""; } 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 @@ Tiny Tiny RSS : Feed $feed "; - if (USE_COMPACT_STYLESHEET) { + if (get_pref($link, 'USE_COMPACT_STYLESHEET')) { print ""; @@ -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 ""; - $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 = ""; + src=\"" . get_pref($link, 'ICONS_URL') . "/$feed_id.ico\">"; } else { $feed_icon = " "; } @@ -1032,7 +1034,7 @@ "; - if (ENABLE_PREFS_CATCHUP_UNCATCHUP) { + if (get_pref($link, 'ENABLE_PREFS_CATCHUP_UNCATCHUP')) { print " diff --git a/functions.php b/functions.php index d8e95594..b9392d81 100644 --- a/functions.php +++ b/functions.php @@ -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); diff --git a/opml.php b/opml.php index 89f9a946..d5eb0e0e 100644 --- a/opml.php +++ b/opml.php @@ -95,7 +95,7 @@

Importing OPML...

"; - if (get_pref($link, 'WEB_DEMO_MODE')) { + if (WEB_DEMO_MODE) { print "OPML import is disabled in demo-mode."; print "

Return to preferences

"; diff --git a/prefs.php b/prefs.php index 92413e34..09fbc9e5 100644 --- a/prefs.php +++ b/prefs.php @@ -61,7 +61,7 @@ Tiny-Tiny RSS v © 2005 Andrew Dolgov - +
Running in demo mode, some functionality is disabled. diff --git a/schema/ttrss_schema_mysql.sql b/schema/ttrss_schema_mysql.sql index fa4b160c..6fade732 100644 --- a/schema/ttrss_schema_mysql.sql +++ b/schema/ttrss_schema_mysql.sql @@ -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'); diff --git a/schema/ttrss_schema_pgsql.sql b/schema/ttrss_schema_pgsql.sql index a892a80f..7162eeec 100644 --- a/schema/ttrss_schema_pgsql.sql +++ b/schema/ttrss_schema_pgsql.sql @@ -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'); -- 2.39.5