Exemplo n.º 1
0
 * @license         http://www.fsf.org/copyleft/gpl.html GNU public license
 * @package         article
 * @since           1.0
 * @author          Taiwen Jiang <*****@*****.**>
 * @version         $Id: index.php 2178 2008-09-26 08:34:09Z phppp $
 */
include "header.php";
/*
 * Set groups for cache purposes
 * Group-based cache is available with XOOPS 2.2*
 * Will be re-implemented in 2.30+
 */
if (!empty($xoopsUser)) {
    $xoopsOption["cache_group"] = implode(",", $xoopsUser->groups());
}
$xoopsOption["template_main"] = art_getTemplate("index", $xoopsModuleConfig["template"]);
$xoops_module_header = art_getModuleHeader($xoopsModuleConfig["template"]) . '
    <link rel="alternate" type="application/rss+xml" title="' . $xoopsModule->getVar('name') . ' rss" href="' . XOOPS_URL . '/modules/' . $GLOBALS["artdirname"] . '/xml.php' . URL_DELIMITER . 'rss" />
    <link rel="alternate" type="application/rss+xml" title="' . $xoopsModule->getVar('name') . ' rdf" href="' . XOOPS_URL . '/modules/' . $GLOBALS["artdirname"] . '/xml.php' . URL_DELIMITER . 'rdf" />
    <link rel="alternate" type="application/atom+xml" title="' . $xoopsModule->getVar('name') . ' atom" href="' . XOOPS_URL . '/modules/' . $GLOBALS["artdirname"] . '/xml.php' . URL_DELIMITER . 'atom" />
    ';
$xoopsOption["xoops_module_header"] = $xoops_module_header;
include_once XOOPS_ROOT_PATH . "/header.php";
include XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->getVar("dirname") . "/include/vars.php";
// Dispatch upon templates
if (!empty($xoopsModuleConfig["template"]) && "default" != $xoopsModuleConfig["template"]) {
    if (@(include XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->getVar("dirname") . "/index." . $xoopsModuleConfig["template"] . ".php")) {
        include "footer.php";
        return;
    }
}
Exemplo n.º 2
0
 * @license         http://www.fsf.org/copyleft/gpl.html GNU public license
 * @package         article
 * @since           1.0
 * @author          Taiwen Jiang <*****@*****.**>
 * @version         $Id: cp.category.php 2178 2008-09-26 08:34:09Z phppp $
 */
