• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP get_article_tags函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_article_tags函数的典型用法代码示例。如果您正苦于以下问题:PHP get_article_tags函数的具体用法?PHP get_article_tags怎么用?PHP get_article_tags使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_article_tags函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: filter_test

 function filter_test($filter_type, $reg_exp, $action_id, $action_param, $filter_param, $inverse, $feed_id, $cat_id, $cat_filter)
 {
     $result = db_query($this->link, "SELECT name FROM ttrss_filter_types WHERE\n\t\t\tid = " . $filter_type);
     $type_name = db_fetch_result($result, 0, "name");
     $result = db_query($this->link, "SELECT name FROM ttrss_filter_actions WHERE\n\t\t\tid = " . $action_id);
     $action_name = db_fetch_result($result, 0, "name");
     $filter["reg_exp"] = $reg_exp;
     $filter["action"] = $action_name;
     $filter["type"] = $type_name;
     $filter["action_param"] = $action_param;
     $filter["filter_param"] = $filter_param;
     $filter["inverse"] = $inverse;
     $filters[$type_name] = array($filter);
     if ($feed_id) {
         $feed = $feed_id;
     } else {
         $feed = -4;
     }
     $regexp_valid = preg_match('/' . $filter['reg_exp'] . '/', $filter['reg_exp']) !== FALSE;
     print __("Articles matching this filter:");
     print "<div class=\"filterTestHolder\">";
     print "<table width=\"100%\" cellspacing=\"0\" id=\"prefErrorFeedList\">";
     if ($regexp_valid) {
         $feed_title = getFeedTitle($this->link, $feed);
         $qfh_ret = queryFeedHeadlines($this->link, $cat_filter ? $cat_id : $feed, 30, "", $cat_filter, false, false, false, "date_entered DESC", 0, $_SESSION["uid"], $filter);
         $result = $qfh_ret[0];
         $articles = array();
         $found = 0;
         while ($line = db_fetch_assoc($result)) {
             $entry_timestamp = strtotime($line["updated"]);
             $entry_tags = get_article_tags($this->link, $line["id"], $_SESSION["uid"]);
             $content_preview = truncate_string(strip_tags($line["content_preview"]), 100, '...');
             if ($line["feed_title"]) {
                 $feed_title = $line["feed_title"];
             }
             print "<tr>";
             print "<td width='5%' align='center'><input\n\t\t\t\t\tdojoType=\"dijit.form.CheckBox\" checked=\"1\"\n\t\t\t\t\tdisabled=\"1\" type=\"checkbox\"></td>";
             print "<td>";
             print $line["title"];
             print "&nbsp;(";
             print "<b>" . $feed_title . "</b>";
             print "):&nbsp;";
             print "<span class=\"insensitive\">" . $content_preview . "</span>";
             print " " . mb_substr($line["date_entered"], 0, 16);
             print "</td></tr>";
             $found++;
         }
         if ($found == 0) {
             print "<tr><td align='center'>" . __("No articles matching this filter has been found.") . "</td></tr>";
         }
     } else {
         print "<tr><td align='center' class='error'>" . __("Invalid regular expression.") . "</td></tr>";
     }
     print "</table>";
     print "</div>";
 }
开发者ID:4iji,项目名称:Tiny-Tiny-RSS,代码行数:56,代码来源:pref_filters.php


示例2: digestgetcontents

 function digestgetcontents()
 {
     $article_id = db_escape_string($_REQUEST['article_id']);
     $result = db_query($this->link, "SELECT content,title,link,marked,published\n\t\t\tFROM ttrss_entries, ttrss_user_entries\n\t\t\tWHERE id = '{$article_id}' AND ref_id = id AND owner_uid = " . $_SESSION['uid']);
     $content = sanitize($this->link, db_fetch_result($result, 0, "content"));
     $title = strip_tags(db_fetch_result($result, 0, "title"));
     $article_url = htmlspecialchars(db_fetch_result($result, 0, "link"));
     $marked = sql_bool_to_bool(db_fetch_result($result, 0, "marked"));
     $published = sql_bool_to_bool(db_fetch_result($result, 0, "published"));
     print json_encode(array("article" => array("id" => $article_id, "url" => $article_url, "tags" => get_article_tags($this->link, $article_id), "marked" => $marked, "published" => $published, "title" => $title, "content" => $content)));
 }
开发者ID:bohoo,项目名称:tiny_tiny_rss-openshift-quickstart-1,代码行数:11,代码来源:init.php


示例3: format_article

