⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 functions.ini.php

📁 php 开发的内容管理系统
💻 PHP
字号:
<?php
// $Id: functions.php,v 1.1.1.1 2005/11/10 19:51:18 phppp Exp $
// ------------------------------------------------------------------------ //
// This program is free software; you can redistribute it and/or modify     //
// it under the terms of the GNU General Public License as published by     //
// the Free Software Foundation; either version 2 of the License, or        //
// (at your option) any later version.                                      //
//                                                                          //
// 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.  See the            //
// GNU General Public License for more details.                             //
//                                                                          //
// You should have received a copy of the GNU General Public License        //
// along with this program; if not, write to the Free Software              //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
// ------------------------------------------------------------------------ //
// Author: phppp (D.J., infomax@gmail.com)                                  //
// URL: http://xoopsforge.com, http://xoops.org.cn                          //
// Project: Article Project                                                 //
// ------------------------------------------------------------------------ //

/*

The functions loaded on initializtion
*/

if (!defined('XOOPS_ROOT_PATH')){ exit(); }
if (!defined('ARTICLE_INI')){ exit(); }

if(!defined("ART_FUNCTIONS_INI")):
define("ART_FUNCTIONS_INI", 1);

function art_constant($name)
{
	if(defined($GLOBALS["ART_VAR_PREFIXU"]."_".strtoupper($name))){
		return CONSTANT($GLOBALS["ART_VAR_PREFIXU"]."_".strtoupper($name));
	}else{
		return strtolower($name);
	}
}

function art_DB_prefix($name, $isRel = false)
{
	$relative_name = $GLOBALS["ART_DB_PREFIX"]."_".$name;
	if($isRel) return $relative_name;
	return $GLOBALS["xoopsDB"]->prefix($relative_name);
}

function art_load_object()
{
	if(class_exists("ArtObject")) return;
	if(!defined("XOOPS_PATH") || !@include_once(XOOPS_PATH."/Frameworks/art/object.php")){
		include_once(XOOPS_ROOT_PATH."/Frameworks/art/object.php");
	}
}

function art_load_config()
{
	static $moduleConfig;
	if(isset($moduleConfig[$GLOBALS["artdirname"]])){
		return $moduleConfig[$GLOBALS["artdirname"]];
	}
	
    if(isset($GLOBALS["xoopsModule"]) && is_object($GLOBALS["xoopsModule"]) && $GLOBALS["xoopsModule"]->getVar("dirname", "n") == $GLOBALS["artdirname"]){
	    if(!empty($GLOBALS["xoopsModuleConfig"])) {
		    $moduleConfig[$GLOBALS["artdirname"]] =& $GLOBALS["xoopsModuleConfig"];
	    }else{
		    return null;
	    }
    }else{
		$module_handler =& xoops_gethandler('module');
		$module = $module_handler->getByDirname($GLOBALS["artdirname"]);
	
	    $config_handler =& xoops_gethandler('config');
	    $criteria = new CriteriaCompo(new Criteria('conf_modid', $module->getVar('mid')));
	    $configs =& $config_handler->getConfigs($criteria);
	    foreach(array_keys($configs) as $i){
		    $moduleConfig[$GLOBALS["artdirname"]][$configs[$i]->getVar('conf_name')] = $configs[$i]->getConfValueForOutput();
	    }
	    unset($configs);
    }
	if($customConfig = @include(XOOPS_ROOT_PATH."/modules/".$GLOBALS["artdirname"]."/include/plugin.php")){
		$moduleConfig[$GLOBALS["artdirname"]] = array_merge($moduleConfig[$GLOBALS["artdirname"]], $customConfig);
	}
    return $moduleConfig[$GLOBALS["artdirname"]];
}

function art_define_url_delimiter()
{
	if(defined("URL_DELIMITER")){
		if(!in_array(URL_DELIMITER, array("?","/"))) die("Exit on security");
	}else{
		$moduleConfig = art_load_config();
		if(empty($moduleConfig["do_urw"])){
			define("URL_DELIMITER", "?");
		}else{
			define("URL_DELIMITER", "/");
		}
	}
}
endif;
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -