function newbb_load_lang_file($filename, $module = '', $default = 'english') { if (function_exists("xoops_load_lang_file")) { return xoops_load_lang_file($filename, $module, $default); } $lang = $GLOBALS['xoopsConfig']['language']; $path = XOOPS_ROOT_PATH . (empty($module) ? '/' : "/modules/{$module}/") . 'language'; if (!($ret = @(include_once "{$path}/{$lang}/{$filename}.php"))) { $ret = @(include_once "{$path}/{$default}/{$filename}.php"); } return $ret; }
/** * Display tag list * * @var array $tags array of tag string * OR * @var integer $itemid * @var integer $catid * @var integer $modid * * @return array (subject language, array of linked tags) */ function tagBar($tags, $catid = 0, $modid = 0) { static $loaded, $delimiter; if (empty($tags)) { return array(); } if (!isset($loaded)) { include XOOPS_ROOT_PATH . "/modules/tag/include/vars.php"; include_once XOOPS_ROOT_PATH . "/modules/tag/include/functions.php"; tag_define_url_delimiter(); if (!is_object($GLOBALS["xoopsModule"]) || "tag" != $GLOBALS["xoopsModule"]->getVar("dirname")) { if (function_exists("xoops_load_lang_file")) { xoops_load_lang_file("main", "tag"); } else { $path = XOOPS_ROOT_PATH . "/modules/tag/language"; if (!@(include_once "{$path}/{$GLOBALS['xoopsConfig']['language']}/main.php")) { $ret = @(include_once "{$path}/english/main.php"); } } } $loaded = 1; $delimiter = @file_exists(XOOPS_ROOT_PATH . "/modules/tag/images/delimiter.gif") ? "<img src=\"" . XOOPS_URL . "/modules/tag/images/delimiter.gif\" alt=\"\" />" : "<img src=\"" . XOOPS_URL . "/images/pointer.gif\" alt=\"\" />"; } // itemid if (is_numeric($tags)) { if (empty($modid) && is_object($GLOBALS["xoopsModule"])) { $modid = $GLOBALS["xoopsModule"]->getVar("mid"); } $tag_handler =& xoops_getmodulehandler("tag", "tag"); if (!($tags = $tag_handler->getByItem($tags, $modid, $catid))) { return array(); } // if ready, do nothing } elseif (is_array($tags)) { // parse } elseif (!($tags = tag_parse_tag($tags))) { return array(); } $tags_data = array(); foreach ($tags as $tag) { $tags_data[] = "<a href=\"" . XOOPS_URL . "/modules/" . $GLOBALS["xoopsModule"]->getVar("dirname") . "/view.tag.php" . URL_DELIMITER . urlencode($tag) . "\" title=\"" . htmlspecialchars($tag) . "\">" . htmlspecialchars($tag) . "</a>"; } return array("title" => TAG_MD_TAGS, "delimiter" => $delimiter, "tags" => $tags_data); }
/** * Constructor * * @param string $name "name" attribute * @param int $size Size * @param int $maxlength Maximum length of text * @param mixed $value Initial text or itemid * @param int $catid category id (applicable if $value is itemid) */ function XoopsFormTag($name, $size, $maxlength, $value = null, $catid = 0) { include XOOPS_ROOT_PATH . "/modules/tag/include/vars.php"; if (!is_object($GLOBALS["xoopsModule"]) || "tag" != $GLOBALS["xoopsModule"]->getVar("dirname")) { if (function_exists("xoops_load_lang_file")) { xoops_load_lang_file("main", "tag"); } else { $path = XOOPS_ROOT_PATH . "/modules/tag/language"; if (!@(include_once "{$path}/{$GLOBALS['xoopsConfig']['language']}/main.php")) { $ret = @(include_once "{$path}/english/main.php"); } } } // itemid if (!empty($value) && is_numeric($value) && is_object($GLOBALS["xoopsModule"])) { $modid = $GLOBALS["xoopsModule"]->getVar("mid"); $tag_handler =& xoops_getmodulehandler("tag", "tag"); if ($tags = $tag_handler->getByItem($value, $modid, $catid)) { $value = htmlspecialchars(implode(", ", $tags)); } } $caption = TAG_MD_TAGS; $this->XoopsFormText($caption, $name, $size, $maxlength, $value); }
<?php /** * Tag management * * @copyright The XOOPS project http://www.xoops.org/ * @license http://www.fsf.org/copyleft/gpl.html GNU public license * @author Taiwen Jiang (phppp or D.J.) <*****@*****.**> * @since 1.00 * @version $Id$ * @package module::tag */ include dirname(__FILE__) . "/header.php"; if (!is_object($GLOBALS["xoopsModule"]) || "tag" != $GLOBALS["xoopsModule"]->getVar("dirname")) { if (function_exists("xoops_load_lang_file")) { xoops_load_lang_file("main", "tag"); } else { $path = XOOPS_ROOT_PATH . "/modules/tag/language"; if (!@(include_once "{$path}/{$GLOBALS['xoopsConfig']['language']}/main.php")) { $ret = @(include_once "{$path}/english/main.php"); } } } if (tag_parse_args($args_num, $args, $args_str)) { $args["tag"] = !empty($args["tag"]) ? $args["tag"] : @$args_num[0]; $args["term"] = !empty($args["term"]) ? $args["term"] : @$args_str[0]; $args["modid"] = !empty($args["modid"]) ? $args["modid"] : @$args_num[1]; $args["catid"] = !empty($args["catid"]) ? $args["catid"] : @$args_num[2]; $args["start"] = !empty($args["start"]) ? $args["start"] : @$args_num[3]; } $tag_id = intval(empty($_GET["tag"]) ? @$args["tag"] : $_GET["tag"]);
* Tag management * * @copyright The XOOPS project http://www.xoops.org/ * @license http://www.fsf.org/copyleft/gpl.html GNU public license * @author Taiwen Jiang (phppp or D.J.) <*****@*****.**> * @since 1.00 * @version $Id$ * @package module::tag */ if (!defined('XOOPS_ROOT_PATH')) { exit; } include XOOPS_ROOT_PATH . "/modules/tag/include/vars.php"; include_once XOOPS_ROOT_PATH . "/modules/tag/include/functions.php"; if (function_exists("xoops_load_lang_file")) { xoops_load_lang_file("blocks", "tag"); } else { $path = XOOPS_ROOT_PATH . "/modules/tag/language"; $language = preg_replace("/[^a-z0-9_\\-]/i", "", $GLOBALS['xoopsConfig']['language']); if (!@(include_once "{$path}/{$language}/blocks.php")) { $ret = @(include_once "{$path}/english/blocks.php"); } } /**#@+ * Function to display tag cloud * * Developer guide: * <ul> * <li>Build your tag_block_cloud_show function, for example newbb_block_tag_cloud_show;</li> * <li>Call the tag_block_cloud_show in your defined block function:<br /> * <code>
function forum_load_lang_file( $filename, $module = '', $default = 'english' ) { if(function_exists("xoops_load_lang_file")){ return xoops_load_lang_file($filename, $module, $default); } $lang = $GLOBALS['xoopsConfig']['language']; $path = XOOPS_ROOT_PATH . ( empty($module) ? '/' : "/modules/$module/" ) . 'language'; if ( !( $ret = @include_once( "$path/$lang/$filename.php" ) ) ) { $ret = @include_once( "$path/$default/$filename.php" ); } return $ret; }
/** * Load the module info for this module * * @param string $dirname Module directory * @param bool $verbose Give an error on fail? */ function loadInfo($dirname, $verbose = true) { global $xoopsConfig; xoops_load_lang_file('modinfo', $dirname); if (file_exists(XOOPS_ROOT_PATH . '/modules/' . $dirname . '/xoops_version.php')) { include XOOPS_ROOT_PATH . '/modules/' . $dirname . '/xoops_version.php'; } else { if (false != $verbose) { echo "Module File for {$dirname} Not Found!"; } return; } $this->modinfo = $modversion; unset($modversion); }