function format_article($link, $id, $mark_as_read = true, $zoom_mode = false, $owner_uid = false)
{
    if (!$owner_uid) {
        $owner_uid = $_SESSION["uid"];
    }
    $rv = array();
    $rv['id'] = $id;
    /* we can figure out feed_id from article id anyway, why do we
     * pass feed_id here? let's ignore the argument :( */
    $result = db_query($link, "SELECT feed_id FROM ttrss_user_entries\n\t\t\tWHERE ref_id = '{$id}'");
    $feed_id = (int) db_fetch_result($result, 0, "feed_id");
    $rv['feed_id'] = $feed_id;
    //if (!$zoom_mode) { print "<article id='$id'><![CDATA["; };
    if ($mark_as_read) {
        $result = db_query($link, "UPDATE ttrss_user_entries\n\t\t\t\tSET unread = false,last_read = NOW()\n\t\t\t\tWHERE ref_id = '{$id}' AND owner_uid = {$owner_uid}");
        ccache_update($link, $feed_id, $owner_uid);
    }
    $result = db_query($link, "SELECT id,title,link,content,feed_id,comments,int_id,\n\t\t\t" . SUBSTRING_FOR_DATE . "(updated,1,16) as updated,\n\t\t\t(SELECT site_url FROM ttrss_feeds WHERE id = feed_id) as site_url,\n\t\t\tnum_comments,\n\t\t\ttag_cache,\n\t\t\tauthor,\n\t\t\torig_feed_id,\n\t\t\tnote,\n\t\t\tcached_content\n\t\t\tFROM ttrss_entries,ttrss_user_entries\n\t\t\tWHERE\tid = '{$id}' AND ref_id = id AND owner_uid = {$owner_uid}");
    if ($result) {
        $line = db_fetch_assoc($result);
        $tag_cache = $line["tag_cache"];
        $line["tags"] = get_article_tags($link, $id, $owner_uid, $line["tag_cache"]);
        unset($line["tag_cache"]);
        $line["content"] = sanitize($link, $line["content"], false, $owner_uid, $line["site_url"]);
        global $pluginhost;
        foreach ($pluginhost->get_hooks($pluginhost::HOOK_RENDER_ARTICLE) as $p) {
            $line = $p->hook_render_article($line);
        }
        $num_comments = $line["num_comments"];
        $entry_comments = "";
        if ($num_comments > 0) {
            if ($line["comments"]) {
                $comments_url = htmlspecialchars($line["comments"]);
            } else {
                $comments_url = htmlspecialchars($line["link"]);
            }
            $entry_comments = "<a target='_blank' href=\"{$comments_url}\">{$num_comments} comments</a>";
        } else {
            if ($line["comments"] && $line["link"] != $line["comments"]) {
                $entry_comments = "<a target='_blank' href=\"" . htmlspecialchars($line["comments"]) . "\">comments</a>";
            }
        }
        if ($zoom_mode) {
            header("Content-Type: text/html");
            $rv['content'] .= "<html><head>\n\t\t\t\t\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\n\t\t\t\t\t\t<title>Tiny Tiny RSS - " . $line["title"] . "</title>\n\t\t\t\t\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"tt-rss.css\">\n\t\t\t\t\t</head><body>";
        }
        $title_escaped = htmlspecialchars($line['title']);
        $rv['content'] .= "<div id=\"PTITLE-FULL-{$id}\" style=\"display : none\">" . strip_tags($line['title']) . "</div>";
        $rv['content'] .= "<div class=\"postReply\" id=\"POST-{$id}\">";
        $rv['content'] .= "<div class=\"postHeader\" id=\"POSTHDR-{$id}\">";
        $entry_author = $line["author"];
        if ($entry_author) {
            $entry_author = __(" - ") . $entry_author;
        }
        $parsed_updated = make_local_datetime($link, $line["updated"], true, $owner_uid, true);
        $rv['content'] .= "<div class=\"postDate\">{$parsed_updated}</div>";
        if ($line["link"]) {
            $rv['content'] .= "<div class='postTitle'><a target='_blank'\n\t\t\t\t\ttitle=\"" . htmlspecialchars($line['title']) . "\"\n\t\t\t\t\thref=\"" . htmlspecialchars($line["link"]) . "\">" . $line["title"] . "<span class='author'>{$entry_author}</span></a></div>";
        } else {
            $rv['content'] .= "<div class='postTitle'>" . $line["title"] . "{$entry_author}</div>";
        }
        $tags_str = format_tags_string($line["tags"], $id);
        $tags_str_full = join(", ", $line["tags"]);
        if (!$tags_str_full) {
            $tags_str_full = __("no tags");
        }
        if (!$entry_comments) {
            $entry_comments = "&nbsp;";
        }
        # placeholder
        $rv['content'] .= "<div class='postTags' style='float : right'>\n\t\t\t\t<img src='" . theme_image($link, 'images/tag.png') . "'\n\t\t\t\tclass='tagsPic' alt='Tags' title='Tags'>&nbsp;";
        if (!$zoom_mode) {
            $rv['content'] .= "<span id=\"ATSTR-{$id}\">{$tags_str}</span>\n\t\t\t\t\t<a title=\"" . __('Edit tags for this article') . "\"\n\t\t\t\t\thref=\"#\" onclick=\"editArticleTags({$id}, {$feed_id})\">(+)</a>";
            $rv['content'] .= "<div dojoType=\"dijit.Tooltip\"\n\t\t\t\t\tid=\"ATSTRTIP-{$id}\" connectId=\"ATSTR-{$id}\"\n\t\t\t\t\tposition=\"below\">{$tags_str_full}</div>";
            global $pluginhost;
            foreach ($pluginhost->get_hooks($pluginhost::HOOK_ARTICLE_BUTTON) as $p) {
                $rv['content'] .= $p->hook_article_button($line);
            }
        } else {
            $tags_str = strip_tags($tags_str);
            $rv['content'] .= "<span id=\"ATSTR-{$id}\">{$tags_str}</span>";
        }
        $rv['content'] .= "</div>";
        $rv['content'] .= "<div clear='both'>{$entry_comments}</div>";
        if ($line["orig_feed_id"]) {
            $tmp_result = db_query($link, "SELECT * FROM ttrss_archived_feeds\n\t\t\t\t\tWHERE id = " . $line["orig_feed_id"]);
            if (db_num_rows($tmp_result) != 0) {
                $rv['content'] .= "<div clear='both'>";
                $rv['content'] .= __("Originally from:");
                $rv['content'] .= "&nbsp;";
                $tmp_line = db_fetch_assoc($tmp_result);
                $rv['content'] .= "<a target='_blank'\n\t\t\t\t\t\thref=' " . htmlspecialchars($tmp_line['site_url']) . "'>" . $tmp_line['title'] . "</a>";
                $rv['content'] .= "&nbsp;";
                $rv['content'] .= "<a target='_blank' href='" . htmlspecialchars($tmp_line['feed_url']) . "'>";
                $rv['content'] .= "<img title='" . __('Feed URL') . "'class='tinyFeedIcon' src='images/pub_set.svg'></a>";
                $rv['content'] .= "</div>";
            }
        }
        $rv['content'] .= "</div>";
        $rv['content'] .= "<div id=\"POSTNOTE-{$id}\">";
//.........这里部分代码省略.........
开发者ID:rclsilver,项目名称:openshift-tt-rss,代码行数:101,代码来源:functions.php


示例4: setArticleTags

 function setArticleTags()
 {
     $id = db_escape_string($_REQUEST["id"]);
     $tags_str = db_escape_string($_REQUEST["tags_str"]);
     $tags = array_unique(trim_array(explode(",", $tags_str)));
     db_query($this->link, "BEGIN");
     $result = db_query($this->link, "SELECT int_id FROM ttrss_user_entries WHERE\n\t\t\t\tref_id = '{$id}' AND owner_uid = '" . $_SESSION["uid"] . "' LIMIT 1");
     if (db_num_rows($result) == 1) {
         $tags_to_cache = array();
         $int_id = db_fetch_result($result, 0, "int_id");
         db_query($this->link, "DELETE FROM ttrss_tags WHERE\n\t\t\t\tpost_int_id = {$int_id} AND owner_uid = '" . $_SESSION["uid"] . "'");
         foreach ($tags as $tag) {
             $tag = sanitize_tag($tag);
             if (!tag_is_valid($tag)) {
                 continue;
             }
             if (preg_match("/^[0-9]*\$/", $tag)) {
                 continue;
             }
             //					print "<!-- $id : $int_id : $tag -->";
             if ($tag != '') {
                 db_query($this->link, "INSERT INTO ttrss_tags\n\t\t\t\t\t\t\t\t(post_int_id, owner_uid, tag_name) VALUES ('{$int_id}', '" . $_SESSION["uid"] . "', '{$tag}')");
             }
             array_push($tags_to_cache, $tag);
         }
         /* update tag cache */
         sort($tags_to_cache);
         $tags_str = join(",", $tags_to_cache);
         db_query($this->link, "UPDATE ttrss_user_entries\n\t\t\t\tSET tag_cache = '{$tags_str}' WHERE ref_id = '{$id}'\n\t\t\t\t\t\tAND owner_uid = " . $_SESSION["uid"]);
     }
     db_query($this->link, "COMMIT");
     $tags = get_article_tags($this->link, $id);
     $tags_str = format_tags_string($tags, $id);
     $tags_str_full = join(", ", $tags);
     if (!$tags_str_full) {
         $tags_str_full = __("no tags");
     }
     print json_encode(array("tags_str" => array("id" => $id, "content" => $tags_str, "content_full" => $tags_str_full)));
 }
开发者ID:bohoo,项目名称:tiny_tiny_rss-openshift-quickstart-1,代码行数:39,代码来源:rpc.php


示例5: testFilter

 function testFilter()
 {
     $filter = array();
     $filter["enabled"] = true;
     $filter["match_any_rule"] = sql_bool_to_bool(checkbox_to_sql_bool(db_escape_string($_REQUEST["match_any_rule"])));
     $filter["rules"] = array();
     $result = db_query($this->link, "SELECT id,name FROM ttrss_filter_types");
     $filter_types = array();
     while ($line = db_fetch_assoc($result)) {
         $filter_types[$line["id"]] = $line["name"];
     }
     $rctr = 0;
     foreach ($_REQUEST["rule"] as $r) {
         $rule = json_decode($r, true);
         if ($rule && $rctr < 5) {
             $rule["type"] = $filter_types[$rule["filter_type"]];
             unset($rule["filter_type"]);
             if (strpos($rule["feed_id"], "CAT:") === 0) {
                 $rule["cat_id"] = (int) substr($rule["feed_id"], 4);
                 unset($rule["feed_id"]);
             }
             array_push($filter["rules"], $rule);
             ++$rctr;
         } else {
             break;
         }
     }
     $feed_title = getFeedTitle($this->link, $feed);
     $qfh_ret = queryFeedHeadlines($this->link, -4, 30, "", false, false, false, false, "date_entered DESC", 0, $_SESSION["uid"], $filter);
     $result = $qfh_ret[0];
     $articles = array();
     $found = 0;
     print __("Articles matching this filter:");
     print "<div class=\"filterTestHolder\">";
     print "<table width=\"100%\" cellspacing=\"0\" id=\"prefErrorFeedList\">";
     while ($line = db_fetch_assoc($result)) {
         $entry_timestamp = strtotime($line["updated"]);
         $entry_tags = get_article_tags($this->link, $line["id"], $_SESSION["uid"]);
         $content_preview = truncate_string(strip_tags($line["content_preview"]), 100, '...');
         if ($line["feed_title"]) {
             $feed_title = $line["feed_title"];
         }
         print "<tr>";
         print "<td width='5%' align='center'><input\n\t\t\t\tdojoType=\"dijit.form.CheckBox\" checked=\"1\"\n\t\t\t\tdisabled=\"1\" type=\"checkbox\"></td>";
         print "<td>";
         print $line["title"];
         print "&nbsp;(";
         print "<b>" . $feed_title . "</b>";
         print "):&nbsp;";
         print "<span class=\"insensitive\">" . $content_preview . "</span>";
         print " " . mb_substr($line["date_entered"], 0, 16);
         print "</td></tr>";
         $found++;
     }
     if ($found == 0) {
         print "<tr><td align='center'>" . __("No recent articles matching this filter have been found.") . "</td></tr>";
     }
     print "</table></div>";
     print "<div style='text-align : center'>";
     print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('filterTestDlg').hide()\">" . __('Close this window') . "</button>";
     print "</div>";
 }
开发者ID:rolfkleef,项目名称:Tiny-Tiny-RSS,代码行数:62,代码来源:filters.php


示例6: outputHeadlinesList


//.........这里部分代码省略.........
                print sanitize_rss($link, $line["content_preview"]);
                $article_content = $line["content_preview"];
                $e_result = db_query($link, "SELECT * FROM ttrss_enclosures WHERE\n\t\t\t\t\t\tpost_id = '{$id}' AND content_url != ''");
                if (db_num_rows($e_result) > 0) {
                    $entries_html = array();
                    $entries = array();
                    while ($e_line = db_fetch_assoc($e_result)) {
                        $url = $e_line["content_url"];
                        $ctype = $e_line["content_type"];
                        if (!$ctype) {
                            $ctype = __("unknown type");
                        }
                        $filename = substr($url, strrpos($url, "/") + 1);
                        $entry = format_inline_player($link, $url, $ctype);
                        $entry .= " <a target=\"_blank\" href=\"" . htmlspecialchars($url) . "\">" . $filename . " (" . $ctype . ")" . "</a>";
                        array_push($entries_html, $entry);
                        $entry = array();
                        $entry["type"] = $ctype;
                        $entry["filename"] = $filename;
                        $entry["url"] = $url;
                        array_push($entries, $entry);
                    }
                    $tmp_result = db_query($link, "SELECT always_display_enclosures FROM\n\t\t\t\t\tttrss_feeds WHERE id = " . $line['feed_id'] . " AND owner_uid = " . $_SESSION["uid"]);
                    $always_display_enclosures = db_fetch_result($tmp_result, 0, "always_display_enclosures");
                    if (!get_pref($link, "STRIP_IMAGES")) {
                        if ($always_display_enclosures || !preg_match("/img/i", $article_content)) {
                            foreach ($entries as $entry) {
                                if (preg_match("/image/", $entry["type"]) || preg_match("/\\.(jpg|png|gif|bmp)/i", $entry["filename"])) {
                                    print "<p><img \n\t\t\t\t\t\t\t\t\talt=\"" . htmlspecialchars($entry["filename"]) . "\"\n\t\t\t\t\t\t\t\t\tsrc=\"" . htmlspecialchars($entry["url"]) . "\"></p>";
                                }
                            }
                        }
                    }
                    print "<div class=\"cdmEnclosures\">";
                    if (db_num_rows($e_result) == 1) {
                        print __("Attachment:") . " ";
                    } else {
                        print __("Attachments:") . " ";
                    }
                    print join(", ", $entries_html);
                    print "</div>";
                }
                print "<br clear='both'>";
                //					print "</div>";
                /*					if (!$expand_cdm) {
                						print "<a id=\"CICH-$id\" 
                							href=\"javascript:cdmExpandArticle($id)\">
                							Show article</a>";
                					} */
                print "</div>";
                print "<div class=\"cdmFooter\"><span class='s0'>";
                /* print "<div class=\"markedPic\">Star it: $marked_pic</div>"; */
                print __("Select:") . " <input type=\"checkbox\" onclick=\"toggleSelectRowById(this, \n\t\t\t\t\t\t\t'RROW-{$id}')\" class=\"feedCheckBox\" id=\"RCHK-{$id}\">";
                print "</span><span class='s1'>{$marked_pic}&nbsp;";
                print "{$published_pic}&nbsp;";
                print "<img src=\"images/art-zoom.png\" class='tagsPic' \n\t\t\t\t\t\tonclick=\"zoomToArticle({$id})\"\n\t\t\t\t\t\tstyle=\"cursor : pointer\"\n\t\t\t\t\t\talt='Zoom' \n\t\t\t\t\t\ttitle='" . __('Show article summary in new window') . "'>&nbsp;";
                $note_escaped = htmlspecialchars($line['note'], ENT_QUOTES);
                print "<img src=\"images/art-pub-note.png\" class='tagsPic' \n\t\t\t\t\t\tstyle=\"cursor : pointer\" style=\"cursor : pointer\"\n\t\t\t\t\t\tonclick=\"publishWithNote({$id}, '{$note_escaped}')\"\n\t\t\t\t\t\talt='PubNote' title='" . __('Publish article with a note') . "'>";
                print "</span>";
                $tags_str = format_tags_string(get_article_tags($link, $id), $id);
                print "<span class='s1'>\n\t\t\t\t\t\t<img class='tagsPic' src='" . theme_image($link, 'images/tag.png') . "' alt='Tags' title='Tags'>\n\t\t\t\t\t\t<span id=\"ATSTR-{$id}\">{$tags_str}</span>\n\t\t\t\t\t\t<a title=\"" . __('Edit tags for this article') . "\" \n\t\t\t\t\t\thref=\"javascript:editArticleTags({$id}, {$feed_id}, true)\">(+)</a>";
                print "</span>";
                print "<span class='s2'><a class=\"cdmToggleLink\"\n\t\t\t\t\t\t\thref=\"javascript:toggleUnread({$id})\">\n\t\t\t\t\t\t\t" . __('toggle unread') . "</a></span>";
                print "</div>";
                print "</div>";
            }
            ++$lnum;
        }
        if (!get_pref($link, 'COMBINED_DISPLAY_MODE') && !$offset) {
            print "</table>";
        }
    } else {
        $message = "";
        switch ($view_mode) {
            case "unread":
                $message = __("No unread articles found to display.");
                break;
            case "updated":
                $message = __("No updated articles found to display.");
                break;
            case "marked":
                $message = __("No starred articles found to display.");
                break;
            default:
                if ($feed < -10) {
                    $message = __("No articles found to display. You can assign articles to labels manually (see the Actions menu above) or use a filter.");
                } else {
                    $message = __("No articles found to display.");
                }
        }
        if (!$offset) {
            print "<div class='whiteBox'>{$message}</div>";
        }
    }
    if (!$offset) {
        print "</div>";
        print "</div>";
    }
    return array($topmost_article_ids, $headlines_count, $feed, $disable_cache, $vgroup_last_feed);
}
开发者ID:wangroot,项目名称:Tiny-Tiny-RSS,代码行数:101,代码来源:functions.php


