summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-11-17 18:29:07 +0100
committerAndrew Dolgov <[email protected]>2005-11-17 18:29:07 +0100
commitf1a80dae05c5c185797be8f66f419222cb3888dd (patch)
tree5229ae39a3e38a8c240aa1312d5e80687183c33a /functions.php
parent4e9dd2cddfc3645830f0bb2f5dc4127aaa31ae06 (diff)
functions.php is now uid-aware
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/functions.php b/functions.php
index ac1fe4fb6..da3ac8725 100644
--- a/functions.php
+++ b/functions.php
@@ -1,4 +1,8 @@
<?
+ session_start();
+
+ $_SESSION["uid"] = 1; // FIXME: placeholder
+
require_once 'config.php';
require_once 'db-prefs.php';
@@ -6,7 +10,10 @@
function purge_old_posts($link) {
- $result = db_query($link, "SELECT id,purge_interval FROM ttrss_feeds");
+ $user_id = $_SESSION["uid"];
+
+ $result = db_query($link, "SELECT id,purge_interval FROM ttrss_feeds
+ WHERE owner_uid = '$user_id'");
while ($line = db_fetch_assoc($result)) {
@@ -42,9 +49,11 @@
db_query($link, "BEGIN");
+ $user_id = $_SESSION["uid"];
+
$result = db_query($link, "SELECT feed_url,id,
substring(last_updated,1,19) as last_updated,
- update_interval FROM ttrss_feeds");
+ update_interval FROM ttrss_feeds WHERE owner_uid = '$user_id'");
while ($line = db_fetch_assoc($result)) {
$upd_intl = $line["update_interval"];