示例#1
0
function display_action_form($action = "")
{
    $action_options = array("no" => _SELECT, "template" => art_constant("AM_PERMISSION_TEMPLATE"), "apply" => art_constant("AM_PERMISSION_TEMPLATE_APPLY"), "default" => art_constant("AM_PERMISSION_SETBYGROUP"));
    $actionform = new XoopsSimpleForm(art_constant("AM_PERMISSION_ACTION"), 'actionform', 'admin.permission.php', "GET");
    $action_select = new XoopsFormSelect("", 'action', $action);
    $action_select->setExtra('onchange="document.forms.actionform.submit()"');
    $action_select->addOptionArray($action_options);
    $actionform->addElement($action_select);
    $actionform->display();
}
示例#2
0
/**
 * Function to check status of a folder
 *
 * @return bool
 */
function art_admin_getPathStatus($path)
{
    if (empty($path)) {
        return false;
    }
    if (@is_writable($path)) {
        $path_status = art_constant("AM_AVAILABLE");
    } elseif (!@is_dir($path)) {
        $path_status = "<font color=\"red\">" . art_constant("AM_NOTAVAILABLE") . "</font> <a href=" . XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/admin/index.php?op=createdir&amp;path={$path}>" . art_constant("AM_CREATETHEDIR") . "</a>";
    } else {
        $path_status = "<font color=\"red\">" . art_constant("AM_NOTWRITABLE") . "</font> <a href=" . XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/admin/index.php?op=setperm&amp;path={$path}>" . art_constant("AM_SETMPERM") . "</a>";
    }
    return $path_status;
}
示例#3
0
 /**
  * Constructor
  *
  * @param    string    $caption
  * @param    string    $name
  * @param    mixed    $value            Pre-selected value
  */
 function XoopsFormSelectWriter($caption, $name, $value = array())
 {
     $this->XoopsFormElementTray($caption, " | ", $name);
     $select_form = new XoopsFormSelect("", $name, $value, $size = 1, $multiple = false);
     if (!empty($value)) {
         if (!is_array($value)) {
             $value = array($value);
         }
         $criteria = new CriteriaCompo(new Criteria("writer_id", "(" . implode(", ", $value) . ")", "IN"));
         $criteria->setSort('writer_name');
         $criteria->setOrder('ASC');
         $writer_handler =& xoops_getmodulehandler("writer", $GLOBALS["artdirname"]);
         $select_form->addOptionArray($writer_handler->getList($criteria));
     }
     $action_tray = new XoopsFormElementTray("", " | ");
     //$action_tray->addElement(new XoopsFormLabel('', "<a href='".XOOPS_URL."/modules/".$GLOBALS["artdirname"]."/edit.writer.php?search=1&amp;target=".$name."' target='writereditor'>"._SEARCH."</a>"));
     $action_tray->addElement(new XoopsFormLabel('', "<a href='###' onclick='return openWithSelfMain(\"" . XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/edit.writer.php?search=1\", \"writereditor\", 800, 500, null);' >" . _SEARCH . "</a>"));
     $action_tray->addElement(new XoopsFormLabel('', "<a href='###' onclick='var sel = xoopsGetElementById(\"" . $name . "\");for (var i = sel.options.length-1; i >= 0; i--) {if (sel.options[i].selected) {sel.options[i] = null;}}'>" . art_constant("MD_REMOVE") . "</a>" . "<script type=\"text/javascript\">\r\n            function addusers(opts) {\r\n                var num = opts.substring(0, opts.indexOf(\":\"));\r\n                opts = opts.substring(opts.indexOf(\":\")+1, opts.length);\r\n                var sel = xoopsGetElementById(\"" . $name . "\");\r\n                var arr = new Array(num);\r\n                for (var n = 0; n < num; n++) {\r\n                    var nm = opts.substring(0, opts.indexOf(\":\"));\r\n                    opts = opts.substring(opts.indexOf(\":\")+1, opts.length);\r\n                    var val = opts.substring(0, opts.indexOf(\":\"));\r\n                    opts = opts.substring(opts.indexOf(\":\")+1, opts.length);\r\n                    var txt = opts.substring(0, nm - val.length);\r\n                    opts = opts.substring(nm - val.length, opts.length);\r\n                    var added = false;\r\n                    for (var k = 0; k < sel.options.length; k++) {\r\n                        if (sel.options[k].value == val) {\r\n                            added = true;\r\n                            sel.options[k].selected = true;\r\n                            break;\r\n                        }\r\n                    }\r\n                    if (added == false) {\r\n                        sel.options[k] = new Option(txt, val);\r\n                        sel.options[k].selected = true;\r\n                    }\r\n                }\r\n                return true;\r\n            }\r\n            </script>"));
     $this->addElement($select_form);
     $this->addElement($action_tray);
 }
