本文整理汇总了PHP中art_constant函数的典型用法代码示例。如果您正苦于以下问题:PHP art_constant函数的具体用法?PHP art_constant怎么用?PHP art_constant使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了art_constant函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display_action_form
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: art_admin_getPathStatus
/**
* 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&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&path={$path}>" . art_constant("AM_SETMPERM") . "</a>";
}
return $path_status;
}
示例3: XoopsFormSelectWriter
/**
* 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&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: art_constant
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: loadModuleAdminMenu
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 . "&type=submitted&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: xoops_getmodulehandler
*
* @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 <phppp@users.sourceforge.net>
* @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: art_constant
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: CriteriaCompo
$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: define
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: CriteriaCompo
$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: art_constant
//$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: dirname
* 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 <phppp@users.sourceforge.net>
* @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: array
/*
$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: art_constant
$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: xoops_getmodulehandler
* @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 <phppp@users.sourceforge.net>
* @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();
}