include "header.php";
$from = !empty($_GET["from"]) || !empty($_POST["from"]) ? 1 : 0;
$category_handler =& xoops_getmodulehandler("category", $GLOBALS["artdirname"]);
$isadmin = art_isAdministrator();
if (!$isadmin) {
    redirect_header(XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/index.php", 2, art_constant("MD_NOACCESS"));
}
$xoopsOption["xoops_pagetitle"] = $xoopsModule->getVar("name") . " - " . art_constant("MD_CPCATEGORY");
$template = $xoopsModuleConfig["template"];
$xoopsOption["template_main"] = art_getTemplate("cpcategory", $template);
$xoopsOption["xoops_module_header"] = art_getModuleHeader($template);
// Disable cache
$xoopsConfig["module_cache"][$xoopsModule->getVar("mid")] = 0;
include_once XOOPS_ROOT_PATH . "/header.php";
include XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->getVar("dirname") . "/include/vars.php";
// get Category Tree
/*
array(
"prefix" =>
"cat_id" =>
"title" =>
"order" =>
);
*/
$categories =& $category_handler->getTree(0, "all", "&nbsp;&nbsp;&nbsp;&nbsp;");
Exemplo n.º 3
0
 * Global Xoops Entity could be used by blocks or other add-ons
 * Designed by Skalpa for Xoops 2.3+
 */
$xoopsEntity =& $topic_obj;
$category_handler =& xoops_getmodulehandler("category", $GLOBALS["artdirname"]);
$category_obj =& $category_handler->get($topic_obj->getVar("cat_id"));
if (!$category_handler->getPermission($category_obj, "access")) {
    redirect_header(XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/index.php", 2, art_constant("MD_NOACCESS"));
}
// Disable cache for category moderators since we don't have proper cache handling way for them
if (art_isModerator($category_obj)) {
    $xoopsConfig["module_cache"][$xoopsModule->getVar("mid")] = 0;
}
$xoopsOption["xoops_pagetitle"] = $xoopsModule->getVar("name") . " - " . $topic_obj->getVar("top_title");
$template = $topic_obj->getVar("top_template");
$xoopsOption["template_main"] = art_getTemplate("topic", $template);
$xoopsOption["xoops_module_header"] = art_getModuleHeader($template);
include_once XOOPS_ROOT_PATH . "/header.php";
include XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->getVar("dirname") . "/include/vars.php";
$article_handler =& xoops_getmodulehandler("article", $GLOBALS["artdirname"]);
$articles_object = $topic_handler->getArticles($topic_obj, $xoopsModuleConfig["articles_perpage"], $start);
$articles = array();
$uids = array();
foreach (array_keys($articles_object) as $id) {
    $uids[$articles_object[$id]->getVar("uid")] = 1;
}
$author_array = array_keys($uids);
$users = art_getUnameFromId($author_array);
$articles = array();
foreach ($articles_object as $id => $article) {
    $author =& $article->getAuthor();
Exemplo n.º 4
0
    if (!empty($category_id)) {
        $category_obj =& $category_handler->get($category_id);
        $categories_obj = array($category_id => $category_obj);
    } else {
        $categories_obj = $category_handler->getAllByPermission("moderate", array("cat_title", "cat_pid"));
    }
    $categories_id = array_keys($categories_obj);
    $topic_obj = false;
    $allowed_type = array("published", "registered", "featured", "submitted", "all");
}
if (!empty($category_id) && !$category_handler->getPermission($category_obj, "moderate") || empty($category_id) && !$isAdmin) {
    redirect_header(XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/", 2, art_constant("MD_NOACCESS"));
}
$xoopsOption["xoops_pagetitle"] = $xoopsModule->getVar("name") . " - " . art_constant("MD_CPARTICLE");
$template = empty($topic_obj) ? empty($category_obj) ? $xoopsModuleConfig["template"] : $category_obj->getVar("cat_template") : $topic_obj->getVar("top_template");
$xoopsOption["template_main"] = art_getTemplate("cparticle", $template);
$xoopsOption["xoops_module_header"] = art_getModuleHeader($template);
// Disable cache
$xoopsConfig["module_cache"][$xoopsModule->getVar("mid")] = 0;
include_once XOOPS_ROOT_PATH . "/header.php";
include XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->getVar("dirname") . "/include/vars.php";
$type = empty($_GET["type"]) ? "" : (in_array($_GET["type"], $allowed_type) ? $_GET["type"] : "");
$byCategory = true;
switch ($type) {
    case "submitted":
        $type_name = art_constant("MD_SUBMITTED");
        $criteria = new CriteriaCompo(new Criteria("art_time_publish", 0));
        $criteria->add(new Criteria("art_time_submit", 0, ">"));
        $byCategory = false;
        break;
    case "registered":
Exemplo n.º 5
0
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * @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: view.directory.php 2178 2008-09-26 08:34:09Z phppp $
 */
include "header.php";
// Set groups, template, header for cache purposes
if (!empty($xoopsUser)) {
    $xoopsOption["cache_group"] = implode(",", $xoopsUser->groups());
}
$xoopsOption["template_main"] = art_getTemplate("directory", $xoopsModuleConfig["template"]);
$xoops_module_header = art_getModuleHeader($xoopsModuleConfig["template"]) . '
    <link rel="alternate" type="application/rss+xml" title="' . $xoopsModule->getVar('name') . ' rss" href="' . XOOPS_URL . '/modules/' . $GLOBALS["artdirname"] . '/xml.php' . URL_DELIMITER . 'rss" />
    <link rel="alternate" type="application/rss+xml" title="' . $xoopsModule->getVar('name') . ' rdf" href="' . XOOPS_URL . '/modules/' . $GLOBALS["artdirname"] . '/xml.php' . URL_DELIMITER . 'rdf" />
    <link rel="alternate" type="application/atom+xml" title="' . $xoopsModule->getVar('name') . ' atom" href="' . XOOPS_URL . '/modules/' . $GLOBALS["artdirname"] . '/xml.php' . URL_DELIMITER . 'atom" />
    ';
$xoopsOption["xoops_module_header"] = $xoops_module_header;
include_once XOOPS_ROOT_PATH . "/header.php";
include XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->getVar("dirname") . "/include/vars.php";
// Following part will not be executed if cache enabled
if (art_parse_args($args_num, $args, $args_str)) {
    $args["category"] = !empty($args["category"]) ? $args["category"] : @$args_num[0];
}
$category_id = intval(empty($_GET["category"]) ? @$args["category"] : $_GET["category"]);
$category_handler =& xoops_getmodulehandler("category", $GLOBALS["artdirname"]);
$category_obj =& $category_handler->get($category_id);
Exemplo n.º 6
0
    // text of page
    $article_data["text"] = array("title" => $p_subtitile, "body" => $p_text);
    require_once XOOPS_ROOT_PATH . "/class/pagenav.php";
    $count_page = $art_id > 0 ? $article_obj->getPagecount(true) : 1;
    if (!empty($newpage)) {
        $count_page++;
        $curr_page = $newpage - 1;
    } else {
        $curr_page = $page;
    }
    $nav = new XoopsPageNav($count_page, 1, $curr_page, "page", "category=" . $cat_id . "&amp;article=" . $art_id);
    $article_data["pages"] = $nav->renderNav(5);
    // elinks
    $elinks = art_parseLinks($p_elinks);
    $template = $myts->htmlSpecialChars($myts->stripSlashesGPC($_POST["art_template"]));
    $_template = art_getTemplate("article", $template);
    $module_header = art_getModuleHeader($_template);
    $xoopsTpl->assign("xoops_module_header", $module_header);
    require_once XOOPS_ROOT_PATH . "/class/template.php";
    $tpl = new XoopsTpl();
    $tpl->assign("article", $article_data);
    $tpl->assign("dirname", $GLOBALS["artdirname"]);
    $tpl->assign("modulename", $xoopsModule->getVar("name"));
    $tpl->assign("elinks", $elinks);
    $tpl->assign("page", $page);
    $tpl->assign("xoops_url", XOOPS_URL);
    $tpl->display("db:" . $_template);
}
foreach (array("art_title", "uid", "writer_id", "art_source", "art_keywords", "art_elinks", "art_image_caption", "art_template", "art_summary", "trackbacks", "subtitle", "text", "dohtml", "dosmiley", "doxcode", "dobr", "editor") as $tag) {
    ${$tag} = $myts->htmlSpecialChars($myts->stripSlashesGPC(trim(@$_POST[$tag])));
}
Exemplo n.º 7
0
}
if (!empty($category_id)) {
    if (!in_array($category_id, $categories_id)) {
        redirect_header(XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/index.php", 2, art_constant("MD_NOACCESS"));
    }
    $category_obj =& $category_handler->get($category_id);
    $page["category"] = $category_obj->getVar("cat_title");
    $categories = array($category_id);
} else {
    $categories = $categories_id;
}
if (!empty($xoopsUser)) {
    $xoopsOption["cache_group"] = implode(",", $xoopsUser->groups());
}
$xoopsOption["xoops_pagetitle"] = $xoopsModule->getVar("name") . " - " . art_constant("MD_ACHIVE");
$xoopsOption["template_main"] = art_getTemplate("archive", $xoopsModuleConfig["template"]);
$xoopsOption["xoops_module_header"] = art_getModuleHeader($xoopsModuleConfig["template"]);
include_once XOOPS_ROOT_PATH . "/header.php";
include XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->getVar("dirname") . "/include/vars.php";
$year = empty($year) ? date("Y") : $year;
if ($month < 1) {
    $month = $day = 0;
    $page["time"] = sprintf(art_constant("MD_TIME_Y"), $year);
} elseif ($day < 1) {
    $day = 0;
    $page["time"] = sprintf(art_constant("MD_TIME_YM"), $year, $month);
} else {
    $page["time"] = sprintf(art_constant("MD_TIME_YMD"), $year, $month, $day);
}
$time = array("year" => $year, "month" => $month, "day" => $day);
if ($xoopsUser) {