Esempio n. 1
0
 * You may not change or alter any portion of this comment or credits
 * of supporting developers from this source code or any supporting source code
 * which is considered copyrighted (c) material of the original comment or credit authors.
 * This program is distributed in the hope that it will be useful,
 * 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: counter.php 2178 2008-09-26 08:34:09Z phppp $
 */
include "header.php";
if (empty($xoopsModuleConfig['do_counter'])) {
    return;
}
$article_id = empty($_GET['article']) ? 0 : intval($_GET['article']);
if (empty($article_id)) {
    return;
}
if (art_getcookie("art_" . $article_id) > 0) {
    return;
}
$article_handler =& xoops_getmodulehandler('article', $xoopsModule->getVar("dirname"));
$article_obj =& $article_handler->get($article_id);
$article_obj->setVar("art_counter", $article_obj->getVar("art_counter") + 1, true);
$article_handler->insert($article_obj, true);
art_setcookie("art_" . $article_id, time());
return;
Esempio n. 2
0
/**
 * Article module for XOOPS
 *
 * You may not change or alter any portion of this comment or credits
 * of supporting developers from this source code or any supporting source code 
 * which is considered copyrighted (c) material of the original comment or credit authors.
 * This program is distributed in the hope that it will be useful,
 * 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: counter.php 2178 2008-09-26 08:34:09Z phppp $
 */
include "header.php";
$article_id = empty($_GET['id']) ? 0 : intval($_GET['id']);
if (empty($article_id)) {
    return;
}
if (art_getcookie("ilog_" . $article_id) > 0) {
    return;
}
$article_handler =& xoops_getmodulehandler('article', $xoopsModule->getVar("dirname"));
$article_obj =& $article_handler->get($article_id);
$article_obj->setVar("counter", $article_obj->getVar("counter") + 1, true);
$article_handler->insert($article_obj, true);
art_setcookie("ilog_" . $article_id, time());
return;
Esempio n. 3
0
$isModerator = $category_handler->getPermission($category_obj, "moderate");
if (!$isModerator && (!$isAuthor || !$category_handler->getPermission($category_obj, "submit"))) {
    redirect_header("index.php", 2, art_constant("MD_NOACCESS"));
    exit;
}
$canPublish = $category_handler->getPermission($category_obj, "publish");
$permission_handler =& xoops_getmodulehandler("permission", $xoopsModule->getVar("dirname"));
$canhtml = $permission_handler->getPermission("html");
$canupload = $permission_handler->getPermission("upload");
if (!$canhtml) {
    $_POST["dohtml"] = 0;
}
// Set cookies
foreach (array("editor", "form_mode") as $var) {
    if (!empty($_POST[$var])) {
        art_setcookie($var, $_POST[$var]);
    }
}
include XOOPS_ROOT_PATH . "/header.php";
include XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->getVar("dirname") . "/include/vars.php";
// Article actions
// "delete": delete one page
// "edit": edit
// "save": save
// "save_edit": submit and continue to edit
// "publish": regular submission
// "preview": preview and continue to edit
$art_image_file_upload = "";
if ($canupload && empty($_POST["del"]) && empty($_POST["delete"]) && !empty($_FILES["userfile"]["name"])) {
    $uploader = new art_uploader(XOOPS_ROOT_PATH . "/" . $xoopsModuleConfig["path_image"], array("jpg", "png", "gif", "jpeg"));
    if ($uploader->fetchMedia($_POST["xoops_upload_file"][0])) {