X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=include%2Ffunctions.php;h=009955c999f371221ee8ae1dcbced7f6d760162a;hb=f5fdc4f4f1de5f078f0eb0c2f678f533c3734452;hp=44331d72e1c88090441a622051a639825d7a7b7f;hpb=5081319e23daad80694701866e7aa0297f02ca53;p=tt-rss.git diff --git a/include/functions.php b/include/functions.php index 44331d72..009955c9 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1,4 +1,8 @@ connect(MEMCACHE_SERVER, 11211); - } - require_once 'db-prefs.php'; require_once 'version.php'; @@ -113,6 +112,9 @@ * @return void */ function _debug($msg) { + if (defined('QUIET') && QUIET) { + return; + } $ts = strftime("%H:%M:%S", time()); if (function_exists('posix_getpid')) { $ts = "$ts/" . posix_getpid(); @@ -374,7 +376,33 @@ $favicon_url = get_favicon_url($site_url); if ($favicon_url) { - $contents = fetch_file_contents($favicon_url, "image"); + // Limiting to "image" type misses those served with text/plain + $contents = fetch_file_contents($favicon_url); // , "image"); + + if ($contents) { + // Crude image type matching. + // Patterns gleaned from the file(1) source code. + if (preg_match('/^\x00\x00\x01\x00/', $contents)) { + // 0 string \000\000\001\000 MS Windows icon resource + //error_log("check_feed_favicon: favicon_url=$favicon_url isa MS Windows icon resource"); + } + elseif (preg_match('/^GIF8/', $contents)) { + // 0 string GIF8 GIF image data + //error_log("check_feed_favicon: favicon_url=$favicon_url isa GIF image"); + } + elseif (preg_match('/^\x89PNG\x0d\x0a\x1a\x0a/', $contents)) { + // 0 string \x89PNG\x0d\x0a\x1a\x0a PNG image data + //error_log("check_feed_favicon: favicon_url=$favicon_url isa PNG image"); + } + elseif (preg_match('/^\xff\xd8/', $contents)) { + // 0 beshort 0xffd8 JPEG image data + //error_log("check_feed_favicon: favicon_url=$favicon_url isa JPG image"); + } + else { + //error_log("check_feed_favicon: favicon_url=$favicon_url isa UNKNOWN type"); + $contents = ""; + } + } if ($contents) { $fp = @fopen($icon_file, "w"); @@ -811,6 +839,11 @@ $_SESSION["uid"] = 1; $_SESSION["name"] = "admin"; + $_SESSION["access_level"] = 10; + + if (!$_SESSION["csrf_token"]) { + $_SESSION["csrf_token"] = sha1(uniqid(rand(), true)); + } $_SESSION["ip_address"] = $_SERVER["REMOTE_ADDR"]; @@ -1291,12 +1324,15 @@ } } - function catchup_feed($link, $feed, $cat_view, $owner_uid = false) { + function catchup_feed($link, $feed, $cat_view, $owner_uid = false, $max_id = false) { if (!$owner_uid) $owner_uid = $_SESSION['uid']; //if (preg_match("/^-?[0-9][0-9]*$/", $feed) != false) { + $ref_check_qpart = ($max_id && + !get_pref($link, 'REVERSE_HEADLINES')) ? "ref_id <= '$max_id'" : "true"; + if (is_numeric($feed)) { if ($cat_view) { @@ -1317,34 +1353,43 @@ db_query($link, "UPDATE ttrss_user_entries SET unread = false,last_read = NOW() - WHERE feed_id = '$tmp_feed' AND owner_uid = $owner_uid"); + WHERE feed_id = '$tmp_feed' + AND $ref_check_qpart + AND owner_uid = $owner_uid"); } } else if ($feed == -2) { db_query($link, "UPDATE ttrss_user_entries SET unread = false,last_read = NOW() WHERE (SELECT COUNT(*) FROM ttrss_user_labels2 WHERE article_id = ref_id) > 0 - AND unread = true AND owner_uid = $owner_uid"); + AND $ref_check_qpart + AND unread = true AND owner_uid = $owner_uid"); } } else if ($feed > 0) { db_query($link, "UPDATE ttrss_user_entries SET unread = false,last_read = NOW() - WHERE feed_id = '$feed' AND owner_uid = $owner_uid"); + WHERE feed_id = '$feed' + AND $ref_check_qpart + AND owner_uid = $owner_uid"); } else if ($feed < 0 && $feed > -10) { // special, like starred if ($feed == -1) { db_query($link, "UPDATE ttrss_user_entries SET unread = false,last_read = NOW() - WHERE marked = true AND owner_uid = $owner_uid"); + WHERE marked = true + AND $ref_check_qpart + AND owner_uid = $owner_uid"); } if ($feed == -2) { db_query($link, "UPDATE ttrss_user_entries SET unread = false,last_read = NOW() - WHERE published = true AND owner_uid = $owner_uid"); + WHERE published = true + AND $ref_check_qpart + AND owner_uid = $owner_uid"); } if ($feed == -3) { @@ -1376,7 +1421,7 @@ if ($feed == -4) { db_query($link, "UPDATE ttrss_user_entries SET unread = false,last_read = NOW() - WHERE owner_uid = $owner_uid"); + WHERE $ref_check_qpart AND owner_uid = $owner_uid"); } } else if ($feed < -10) { // label @@ -1386,6 +1431,7 @@ db_query($link, "UPDATE ttrss_user_entries, ttrss_user_labels2 SET unread = false, last_read = NOW() WHERE label_id = '$label_id' AND unread = true + AND $ref_check_qpart AND owner_uid = '$owner_uid' AND ref_id = article_id"); } @@ -1403,7 +1449,7 @@ while ($line = db_fetch_assoc($result)) { db_query($link, "UPDATE ttrss_user_entries SET unread = false, last_read = NOW() - WHERE int_id = " . $line["post_int_id"]); + WHERE $ref_check_qpart AND int_id = " . $line["post_int_id"]); } db_query($link, "COMMIT"); } @@ -1455,8 +1501,6 @@ array_push($ret_arr, $cv); - $age_qpart = getMaxAgeSubquery(); - $result = db_query($link, "SELECT id AS cat_id, value AS unread FROM ttrss_feed_categories, ttrss_cat_counters_cache WHERE ttrss_cat_counters_cache.feed_id = id AND @@ -1493,8 +1537,6 @@ $cat_query = "cat_id IS NULL"; } - $age_qpart = getMaxAgeSubquery(); - $result = db_query($link, "SELECT id FROM ttrss_feeds WHERE $cat_query AND owner_uid = " . $owner_uid); @@ -1508,9 +1550,9 @@ $match_part = implode(" OR ", $cat_feeds); $result = db_query($link, "SELECT COUNT(int_id) AS unread - FROM ttrss_user_entries,ttrss_entries - WHERE unread = true AND ($match_part) AND id = ref_id - AND $age_qpart AND owner_uid = " . $owner_uid); + FROM ttrss_user_entries + WHERE unread = true AND ($match_part) + AND owner_uid = " . $owner_uid); $unread = 0; @@ -1526,10 +1568,8 @@ $result = db_query($link, " SELECT COUNT(unread) AS unread FROM - ttrss_user_entries, ttrss_labels2, ttrss_user_labels2, ttrss_feeds - WHERE label_id = ttrss_labels2.id AND article_id = ref_id AND - ttrss_labels2.owner_uid = '$owner_uid' - AND unread = true AND feed_id = ttrss_feeds.id + ttrss_user_entries, ttrss_user_labels2 + WHERE article_id = ref_id AND unread = true AND ttrss_user_entries.owner_uid = '$owner_uid'"); $unread = db_fetch_result($result, 0, "unread"); @@ -1539,16 +1579,6 @@ } } - function getMaxAgeSubquery($days = COUNTERS_MAX_AGE) { - if (DB_TYPE == "pgsql") { - return "ttrss_entries.date_updated > - NOW() - INTERVAL '$days days'"; - } else { - return "ttrss_entries.date_updated > - DATE_SUB(NOW(), INTERVAL $days DAY)"; - } - } - function getFeedUnread($link, $feed, $is_cat = false) { return getFeedArticles($link, $feed, $is_cat, true, $_SESSION["uid"]); } @@ -1556,13 +1586,8 @@ function getLabelUnread($link, $label_id, $owner_uid = false) { if (!$owner_uid) $owner_uid = $_SESSION["uid"]; - $result = db_query($link, " - SELECT COUNT(unread) AS unread FROM - ttrss_user_entries, ttrss_labels2, ttrss_user_labels2, ttrss_feeds - WHERE label_id = ttrss_labels2.id AND article_id = ref_id AND - ttrss_labels2.owner_uid = '$owner_uid' AND ttrss_labels2.id = '$label_id' - AND unread = true AND feed_id = ttrss_feeds.id - AND ttrss_user_entries.owner_uid = '$owner_uid'"); + $result = db_query($link, "SELECT COUNT(ref_id) AS unread FROM ttrss_user_entries, ttrss_user_labels2 + WHERE owner_uid = '$owner_uid' AND unread = true AND label_id = '$label_id' AND article_id = ref_id"); if (db_num_rows($result) != 0) { return db_fetch_result($result, 0, "unread"); @@ -1575,6 +1600,7 @@ $owner_uid = false) { $n_feed = (int) $feed; + $need_entries = false; if (!$owner_uid) $owner_uid = $_SESSION["uid"]; @@ -1584,8 +1610,6 @@ $unread_qpart = "true"; } - $age_qpart = getMaxAgeSubquery(); - if ($is_cat) { return getCategoryUnread($link, $n_feed, $owner_uid); } if ($feed != "0" && $n_feed == 0) { @@ -1594,8 +1618,7 @@ $result = db_query($link, "SELECT SUM((SELECT COUNT(int_id) FROM ttrss_user_entries,ttrss_entries WHERE int_id = post_int_id - AND ref_id = id AND $age_qpart - AND $unread_qpart)) AS count FROM ttrss_tags + AND ref_id = id AND $unread_qpart)) AS count FROM ttrss_tags WHERE owner_uid = $owner_uid AND tag_name = '$feed'"); return db_fetch_result($result, 0, "count"); @@ -1613,6 +1636,9 @@ } else { $match_part .= " AND updated > DATE_SUB(NOW(), INTERVAL $intl HOUR) "; } + + $need_entries = true; + } else if ($n_feed == -4) { $match_part = "true"; } else if ($n_feed >= 0) { @@ -1633,20 +1659,18 @@ if ($match_part) { - if ($n_feed != 0) { - $from_qpart = "ttrss_user_entries,ttrss_feeds,ttrss_entries"; - $feeds_qpart = "ttrss_user_entries.feed_id = ttrss_feeds.id AND"; - } else { + if ($need_entries) { $from_qpart = "ttrss_user_entries,ttrss_entries"; - $feeds_qpart = ''; + $from_where = "ttrss_entries.id = ttrss_user_entries.ref_id AND"; + } else { + $from_qpart = "ttrss_user_entries"; } $query = "SELECT count(int_id) AS unread FROM $from_qpart WHERE - ttrss_user_entries.ref_id = ttrss_entries.id AND - $age_qpart AND - $feeds_qpart - $unread_qpart AND ($match_part) AND ttrss_user_entries.owner_uid = $owner_uid"; + $unread_qpart AND $from_where ($match_part) AND ttrss_user_entries.owner_uid = $owner_uid"; + + //echo "[$feed/$query]\n"; $result = db_query($link, $query); @@ -1655,8 +1679,7 @@ $result = db_query($link, "SELECT COUNT(post_int_id) AS unread FROM ttrss_tags,ttrss_user_entries,ttrss_entries WHERE tag_name = '$feed' AND post_int_id = int_id AND ref_id = ttrss_entries.id - AND $unread_qpart AND $age_qpart AND - ttrss_tags.owner_uid = " . $owner_uid); + AND $unread_qpart AND ttrss_tags.owner_uid = " . $owner_uid); } $unread = db_fetch_result($result, 0, "unread"); @@ -1707,12 +1730,9 @@ $ret_arr = array(); - $age_qpart = getMaxAgeSubquery(); - $result = db_query($link, "SELECT tag_name,SUM((SELECT COUNT(int_id) FROM ttrss_user_entries,ttrss_entries WHERE int_id = post_int_id - AND ref_id = id AND $age_qpart - AND unread = true)) AS count FROM ttrss_tags + AND ref_id = id AND unread = true)) AS count FROM ttrss_tags WHERE owner_uid = ".$_SESSION['uid']." GROUP BY tag_name ORDER BY count DESC LIMIT 55"); @@ -1760,8 +1780,6 @@ $ret_arr = array(); - $age_qpart = getMaxAgeSubquery(); - $owner_uid = $_SESSION["uid"]; $result = db_query($link, "SELECT id, caption FROM ttrss_labels2 @@ -1793,8 +1811,6 @@ $ret_arr = array(); - $age_qpart = getMaxAgeSubquery(); - $query = "SELECT ttrss_feeds.id, ttrss_feeds.title, ".SUBSTRING_FOR_DATE."(ttrss_feeds.last_updated,1,19) AS last_updated, @@ -2360,7 +2376,7 @@ } else if ($feed == 0 && !$cat_view) { // archive virtual feed $query_strategy_part = "feed_id IS NULL"; } else if ($feed == 0 && $cat_view) { // uncategorized - $query_strategy_part = "cat_id IS NULL"; + $query_strategy_part = "cat_id IS NULL AND feed_id IS NOT NULL"; $vfeed_query_part = "ttrss_feeds.title AS feed_title,"; } else if ($feed == -1) { // starred virtual feed $query_strategy_part = "marked = true"; @@ -2674,7 +2690,7 @@ $node = $doc->getElementsByTagName('body')->item(0); - return $doc->saveXML($node); + return $doc->saveXML($node, LIBXML_NOEMPTYTAG); } /** @@ -2684,19 +2700,19 @@ * @param integer $limit The maximum number of articles by digest. * @return boolean Return false if digests are not enabled. */ - function send_headlines_digests($link, $limit = 100, $debug = true) { + function send_headlines_digests($link, $debug = false) { require_once 'lib/phpmailer/class.phpmailer.php'; $user_limit = 15; // amount of users to process (e.g. emails to send out) - $days = 1; + $limit = 1000; // maximum amount of headlines to include - if ($debug) _debug("Sending digests, batch of max $user_limit users, days = $days, headline limit = $limit"); + if ($debug) _debug("Sending digests, batch of max $user_limit users, headline limit = $limit"); if (DB_TYPE == "pgsql") { - $interval_query = "last_digest_sent < NOW() - INTERVAL '$days days'"; + $interval_query = "last_digest_sent < NOW() - INTERVAL '1 days'"; } else if (DB_TYPE == "mysql") { - $interval_query = "last_digest_sent < DATE_SUB(NOW(), INTERVAL $days DAY)"; + $interval_query = "last_digest_sent < DATE_SUB(NOW(), INTERVAL 1 DAY)"; } $result = db_query($link, "SELECT id,email FROM ttrss_users @@ -2705,58 +2721,71 @@ while ($line = db_fetch_assoc($result)) { if (get_pref($link, 'DIGEST_ENABLE', $line['id'], false)) { - print "Sending digest for UID:" . $line['id'] . " - " . $line["email"] . " ... "; + $preferred_ts = strtotime(get_pref($link, 'DIGEST_PREFERRED_TIME', $line['id'], '00:00')); - $do_catchup = get_pref($link, 'DIGEST_CATCHUP', $line['id'], false); + // try to send digests within 2 hours of preferred time + if ($preferred_ts && time() >= $preferred_ts && + time() - $preferred_ts <= 7200) { - $tuple = prepare_headlines_digest($link, $line["id"], $days, $limit); - $digest = $tuple[0]; - $headlines_count = $tuple[1]; - $affected_ids = $tuple[2]; - $digest_text = $tuple[3]; + if ($debug) print "Sending digest for UID:" . $line['id'] . " - " . $line["email"] . " ... "; - if ($headlines_count > 0) { + $do_catchup = get_pref($link, 'DIGEST_CATCHUP', $line['id'], false); - $mail = new PHPMailer(); + global $tz_offset; - $mail->PluginDir = "lib/phpmailer/"; - $mail->SetLanguage("en", "lib/phpmailer/language/"); + // reset tz_offset global to prevent tz cache clash between users + $tz_offset = -1; - $mail->CharSet = "UTF-8"; + $tuple = prepare_headlines_digest($link, $line["id"], 1, $limit); + $digest = $tuple[0]; + $headlines_count = $tuple[1]; + $affected_ids = $tuple[2]; + $digest_text = $tuple[3]; - $mail->From = SMTP_FROM_ADDRESS; - $mail->FromName = SMTP_FROM_NAME; - $mail->AddAddress($line["email"], $line["login"]); + if ($headlines_count > 0) { - if (SMTP_HOST) { - $mail->Host = SMTP_HOST; - $mail->Mailer = "smtp"; - $mail->SMTPAuth = SMTP_LOGIN != ''; - $mail->Username = SMTP_LOGIN; - $mail->Password = SMTP_PASSWORD; - } + $mail = new PHPMailer(); + + $mail->PluginDir = "lib/phpmailer/"; + $mail->SetLanguage("en", "lib/phpmailer/language/"); - $mail->IsHTML(true); - $mail->Subject = DIGEST_SUBJECT; - $mail->Body = $digest; - $mail->AltBody = $digest_text; + $mail->CharSet = "UTF-8"; - $rc = $mail->Send(); + $mail->From = SMTP_FROM_ADDRESS; + $mail->FromName = SMTP_FROM_NAME; + $mail->AddAddress($line["email"], $line["login"]); - if (!$rc) print "ERROR: " . $mail->ErrorInfo; + if (SMTP_HOST) { + $mail->Host = SMTP_HOST; + $mail->Mailer = "smtp"; + $mail->SMTPAuth = SMTP_LOGIN != ''; + $mail->Username = SMTP_LOGIN; + $mail->Password = SMTP_PASSWORD; + } + + $mail->IsHTML(true); + $mail->Subject = DIGEST_SUBJECT; + $mail->Body = $digest; + $mail->AltBody = $digest_text; + + $rc = $mail->Send(); - print "RC=$rc\n"; + if (!$rc && $debug) print "ERROR: " . $mail->ErrorInfo; - if ($rc && $do_catchup) { - print "Marking affected articles as read...\n"; - catchupArticlesById($link, $affected_ids, 0, $line["id"]); + if ($debug) print "RC=$rc\n"; + + if ($rc && $do_catchup) { + if ($debug) print "Marking affected articles as read...\n"; + catchupArticlesById($link, $affected_ids, 0, $line["id"]); + } + } else { + if ($debug) print "No headlines\n"; } - } else { - print "No headlines\n"; - } - db_query($link, "UPDATE ttrss_users SET last_digest_sent = NOW() - WHERE id = " . $line["id"]); + db_query($link, "UPDATE ttrss_users SET last_digest_sent = NOW() + WHERE id = " . $line["id"]); + + } } } @@ -2764,7 +2793,7 @@ } - function prepare_headlines_digest($link, $user_id, $days = 1, $limit = 100) { + function prepare_headlines_digest($link, $user_id, $days = 1, $limit = 1000) { require_once "lib/MiniTemplator.class.php"; @@ -2774,11 +2803,14 @@ $tpl->readTemplateFromFile("templates/digest_template_html.txt"); $tpl_t->readTemplateFromFile("templates/digest_template.txt"); - $tpl->setVariable('CUR_DATE', date('Y/m/d')); - $tpl->setVariable('CUR_TIME', date('G:i')); + $user_tz_string = get_pref($link, 'USER_TIMEZONE', $user_id); + $local_ts = convert_timestamp(time(), 'UTC', $user_tz_string); + + $tpl->setVariable('CUR_DATE', date('Y/m/d', $local_ts)); + $tpl->setVariable('CUR_TIME', date('G:i', $local_ts)); - $tpl_t->setVariable('CUR_DATE', date('Y/m/d')); - $tpl_t->setVariable('CUR_TIME', date('G:i')); + $tpl_t->setVariable('CUR_DATE', date('Y/m/d', $local_ts)); + $tpl_t->setVariable('CUR_TIME', date('G:i', $local_ts)); $affected_ids = array(); @@ -2790,20 +2822,25 @@ $result = db_query($link, "SELECT ttrss_entries.title, ttrss_feeds.title AS feed_title, + COALESCE(ttrss_feed_categories.title, '".__('Uncategorized')."') AS cat_title, date_updated, ttrss_user_entries.ref_id, link, - SUBSTRING(content, 1, 120) AS excerpt, + score, + content, ".SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated FROM ttrss_user_entries,ttrss_entries,ttrss_feeds + LEFT JOIN + ttrss_feed_categories ON (cat_id = ttrss_feed_categories.id) WHERE ref_id = ttrss_entries.id AND feed_id = ttrss_feeds.id AND include_in_digest = true AND $interval_query AND ttrss_user_entries.owner_uid = $user_id AND unread = true - ORDER BY ttrss_feeds.title, date_updated DESC + AND score >= 0 + ORDER BY ttrss_feed_categories.title, ttrss_feeds.title, score DESC, date_updated DESC LIMIT $limit"); $cur_feed_title = ""; @@ -2825,12 +2862,24 @@ $updated = make_local_datetime($link, $line['last_updated'], false, $user_id); +/* if ($line["score"] != 0) { + if ($line["score"] > 0) $line["score"] = '+' . $line["score"]; + + $line["title"] .= " (".$line['score'].")"; + } */ + + if (get_pref($link, 'ENABLE_FEED_CATS', $user_id)) { + $line['feed_title'] = $line['cat_title'] . " / " . $line['feed_title']; + } + $tpl->setVariable('FEED_TITLE', $line["feed_title"]); $tpl->setVariable('ARTICLE_TITLE', $line["title"]); $tpl->setVariable('ARTICLE_LINK', $line["link"]); $tpl->setVariable('ARTICLE_UPDATED', $updated); $tpl->setVariable('ARTICLE_EXCERPT', - truncate_string(strip_tags($line["excerpt"]), 100)); + truncate_string(strip_tags($line["content"]), 300)); +// $tpl->setVariable('ARTICLE_CONTENT', +// strip_tags($article_content)); $tpl->addBlock('article'); @@ -3002,8 +3051,6 @@ function get_article_tags($link, $id, $owner_uid = 0, $tag_cache = false) { - global $memcache; - $a_id = db_escape_string($id); if (!$owner_uid) $owner_uid = $_SESSION["uid"]; @@ -3016,40 +3063,34 @@ $obj_id = md5("TAGS:$owner_uid:$id"); $tags = array(); - if ($memcache && $obj = $memcache->get($obj_id)) { - $tags = $obj; - } else { - /* check cache first */ + /* check cache first */ - if ($tag_cache === false) { - $result = db_query($link, "SELECT tag_cache FROM ttrss_user_entries - WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]); + if ($tag_cache === false) { + $result = db_query($link, "SELECT tag_cache FROM ttrss_user_entries + WHERE ref_id = '$id' AND owner_uid = $owner_uid"); - $tag_cache = db_fetch_result($result, 0, "tag_cache"); - } + $tag_cache = db_fetch_result($result, 0, "tag_cache"); + } - if ($tag_cache) { - $tags = explode(",", $tag_cache); - } else { + if ($tag_cache) { + $tags = explode(",", $tag_cache); + } else { - /* do it the hard way */ + /* do it the hard way */ - $tmp_result = db_query($link, $query); + $tmp_result = db_query($link, $query); - while ($tmp_line = db_fetch_assoc($tmp_result)) { - array_push($tags, $tmp_line["tag_name"]); - } + while ($tmp_line = db_fetch_assoc($tmp_result)) { + array_push($tags, $tmp_line["tag_name"]); + } - /* update the cache */ + /* update the cache */ - $tags_str = db_escape_string(join(",", $tags)); + $tags_str = db_escape_string(join(",", $tags)); - db_query($link, "UPDATE ttrss_user_entries - SET tag_cache = '$tags_str' WHERE ref_id = '$id' - AND owner_uid = " . $_SESSION["uid"]); - } - - if ($memcache) $memcache->add($obj_id, $tags, 0, 3600); + db_query($link, "UPDATE ttrss_user_entries + SET tag_cache = '$tags_str' WHERE ref_id = '$id' + AND owner_uid = $owner_uid"); } return $tags; @@ -3172,7 +3213,9 @@ return $entry; } - function format_article($link, $id, $mark_as_read = true, $zoom_mode = false) { + function format_article($link, $id, $mark_as_read = true, $zoom_mode = false, $owner_uid = false) { + + if (!$owner_uid) $owner_uid = $_SESSION["uid"]; $rv = array(); @@ -3191,7 +3234,7 @@ //if (!$zoom_mode) { print "
"; } + $title_escaped = db_escape_string($line['title']); + $rv['content'] .= "
" . truncate_string(strip_tags($line['title']), 15) . "
"; + $rv['content'] .= "
" . + strip_tags($line['title']) . "
"; + $rv['content'] .= "
"; $rv['content'] .= "
$parsed_updated
"; if ($line["link"]) { - $rv['content'] .= "
" . truncate_string($line["title"], 100) . "$entry_author
"; } else { - $rv['content'] .= "
" . $line["title"] . "$entry_author
"; + $rv['content'] .= "
" . $line["title"] . "$entry_author
"; } $tag_cache = $line["tag_cache"]; if (!$tag_cache) - $tags = get_article_tags($link, $id); + $tags = get_article_tags($link, $id, $owner_uid); else $tags = explode(",", $tag_cache); @@ -3310,7 +3358,7 @@ if (!$entry_comments) $entry_comments = " "; # placeholder - $rv['content'] .= "
+ $rv['content'] .= "