summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-11-17 19:04:00 +0100
committerAndrew Dolgov <[email protected]>2005-11-17 19:04:00 +0100
commit06da450f4ce9e462d1b337e37e0bee5de07d77bc (patch)
tree5cb42d8ea27883661bf9c8791666c4bdf160f38a /functions.php
parent5d3f29da4ba7fb7fe898bbde28e8d133f0b15764 (diff)
further functions.php uid work
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php19
1 files changed, 10 insertions, 9 deletions
diff --git a/functions.php b/functions.php
index da3ac8725..42d00c060 100644
--- a/functions.php
+++ b/functions.php
@@ -1,11 +1,11 @@
<?
session_start();
- $_SESSION["uid"] = 1; // FIXME: placeholder
-
require_once 'config.php';
require_once 'db-prefs.php';
+ $_SESSION["uid"] = PLACEHOLDER_UID; // FIXME: placeholder
+
define('MAGPIE_OUTPUT_ENCODING', 'UTF-8');
function purge_old_posts($link) {
@@ -157,7 +157,7 @@
$result = db_query($link, "SELECT reg_exp,
(SELECT name FROM ttrss_filter_types
WHERE id = filter_type) as name
- FROM ttrss_filters");
+ FROM ttrss_filters WHERE owner_uid = ".$_SESSION["uid"]);
while ($line = db_fetch_assoc($result)) {
if (!$filters[$line["name"]]) $filters[$line["name"]] = array();
@@ -228,7 +228,7 @@
FROM
ttrss_entries
WHERE
- guid = '$entry_guid'");
+ guid = '$entry_guid' AND owner_uid = " . $_SESSION["uid"]);
// print db_num_rows($result) . "$entry_guid<br/>";
@@ -257,7 +257,8 @@
feed_id,
comments,
no_orig_date,
- date_entered)
+ date_entered,
+ owner_uid)
VALUES
('$entry_title',
'$entry_guid',
@@ -268,7 +269,7 @@
'$feed',
'$entry_comments',
$no_orig_date,
- NOW())";
+ NOW(),".$_SESSION["uid"].")";
$result = db_query($link, $query);
@@ -362,14 +363,14 @@
$tag = db_escape_string(strtolower($tag));
$result = db_query($link, "SELECT id FROM ttrss_tags
- WHERE tag_name = '$tag' AND post_id = '$entry_id' LIMIT 1");
+ WHERE tag_name = '$tag' AND post_id = '$entry_id' AND owner_uid = ".$_SESSION["uid"]." LIMIT 1");
if ($result && db_num_rows($result) == 0) {
// print "tagging $entry_id as $tag<br>";
- db_query($link, "INSERT INTO ttrss_tags (tag_name,post_id)
- VALUES ('$tag', '$entry_id')");
+ db_query($link, "INSERT INTO ttrss_tags (owner_uid,tag_name,post_id)
+ VALUES ('".$_SESSION["uid"]."','$tag', '$entry_id')");
}
}
}