示例7: generate_syndicated_feed

 private function generate_syndicated_feed($owner_uid, $feed, $is_cat, $limit, $offset, $search, $search_mode, $view_mode = false, $format = 'atom', $order = false, $orig_guid = false)
 {
     require_once "lib/MiniTemplator.class.php";
     $note_style = "background-color : #fff7d5;\n\t\t\tborder-width : 1px; " . "padding : 5px; border-style : dashed; border-color : #e7d796;" . "margin-bottom : 1em; color : #9a8c59;";
     if (!$limit) {
         $limit = 60;
     }
     $date_sort_field = "date_entered DESC, updated DESC";
     if ($feed == -2) {
         $date_sort_field = "last_published DESC";
     } else {
         if ($feed == -1) {
             $date_sort_field = "last_marked DESC";
         }
     }
     switch ($order) {
         case "title":
             $date_sort_field = "ttrss_entries.title";
             break;
         case "date_reverse":
             $date_sort_field = "date_entered, updated";
             break;
         case "feed_dates":
             $date_sort_field = "updated DESC";
             break;
     }
     $qfh_ret = queryFeedHeadlines($feed, 1, $view_mode, $is_cat, $search, $search_mode, $date_sort_field, $offset, $owner_uid, false, 0, false, true);
     $result = $qfh_ret[0];
     if ($this->dbh->num_rows($result) != 0) {
         $ts = strtotime($this->dbh->fetch_result($result, 0, "date_entered"));
         if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= $ts) {
             header('HTTP/1.0 304 Not Modified');
             return;
         }
         $last_modified = gmdate("D, d M Y H:i:s", $ts) . " GMT";
         header("Last-Modified: {$last_modified}", true);
     }
     $qfh_ret = queryFeedHeadlines($feed, $limit, $view_mode, $is_cat, $search, $search_mode, $date_sort_field, $offset, $owner_uid, false, 0, false, true);
     $result = $qfh_ret[0];
     $feed_title = htmlspecialchars($qfh_ret[1]);
     $feed_site_url = $qfh_ret[2];
     $last_error = $qfh_ret[3];
     $feed_self_url = get_self_url_prefix() . "/public.php?op=rss&id={$feed}&key=" . get_feed_access_key($feed, false, $owner_uid);
     if (!$feed_site_url) {
         $feed_site_url = get_self_url_prefix();
     }
     if ($format == 'atom') {
         $tpl = new MiniTemplator();
         $tpl->readTemplateFromFile("templates/generated_feed.txt");
         $tpl->setVariable('FEED_TITLE', $feed_title, true);
         $tpl->setVariable('VERSION', VERSION, true);
         $tpl->setVariable('FEED_URL', htmlspecialchars($feed_self_url), true);
         if (PUBSUBHUBBUB_HUB && $feed == -2) {
             $tpl->setVariable('HUB_URL', htmlspecialchars(PUBSUBHUBBUB_HUB), true);
             $tpl->addBlock('feed_hub');
         }
         $tpl->setVariable('SELF_URL', htmlspecialchars(get_self_url_prefix()), true);
         $line["content_preview"] = truncate_string(strip_tags($line["content_preview"]), 100, '...');
         while ($line = $this->dbh->fetch_assoc($result)) {
             foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) {
                 $line = $p->hook_query_headlines($line);
             }
             $tpl->setVariable('ARTICLE_ID', htmlspecialchars($orig_guid ? $line['link'] : get_self_url_prefix() . "/public.php?url=" . urlencode($line['link'])), true);
             $tpl->setVariable('ARTICLE_LINK', htmlspecialchars($line['link']), true);
             $tpl->setVariable('ARTICLE_TITLE', htmlspecialchars($line['title']), true);
             $tpl->setVariable('ARTICLE_EXCERPT', $line["content_preview"], true);
             $content = sanitize($line["content"], false, $owner_uid);
             if ($line['note']) {
                 $content = "<div style=\"{$note_style}\">Article note: " . $line['note'] . "</div>" . $content;
                 $tpl->setVariable('ARTICLE_NOTE', htmlspecialchars($line['note']), true);
             }
             $tpl->setVariable('ARTICLE_CONTENT', $content, true);
             $tpl->setVariable('ARTICLE_UPDATED_ATOM', date('c', strtotime($line["updated"])), true);
             $tpl->setVariable('ARTICLE_UPDATED_RFC822', date(DATE_RFC822, strtotime($line["updated"])), true);
             $tpl->setVariable('ARTICLE_AUTHOR', htmlspecialchars($line['author']), true);
             $tpl->setVariable('ARTICLE_SOURCE_LINK', htmlspecialchars($line['site_url']), true);
             $tpl->setVariable('ARTICLE_SOURCE_TITLE', htmlspecialchars($line['feed_title']), true);
             $tags = get_article_tags($line["id"], $owner_uid);
             foreach ($tags as $tag) {
                 $tpl->setVariable('ARTICLE_CATEGORY', htmlspecialchars($tag), true);
                 $tpl->addBlock('category');
             }
             $enclosures = get_article_enclosures($line["id"]);
             foreach ($enclosures as $e) {
                 $type = htmlspecialchars($e['content_type']);
                 $url = htmlspecialchars($e['content_url']);
                 $length = $e['duration'];
                 $tpl->setVariable('ARTICLE_ENCLOSURE_URL', $url, true);
                 $tpl->setVariable('ARTICLE_ENCLOSURE_TYPE', $type, true);
                 $tpl->setVariable('ARTICLE_ENCLOSURE_LENGTH', $length, true);
                 $tpl->addBlock('enclosure');
             }
             $tpl->addBlock('entry');
         }
         $tmp = "";
         $tpl->addBlock('feed');
         $tpl->generateOutputToString($tmp);
         if (@(!$_REQUEST["noxml"])) {
             header("Content-Type: text/xml; charset=utf-8");
         } else {
//.........这里部分代码省略.........
开发者ID:cs-team,项目名称:tiny_tiny_rss-openshift-quickstart,代码行数:101,代码来源:public.php


示例8: generate_syndicated_feed

 private function generate_syndicated_feed($owner_uid, $feed, $is_cat, $limit, $search, $search_mode, $match_on, $view_mode = false)
 {
     require_once "lib/MiniTemplator.class.php";
     $note_style = "background-color : #fff7d5;\n\t\t\tborder-width : 1px; " . "padding : 5px; border-style : dashed; border-color : #e7d796;" . "margin-bottom : 1em; color : #9a8c59;";
     if (!$limit) {
         $limit = 30;
     }
     if (get_pref($this->link, "SORT_HEADLINES_BY_FEED_DATE", $owner_uid)) {
         $date_sort_field = "updated";
     } else {
         $date_sort_field = "date_entered";
     }
     $qfh_ret = queryFeedHeadlines($this->link, $feed, $limit, $view_mode, $is_cat, $search, $search_mode, $match_on, "{$date_sort_field} DESC", 0, $owner_uid);
     $result = $qfh_ret[0];
     $feed_title = htmlspecialchars($qfh_ret[1]);
     $feed_site_url = $qfh_ret[2];
     $last_error = $qfh_ret[3];
     $feed_self_url = get_self_url_prefix() . "/public.php?op=rss&id=-2&key=" . get_feed_access_key($this->link, -2, false, $owner_uid);
     if (!$feed_site_url) {
         $feed_site_url = get_self_url_prefix();
     }
     $tpl = new MiniTemplator();
     $tpl->readTemplateFromFile("templates/generated_feed.txt");
     $tpl->setVariable('FEED_TITLE', $feed_title, true);
     $tpl->setVariable('VERSION', VERSION, true);
     $tpl->setVariable('FEED_URL', htmlspecialchars($feed_self_url), true);
     if (PUBSUBHUBBUB_HUB && $feed == -2) {
         $tpl->setVariable('HUB_URL', htmlspecialchars(PUBSUBHUBBUB_HUB), true);
         $tpl->addBlock('feed_hub');
     }
     $tpl->setVariable('SELF_URL', htmlspecialchars(get_self_url_prefix()), true);
     while ($line = db_fetch_assoc($result)) {
         $tpl->setVariable('ARTICLE_ID', htmlspecialchars($line['link']), true);
         $tpl->setVariable('ARTICLE_LINK', htmlspecialchars($line['link']), true);
         $tpl->setVariable('ARTICLE_TITLE', htmlspecialchars($line['title']), true);
         $tpl->setVariable('ARTICLE_EXCERPT', truncate_string(strip_tags($line["content_preview"]), 100, '...'), true);
         $content = sanitize($this->link, $line["content_preview"], false, $owner_uid);
         if ($line['note']) {
             $content = "<div style=\"{$note_style}\">Article note: " . $line['note'] . "</div>" . $content;
         }
         $tpl->setVariable('ARTICLE_CONTENT', $content, true);
         $tpl->setVariable('ARTICLE_UPDATED_ATOM', date('c', strtotime($line["updated"])), true);
         $tpl->setVariable('ARTICLE_UPDATED_RFC822', date(DATE_RFC822, strtotime($line["updated"])), true);
         $tpl->setVariable('ARTICLE_AUTHOR', htmlspecialchars($line['author']), true);
         $tags = get_article_tags($this->link, $line["id"], $owner_uid);
         foreach ($tags as $tag) {
             $tpl->setVariable('ARTICLE_CATEGORY', htmlspecialchars($tag), true);
             $tpl->addBlock('category');
         }
         $enclosures = get_article_enclosures($this->link, $line["id"]);
         foreach ($enclosures as $e) {
             $type = htmlspecialchars($e['content_type']);
             $url = htmlspecialchars($e['content_url']);
             $length = $e['duration'];
             $tpl->setVariable('ARTICLE_ENCLOSURE_URL', $url, true);
             $tpl->setVariable('ARTICLE_ENCLOSURE_TYPE', $type, true);
             $tpl->setVariable('ARTICLE_ENCLOSURE_LENGTH', $length, true);
             $tpl->addBlock('enclosure');
         }
         $tpl->addBlock('entry');
     }
     $tmp = "";
     $tpl->addBlock('feed');
     $tpl->generateOutputToString($tmp);
     print $tmp;
 }
开发者ID:nvdnkpr,项目名称:Tiny-Tiny-RSS,代码行数:66,代码来源:public.php


示例9: format_article

function format_article($id, $mark_as_read = true, $zoom_mode = false, $owner_uid = false)
{
    if (!$owner_uid) {
        $owner_uid = $_SESSION["uid"];
    }
    $rv = array();
    $rv['id'] = $id;
    /* we can figure out feed_id from article id anyway, why do we
     * pass feed_id here? let's ignore the argument :(*/
    $result = db_query("SELECT feed_id FROM ttrss_user_entries\n\t\t\tWHERE ref_id = '{$id}'");
    $feed_id = (int) db_fetch_result($result, 0, "feed_id");
    $rv['feed_id'] = $feed_id;
    //if (!$zoom_mode) { print "<article id='$id'><![CDATA["; };
    if ($mark_as_read) {
        $result = db_query("UPDATE ttrss_user_entries\n\t\t\t\tSET unread = false,last_read = NOW()\n\t\t\t\tWHERE ref_id = '{$id}' AND owner_uid = {$owner_uid}");
        ccache_update($feed_id, $owner_uid);
    }
    $result = db_query("SELECT id,title,link,content,feed_id,comments,int_id,\n\t\t\t" . SUBSTRING_FOR_DATE . "(updated,1,16) as updated,\n\t\t\t(SELECT site_url FROM ttrss_feeds WHERE id = feed_id) as site_url,\n\t\t\t(SELECT hide_images FROM ttrss_feeds WHERE id = feed_id) as hide_images,\n\t\t\t(SELECT always_display_enclosures FROM ttrss_feeds WHERE id = feed_id) as always_display_enclosures,\n\t\t\tnum_comments,\n\t\t\ttag_cache,\n\t\t\tauthor,\n\t\t\torig_feed_id,\n\t\t\tnote\n\t\t\tFROM ttrss_entries,ttrss_user_entries\n\t\t\tWHERE\tid = '{$id}' AND ref_id = id AND owner_uid = {$owner_uid}");
    if ($result) {
        $line = db_fetch_assoc($result);
        $tag_cache = $line["tag_cache"];
        $line["tags"] = get_article_tags($id, $owner_uid, $line["tag_cache"]);
        unset($line["tag_cache"]);
        $line["content"] = sanitize($line["content"], sql_bool_to_bool($line['hide_images']), $owner_uid, $line["site_url"]);
        foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_RENDER_ARTICLE) as $p) {
            $line = $p->hook_render_article($line);
        }
        $num_comments = $line["num_comments"];
        $entry_comments = "";
        if ($num_comments > 0) {
            if ($line["comments"]) {
                $comments_url = htmlspecialchars($line["comments"]);
            } else {
                $comments_url = htmlspecialchars($line["link"]);
            }
            $entry_comments = "<a target='_blank' href=\"{$comments_url}\">{$num_comments} comments</a>";
        } else {
            if ($line["comments"] && $line["link"] != $line["comments"]) {
                $entry_comments = "<a target='_blank' href=\"" . htmlspecialchars($line["comments"]) . "\">comments</a>";
            }
        }
        if ($zoom_mode) {
            header("Content-Type: text/html");
            $rv['content'] .= "<html><head>\n\t\t\t\t\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\n\t\t\t\t\t\t<title>Tiny Tiny RSS - " . $line["title"] . "</title>\n\t\t\t\t\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"css/tt-rss.css\">\n\t\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\tfunction openSelectedAttachment(elem) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tvar url = elem[elem.selectedIndex].value;\n\n\t\t\t\t\t\t\t\tif (url) {\n\t\t\t\t\t\t\t\t\twindow.open(url);\n\t\t\t\t\t\t\t\t\telem.selectedIndex = 0;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\texception_error(\"openSelectedAttachment\", e);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t</script>\n\t\t\t\t\t</head><body id=\"ttrssZoom\">";
        }
        $rv['content'] .= "<div class=\"postReply\" id=\"POST-{$id}\">";
        $rv['content'] .= "<div class=\"postHeader\" id=\"POSTHDR-{$id}\">";
        $entry_author = $line["author"];
        if ($entry_author) {
            $entry_author = __(" - ") . $entry_author;
        }
        $parsed_updated = make_local_datetime($line["updated"], true, $owner_uid, true);
        $rv['content'] .= "<div class=\"postDate\">{$parsed_updated}</div>";
        if ($line["link"]) {
            $rv['content'] .= "<div class='postTitle'><a target='_blank'\n\t\t\t\t\ttitle=\"" . htmlspecialchars($line['title']) . "\"\n\t\t\t\t\thref=\"" . htmlspecialchars($line["link"]) . "\">" . $line["title"] . "</a>" . "<span class='author'>{$entry_author}</span></div>";
        } else {
            $rv['content'] .= "<div class='postTitle'>" . $line["title"] . "{$entry_author}</div>";
        }
        $tags_str = format_tags_string($line["tags"], $id);
        $tags_str_full = join(", ", $line["tags"]);
        if (!$tags_str_full) {
            $tags_str_full = __("no tags");
        }
        if (!$entry_comments) {
            $entry_comments = "&nbsp;";
        }
        # placeholder
        $rv['content'] .= "<div class='postTags' style='float : right'>\n\t\t\t\t<img src='images/tag.png'\n\t\t\t\tclass='tagsPic' alt='Tags' title='Tags'>&nbsp;";
        if (!$zoom_mode) {
            $rv['content'] .= "<span id=\"ATSTR-{$id}\">{$tags_str}</span>\n\t\t\t\t\t<a title=\"" . __('Edit tags for this article') . "\"\n\t\t\t\t\thref=\"#\" onclick=\"editArticleTags({$id}, {$feed_id})\">(+)</a>";
            $rv['content'] .= "<div dojoType=\"dijit.Tooltip\"\n\t\t\t\t\tid=\"ATSTRTIP-{$id}\" connectId=\"ATSTR-{$id}\"\n\t\t\t\t\tposition=\"below\">{$tags_str_full}</div>";
            foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ARTICLE_BUTTON) as $p) {
                $rv['content'] .= $p->hook_article_button($line);
            }
        } else {
            $tags_str = strip_tags($tags_str);
            $rv['content'] .= "<span id=\"ATSTR-{$id}\">{$tags_str}</span>";
        }
        $rv['content'] .= "</div>";
        $rv['content'] .= "<div clear='both'>";
        foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ARTICLE_LEFT_BUTTON) as $p) {
            $rv['content'] .= $p->hook_article_left_button($line);
        }
        $rv['content'] .= "{$entry_comments}</div>";
        if ($line["orig_feed_id"]) {
            $tmp_result = db_query("SELECT * FROM ttrss_archived_feeds\n\t\t\t\t\tWHERE id = " . $line["orig_feed_id"]);
            if (db_num_rows($tmp_result) != 0) {
                $rv['content'] .= "<div clear='both'>";
                $rv['content'] .= __("Originally from:");
                $rv['content'] .= "&nbsp;";
                $tmp_line = db_fetch_assoc($tmp_result);
                $rv['content'] .= "<a target='_blank'\n\t\t\t\t\t\thref=' " . htmlspecialchars($tmp_line['site_url']) . "'>" . $tmp_line['title'] . "</a>";
                $rv['content'] .= "&nbsp;";
                $rv['content'] .= "<a target='_blank' href='" . htmlspecialchars($tmp_line['feed_url']) . "'>";
                $rv['content'] .= "<img title='" . __('Feed URL') . "'class='tinyFeedIcon' src='images/pub_set.svg'></a>";
                $rv['content'] .= "</div>";
            }
        }
        $rv['content'] .= "</div>";
        $rv['content'] .= "<div id=\"POSTNOTE-{$id}\">";
