further reduce db hit on tags in viewfeed
This commit is contained in:
parent
9c50687358
commit
ca5133cb91
|
@ -4590,7 +4590,7 @@
|
||||||
return $feedlist;
|
return $feedlist;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_article_tags($link, $id, $owner_uid = 0) {
|
function get_article_tags($link, $id, $owner_uid = 0, $tag_cache = false) {
|
||||||
|
|
||||||
global $memcache;
|
global $memcache;
|
||||||
|
|
||||||
|
@ -4611,10 +4611,12 @@
|
||||||
} else {
|
} else {
|
||||||
/* check cache first */
|
/* check cache first */
|
||||||
|
|
||||||
$result = db_query($link, "SELECT tag_cache FROM ttrss_user_entries
|
if ($tag_cache === false) {
|
||||||
WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
|
$result = db_query($link, "SELECT tag_cache FROM ttrss_user_entries
|
||||||
|
WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
|
||||||
|
|
||||||
$tag_cache = db_fetch_result($result, 0, "tag_cache");
|
$tag_cache = db_fetch_result($result, 0, "tag_cache");
|
||||||
|
}
|
||||||
|
|
||||||
if ($tag_cache) {
|
if ($tag_cache) {
|
||||||
$tags = explode(",", $tag_cache);
|
$tags = explode(",", $tag_cache);
|
||||||
|
@ -5537,10 +5539,9 @@
|
||||||
|
|
||||||
$tag_cache = $line["tag_cache"];
|
$tag_cache = $line["tag_cache"];
|
||||||
|
|
||||||
if ($tag_cache)
|
$tags_str = format_tags_string(
|
||||||
$tags_str = format_tags_string(explode(",", $tag_cache), $id);
|
get_article_tags($link, $id, $_SESSION["uid"], $tag_cache),
|
||||||
else
|
$id);
|
||||||
$tags_str = format_tags_string(get_article_tags($link, $id), $id);
|
|
||||||
|
|
||||||
$reply['content'] .= "<img src='".theme_image($link,
|
$reply['content'] .= "<img src='".theme_image($link,
|
||||||
'images/tag.png')."' alt='Tags' title='Tags'>
|
'images/tag.png')."' alt='Tags' title='Tags'>
|
||||||
|
|
Loading…
Reference in New Issue