Esempio n. 1
0
/**
* This function generates the list with the five latest published records
*
* @param    string
* @return   string
* @access   public
* @author   Thorsten Rinne <*****@*****.**>
* @since    2002-05-07
*/
function generateFiveNewest($language = '')
{
    global $PMF_LANG;
    $result = generateNewestData($language, PMF_NUMBER_RECORDS_LATEST);
    if (count($result) > 0) {
        $output = '<ol>';
        foreach ($result as $row) {
            $output .= '<li><a href="' . $row['url'] . '">' . makeShorterText(PMF_htmlentities($row['thema'], ENT_NOQUOTES, $PMF_LANG['metaCharset']), 8) . '</a> (' . makeDate($row['datum']) . ')</li>';
        }
        $output .= '</ol>';
    } else {
        $output = $PMF_LANG["err_noArticles"];
    }
    return $output;
}
Esempio n. 2
0
require_once PMF_ROOT_DIR . "/lang/" . $PMF_CONF["language"];
$query = 'SELECT ' . SQLPREFIX . 'faqdata.id AS id, ' . SQLPREFIX . 'faqdata.lang AS lang, ' . SQLPREFIX . 'faqdata.thema AS thema, ' . SQLPREFIX . 'faqcategoryrelations.category_id AS category_id, ' . SQLPREFIX . 'faqvisits.visits AS visits, ' . SQLPREFIX . 'faqdata.datum AS datum, ' . SQLPREFIX . 'faqvisits.last_visit AS last_visit FROM ' . SQLPREFIX . 'faqvisits, ' . SQLPREFIX . 'faqdata LEFT JOIN ' . SQLPREFIX . 'faqcategoryrelations ON ' . SQLPREFIX . 'faqdata.id = ' . SQLPREFIX . 'faqcategoryrelations.record_id AND ' . SQLPREFIX . 'faqdata.lang = ' . SQLPREFIX . 'faqcategoryrelations.record_lang WHERE ' . SQLPREFIX . 'faqdata.id = ' . SQLPREFIX . 'faqvisits.id AND ' . SQLPREFIX . 'faqdata.lang = ' . SQLPREFIX . 'faqvisits.lang AND ' . SQLPREFIX . 'faqdata.active = \'yes\' ORDER BY ' . SQLPREFIX . 'faqvisits.visits 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["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");
Esempio n. 3
0
function arrayToFacic($dataCollection)
{
    if (is_array($dataCollection)) {
        reset($dataCollection);
        $data = array();
        if ($_GET['debug'] == 'yes') {
            var_dump($dataCollection);
        }
        while (list($key, $val) = each($dataCollection)) {
            $INV = implode('; ', $dataCollection[$key]["917"]);
            $data[] = array("MFN" => $dataCollection[$key]["mfn"], "SEQN" => $dataCollection[$key]["920"], "teste" => $dataCollection[$key]["920"], "previous" => $dataCollection[$key - 1]["920"], "YEAR" => $dataCollection[$key]["911"], "VOLU" => $dataCollection[$key]["912"], "FASC" => $dataCollection[$key]["913"], "TYPE" => $dataCollection[$key]["916"] == NULL || $dataCollection[$key]["916"] == 'null' ? '' : $dataCollection[$key]["916"], "INVENTORY" => $INV ? $INV : '', "STAT" => $dataCollection[$key]["914"], "QTD" => $dataCollection[$key]["915"], "FORMERSTAT" => $dataCollection[$key]["914"], "FORMERQTD" => $dataCollection[$key]["915"], "MASK" => $dataCollection[$key]["910"], "NOTE" => makeShorterText($dataCollection[$key]["900"], 30));
        }
    }
    return $data;
}
Esempio n. 4
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();
Esempio n. 5
0
 /**
  * The header of the PDF file
  *
  * @return   void
  * @access   private
  */
 function Header()
 {
     $title = $this->categories[$this->category]["name"] . ": " . $this->thema;
     $currentTextColor = $this->TextColor;
     $this->SetTextColor(0, 0, 0);
     $this->SetFont("Arial", "I", 18);
     $this->MultiCell(0, 9, $title, 1, 1, "C", 1);
     $this->Ln(8);
     if ($this->enableBookmarks == true) {
         $this->Bookmark(makeShorterText($this->thema, 5));
     }
     $this->TextColor = $currentTextColor;
 }