//.........这里部分代码省略.........
开发者ID:cs-team,项目名称:tiny_tiny_rss-openshift-quickstart,代码行数:101,代码来源:functions.php


示例10: module_popup_dialog


//.........这里部分代码省略.........
        print "<div style=\"line-height : 100%\">";
        print "<input type=\"checkbox\" name=\"enabled\" id=\"enabled\" checked=\"1\">\n\t\t\t\t\t<label for=\"enabled\">" . __('Enabled') . "</label><br/>";
        print "<input type=\"checkbox\" name=\"inverse\" id=\"inverse\">\n\t\t\t\t<label for=\"inverse\">" . __('Inverse match') . "</label>";
        print "</div>";
        print "</div>";
        print "</form>";
        print "<div class=\"dlgButtons\">";
        print "<button onclick=\"return createFilter()\">" . __('Create') . "</button> ";
        print "<button onclick=\"return closeInfoBox()\">" . __('Cancel') . "</button>";
        print "</div>";
        //			print "</td></tr></table>";
        return;
    }
    if ($id == "feedUpdateErrors") {
        print "<div id=\"infoBoxTitle\">" . __('Update Errors') . "</div>";
        print "<div class=\"infoBoxContents\">";
        print __("These feeds have not been updated because of errors:");
        $result = db_query($link, "SELECT id,title,feed_url,last_error\n\t\t\tFROM ttrss_feeds WHERE last_error != '' AND owner_uid = " . $_SESSION["uid"]);
        print "<ul class='feedErrorsList'>";
        while ($line = db_fetch_assoc($result)) {
            print "<li><b>" . $line["title"] . "</b> (" . $line["feed_url"] . "): " . "<em>" . $line["last_error"] . "</em>";
        }
        print "</ul>";
        print "<div align='center'>";
        print "<button onclick=\"return closeInfoBox()\">" . __('Close this window') . "</button>";
        print "</div>";
        return;
    }
    if ($id == "editArticleTags") {
        print "<div id=\"infoBoxTitle\">" . __('Edit Tags') . "</div>";
        print "<div class=\"infoBoxContents\">";
        print "<form id=\"tag_edit_form\" onsubmit='return false'>";
        print __("Tags for this article (separated by commas):") . "<br>";
        $tags = get_article_tags($link, $param);
        $tags_str = join(", ", $tags);
        print "<table width='100%'>";
        print "<tr><td colspan='2'><input type=\"hidden\" name=\"id\" value=\"{$param}\"></td></tr>";
        print "<tr><td colspan='2'><textarea rows='4' class='iedit' id='tags_str' \n\t\t\t\tname='tags_str'>{$tags_str}</textarea>\n\t\t\t<div class=\"autocomplete\" id=\"tags_choices\" \n\t\t\t\t\tstyle=\"display:none\"></div>\t\n\t\t\t</td></tr>";
        print "</table>";
        print "</form>";
        print "<div align='right'>";
        print "<button onclick=\"return editTagsSave()\">" . __('Save') . "</button> ";
        print "<button onclick=\"return closeInfoBox()\">" . __('Cancel') . "</button>";
        print "</div>";
        return;
    }
    if ($id == "printTagCloud") {
        print "<div id=\"infoBoxTitle\">" . __('Tag Cloud') . "</div>";
        print "<div class=\"infoBoxContents\">";
        print __("Showing most popular tags ") . " (<a \n\t\t\thref='javascript:toggleTags(true)'>" . __('more tags') . "</a>):<br/>";
        print "<div class=\"tagCloudContainer\">";
        printTagCloud($link);
        print "</div>";
        print "<div align='center'>";
        print "<button onclick=\"return closeInfoBox()\">" . __('Close this window') . "</button>";
        print "</div>";
        print "</div>";
        return;
    }
    /*		if ($id == "offlineDownload") {
    			print "<div id=\"infoBoxTitle\">".__('Download articles')."</div>";
    			print "<div class=\"infoBoxContents\">";
    
    			print "<form name='download_ops_form' id='download_ops_form'>";
    
    			print "<div class=\"dlgSec\">".__("Download")."</div>";
开发者ID:buggithubs,项目名称:Tiny-Tiny-RSS,代码行数:67,代码来源:popup-dialog.php


示例11: module_popup_dialog

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_artx_drupal_view函数代码示例发布时间:2022-05-15
下一篇:
PHP get_article_parent_cats函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap