示例#1
0
    $topic_obj =& $topic_handler->getByPost($post_id);
    $topic_id = $topic_obj->getVar('topic_id');
    if (!($approved = $topic_obj->getVar('approved'))) {
        die(_MD_NORIGHTTOVIEW);
    }
    $forum_handler =& xoops_getmodulehandler('forum', 'newbb');
    $forum = $forum ? $forum : $topic_obj->getVar('forum_id');
    $forum_obj =& $forum_handler->get($forum);
    if (!$forum_handler->getPermission($forum_obj)) {
        die(_MD_NORIGHTTOACCESS);
    }
    if (!$topic_handler->getPermission($forum_obj, $topic_obj->getVar('topic_status'), "view")) {
        die(_MD_NORIGHTTOVIEW);
    }
    $pdf_data['title'] = $forum_obj->getVar("forum_name");
    $pdf_data['subtitle'] = $topic_obj->getVar('topic_title');
    $pdf_data['subsubtitle'] = $post_data['subject'];
    $pdf_data['date'] = $post_data['date'];
    $pdf_data['content'] = $post_data['text'];
    $pdf_data['author'] = $post_data['author'];
} else {
    $pdf_data = unserialize(base64_decode($_POST["pdf_data"]));
}
$pdf_data['filename'] = preg_replace("/[^0-9a-z\\-_\\.]/i", '', $pdf_data["title"]);
include XOOPS_ROOT_PATH . "/Frameworks/fpdf/init.php";
error_reporting(0);
ob_end_clean();
$pdf = new xoopsPDF($xoopsConfig["language"]);
$pdf->initialize();
$pdf->output($pdf_data, _CHARSET);
示例#2
0
    }
    $pdf_data["author"] = $article_data["author"]["name"];
    $tmp = array();
    if ($article_data["source"]) {
        $tmp[] = $article_data["source"];
    }
    if ($article_data["author"]["author"]) {
        $tmp[] = $article_data["author"]["author"];
    }
    if (count($tmp)) {
        $pdf_data["author"] .= " (" . implode(" ", $tmp) . ")";
    }
    $pdf_data["date"] = $article_data["time"];
    $pdf_data["content"] = "";
    if ($article_data["keywords"]) {
        $pdf_data["content"] .= art_constant("MD_KEYWORDS") . ": " . $article_data["keywords"] . "<br /><br />";
    }
    if ($article_data["summary"]) {
        $pdf_data["content"] .= art_constant("MD_SUMMARY") . ": " . $article_data["summary"] . "<br /><br />";
    }
    $pdf_data["content"] .= $article_data["text"]["body"] . "<br />";
    $pdf_data["url"] = XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/view.article.php" . URL_DELIMITER . "c" . $category_id . "/" . $article_obj->getVar("art_id");
}
$pdf_data['filename'] = preg_replace("/[^0-9a-z\\-_\\.]/i", '', $pdf_data["title"]);
include XOOPS_ROOT_PATH . "/Frameworks/fpdf/init.php";
error_reporting(0);
ob_end_clean();
$pdf = new xoopsPDF($xoopsConfig["language"], _CHARSET);
$pdf->initialize();
$pdf->output($pdf_data);