示例#4
0
if (!empty($newpage)) {
    $form_advance = false;
}
// Disable cache
$xoopsConfig["module_cache"][$xoopsModule->getVar("mid")] = 0;
include XOOPS_ROOT_PATH . "/header.php";
include XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->getVar("dirname") . "/include/vars.php";
// Disclaimer
if (!empty($xoopsModuleConfig["disclaimer"])) {
    echo "<div><strong>" . art_constant("MD_DISCLAIMER") . "</strong></div><br />";
    echo "<div class=\"confirmMsg\" style=\"text-align:left;\">" . $myts->displayTarea($xoopsModuleConfig['disclaimer']) . "</div><br />";
}
if ($user_id > 0) {
    $criteria = new CriteriaCompo(new Criteria("art_time_submit", 0));
    $criteria->add(new Criteria("art_time_create", 0, ">"));
    $criteria->add(new Criteria("uid", $user_id));
    if ($art_id > 0) {
        $criteria->add(new Criteria("art_id", $art_id, "<>"));
    }
    $drafts = $article_handler->getIds($criteria);
    if (count($drafts)) {
        echo "<div><strong>" . art_constant("MD_DRAFTS") . "</strong></div>";
        echo "<div class=\"confirmMsg\" style=\"text-align:left;\">";
        foreach ($drafts as $draft) {
            echo "<a href=\"edit.article.php?article=" . $draft . "\" title=\"click to edit\">#" . $draft . "</a> ";
        }
        echo "</div><br clear=\"both\">";
    }
}
include XOOPS_ROOT_PATH . "/modules/" . $GLOBALS["artdirname"] . "/include/form.article.php";
include XOOPS_ROOT_PATH . "/footer.php";
示例#5
0
require XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->getVar("dirname") . "/include/vars.php";
loadModuleAdminMenu(1);
$category_handler =& xoops_getmodulehandler("category", $GLOBALS["artdirname"]);
$article_counts =& $category_handler->getArticleCountsRegistered();
$counts = array();
foreach ($article_counts as $id => $count) {
    if ($count > 0) {
        $counts[$id] = $count;
    }
}
$ids = array_keys($counts);
if (count($ids) > 0) {
    echo "<fieldset><legend style=\"font-weight: bold; color: #900;\">" . art_constant("AM_SUBMITTED") . "</legend>";
    echo "<div style=\"padding: 8px;\">";
    $category_handler =& xoops_getmodulehandler("category", $GLOBALS["artdirname"]);
    $criteria = new Criteria("cat_id", "(" . implode(",", $ids) . ")", "IN");
    $cat_titles = $category_handler->getList($criteria);
    foreach ($cat_titles as $id => $title) {
        echo "<br clear=\"all\" /><a href=\"" . XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/cp.article.php?category=" . $id . "&amp;type=submitted&amp;from=1\">" . $title . "(<font color=\"red\">" . $counts[$id] . "</font>)</a>";
    }
    echo "</div>";
    echo "</fieldset><br style=\"clear:both\"/>";
}
echo "<fieldset><legend style=\"font-weight: bold; color: #900;\">" . art_constant("AM_CATEGORIES") . "</legend>";
echo "<div style=\"padding: 8px;\">";
echo "<br clear=\"all\" /><a style=\"border: 1px solid #5E5D63; padding: 4px 8px;\" href=\"" . XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/cp.category.php?from=1\">" . art_constant("AM_CPCATEGORY") . "</a>";
echo "<br clear=\"all\" />";
echo "<br clear=\"all\" /><a style=\"border: 1px solid #5E5D63; padding: 4px 8px;\" href=\"" . XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/edit.category.php?from=1\">" . art_constant("AM_ADDCATEGORY") . "</a>";
echo "</div>";
echo "</fieldset><br clear=\"all\" />";
xoops_cp_footer();
示例#6
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: 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" =>
);
示例#7
0
echo "<div style='padding: 8px;'>";
echo "<label>" . art_constant("AM_ABOUT_MODULE_STATUS") . ":</label><text>" . art_getInfo('module_status') . "</text><br />";
echo "<label>" . art_constant("AM_ABOUT_WEBSITE") . ":</label><text>" . "<a href='" . art_getInfo('module_website_url') . "' target='_blank'>" . art_getInfo('module_website_name') . "</a>" . "</text><br />";
echo "<label>" . art_constant("AM_ABOUT_MODULE_TEAM") . ":</label><text>" . art_getInfo('module_team') . "</text><br />";
echo "</div>";
echo "</fieldset>";
echo "<br clear=\"all\" />";
echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . art_constant("AM_ABOUT_AUTHOR_INFO") . "</legend>";
echo "<div style='padding: 8px;'>";
echo "<label>" . art_constant("AM_ABOUT_AUTHOR_NAME") . ":</label><text>" . art_getInfo('author') . "</text><br />";
echo "<label>" . art_constant("AM_ABOUT_WEBSITE") . ":</label><text>" . "<a href='" . art_getInfo('author_website_url') . "' target='_blank'>" . art_getInfo('author_website_name') . "</a>" . "</text><br />";
echo "<label>" . art_constant("AM_ABOUT_AUTHOR_WORD") . ":</label><text>" . art_getInfo('author_word') . "</text><br />";
echo "</div>";
echo "</fieldset>";
echo "<br clear=\"all\" />";
echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . art_constant("AM_ABOUT_DISCLAIMER") . "</legend>";
echo "<div style='padding: 8px;'>";
echo "<div>" . art_constant("AM_ABOUT_DISCLAIMER_TEXT") . "</div>";
echo "</div>";
echo "</fieldset>";
echo "<br clear=\"all\" />";
$file = XOOPS_ROOT_PATH . "/modules/" . $GLOBALS["artdirname"] . "/changelog.txt";
if (is_readable($file)) {
    echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . art_constant("AM_ABOUT_CHANGELOG") . "</legend>";
    echo "<div style='padding: 8px;'>";
    echo "<div>" . implode("<br />", file($file)) . "</div>";
    echo "</div>";
    echo "</fieldset>";
    echo "<br clear=\"all\" />";
}
xoops_cp_footer();
示例#8
0
    $criteria = new CriteriaCompo(new Criteria("art_id", $article_id));
    $ip = art_getIP();
    if ($uid > 0) {
        $criteria->add(new Criteria("uid", $uid));
    } else {
        $criteria->add(new Criteria("rate_ip", $ip));
        $criteria->add(new Criteria("rate_time", time() - 24 * 3600, ">"));
    }
    $rate_handler =& xoops_getmodulehandler("rate", $GLOBALS["artdirname"]);
    if ($count = $rate_handler->getCount($criteria)) {
        $message = art_constant("MD_ALREADYRATED");
    } else {
        $rate_obj =& $rate_handler->create();
        $rate_obj->setVar("art_id", $article_id);
        $rate_obj->setVar("uid", $uid);
        $rate_obj->setVar("rate_ip", $ip);
        $rate_obj->setVar("rate_rating", $rate);
        $rate_obj->setVar("rate_time", time());
        if (!($rate_id = $rate_handler->insert($rate_obj))) {
            redirect_header("javascript:history.go(-1);", 1, art_constant("MD_NOTSAVED"));
            exit;
        }
        $article_obj =& $article_handler->get($article_id);
        $article_obj->setVar("art_rating", $article_obj->getVar("art_rating") + $rate, true);
        $article_obj->setVar("art_rates", $article_obj->getVar("art_rates") + 1, true);
        $article_handler->insert($article_obj, true);
        $message = art_constant("MD_ACTIONDONE");
    }
}
redirect_header(XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/view.article.php" . URL_DELIMITER . $article_id . "/p" . $page . "/c" . $category_id, 2, $message);
include 'footer.php';
示例#9
0
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_PERM_VIEW", "浏览全文");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_PERM_VIEW_DESC", "");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_PERM_SUBMIT", "提交");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_PERM_SUBMIT_DESC", "");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_PERM_PUBLISH", "自动发布");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_PERM_PUBLISH_DEC", "");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_PERM_RATE", "评分");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_PERM_RATE_DESC", "");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_PERM_MODERATE", "管理");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_PERM_MODERATE_DESC", "");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_PERMISSION_GLOBAL", "全局权限");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_PERMISSION_GLOBAL_DESC", "");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_PERM_SEARCH", "搜索");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_PERM_HTML", "使用HTML");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_PERM_UPLOAD", "上传");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_PERMISSION_DESC", "可以设定的分类权限: " . art_constant("AM_PERM_ACCESS") . ", " . art_constant("AM_PERM_VIEW") . ", " . art_constant("AM_PERM_SUBMIT") . ", " . art_constant("AM_PERM_RATE") . ", " . art_constant("AM_PERM_MODERATE") . "<br />" . "可以设定的全局权限: " . art_constant("AM_PERM_SEARCH") . ", " . art_constant("AM_PERM_HTML") . ", " . art_constant("AM_PERM_UPLOAD"));
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_PERMISSION_TEMPLATE", "设置缺省权限模板");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_PERMISSION_TEMPLATE_DESC", "编辑下列权限模板从而可以方便的应用到某个/些论坛");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_PERMISSION_TEMPLATE_CREATED", "权限模板已生成");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_PERMISSION_TEMPLATE_ERROR", "建立权限模板时发生错误");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_PERMISSION_TEMPLATE_APPLY", "应用缺省权限模板");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_PERMISSION_TEMPLATE_APPLIED", "所选择的类别已经采用缺省权限");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_PERMISSION_ACTION", "权限管理工具");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_PERMISSION_SETBYGROUP", "直接按群组设置权限");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_PAGENAME", "页面");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_TOPICS", "专题设置");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_CPTOPIC", "专题管理");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_ADDTOPIC", "添加专题");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_TRACKBACKS", "跟踪设置");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_CPTRACKBACK", "跟踪管理");
define($GLOBALS["ART_VAR_PREFIXU"] . "_AM_PREFERENCES", "模块参数");
示例#10
0
$criteria = new CriteriaCompo(new Criteria('art_time_publish', 0, ">"));
if (count($spotlight_obj->getVar("sp_categories")) > 0) {
    $criteria->add(new Criteria('cat_id', '(' . implode(',', $spotlight_obj->getVar("sp_categories")) . ')', '>'), "AND");
}
$articles_count = $article_handler->getCount($criteria);
if ($articles_count > 0) {
    $tags = array("art_title", "cat_id");
    $criteria->setStart($start);
    $criteria->setLimit($xoopsModuleConfig["articles_perpage"]);
    $articles_obj =& $article_handler->getAll($criteria, $tags);
    foreach ($articles_obj as $id => $article) {
        $cat_id[] = $article->getVar('cat_id');
    }
    $criteria = new Criteria("cat_id", "(" . implode(",", $cat_id) . ")", "IN");
    $categories = $category_handler->getList($criteria);
    $heading = array("ID", art_constant("AM_TITLE"), art_constant("AM_CATEGORY"), art_constant("AM_SPOTIT"));
    $article_table = "\n<tr><td colspan='2'>";
    $article_table .= "\n<table border='0' width='100%' cellpadding ='2' cellspacing='1' class = 'outer'>";
    $article_table .= "\n<tr >";
    for ($i = 0; $i < count($heading); $i++) {
        $article_table .= "<th align='center'>" . $heading[$i] . "</th>";
    }
    $article_table .= "</tr>";
    foreach ($articles_obj as $id => $article) {
        $article_table .= "\n<tr>";
        $article_table .= "<td align='center' class = 'head'>" . $id . "";
        $article_table .= "</td><td align='left' class = 'even'>" . $article->getVar('art_title');
        $article_table .= "</td><td align='left' class = 'even'>" . $categories[$article->getVar('cat_id')];
        $article_table .= "</td>";
        if ($spotlight_obj->getVar("art_id") == $id) {
            $selected = "checked";
示例#11
0
//$modversion["notification"]["event"][$i]["admin_only"] = 1;
$modversion["notification"]["event"][$i]["title"] = art_constant("MI_CATEGORY_ARTICLESUBMIT_NOTIFY");
$modversion["notification"]["event"][$i]["caption"] = art_constant("MI_CATEGORY_ARTICLESUBMIT_NOTIFYCAP");
$modversion["notification"]["event"][$i]["description"] = art_constant("MI_CATEGORY_ARTICLESUBMIT_NOTIFYDSC");
$modversion["notification"]["event"][$i]["mail_template"] = "category_articlesubmit_notify";
$modversion["notification"]["event"][$i]["mail_subject"] = art_constant("MI_CATEGORY_ARTICLESUBMIT_NOTIFYSBJ");
$i++;
$modversion["notification"]["event"][$i]["name"] = "article_new";
$modversion["notification"]["event"][$i]["category"] = "category";
$modversion["notification"]["event"][$i]["title"] = art_constant("MI_CATEGORY_NEWARTICLE_NOTIFY");
$modversion["notification"]["event"][$i]["caption"] = art_constant("MI_CATEGORY_NEWARTICLE_NOTIFYCAP");
$modversion["notification"]["event"][$i]["description"] = art_constant("MI_CATEGORY_NEWARTICLE_NOTIFYDSC");
$modversion["notification"]["event"][$i]["mail_template"] = "category_newarticle_notify";
$modversion["notification"]["event"][$i]["mail_subject"] = art_constant("MI_CATEGORY_NEWARTICLE_NOTIFYSBJ");
$i++;
$modversion["notification"]["event"][$i]["name"] = "article_approve";
$modversion["notification"]["event"][$i]["category"] = "article";
$modversion["notification"]["event"][$i]["title"] = art_constant("MI_ARTICLE_ARTICLEAPPROVE_NOTIFY");
$modversion["notification"]["event"][$i]["caption"] = art_constant("MI_ARTICLE_ARTICLEAPPROVE_NOTIFYCAP");
$modversion["notification"]["event"][$i]["description"] = art_constant("MI_ARTICLE_ARTICLEAPPROVE_NOTIFYDSC");
$modversion["notification"]["event"][$i]["mail_template"] = "article_approve_notify";
$modversion["notification"]["event"][$i]["mail_subject"] = art_constant("MI_ARTICLE_ARTICLEAPPROVE_NOTIFYSBJ");
$i++;
$modversion["notification"]["event"][$i]["name"] = "article_monitor";
$modversion["notification"]["event"][$i]["category"] = "article";
$modversion["notification"]["event"][$i]["title"] = art_constant("MI_ARTICLE_ARTICLEMONITOR_NOTIFY");
$modversion["notification"]["event"][$i]["caption"] = art_constant("MI_ARTICLE_ARTICLEMONITOR_NOTIFYCAP");
$modversion["notification"]["event"][$i]["description"] = art_constant("MI_ARTICLE_ARTICLEMONITOR_NOTIFYDSC");
$modversion["notification"]["event"][$i]["mail_template"] = "article_monitor_notify";
$modversion["notification"]["event"][$i]["mail_subject"] = art_constant("MI_ARTICLE_ARTICLEMONITOR_NOTIFYSBJ");
示例#12
0
 * 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: permission.php 2178 2008-09-26 08:34:09Z phppp $
 */
if (!defined("XOOPS_ROOT_PATH")) {
    exit;
}
include_once dirname(dirname(__FILE__)) . "/include/vars.php";
mod_loadFunctions("parse", $GLOBALS["artdirname"]);
$GLOBALS["perms_global"] = array("search" => array("id" => 1, "title" => art_constant("AM_PERM_SEARCH")), "html" => array("id" => 2, "title" => art_constant("AM_PERM_HTML")), "upload" => array("id" => 3, "title" => art_constant("AM_PERM_UPLOAD")));
$GLOBALS["perms_category"] = array("access" => array("title" => art_constant("AM_PERM_ACCESS"), "desc" => art_constant("AM_PERM_ACCESS_DESC")), "view" => array("title" => art_constant("AM_PERM_VIEW"), "desc" => art_constant("AM_PERM_VIEW_DESC")), "submit" => array("title" => art_constant("AM_PERM_SUBMIT"), "desc" => art_constant("AM_PERM_SUBMIT_DESC")), "publish" => array("title" => art_constant("AM_PERM_PUBLISH"), "desc" => art_constant("AM_PERM_PUBLISH_DEC")), "rate" => array("title" => art_constant("AM_PERM_RATE"), "desc" => art_constant("AM_PERM_RATE_DESC")), "moderate" => array("title" => art_constant("AM_PERM_MODERATE"), "desc" => art_constant("AM_PERM_MODERATE_DESC")));
// Initializing XoopsGroupPermHandler if not loaded yet
if (!class_exists("XoopsGroupPermHandler")) {
    require_once XOOPS_ROOT_PATH . '/kernel/groupperm.php';
}
art_parse_class('
class [CLASS_PREFIX]PermissionHandler extends XoopsGroupPermHandler
{
    function deleteByCategory($cat_id)
    {
        global $xoopsModule;

        if (is_object($xoopsModule) && $xoopsModule->getVar("dirname") == $GLOBALS["artdirname"]) {
            $module_id = $xoopsModule->getVar("mid") ;
        } else {
            $module_handler =& xoops_gethandler("module");
示例#13
0
         /*
         $articles_obj =& $article_handler->getPublished(
         $xoopsModuleConfig["articles_perpage"],
         0,
         $criteria,
         array("art_title", "uid", "cat_id", "art_time_publish", "art_keywords", "art_summary", "art_author", "art_source")
         );
         */
         foreach ($articles_obj as $id => $article) {
             $uids[$article->getVar("uid")] = 1;
         }
         $users = art_getUnameFromId(array_keys($uids));
         foreach ($articles_obj as $id => $article) {
             $content = art_constant("MD_CATEGORY") . ": " . $categories_obj[$article->getVar("cat_id")]->getVar("cat_title") . "<br />";
             $content .= art_constant("MD_TITLE") . ": " . $article->getVar("art_title") . "<br />";
             $content .= art_constant("MD_SUMMARY") . ": " . $article->getSummary(true);
             $items[] = array("title" => $article->getVar("art_title"), "link" => XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/view.article.php" . URL_DELIMITER . $article->getVar("art_id") . "/c" . $article->getVar("cat_id"), "description" => $content, "descriptionHtmlSyndicated" => true, "date" => $article->getTime("rss"), "source" => XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/", "author" => $users[$article->getVar("uid")]);
         }
         $xml_link = XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/";
         break;
 }
 $xml_charset = empty($xoopsModuleConfig["do_rssutf8"]) ? _CHARSET : "UTF-8";
 $xml_handler =& xoops_getmodulehandler("xml", $GLOBALS["artdirname"]);
 $xml = $xml_handler->create($type);
 $xml->setVar("encoding", $xml_charset);
 $xml->setVar("title", $xoopsConfig["sitename"] . " :: " . $pagetitle, "UTF-8", $xml_charset, true);
 $xml->setVar("description", $rssdesc, true);
 $xml->setVar("descriptionHtmlSyndicated", true);
 $xml->setVar("link", $xml_link);
 $xml->setVar("syndicationURL", XOOPS_URL . "/" . xoops_getenv("PHP_SELF"));
 $xml->setVar("webmaster", checkEmail($xoopsConfig["adminmail"], true));
示例#14
0
$xoops_pagetitle = $xoopsModule->getVar("name") . " - " . art_constant("MD_CPCATEGORY");
$xoopsOption["xoops_pagetitle"] = $xoops_pagetitle;
include_once XOOPS_ROOT_PATH . "/header.php";
include XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->getVar("dirname") . "/include/vars.php";
$category_handler =& xoops_getmodulehandler("category", $GLOBALS["artdirname"]);
$message = art_constant("MD_ACTIONDONE");
switch ($op) {
    case "delete":
        $category_obj =& $category_handler->get($category_id);
        if (empty($_POST["confirm_submit"])) {
            $hiddens["category"] = $category_id;
            $hiddens["op"] = $op;
            $hiddens["from"] = $from;
            $action = XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/am.category.php";
            $msg = _DELETE . ": " . $category_obj->getVar("cat_title");
            $msg .= "<br />" . (empty($xoopsModuleConfig["category_delete_forced"]) ? art_constant("MD_MOVE_CATEGORYANDARTICLE") : art_constant("MD_DELETE_CATEGORYANDARTICLE")) . "<br />" . art_constant("MD_CONFIG_CATEGORYANDARTICLE");
            include_once XOOPS_ROOT_PATH . "/header.php";
            xoops_confirm($hiddens, $action, $msg);
            include_once XOOPS_ROOT_PATH . "/footer.php";
            exit;
        }
        $category_handler->delete($category_obj, true, @$xoopsModuleConfig["category_delete_forced"]);
        break;
    case "order":
        for ($i = 0; $i < count($cat_id); $i++) {
            $cat_obj =& $category_handler->get($cat_id[$i]);
            if ($cat_order[$i] != $cat_obj->getVar("cat_order")) {
                $cat_obj->setVar("cat_order", $cat_order[$i]);
                $category_handler->insert($cat_obj);
            }
            unset($cat_obj);
示例#15
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: index.list.php 2178 2008-09-26 08:34:09Z phppp $
 */
if (!defined('XOOPS_ROOT_PATH') || !is_object($xoopsModule)) {
    return false;
    exit;
}
// Instantiate the handlers
$category_handler =& xoops_getmodulehandler("category", $GLOBALS["artdirname"]);
$article_handler =& xoops_getmodulehandler("article", $GLOBALS["artdirname"]);
if (!($categories_obj = $category_handler->getAllByPermission("access", array("cat_title", "cat_pid")))) {
    redirect_header("index.php", 2, art_constant("MD_NOACCESS"));
}
$categories_id = array_keys($categories_obj);
// Get spotlight if enabled && isFirstPage
if (!empty($xoopsModuleConfig["do_spotlight"])) {
    $spotlight_handler =& xoops_getmodulehandler("spotlight", $GLOBALS["artdirname"]);
    $sp_data = $spotlight_handler->getContent();
    $article_spotlight_id = $sp_data["art_id"];
}
// Get featured articles if enabled && isFirstPage
if ($xoopsModuleConfig["featured_index"]) {
    $criteria = new CriteriaCompo(new Criteria("ac.ac_feature", 0, ">"));
    $articles_featured_id = $article_handler->getIdsByCategory($categories_id, $xoopsModuleConfig["featured_index"], 0, $criteria);
} else {
    $articles_featured_id = array();
}
示例#16
0
// Order
$form_art->addElement(new XoopsFormText(art_constant("MD_ORDER"), "top_order", 20, 20, $topic_obj->getVar("top_order")));
// expire
$top_expire = $topic_obj->isNew() ? (empty($xoopsModuleConfig["topic_expire"]) ? 365 : $xoopsModuleConfig["topic_expire"]) * 3600 * 24 + time() : $topic_obj->getVar("top_expire");
$form_art->addElement(new XoopsFormDateTime(art_constant("MD_EXPIRATION"), "top_expire", 15, intval($top_expire)));
// Template set
$templates =& art_getTemplateList("topic");
if (count($templates) > 0) {
    $template_option_tray = new XoopsFormElementTray(art_constant("MD_TEMPLATE_SELECT"), "<br />");
    $template_select = new XoopsFormSelect("", "top_template", $topic_obj->getVar("top_template"));
    $template_select->addOptionArray($templates);
    $template_option_tray->addElement($template_select);
    $form_art->addElement($template_option_tray);
}
// Sponsor links
$form_art->addElement(new XoopsFormTextArea(art_constant("MD_SPONSOR"), "top_sponsor", $topic_obj->getVar("top_sponsor", "e")));
//$form_art->addElement(new XoopsFormLabel(art_constant("MD_SPONSOR_DESC"), art_constant("MD_SPONSOR_DESC_TEXT")));
$form_art->addElement(new XoopsFormHidden("top_id", $topic_obj->getVar("top_id")));
$form_art->addElement(new XoopsFormHidden("from", $from));
$button_tray = new XoopsFormElementTray("", "");
$button_tray->addElement(new XoopsFormButton("", "submit", _SUBMIT, "submit"));
$cancel_button = new XoopsFormButton('', 'cancel', _CANCEL, 'button');
if (!empty($from)) {
    $extra = "admin/admin.topic.php";
} elseif (!$topic_obj->getVar("top_id")) {
    $extra = "view.category.php?category=" . intval($category_id);
} else {
    $extra = "view.topic.php?topic=" . $topic_obj->getVar("cat_id");
}
$cancel_button->setExtra("onclick='window.document.location=\"" . $extra . "\"'");
$button_tray->addElement($cancel_button);
示例#17
0
    $trackback_obj->setVar("tb_url", $url);
    $trackback_obj->setVar("tb_excerpt", $excerpt);
    $trackback_obj->setVar("tb_blog_name", $blog_name);
    $trackback_obj->setVar("tb_ip", art_getIP());
    $trackback_obj->setVar("tb_status", $tb_status);
    $result = $trackback_handler->insert($trackback_obj);
    $criteria = new CriteriaCompo(new Criteria("art_id", $article_id));
    $criteria->add(new Criteria("tb_status", 0, ">"));
    $count = $trackback_handler->getCount($criteria);
    $article_handler =& xoops_getmodulehandler("article", $GLOBALS["artdirname"]);
    $article_obj =& $article_handler->get($article_id);
    if ($count > $article_obj->getVar("art_trackbacks")) {
        $article_obj->setVar("art_trackbacks", $count);
        $article_handler->insert($article_obj);
    }
    art_trackback_response(0);
    if (!empty($xoopsModuleConfig["notification_enabled"]) && $result) {
        $notification_handler =& xoops_gethandler("notification");
        $tags = array();
        $tags["ARTICLE_TITLE"] = $article_obj->getVar("art_title");
        $tags["ARTICLE_URL"] = XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/view.article.php" . URL_DELIMITER . $article_obj->getVar("art_id") . "#tb" . $trackback_obj->getVar("tb_id");
        if ($trackback_obj->getVar("tb_status")) {
            $tags["ARTICLE_ACTION"] = art_constant("MD_NOT_ACTION_TRACKBACK");
            $notification_handler->triggerEvent("article", $article_id, "article_monitor", $tags);
            $notification_handler->triggerEvent("global", 0, "article_monitor", $tags);
        } else {
            $tags["TRACKBACK_URL"] = XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/cp.trackback.php?article=" . $article_obj->getVar("art_id");
            $notification_handler->triggerEvent("global", 0, "article_trackback", $tags);
        }
    }
}
示例#18
0
        $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":
        $type_name = art_constant("MD_REGISTERED");
        $criteria = new CriteriaCompo(new Criteria("ac.ac_publish", 0));
        break;
    case "featured":
        $type_name = art_constant("MD_FEATURED");
        $criteria = new CriteriaCompo(new Criteria("ac.ac_feature", 0, ">"));
        break;
    case "published":
        $type = "published";
        $type_name = art_constant("MD_PUBLISHED");
        $criteria = new CriteriaCompo(new Criteria("ac.ac_publish", 0, ">"));
        $criteria->add(new Criteria("ac.ac_feature", 0));
        break;
    case "all":
    default:
        $type_name = _ALL;
        $criteria = new CriteriaCompo(new Criteria("1", 1));
        break;
}
$article_handler =& xoops_getmodulehandler("article", $GLOBALS["artdirname"]);
if (!empty($topic_id)) {
    $articles_count = $topic_handler->getArticleCount($topic_id);
    $tags = array("a.art_summary", "a.art_title", "a.uid", "at.at_time", "a.cat_id");
    $articles_array = $article_handler->getByTopic($topic_id, $xoopsModuleConfig["articles_perpage"], $start, null, $tags, false);
} elseif ($byCategory) {
示例#19
0
        }
        if(num == 0) {
            window.close();
            return false;
        }
        sel_str = num+":"+sel_str;
        window.opener.addItem(sel_str);
        if(multiple==0){ 
            window.close();
            window.opener.focus();
        }
        return true;
    }
    </script>
';
$form_article = new XoopsThemeForm(art_constant("MD_ARTICLE_SELECT"), "selectarticle", xoops_getenv('PHP_SELF'), "GET");
$article_handler =& xoops_getmodulehandler("article", $GLOBALS["artdirname"]);
$criteria = new CriteriaCompo(new Criteria("cat_id", $category_id));
$article_count = $article_handler->getCount($criteria);
$criteria->setSort("art_id");
$criteria->setLimit($limit);
$criteria->setStart($start);
$select_form = new XoopsFormSelect("", $name_current);
$select_form->addOptionArray($article_handler->getList($criteria));
$select_tray = new XoopsFormElementTray("", "<br />");
$select_tray->addElement($select_form);
$nav = new XoopsPageNav($article_count, $limit, $start, "start", "target=" . $_REQUEST["target"] . "&amp;category=" . $category_id);
//$user_select_nav = new XoopsFormLabel(sprintf(_MA_SEARCH_COUNT, $usercount), $nav->renderNav(4));
$select_tray->addElement($nav->renderNav(4));
$add_button = new XoopsFormButton('', '', _ADD, 'button');
$add_button->setExtra('onclick="addItem();"');
示例#20
0
        $button[$i]->setExtra("tabindex={$i_tab}");
        $button[$i]->setExtra('onclick="window.document.' . $form_art->getName() . '.delart.value=1; window.document.' . $form_art->getName() . '.submit()"');
        $form_art->addElement(new XoopsFormHidden('delart', 0));
    }
}
$i++;
$i_tab++;
$button[$i] = new XoopsFormButton('', 'cancel', _CANCEL, 'button');
if (!$article_obj->getVar("art_id")) {
    $extra = "view.category.php?category=" . intval($cat_id);
} else {
    $extra = "view.article.php?article=" . $article_obj->getVar("art_id") . "&amp;category=" . $cat_id . "&amp;page=" . $page;
}
$button[$i]->setExtra("onclick='window.document.location=\"" . $extra . "\"'");
$button[$i]->setExtra("tabindex={$i_tab}");
// Create button for help
$i++;
$i_tab++;
$button[$i] = new XoopsFormButton('', 'help', art_constant("MD_HELP"), 'button');
$button[$i]->setExtra("tabindex={$i_tab}");
$help_text = "";
foreach ($help_btn as $key => $val) {
    $help_text .= htmlspecialchars("<li>[<strong>{$key}</strong>] - {$val}</li>", ENT_QUOTES);
}
$button[$i]->setExtra("onclick=\"\r\n    var help_window = openWithSelfMain(null, 'help', 500, 200, true);\r\n    help_window.document.write('" . $help_text . "')\r\n\"");
foreach (array_keys($button) as $btn) {
    $button_tray->addElement($button[$btn]);
}
$form_art->addElement($button_tray);
// Display the form
$form_art->display();
示例#21
0
 * 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: admin.file.php 2178 2008-09-26 08:34:09Z phppp $
 */
include "header.php";
/*
 * The feature is to be reactivated after article 1.0 release
 *
 * redirect to index page by now
 */
/*
header("location: ".XOOPS_URL."/modules/".$GLOBALS["artdirname"]."/admin/index.php");
exit();
*/
xoops_cp_header();
require XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->getVar("dirname") . "/include/vars.php";
loadModuleAdminMenu(8);
echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . art_constant("AM_FILES") . "</legend>";
echo "<div style=\"padding: 8px;\">";
echo "<h2>Coming soon ...</h2>";
echo "</div>";
echo "</fieldset><br />";
xoops_cp_footer();
exit;
示例#22
0
if (art_parse_args($args_num, $args, $args_str)) {
    $args["topic"] = !empty($args["topic"]) ? $args["topic"] : @$args_num[0];
}
$topic_id = intval(empty($_GET["topic"]) ? @$args["topic"] : $_GET["topic"]);
$start = intval(empty($_GET["start"]) ? @$args["start"] : $_GET["start"]);
$topic_handler =& xoops_getmodulehandler("topic", $GLOBALS["artdirname"]);
$topic_obj =& $topic_handler->get($topic_id);
/*
 * 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();
示例#23
0
            $hiddens["op"] = "delete";
            $hiddens["from"] = $from;
            $hiddens["start"] = $start;
            $hiddens["category"] = $category_id;
            $action = XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/am.topic.php";
            $msg = _DELETE . ": " . $topic_obj->getVar("top_title");
            include_once XOOPS_ROOT_PATH . "/header.php";
            include XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->getVar("dirname") . "/include/vars.php";
            xoops_confirm($hiddens, $action, $msg);
            include_once XOOPS_ROOT_PATH . "/footer.php";
            exit;
        } else {
            $topic_handler->delete($topic_obj);
        }
        break;
    case "order":
        for ($i = 0; $i < count($top_id); $i++) {
            $top_obj =& $topic_handler->get($top_id[$i]);
            if ($top_obj[$i] != $top_obj->getVar("top_order")) {
                $top_obj->setVar("top_order", $top_order[$i]);
                $topic_handler->insert($top_obj);
            }
            unset($top_obj);
        }
        break;
    default:
        break;
}
$redirect = empty($from) ? XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/cp.topic.php?category=" . $category_id . "&amp;start=" . $start : XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/admin/admin.topic.php";
redirect_header($redirect, 2, art_constant("MD_ACTIONDONE"));
include_once "footer.php";
示例#24
0
unset($article_obj, $category_obj);
}

break;
case "unfeature":
$article_handler->unfeatureCategory($art_id[$i], $cat_id[$i]);
break;
}
}
$message = art_constant("MD_ACTIONDONE");
}
*/
if ($update_topic || $update_category) {
    foreach ($art_id as $id) {
        $art_obj =& $article_handler->get($id);
        if (!is_object($art_obj) || @$art_obj->getVar("art_id") == 0) {
            continue;
        }
        if ($update_topic) {
            $article_handler->updateTopics($art_obj);
        }
        if ($update_category) {
            $article_handler->updateCategories($art_obj);
        }
        unset($art_obj);
    }
}
$redirect = empty($from) ? XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/cp.article.php?category=" . $category_id . "&amp;topic=" . $topic_id . "&amp;start=" . $start . "&amp;type=" . $type : XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/admin/admin.article.php";
$message = empty($message) ? art_constant("MD_INVALID") : $message;
redirect_header($redirect, 2, $message);
include_once XOOPS_ROOT_PATH . "/footer.php";
if (!empty($xoopsModuleConfig["forum"]) && $isModerator && !$article_obj->getVar("art_forum")) {
    $form_element["active"]["forum"] = new XoopsFormRadioYN(art_constant("MD_FORUM"), "forum", 0, _YES, " " . _NO);
}
// External Links
$form_element["active"]["art_elinks"] = new XoopsFormTextArea(art_constant("MD_ELINKS"), "art_elinks", $art_elinks, 3);
$form_element["inactive"]["art_elinks"] = new XoopsFormHidden("art_elinks", $art_elinks);
// Trackbacks
if (!empty($xoopsModuleConfig["do_trackback"])) {
    $form_element["active"]["trackbacks"] = new XoopsFormTextArea(art_constant("MD_TRACKBACKS"), "trackbacks", $trackbacks, 3);
    $form_element["inactive"]["trackbacks"] = new XoopsFormHidden("trackbacks", $trackbacks);
}
// Notify for approval
if (!$canPublish && is_object($xoopsUser) && $xoopsModuleConfig["notification_enabled"]) {
    $form_element["active"]["notify"] = new XoopsFormRadioYN(art_constant("MD_NOTIFY_ON_APPROVAL"), "notify", $notify, _YES, " " . _NO);
    $form_element["inactive"]["notify"] = new XoopsFormHidden("notify", $notify);
}
// Approval option
if ($article_obj->getVar("art_time_submit") && !$article_obj->getVar("art_time_publish") && $isModerator) {
    $form_element["active"]["approved"] = new XoopsFormRadioYN(art_constant("MD_APPROVE"), "approved", 1, _YES, " " . _NO);
    $form_element["inactive"]["approved"] =& $form_element["active"]["approved"];
}
// Update publish time
if ($article_obj->getVar("art_time_publish") && $isModerator) {
    $update_time_value = !empty($_POST["update_time_value"]) && !empty($_POST["update_time"]) ? intval(strtotime(@$_POST["update_time_value"]["date"]) + @$_POST["update_time_value"]["time"]) : $article_obj->getVar("art_time_publish");
    $date_tray = new XoopsFormElementTray(art_constant("MD_UPDATE_TIME"));
    $date_tray->addElement(new XoopsFormDateTime("", "update_time_value", 15, $update_time_value));
    $select_option = new XoopsFormCheckBox("", "update_time", intval(@$_POST["update_time"]));
    $select_option->addOption(1, "<strong>" . _YES . "</strong>");
    $date_tray->addElement($select_option);
    $form_element["active"]["update_time"] = $date_tray;
}
示例#26
0
$form_art = new XoopsThemeForm(art_constant("MD_AUTHOR") . " " . $writer_obj->getVar("writer_name") . " (" . ($writer_obj->getVar("writer_id") ? _EDIT : _ADD) . ")", "formwriter", xoops_getenv('PHP_SELF'));
$form_art->setExtra("enctype=\"multipart/form-data\"");
// Title
$form_art->addElement(new XoopsFormText(art_constant("MD_NAME"), "writer_name", 50, 255, $writer_obj->getVar("writer_name")), true);
// Profile
$form_art->addElement(new XoopsFormTextArea(art_constant("MD_PROFILE"), "writer_profile", $writer_obj->getVar("writer_profile", "E")));
// Avatar
if (art_isAdministrator() && !empty($xoopsModuleConfig["path_image"])) {
    //require_once(XOOPS_ROOT_PATH . "/class/xoopstree.php");
    $writer_avatar = $writer_obj->getVar("writer_avatar");
    $image_option_tray = new XoopsFormElementTray(art_constant("MD_IMAGE_UPLOAD"), "<br />");
    $image_option_tray->addElement(new XoopsFormFile("", "userfile", ""));
    $form_art->addElement($image_option_tray);
    unset($image_tray);
    unset($image_option_tray);
    $image_option_tray = new XoopsFormElementTray(art_constant("MD_IMAGE_SELECT"), "<br />");
    $path_image = $xoopsModuleConfig["path_image"];
    $image_array =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . "/" . $path_image . "/");
    array_unshift($image_array, _NONE);
    $image_select = new XoopsFormSelect("", "writer_avatar", $writer_avatar);
    $image_select->addOptionArray($image_array);
    $image_select->setExtra("onchange=\"showImgSelected('img', 'writer_avatar', '/" . $path_image . "/', '', '" . XOOPS_URL . "')\"");
    $image_tray = new XoopsFormElementTray("", "&nbsp;");
    $image_tray->addElement($image_select);
    if (!empty($writer_avatar) && file_exists(XOOPS_ROOT_PATH . "/" . $path_image . "/" . $writer_avatar)) {
        $image_tray->addElement(new XoopsFormLabel("", "<div style=\"padding: 8px;\"><img src=\"" . XOOPS_URL . "/" . $path_image . "/" . $writer_avatar . "\" name=\"img\" id=\"img\" alt=\"\" /></div>"));
    } else {
        $image_tray->addElement(new XoopsFormLabel("", "<div style=\"padding: 8px;\"><img src=\"" . XOOPS_URL . "/images/blank.gif\" name=\"img\" id=\"img\" alt=\"\" /></div>"));
    }
    $image_option_tray->addElement($image_tray);
    $form_art->addElement($image_option_tray);
示例#27
0
            $article_more = new XoopsFormLabel('', "<a href='###' onclick='return openWithSelfMain(\"" . XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/include/select.article.php?target=" . $name . "&amp;category=" . $category_obj->getVar("cat_id") . "\", \"articleselect\", 800, 500, null);' >" . _MORE . "</a>" . "<script type=\"text/javascript\">\r\n                function addItem(opts) {\r\n                    var num = opts.substring(0, opts.indexOf(\":\"));\r\n                    opts = opts.substring(opts.indexOf(\":\")+1, opts.length);\r\n                    var sel = xoopsGetElementById(\"" . $name . "\");\r\n                    var arr = new Array(num);\r\n                    for(var n=0; n<num; n++) {\r\n                        var nm = opts.substring(0, opts.indexOf(\":\"));\r\n                        opts = opts.substring(opts.indexOf(\":\")+1, opts.length);\r\n                        var val = opts.substring(0, opts.indexOf(\":\"));\r\n                        opts = opts.substring(opts.indexOf(\":\")+1, opts.length);\r\n                        var txt = opts.substring(0, nm - val.length);\r\n                        opts = opts.substring(nm - val.length, opts.length);\r\n                        var added = false;\r\n                        for (var k = 0; k < sel.options.length; k++) {\r\n                            if (sel.options[k].value == val) {\r\n                                added = true;\r\n                                break;\r\n                            }\r\n                        }\r\n                        if (added==false) {\r\n                            sel.options[k] = new Option(txt, val);\r\n                            sel.options[k].selected = true;\r\n                        }\r\n                    }\r\n                    return true;\r\n                }\r\n                </script>");
            $article_option_tray->addElement($article_more);
            $form_art->addElement($article_option_tray);
        } else {
            //$criteria_article->setLimit($limit_article);
            $criteria_article->setSort("art_id");
            $criteria_article->setOrder("DESC");
            $article_list = $article_list + $article_handler->getList(new Criteria("cat_id", $category_obj->getVar("cat_id")));
            $article_select = new XoopsFormSelect(art_constant("MD_ENTRY_SELECT"), "cat_entry", $category_obj->getVar("cat_entry"));
            $article_select->addOptionArray($article_list);
            $form_art->addElement($article_select);
        }
    }
}
// Sponsor links
$form_art->addElement(new XoopsFormTextArea(art_constant("MD_SPONSOR"), "cat_sponsor", $category_obj->getVar("cat_sponsor", "E")));
//$form_art->addElement(new XoopsFormLabel(art_constant("MD_SPONSOR_DESC"), art_constant("MD_SPONSOR_DESC_TEXT")));
$form_art->addElement(new XoopsFormHidden("cat_id", $category_obj->getVar("cat_id")));
$form_art->addElement(new XoopsFormHidden("from", $from));
$button_tray = new XoopsFormElementTray("", "");
$button_tray->addElement(new XoopsFormButton("", "submit", _SUBMIT, "submit"));
$cancel_button = new XoopsFormButton('', 'cancel', _CANCEL, 'button');
if (!empty($from)) {
    $extra = "admin/admin.category.php";
} elseif ($category_obj->getVar("cat_id")) {
    $extra = "view.category.php?category=" . $category_obj->getVar("cat_id");
} elseif ($category_obj->getVar("cat_pid")) {
    $extra = "view.category.php?category=" . $category_obj->getVar("cat_pid");
} else {
    $extra = "index.php";
}
示例#28
0
         $data["subsubtitle"] = "#" . $page . " " . $article_data["text"]["title"];
     }
     $tmp = array();
     if ($data["author"]) {
         $tmp[] = $data["author"];
     }
     if ($data["source"]) {
         $tmp[] = $data["source"];
     }
     $data["author"] = implode(" ", $tmp);
     $data["content"] = "";
     if ($data["keywords"]) {
         $data["content"] .= art_constant("MD_KEYWORDS") . ": " . $data["keywords"] . "<br /><br />";
     }
     if ($data["summary"]) {
         $data["content"] .= art_constant("MD_SUMMARY") . ": " . $data["summary"] . "<br /><br />";
     }
     $data["content"] .= $article_data["text"]["body"] . "<br />";
     ${"{$op}_data"} =& $data;
     break;
     // Use title
 // Use title
 case "bookmark":
     break;
     // Use if already linked to a forum topic, redirect to it
 // Use if already linked to a forum topic, redirect to it
 case "newbb":
     $data["content"] = $data["summary"];
     if ($article_obj->getVar("art_forum")) {
         $data["entry"] = $article_obj->getVar("art_forum");
     } else {
        mod_loadFunctions("recon", $xoopsModule->getVar("dirname", "n"));
        art_synchronization();
        break;
}
$form = '<fieldset><legend style="font-weight: bold; color: #900;">' . art_constant("AM_SYNC_TITLE") . '</legend>';
$form .= '<form action="admin.synchronization.php" method="get">';
$form .= '<div style="padding: 10px 2px;">';
$form .= '<h2>' . art_constant("AM_SYNC_CATEGORY") . '</h2>';
$form .= '<input type="hidden" name="type" value="category">';
$form .= art_constant("AM_SYNC_ITEMS") . '<input type="text" name="limit" value="20"> ';
$form .= '<input type="submit" name="submit" value=' . _SUBMIT . ' />';
$form .= '</div>';
$form .= '</form>';
$form .= '<form action="admin.synchronization.php" method="get">';
$form .= '<div style="padding: 10px 2px;">';
$form .= '<h2>' . art_constant("AM_SYNC_ARTICLE") . '</h2>';
$form .= '<input type="hidden" name="type" value="article">';
$form .= art_constant("AM_SYNC_ITEMS") . '<input type="text" name="limit" value="100"> ';
$form .= '<input type="submit" name="submit" value=' . _SUBMIT . ' />';
$form .= '</div>';
$form .= '</form>';
$form .= '<form action="admin.synchronization.php" method="get">';
$form .= '<div style="padding: 10px 2px;">';
$form .= '<h2>' . art_constant("AM_SYNC_MISC") . '</h2>';
$form .= '<input type="hidden" name="type" value="misc">';
$form .= '<input type="submit" name="submit" value=' . _SUBMIT . ' />';
$form .= '</div>';
$form .= '</form>';
$form .= "</fieldset>";
echo $form;
xoops_cp_footer();
示例#30
0
        $print_data["summary"] .= art_constant("MD_KEYWORDS") . ": " . $article_data["keywords"] . "<br /><br />";
    }
    if ($article_data["summary"]) {
        $print_data["summary"] .= art_constant("MD_SUMMARY") . ": " . $article_data["summary"] . "<br /><br />";
    }
    $print_data["content"] = "";
    $print_data["content"] .= $article_data["text"]["body"];
    $print_data["url"] = XOOPS_URL . "/modules/" . $xoopsModule->getVar("dirname") . "/view.article.php" . URL_DELIMITER . "c" . $category_id . "/" . $article_id . "/p" . $page;
}
$print_data["image"] = XOOPS_URL . "/modules/" . $xoopsModule->getVar("dirname") . "/" . $xoopsModule->getInfo('image');
$print_data["module"] = $xoopsModule->getVar("name") . " V" . $xoopsModule->getInfo('version');
header('Content-Type: text/html; charset=' . _CHARSET);
echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>\n";
echo "<html>\n<head>\n";
echo "<title>" . $xoopsConfig['sitename'] . "</title>\n";
echo "<meta http-equiv='Content-Type' content='text/html; charset=" . _CHARSET . "' />\n";
echo "<meta name='AUTHOR' content='" . $myts->htmlspecialchars($xoopsConfig['sitename']) . "' />\n";
echo "<meta name='COPYRIGHT' content='Copyright (c) " . date('Y') . " by " . $xoopsConfig['sitename'] . "' />\n";
echo "<meta name='DESCRIPTION' content='" . $myts->htmlspecialchars($xoopsConfig['slogan']) . "' />\n";
echo "<meta name='GENERATOR' content='" . XOOPS_VERSION . "' />\n";
echo "<style type='text/css'>\r\n            body {\r\n                color:#000000;\r\n                background-color:#EFEFEF;\r\n                font-family: Arial, Helvetica, sans-serif;\r\n                font-size: 12pt;\r\n                margin:10px;\r\n                line-height: 120%;\r\n            }\r\n            a, a:visited, a:active {\r\n                color:#000000;\r\n                text-decoration: none;\r\n            }\r\n            </style>\n";
echo "</head>\n";
echo "<body style='background-color:#ffffff; color:#000000; font-family: Arial' onload='window.print()'>\n" . "<div style='float:center; width: 750px; border: 1px solid #000; padding: 20px;'>\n" . "<div style='text-align: center; display: block; margin: 0 0 6px 0; padding: 5px;'>\n" . "<img src='" . $print_data["image"] . "' border='0' alt='" . $print_data["module"] . "' />\n" . "<h2>" . $print_data["title"] . "</h2>\n" . "</div>\n" . "<div style='margin-top: 12px; margin-bottom: 12px; border-top: 2px solid #ccc;'></div>\n";
if (!empty($print_data["subtitle"])) {
    echo "<div>" . art_constant("MD_CATEGORY") . ": " . $print_data["subtitle"] . "</div>\n";
}
if (!empty($print_data["subsubtitle"])) {
    echo "<div>" . art_constant("MD_SUBTITLE") . ": " . $print_data["subsubtitle"] . "</div>\n";
}
echo "<div>" . art_constant("MD_AUTHOR") . ": " . $print_data["author"] . "</div>\n" . "<div>" . art_constant("MD_DATE") . ": " . $print_data["date"] . "</div>\n" . "<div style='margin-top: 12px; margin-bottom: 12px; border-top: 1px solid #ccc;'></div>\n" . "<div>" . $print_data["summary"] . "</div>\n" . "<div style='margin-top: 12px; margin-bottom: 12px; border-top: 1px solid #ccc;'></div>\n" . "<div>" . $print_data["content"] . "</div>\n" . "<div style='margin-top: 12px; margin-bottom: 12px; border-top: 2px solid #ccc;'></div>\n" . "<div>" . $print_data["module"] . "</div>\n" . "<div>URL: " . $print_data["url"] . "</div>\n" . "</div>\n" . "</body>\n</html>\n";
exit;