Example #1
0
 *
 * @copyright       The XOOPS Project http://sourceforge.net/projects/xoops/
 * @license         http://www.fsf.org/copyleft/gpl.html GNU public license
 * @package         article
 * @since           1.0
 * @author          Taiwen Jiang <*****@*****.**>
 * @version         $Id: print.php 2178 2008-09-26 08:34:09Z phppp $
 */
error_reporting(0);
include 'header.php';
error_reporting(0);
if (!empty($_POST["print_data"])) {
    $print_data = unserialize(base64_decode($_POST["print_data"]));
} elseif (!empty($print_data)) {
} else {
    if (art_parse_args($args_num, $args, $args_str)) {
        $args["article"] = @$args_num[0];
    }
    $article_id = intval(empty($_GET["article"]) ? @$args["article"] : $_GET["article"]);
    $category_id = intval(empty($_GET["category"]) ? @$args["category"] : $_GET["category"]);
    $page = intval(empty($_GET["page"]) ? @$args["page"] : $_GET["page"]);
    $article_handler =& xoops_getmodulehandler("article", $GLOBALS["artdirname"]);
    $article_obj =& $article_handler->get($article_id);
    $category_id = empty($category_id) ? $article_obj->getVar("cat_id") : intval($category_id);
    $category_handler =& xoops_getmodulehandler("category", $GLOBALS["artdirname"]);
    $category_obj =& $category_handler->get($category_id);
    if (empty($category_obj) || !$category_handler->getPermission($category_obj, "view")) {
        die(art_constant("MD_NOACCESS"));
    }
    $article_data = array();
    // title
Example #2
0
 * @package         article
 * @since           1.0
 * @author          Taiwen Jiang <*****@*****.**>
 * @version         $Id: view.list.php 2178 2008-09-26 08:34:09Z phppp $
 */
include "header.php";
// Valid types of articles for regular applications, except author view
$valid_types = array("p" => art_constant("MD_REGULAR"), "f" => art_constant("MD_FEATURED"), "s" => art_constant("MD_SPOTLIGHT"), "a" => _ALL);
// Valid sort criteria for articles for regular applications, except spotlight
$valid_sorts = array("id" => array("key" => "art_id", "title" => art_constant("MD_DEFAULT")), "time_publish" => array("key" => "art_time_publish", "title" => art_constant("MD_TIME")), "title" => array("key" => "art_title", "title" => art_constant("MD_TITLE")), "rating" => array("key" => "art_rating/art_rates", "tag" => "art_rating, art_rates", "title" => art_constant("MD_RATE")), "counter" => array("key" => "art_counter", "title" => art_constant("MD_VIEWS")), "comments" => array("key" => "art_comments", "title" => art_constant("MD_COMMENTS")), "trackbacks" => array("key" => "art_trackbacks", "title" => art_constant("MD_TRACKBACKS")));
// Sort order
$valid_orders = array("DESC" => art_constant("MD_DESC"), "ASC" => art_constant("MD_ASC"));
/*
 * Parse the variables
 */
if ($REQUEST_URI_parsed = art_parse_args($args_num, $args, $args_str)) {
    $args["start"] = !empty($args["start"]) ? $args["start"] : @$args_num[0];
    $args["type"] = @$args_str[0];
    $args["sort"] = @$args_str[1];
    $args["order"] = @$args_str[2];
}
$category_id = intval(empty($_GET["category"]) ? @$args["category"] : $_GET["category"]);
$topic_id = intval(empty($_GET["topic"]) ? @$args["topic"] : $_GET["topic"]);
$uid = intval(empty($_GET["uid"]) ? @$args["uid"] : $_GET["uid"]);
$start = intval(empty($_GET["start"]) ? @$args["start"] : $_GET["start"]);
$type = empty($_GET["type"]) ? @$args["type"] : $_GET["type"];
$sort = empty($_GET["sort"]) ? @$args["sort"] : $_GET["sort"];
$order = in_array($order = strtoupper(empty($_GET["order"]) ? @$args["order"] : $_GET["order"]), array_keys($valid_orders)) ? $order : "DESC";
/*
 * Instantiate category object and check access permissions
 */