Esempio n. 6
0
 function getIssues($titleId, $sort)
 {
     $dataCollection = $this->setRecodsByTitle($titleId, 'all');
     if (is_array($dataCollection)) {
         reset($dataCollection);
         $data = array();
         while (list($key, $val) = each($dataCollection)) {
             $issue = new facicData();
             $issue->set_mfn($dataCollection[$key]["mfn"]);
             $issue->set_year($dataCollection[$key]["911"]);
             $issue->set_vol($dataCollection[$key]["912"]);
             $issue->set_num($dataCollection[$key]["913"]);
             $issue->set_type($dataCollection[$key]["916"]);
             $issue->set_status($dataCollection[$key]["914"]);
             $issue->setData('sequentialNumber', $dataCollection[$key]["920"]);
             $issue->set_qtd($dataCollection[$key]["915"]);
             $issue->set_mask($dataCollection[$key]["910"]);
             $issue->set_note(makeShorterText($dataCollection[$key]["900"], 30));
             $issue->set_idmfn($dataCollection[$key]["mfn"]);
             $data[] = $issue;
         }
     }
     return $data;
 }
Esempio n. 7
0
</script>
<script type="text/javascript" src="editor/htmlarea.js"></script>
<script type="text/javascript" src="editor/plugins/ImageManager/image-manager.js"></script>
<script type="text/javascript">
//<![CDATA[
    HTMLArea.init();
    HTMLArea.loadPlugin('ImageManager');
    HTMLArea.onload = function() {
    var editor = new HTMLArea('content');
    var config = new HTMLArea.Config();
    var phpMyFAQLinks   = {
<?php 
    $output = "'Include internal links' : '',\n";
    $result = $db->query('SELECT ' . SQLPREFIX . 'faqdata.id AS id, ' . SQLPREFIX . 'faqdata.lang AS lang, ' . SQLPREFIX . 'faqcategoryrelations.category_id AS category_id, ' . SQLPREFIX . 'faqdata.thema AS thema FROM ' . SQLPREFIX . 'faqdata LEFT JOIN ' . SQLPREFIX . 'faqcategoryrelations ON ' . SQLPREFIX . 'faqdata.id = ' . SQLPREFIX . 'faqcategoryrelations.record_id AND ' . SQLPREFIX . 'faqdata.lang = ' . SQLPREFIX . 'faqcategoryrelations.record_lang ORDER BY ' . SQLPREFIX . 'faqcategoryrelations.category_id, ' . SQLPREFIX . 'faqdata.id');
    while ($row = $db->fetch_object($result)) {
        $_title = makeShorterText(addslashes(PMF_htmlentities(str_replace(array("\n", "\r", "\r\n"), "", $row->thema), ENT_NOQUOTES, $PMF_LANG['metaCharset'])), 8);
        $output .= sprintf("'%s' : '<a href=\"index.php?action=artikel&amp;cat=%d&amp;id=%d&amp;artlang=%s\">%s<\\/a>',\n", $_title, $row->category_id, $row->id, $row->lang, $_title);
    }
    $output = substr($output, 0, -2);
    print $output;
    ?>
        };

    var internalLinks = {
        id      :   'internalLinks',
        tooltip :   'internal Link',
        options :   phpMyFAQLinks,
        action  :   function(editor)
        {
            var elem = editor._toolbarObjects[this.id].element;
            editor.insertHTML(elem.value);
Esempio n. 8
0
require_once PMF_ROOT_DIR . "/inc/category.php";
require_once PMF_ROOT_DIR . "/lang/" . $PMF_CONF["language"];
$query = 'SELECT ' . SQLPREFIX . 'faqdata.id AS id, ' . SQLPREFIX . 'faqdata.lang AS lang, ' . SQLPREFIX . 'faqcategoryrelations.category_id AS category_id, ' . SQLPREFIX . 'faqdata.thema AS thema, ' . SQLPREFIX . 'faqdata.content AS content, ' . SQLPREFIX . 'faqdata.datum AS datum, ' . SQLPREFIX . 'faqvisits.visits AS visits FROM ' . SQLPREFIX . 'faqvisits, ' . SQLPREFIX . 'faqdata LEFT JOIN ' . SQLPREFIX . 'faqcategoryrelations ON ' . SQLPREFIX . 'faqdata.id = ' . SQLPREFIX . 'faqcategoryrelations.record_id AND ' . SQLPREFIX . 'faqdata.lang = ' . SQLPREFIX . 'faqcategoryrelations.record_lang WHERE ' . SQLPREFIX . 'faqdata.id = ' . SQLPREFIX . 'faqvisits.id AND ' . SQLPREFIX . 'faqdata.lang = ' . SQLPREFIX . 'faqvisits.lang AND ' . SQLPREFIX . 'faqdata.active = \'yes\' ORDER BY ' . SQLPREFIX . 'faqdata.datum 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['msgLatestArticles']) . "</title>\n";
$rss .= "<description>" . htmlspecialchars($PMF_CONF["metaDescription"]) . "</description>\n";
$rss .= "<link>http" . (isset($_SERVER['HTTPS']) ? 's' : '') . "://" . $_SERVER["HTTP_HOST"] . str_replace("/feed/latest/rss.php", "", $_SERVER["PHP_SELF"]) . "</link>";
if ($num = $db->num_rows($result) > 0) {
    $counter = 0;
    $oldId = 0;
    while (($row = $db->fetch_object($result)) && $counter < 5) {
        $counter++;
        if ($oldId != $row->id) {
            $rss .= "\t<item>\n";
            $rss .= "\t\t<title><![CDATA[" . makeShorterText($row->thema, 8) . "]]></title>\n";
            // Get the content
            $content = $row->content;
            // Fix the content internal image references
            $content = str_replace("<img src=\"/", "<img src=\"http" . (isset($_SERVER["HTTPS"]) ? "s" : "") . "://" . $_SERVER["HTTP_HOST"] . "/", $content);
            $rss .= "\t\t<description><![CDATA[<p><b>" . $row->thema . "</b> <em>(" . $row->visits . " " . $PMF_LANG["msgViews"] . ")</em></p>" . $content . "]]></description>\n";
            $rss .= "\t\t<link>http" . (isset($_SERVER['HTTPS']) ? 's' : '') . "://" . $_SERVER["HTTP_HOST"] . str_replace("feed/latest/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<pubDate>" . makeRFC822Date($row->datum) . "</pubDate>\n";
            $rss .= "\t</item>\n";
        }
        $oldId = $row->id;
    }
}
$rss .= "</channel>\n</rss>";
header("Content-Type: text/xml");
header("Content-Length: " . strlen($rss));
Esempio n. 9
0
/**
 * Funcao que busca os dados na base de dados MASK
 * e ordena os dados para enviar ao YUI exibir uma lista
 *  com os dados da base MASK
 * @param array dataCollection
 * @return array with DB data
 */
function arrayToMask($dataCollection)
{
    if (is_array($dataCollection)) {
        reset($dataCollection);
        $data = array();
        while (list($key, $val) = each($dataCollection)) {
            switch ($_SESSION["lang"]) {
                case 'pt':
                    $noteMask = makeShorterText($dataCollection[$key]["900"][2], 30);
                    break;
                case 'es':
                    $noteMask = makeShorterText($dataCollection[$key]["900"][3], 30);
                    break;
                case 'en':
                    $noteMask = makeShorterText($dataCollection[$key]["900"][0], 30);
                    break;
                case 'fr':
                    $noteMask = makeShorterText($dataCollection[$key]["900"][1], 30);
                    break;
            }
            $data[] = array("MFN" => $dataCollection[$key]["mfn"], "MASK" => $dataCollection[$key]["801"], "NOTE" => $noteMask, "usedMask" => $dataCollection[$key]["113"]);
        }
    }
    return $data;
}