Esempio n. 1
0
$rss = "<?xml version=\"1.0\" encoding=\"" . $PMF_LANG["metaCharset"] . "\" standalone=\"yes\" ?>\n<rss version=\"2.0\">\n<channel>\n";
$rss .= "<title>" . htmlspecialchars($PMF_CONF["title"]) . " - " . htmlspecialchars($PMF_LANG["msgTopTen"]) . "</title>\n";
$rss .= "<description>" . htmlspecialchars($PMF_CONF["metaDescription"]) . "</description>\n";
$rss .= "<link>http" . (isset($_SERVER['HTTPS']) ? 's' : '') . "://" . $_SERVER["HTTP_HOST"] . str_replace("/feed/topten/rss.php", "", $_SERVER["PHP_SELF"]) . "</link>";
if ($db->num_rows($result) > 0) {
    $i = 1;
    $counter = 0;
    $oldId = 0;
    while (($row = $db->fetch_object($result)) && $counter < 10) {
        $counter++;
        if ($oldId != $row->id) {
            $rss .= "\t<item>\n";
            $rss .= "\t\t<title><![CDATA[" . makeShorterText($row->thema, 8) . " (" . $row->visits . " " . $PMF_LANG["msgViews"] . ")]]></title>\n";
            $rss .= "\t\t<description><![CDATA[[" . $i . ".] " . $row->thema . " (" . $row->visits . " " . $PMF_LANG["msgViews"] . ")]]></description>\n";
            $rss .= "\t\t<link>http" . (isset($_SERVER['HTTPS']) ? 's' : '') . "://" . $_SERVER["HTTP_HOST"] . str_replace("feed/topten/rss.php", "index.php", $_SERVER["PHP_SELF"]) . "?action=artikel&amp;cat=" . $row->category_id . "&amp;id=" . $row->id . "&amp;artlang=" . $row->lang . "</link>\n";
            $rss .= "\t\t<!-- The real FAQ publication date -->\n";
            // $$row->datum is a phpMyFAQ date
            $rss .= "\t\t<!-- " . makeRFC822Date($row->datum) . " -->\n";
            // $row->last_visit is a mktime timpestamp date
            $rss .= "\t\t<pubDate>" . makeRFC822Date($row->last_visit, false) . "</pubDate>\n";
            $rss .= "\t</item>\n";
            $i++;
        }
        $oldId = $row->id;
    }
}
$rss .= "</channel>\n</rss>";
header("Content-Type: text/xml");
header("Content-Length: " . strlen($rss));
print $rss;
$db->dbclose();
Esempio n. 2
0
PMF_Init::cleanRequest();
/* read configuration, include classes and functions */
require_once PMF_ROOT_DIR . "/inc/data.php";
require_once PMF_ROOT_DIR . "/inc/db.php";
define("SQLPREFIX", $DB["prefix"]);
$db = db::db_select($DB["type"]);
$db->connect($DB["server"], $DB["user"], $DB["password"], $DB["db"]);
require_once PMF_ROOT_DIR . "/inc/config.php";
require_once PMF_ROOT_DIR . "/inc/constants.php";
require_once PMF_ROOT_DIR . "/inc/category.php";
require_once PMF_ROOT_DIR . "/lang/" . $PMF_CONF["language"];
$result = $db->query("SELECT id, datum, header, artikel, link, linktitel, target FROM " . SQLPREFIX . "faqnews ORDER BY datum desc");
$rss = "<?xml version=\"1.0\" encoding=\"" . $PMF_LANG["metaCharset"] . "\" standalone=\"yes\" ?>\n<rss version=\"2.0\">\n<channel>\n";
$rss .= "<title>" . htmlspecialchars($PMF_CONF["title"]) . " - " . htmlspecialchars($PMF_LANG['msgNews']) . "</title>\n";
$rss .= "<description>" . htmlspecialchars($PMF_CONF["metaDescription"]) . "</description>\n";
$rss .= "<link>http" . (isset($_SERVER['HTTPS']) ? 's' : '') . "://" . $_SERVER["HTTP_HOST"] . str_replace("/feed/news/rss.php", "", $_SERVER["PHP_SELF"]) . "</link>";
if ($db->num_rows($result) > 0) {
    while ($row = $db->fetch_object($result)) {
        $rss .= "\t<item>\n";
        $rss .= "\t\t<title><![CDATA[" . $row->header . "]]></title>\n";
        $rss .= "\t\t<description><![CDATA[" . $row->artikel . "]]></description>\n";
        $rss .= "\t\t<link>http" . (isset($_SERVER['HTTPS']) ? 's' : '') . "://" . $_SERVER["HTTP_HOST"] . str_replace("/feed/news/rss.php", "", $_SERVER["PHP_SELF"]) . "#news_" . $row->id . "</link>\n";
        $rss .= "\t\t<pubDate>" . makeRFC822Date($row->datum) . "</pubDate>\n";
        $rss .= "\t</item>\n";
    }
}
$rss .= "</channel>\n</rss>";
header("Content-Type: text/xml");
header("Content-Length: " . strlen($rss));
print $rss;
$db->dbclose();
Esempio n. 3
0
require_once PMF_ROOT_DIR . "/lang/" . $PMF_CONF["language"];
// Get the open questions result set with a time descedant order (the first is the last entered)
$query = "SELECT id, ask_username, ask_usermail, ask_rubrik, ask_content, ask_date FROM " . SQLPREFIX . "faqfragen ORDER BY ask_date DESC";
$result = $db->query($query);
$rss = "<?xml version=\"1.0\" encoding=\"" . $PMF_LANG["metaCharset"] . "\" standalone=\"yes\" ?>\n<rss version=\"2.0\">\n<channel>\n";
$rss .= "<title>" . htmlspecialchars($PMF_CONF["title"]) . " - " . htmlspecialchars($PMF_LANG['msgOpenQuestions']) . "</title>\n";
$rss .= "<description>" . htmlspecialchars($PMF_CONF["metaDescription"]) . "</description>\n";
$rss .= "<link>http" . (isset($_SERVER['HTTPS']) ? 's' : '') . "://" . $_SERVER["HTTP_HOST"] . str_replace("/feed/openquestions/rss.php", "", $_SERVER["PHP_SELF"]) . "</link>";
if ($num = $db->num_rows($result) > 0) {
    $counter = 0;
    while (($row = $db->fetch_object($result)) && $counter < PMF_RSS_OPENQUESTIONS_MAX) {
        $counter++;
        $rss .= "\t<item>\n";
        // Get the content
        $content = $row->ask_content;
        $rss .= "\t\t<title><![CDATA[" . makeShorterText($row->ask_content, 8) . " (" . $row->ask_username . ")]]></title>\n";
        $rss .= "\t\t<description><![CDATA[" . $content . "]]></description>\n";
        // Let the PMF administrator manually choose between (1) (default) and (2)
        // 1. This link below goes to the "Open questions page"
        $rss .= "\t\t<link>http" . (isset($_SERVER['HTTPS']) ? 's' : '') . "://" . $_SERVER["HTTP_HOST"] . str_replace("feed/openquestions/rss.php", "index.php", $_SERVER["PHP_SELF"]) . "?action=open#openq_" . $row->id . "</link>\n";
        // 2. This link below is a shortcut for a fast reply ("Add content" page within the context of the current question)
        //$rss .= "\t\t<link><![CDATA[http".(isset($_SERVER['HTTPS']) ? 's' : '')."://".$_SERVER["HTTP_HOST"].str_replace("feed/openquestions/rss.php", "index.php", $_SERVER["PHP_SELF"])."?action=add&amp;question=".rawurlencode($content)."&amp;cat=".$row->ask_rubrik."]]></link>\n";
        $rss .= "\t\t<pubDate>" . makeRFC822Date($row->ask_date) . "</pubDate>\n";
        $rss .= "\t</item>\n";
    }
}
$rss .= "</channel>\n</rss>";
header("Content-Type: text/xml");
header("Content-Length: " . strlen($rss));
print $rss;
$db->dbclose();