*/ include_once "header.php"; include_once XOOPS_ROOT_PATH . '/class/template.php'; if (function_exists('mb_http_output')) { mb_http_output('pass'); } $categoryid = isset($_GET['categoryid']) ? $_GET['categoryid'] : -1; if ($categoryid != -1) { $categoryObj = $smartsection_category_handler->get($categoryid); } header('Content-Type:text/xml; charset=utf-8'); $tpl = new XoopsTpl(); $tpl->xoops_setCaching(2); $tpl->xoops_setCacheTime(0); $myts = MyTextSanitizer::getInstance(); if (!$tpl->is_cached('db:smartsection_rss.html')) { $channel_category = $xoopsModule->name(); // Check if ML Hack is installed, and if yes, parse the $content in formatForML if (method_exists($myts, 'formatForML')) { $xoopsConfig['sitename'] = $myts->formatForML($xoopsConfig['sitename']); $xoopsConfig['slogan'] = $myts->formatForML($xoopsConfig['slogan']); $channel_category = $myts->formatForML($channel_category); } $tpl->assign('channel_title', xoops_utf8_encode(htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES))); $tpl->assign('channel_link', SMARTSECTION_URL); $tpl->assign('channel_desc', xoops_utf8_encode(htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES))); $tpl->assign('channel_lastbuild', formatTimestamp(time(), 'rss')); $tpl->assign('channel_webmaster', $xoopsConfig['adminmail']); $tpl->assign('channel_editor', $xoopsConfig['adminmail']); if ($categoryid != -1) { $channel_category .= " > " . $categoryObj->name();
if ($topicid == 0) { exit; } if (function_exists('mb_http_output')) { mb_http_output('pass'); } $restricted = news_getmoduleoption('restrictindex'); $newsnumber = news_getmoduleoption('storyhome'); $charset = 'utf-8'; header('Content-Type:text/xml; charset=' . $charset); $story = new NewsStory(); $tpl = new XoopsTpl(); $tpl->xoops_setCaching(2); $tpl->xoops_setCacheTime(3600); // Change this to the value you want if (!$tpl->is_cached('db:news_rss.html', $topicid)) { $xt = new NewsTopic($topicid); $sarray = $story->getAllPublished($newsnumber, 0, $restricted, $topicid); if (is_array($sarray) && count($sarray) > 0) { $sitename = htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES); $slogan = htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES); $tpl->assign('channel_title', xoops_utf8_encode($sitename)); $tpl->assign('channel_link', XOOPS_URL . '/'); $tpl->assign('channel_desc', xoops_utf8_encode($slogan)); $tpl->assign('channel_lastbuild', formatTimestamp(time(), 'rss')); $tpl->assign('channel_webmaster', checkEmail($xoopsConfig['adminmail'], true)); // Fed up with spam $tpl->assign('channel_editor', checkEmail($xoopsConfig['adminmail'], true)); // Fed up with spam $tpl->assign('channel_category', htmlspecialchars($xt->topic_title(), ENT_QUOTES)); $tpl->assign('channel_generator', 'XOOPS');
function myblocksadmin_update_block($bid, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $bmodule, $options = array()) { global $xoopsConfig; if (empty($bmodule)) { xoops_cp_header(); xoops_error(sprintf(_AM_NOTSELNG, _AM_VISIBLEIN)); xoops_cp_footer(); exit; } $myblock = new XoopsBlock($bid); // $myblock->setVar('side', $bside); GIJ - if ($bside >= 0) { $myblock->setVar('side', $bside); } // GIJ + $myblock->setVar('weight', $bweight); $myblock->setVar('visible', $bvisible); $myblock->setVar('title', $btitle); $myblock->setVar('content', $bcontent); $myblock->setVar('bcachetime', $bcachetime); if (isset($options) && count($options) > 0) { $options = implode('|', $options); $myblock->setVar('options', $options); } if ($myblock->getVar('block_type') == 'C') { switch ($bctype) { case 'H': $name = _AM_CUSTOMHTML; break; case 'P': $name = _AM_CUSTOMPHP; break; case 'S': $name = _AM_CUSTOMSMILE; break; default: $name = _AM_CUSTOMNOSMILE; break; } $myblock->setVar('name', $name); $myblock->setVar('c_type', $bctype); } else { $myblock->setVar('c_type', 'H'); } $msg = _AM_DBUPDATED; if ($myblock->store() != false) { $db =& Database::getInstance(); $sql = sprintf("DELETE FROM %s WHERE block_id = %u", $db->prefix('block_module_link'), $bid); $db->query($sql); foreach ($bmodule as $bmid) { $sql = sprintf("INSERT INTO %s (block_id, module_id) VALUES (%u, %d)", $db->prefix('block_module_link'), $bid, intval($bmid)); $db->query($sql); } include_once XOOPS_ROOT_PATH . '/class/template.php'; $xoopsTpl = new XoopsTpl(); $xoopsTpl->xoops_setCaching(2); if ($myblock->getVar('template') != '') { if ($xoopsTpl->is_cached('db:' . $myblock->getVar('template'))) { if (!$xoopsTpl->clear_cache('db:' . $myblock->getVar('template'))) { $msg = 'Unable to clear cache for block ID' . $bid; } } } else { if ($xoopsTpl->is_cached('db:system_dummy.html', 'block' . $bid)) { if (!$xoopsTpl->clear_cache('db:system_dummy.html', 'block' . $bid)) { $msg = 'Unable to clear cache for block ID' . $bid; } } } } else { $msg = 'Failed update of block. ID:' . $bid; } // redirect_header('admin.php?fct=blocksadmin&t='.time(),1,$msg); // exit(); GIJ - return $msg; // GIJ + }
include '../../mainfile.php'; include_once XOOPS_ROOT_PATH . '/class/template.php'; $eventHandler = xoops_getmodulehandler('event', 'extcal'); if (!isset($_GET['cat'])) { $cat = 0; } else { $cat = intval($_GET['cat']); } if (function_exists('mb_http_output')) { mb_http_output('pass'); } header('Content-Type:text/xml; charset=utf-8'); $tpl = new XoopsTpl(); $tpl->xoops_setCaching(0); $tpl->xoops_setCacheTime($xoopsModuleConfig['rss_cache_time'] * 60); if (!$tpl->is_cached('db:extcal_rss.html', $cat)) { $events = $eventHandler->getUpcommingEvent($xoopsModuleConfig['rss_nb_event'], $cat); if (is_array($events)) { $tpl->assign('channel_title', xoops_utf8_encode(htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES))); $tpl->assign('channel_link', XOOPS_URL . '/'); $tpl->assign('channel_desc', xoops_utf8_encode(htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES))); $tpl->assign('channel_lastbuild', formatTimestamp(time(), 'rss')); $tpl->assign('channel_webmaster', $xoopsConfig['adminmail']); $tpl->assign('channel_editor', $xoopsConfig['adminmail']); $tpl->assign('channel_category', 'Event'); $tpl->assign('channel_generator', 'XOOPS'); $tpl->assign('channel_language', _LANGCODE); $tpl->assign('image_url', XOOPS_URL . '/modules/extcal/images/extcal_logo.png'); $tpl->assign('image_width', 92); $tpl->assign('image_height', 52); foreach ($events as $event) {
function plugin_xoopsblock_convert() { if ($this->root->module['platform'] !== "xoops") { return ''; } static $css_show = FALSE; list($tgt, $option1, $option2) = array_pad(func_get_args(), 3, ""); $tgt_bids = array(); if (!$tgt || $tgt === "?") { $tgt = "?"; } else { foreach (explode(",", $tgt) as $_bid) { if (preg_match("/^\\d+\$/", $_bid) && $_bid > 0) { $tgt_bids[] = $_bid; } } } $align = "left"; $around = false; $width = ""; $arg = array(); if (preg_match("/^(left|center|right)\$/i", $option2, $arg)) { $align = $arg[1]; } if (preg_match("/^(left|center|right)\$/i", $option1, $arg)) { $align = $arg[1]; } if (preg_match("/^(around|float|width)(:?w?([\\d]+%?)(?:px)?)?\$/i", $option2, $arg)) { if ($arg[1]) { $around = true; } $width = !strstr($arg[3], "%") ? $arg[3] . "px" : $arg[3]; $width = "width:" . $width . ";"; } if (preg_match("/^(around|float|width)(:?w?([\\d]+%?)(?:px)?)?\$/i", $option1, $arg)) { if ($arg[1]) { $around = true; } $width = !strstr($arg[3], "%") ? $arg[3] . "px" : $arg[3]; $width = "width:" . $width . ";"; } if ($align === 'center') { if (!$width) { $width = 'width:auto;'; } $style = ' style="margin-left:auto;margin-right:auto;' . $width . '"'; $around = false; } else { $style = ' style="float:' . $align . ';' . $width . '"'; } $clear = $around ? '' : '<div style="clear:both;"></div>'; global $xoopsUser; $xoopsblock = new XoopsBlock(); $xoopsgroup = new XoopsGroup(); $arr = array(); $side = null; if ($this->root->userinfo['admin']) { $arr = $xoopsblock->getAllBlocks(); } else { if ($xoopsUser) { $arr = $xoopsblock->getAllBlocksByGroup($xoopsUser->groups()); } else { $arr = $xoopsblock->getAllBlocksByGroup($this->plugin_xoopsblock_getByType("Anonymous")); } } $ret = ""; if ($tgt == "?") { foreach ($arr as $myblock) { $block = array(); $block_type = @$myblock->getVar("type") ? $myblock->getVar("type") : $myblock->getVar("block_type"); $name = @$myblock->getVar("title") ? $myblock->getVar("title") : $myblock->getVar("name"); $bid = $myblock->getVar('bid'); $ret .= "<li>(" . $bid . ")" . $name . "</li>"; } } else { global $xoopsTpl; require_once XOOPS_ROOT_PATH . '/class/template.php'; $xoopsTpl = new XoopsTpl(); if (is_object($xoopsUser)) { $xoopsTpl->assign(array('xoops_isuser' => true, 'xoops_userid' => $xoopsUser->getVar('uid'), 'xoops_uname' => $xoopsUser->getVar('uname'), 'xoops_isadmin' => $xoopsUser->isAdmin())); } $xoopsTpl->assign('xoops_requesturi', htmlspecialchars($GLOBALS['xoopsRequestUri'], ENT_QUOTES)); foreach ($tgt_bids as $bid) { $myblock = new XoopsBlock($bid); $_bid = $myblock->getVar('bid'); if (!empty($_bid)) { $bcachetime = $myblock->getVar('bcachetime'); // Only a guest enable cache. by nao-pon //if (empty($bcachetime)) { if ($bcachetime % 10 == 1) { $bcachetime_guest = TRUE; $bcachetime = $bcachetime - 1; } else { $bcachetime_guest = FALSE; } if (empty($bcachetime) || is_object($xoopsUser) && $bcachetime_guest) { //if (empty($bcachetime)) { $xoopsTpl->xoops_setCaching(0); } else { $xoopsTpl->xoops_setCaching(2); $xoopsTpl->xoops_setCacheTime($bcachetime); } $btpl = $myblock->getVar('template'); if ($btpl != '') { if (empty($bcachetime) || !$xoopsTpl->is_cached('db:' . $btpl, 'blk_' . $myblock->getVar('bid'))) { //$xoopsLogger->addBlock($myblock->getVar('name')); $bresult = $myblock->buildBlock(); if (!$bresult) { continue; } $xoopsTpl->assign_by_ref('block', $bresult); $bcontent = $xoopsTpl->fetch('db:' . $btpl, 'blk_' . $myblock->getVar('bid')); $xoopsTpl->clear_assign('block'); } else { //$xoopsLogger->addBlock($myblock->getVar('name'), true, $bcachetime); $bcontent = $xoopsTpl->fetch('db:' . $btpl, 'blk_' . $myblock->getVar('bid')); } } else { //$bid = $myblock->getVar('bid'); if (empty($bcachetime) || !$xoopsTpl->is_cached('db:system_dummy.html', 'blk_' . $bid)) { //$xoopsLogger->addBlock($myblock->getVar('name')); $bresult = $myblock->buildBlock(); if (!$bresult) { continue; } $xoopsTpl->assign_by_ref('dummy_content', $bresult['content']); $bcontent = $xoopsTpl->fetch('db:system_dummy.html', 'blk_' . $bid); $xoopsTpl->clear_assign('block'); } else { //$xoopsLogger->addBlock($myblock->getVar('name'), true, $bcachetime); $bcontent = $xoopsTpl->fetch('db:system_dummy.html', 'blk_' . $bid); } } $btitle = $myblock->getVar('title'); } else { $btitle = "Block({$bid})"; $bcontent = "Block({$bid}) is not found."; } if ($bcontent) { $ret .= "<h5>" . $btitle . "</h5>\n"; $ret .= $bcontent; foreach (explode("\n", $xoopsTpl->get_template_vars('xoops_block_header')) as $str) { $this->root->head_tags[] = rtrim($str); } foreach (explode("\n", $xoopsTpl->get_template_vars('xoops_module_header')) as $str) { $this->root->head_tags[] = rtrim($str); } $this->root->head_tags = array_unique($this->root->head_tags); } } unset($myblock); } if (!$css_show) { $css_show = true; $this->root->head_pre_tags[] = "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"" . XOOPS_URL . "/xoops.css\" />"; } if ($tgt == "?") { $ret = "<ul>{$ret}</ul>"; } unset($xoopsblock, $xoopsgroup); return "<div{$style}>{$ret}</div>{$clear}"; }
function update_block($bid, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $bmodule, $options = array(), $bgroups = array()) { global $xoopsConfig; if (empty($bmodule)) { xoops_cp_header(); xoops_error(sprintf(_AM_NOTSELNG, _AM_VISIBLEIN)); xoops_cp_footer(); exit; } $myblock = new XoopsBlock($bid); $myblock->setVar('side', $bside); $myblock->setVar('weight', $bweight); $myblock->setVar('visible', $bvisible); $myblock->setVar('title', $btitle); $myblock->setVar('content', $bcontent); $myblock->setVar('bcachetime', $bcachetime); if (isset($options)) { $options_count = count($options); if ($options_count > 0) { //Convert array values to comma-separated for ($i = 0; $i < $options_count; $i++) { if (is_array($options[$i])) { $options[$i] = implode(',', $options[$i]); } } $options = implode('|', $options); $myblock->setVar('options', $options); } } if ($myblock->isCustom()) { switch ($bctype) { case 'H': $name = _AM_CUSTOMHTML; break; case 'P': $name = _AM_CUSTOMPHP; break; case 'S': $name = _AM_CUSTOMSMILE; break; default: $name = _AM_CUSTOMNOSMILE; break; } $myblock->setVar('name', $name); $myblock->setVar('c_type', $bctype); } else { $myblock->setVar('c_type', 'H'); } $msg = _AM_DBUPDATED; if ($myblock->store() != false) { $db =& Database::getInstance(); $sql = sprintf("DELETE FROM %s WHERE block_id = %u", $db->prefix('block_module_link'), $bid); $db->query($sql); foreach ($bmodule as $bmid) { $sql = sprintf("INSERT INTO %s (block_id, module_id) VALUES (%u, %d)", $db->prefix('block_module_link'), $bid, intval($bmid)); $db->query($sql); } include_once XOOPS_ROOT_PATH . '/class/template.php'; $xoopsTpl = new XoopsTpl(); $xoopsTpl->xoops_setCaching(2); if ($myblock->getVar('template') != '') { if ($xoopsTpl->is_cached('db:' . $myblock->getVar('template'), 'blk_' . $myblock->getVar('bid'))) { if (!$xoopsTpl->clear_cache('db:' . $myblock->getVar('template'), 'blk_' . $myblock->getVar('bid'))) { $msg = 'Unable to clear cache for block ID ' . $bid; } } } else { if ($xoopsTpl->is_cached('db:system_dummy.html', 'blk_' . $bid)) { if (!$xoopsTpl->clear_cache('db:system_dummy.html', 'blk_' . $bid)) { $msg = 'Unable to clear cache for block ID ' . $bid; } } } $groupperm_handler =& xoops_gethandler('groupperm'); $groups_with_access =& $groupperm_handler->getGroupIds("block_read", $bid); $removed_groups = array_diff($groups_with_access, $bgroups); if (count($removed_groups) > 0) { foreach ($removed_groups as $groupid) { $criteria = new CriteriaCompo(new Criteria('gperm_name', 'block_read')); $criteria->add(new Criteria('gperm_groupid', $groupid)); $criteria->add(new Criteria('gperm_itemid', $bid)); $criteria->add(new Criteria('gperm_modid', 1)); $perm = $groupperm_handler->getObjects($criteria); if (isset($perm[0]) && is_object($perm[0])) { $groupperm_handler->delete($perm[0]); } } } $new_groups = array_diff($bgroups, $groups_with_access); if (count($new_groups) > 0) { foreach ($new_groups as $groupid) { $groupperm_handler->addRight("block_read", $bid, $groupid); } } } else { $msg = 'Failed update of block. ID:' . $bid; } redirect_header('admin.php?fct=blocksadmin&t=' . time(), 1, $msg); exit; }
if (myshop_utils::getModuleOption('use_rss') == 0) { exit; } // Last cat_cid $cat_cid = isset($_GET['cat_cid']) ? intval($_GET['cat_cid']) : 0; if (function_exists('mb_http_output')) { mb_http_output('pass'); } $charset = 'utf-8'; header('Content-Type:text/xml; charset=' . $charset); $tpl = new XoopsTpl(); $tpl->xoops_setCaching(2); // 1 = Global Cache, 2 = Individual Cache (by template) $tpl->xoops_setCacheTime(MYSHOP_RSS_CACHE); // Time cache in seconds if (!$tpl->is_cached('db:myshop_rss.html', $cat_cid)) { $categoryTitle = ''; if (!empty($cat_cid)) { $category = null; $category = $h_myshop_cat->get($cat_cid); if (is_object($category)) { $categoryTitle = $category->getVar('cat_title'); } } $sitename = htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES); $email = checkEmail($xoopsConfig['adminmail'], true); $slogan = htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES); $limit = myshop_utils::getModuleOption('perpage'); $tpl->assign('charset', $charset); $tpl->assign('channel_title', xoops_utf8_encode($sitename)); $tpl->assign('channel_link', XOOPS_URL . '/');
function make_cblock() { global $xoopsUser, $xoopsOption; $xoopsblock = new XoopsBlock(); $cc_block = $cl_block = $cr_block = ""; $arr = array(); if ($xoopsOption['theme_use_smarty'] == 0) { if (!isset($GLOBALS['xoopsTpl']) || !is_object($GLOBALS['xoopsTpl'])) { include_once XOOPS_ROOT_PATH . '/class/template.php'; $xoopsTpl = new XoopsTpl(); } else { $xoopsTpl =& $GLOBALS['xoopsTpl']; } if (is_object($xoopsUser)) { $block_arr = $xoopsblock->getAllBlocksByGroup($xoopsUser->getGroups(), true, XOOPS_CENTERBLOCK_ALL, XOOPS_BLOCK_VISIBLE); } else { $block_arr = $xoopsblock->getAllBlocksByGroup(XOOPS_GROUP_ANONYMOUS, true, XOOPS_CENTERBLOCK_ALL, XOOPS_BLOCK_VISIBLE); } $block_count = count($block_arr); $xoopsLogger =& XoopsLogger::instance(); for ($i = 0; $i < $block_count; $i++) { $bcachetime = intval($block_arr[$i]->getVar('bcachetime')); if (empty($bcachetime)) { $xoopsTpl->xoops_setCaching(0); } else { $xoopsTpl->xoops_setCaching(2); $xoopsTpl->xoops_setCacheTime($bcachetime); } $btpl = $block_arr[$i]->getVar('template'); if ($btpl != '') { if (empty($bcachetime) || !$xoopsTpl->is_cached('db:' . $btpl)) { $xoopsLogger->addBlock($block_arr[$i]->getVar('name')); $bresult =& $block_arr[$i]->buildBlock(); if (!$bresult) { continue; } $xoopsTpl->assign_by_ref('block', $bresult); $bcontent =& $xoopsTpl->fetch('db:' . $btpl); $xoopsTpl->clear_assign('block'); } else { $xoopsLogger->addBlock($block_arr[$i]->getVar('name'), true, $bcachetime); $bcontent =& $xoopsTpl->fetch('db:' . $btpl); } } else { $bid = $block_arr[$i]->getVar('bid'); if (empty($bcachetime) || !$xoopsTpl->is_cached('db:system_dummy.html', 'blk_' . $bid)) { $xoopsLogger->addBlock($block_arr[$i]->getVar('name')); $bresult =& $block_arr[$i]->buildBlock(); if (!$bresult) { continue; } $xoopsTpl->assign_by_ref('dummy_content', $bresult['content']); $bcontent =& $xoopsTpl->fetch('db:system_dummy.html', 'blk_' . $bid); $xoopsTpl->clear_assign('block'); } else { $xoopsLogger->addBlock($block_arr[$i]->getVar('name'), true, $bcachetime); $bcontent =& $xoopsTpl->fetch('db:system_dummy.html', 'blk_' . $bid); } } $title = $block_arr[$i]->getVar('title'); switch ($block_arr[$i]->getVar('side')) { case XOOPS_CENTERBLOCK_CENTER: if ($title != "") { $cc_block .= '<tr valign="top"><td colspan="2"><strong>' . $title . '</strong><hr />' . $bcontent . '<br /><br /></td></tr>' . "\n"; } else { $cc_block .= '<tr><td colspan="2">' . $bcontent . '<br /><br /></td></tr>' . "\n"; } break; case XOOPS_CENTERBLOCK_LEFT: if ($title != "") { $cl_block .= '<p><strong>' . $title . '</strong><hr />' . $bcontent . '</p>' . "\n"; } else { $cl_block .= '<p>' . $bcontent . '</p>' . "\n"; } break; case XOOPS_CENTERBLOCK_RIGHT: if ($title != "") { $cr_block .= '<p><strong>' . $title . '</strong><hr />' . $bcontent . '</p>' . "\n"; } else { $cr_block .= '<p>' . $bcontent . '</p>' . "\n"; } break; default: break; } unset($bcontent, $title); } echo '<table width="100%">' . $cc_block . '<tr valign="top"><td width="50%">' . $cl_block . '</td><td width="50%">' . $cr_block . '</td></tr></table>' . "\n"; } }
error_reporting(0); $GLOBALS['xoopsLogger']->activated = false; include_once XOOPS_ROOT_PATH . '/class/template.php'; if (function_exists('mb_http_output')) { mb_http_output('pass'); } $categoryid = isset($_GET['categoryid']) ? $_GET['categoryid'] : -1; if ($categoryid != -1) { $categoryObj = $publisher->getHandler('category')->get($categoryid); } header('Content-Type:text/xml; charset=' . _CHARSET); $tpl = new XoopsTpl(); $tpl->xoops_setCaching(2); $tpl->xoops_setCacheTime(0); $myts = MyTextSanitizer::getInstance(); if (!$tpl->is_cached('db:publisher_rss.html')) { $channel_category = $publisher->getModule()->name(); // Check if ML Hack is installed, and if yes, parse the $content in formatForML if (method_exists($myts, 'formatForML')) { $xoopsConfig['sitename'] = $myts->formatForML($xoopsConfig['sitename']); $xoopsConfig['slogan'] = $myts->formatForML($xoopsConfig['slogan']); $channel_category = $myts->formatForML($channel_category); } $tpl->assign('channel_charset', _CHARSET); $tpl->assign('channel_title', htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)); $tpl->assign('channel_link', PUBLISHER_URL); $tpl->assign('channel_desc', htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES)); $tpl->assign('channel_lastbuild', XoopsLocal::formatTimestamp(time(), 'rss')); $tpl->assign('channel_webmaster', $xoopsConfig['adminmail']); $tpl->assign('channel_editor', $xoopsConfig['adminmail']); if ($categoryid != -1) {
$new_array = mylinks_get_new($param_array); // logo image $logo = 'images/logo.gif'; $template = XOOPS_ROOT_PATH . "/modules/{$modulename}/templates/mylinks_rss.html"; $RSS_DESC_MAX = 1000; // rss output if (function_exists('mb_http_output')) { mb_http_output('pass'); } header('Content-Type:text/xml; charset=utf-8'); $tpl = new XoopsTpl(); if ($cache) { $tpl->xoops_setCaching(2); $tpl->xoops_setCacheTime(3600); } if (!$tpl->is_cached('file:' . $template) || !$cache) { if (count($new_array) > 0) { $tpl->assign('channel_title', wani_utf8_encode(htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES))); $tpl->assign('channel_link', XOOPS_URL . '/'); $tpl->assign('channel_desc', wani_utf8_encode(htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES))); $tpl->assign('channel_lastbuild', wani_utf8_encode(date("r"))); $tpl->assign('channel_webmaster', $xoopsConfig['adminmail']); $tpl->assign('channel_editor', $xoopsConfig['adminmail']); $tpl->assign('channel_category', 'New Contents of Mylinks'); $tpl->assign('channel_generator', XOOPS_VERSION); $tpl->assign('channel_language', _LANGCODE); $tpl->assign('image_url', XOOPS_URL . "/{$logo}"); $tpl->assign('channel_pubdate', wani_utf8_encode(date("r"))); $tpl->assign('channel_copyright', 'wanisys'); $dimention = getimagesize(XOOPS_ROOT_PATH . "/{$logo}"); $width = empty($dimention[0]) ? 88 : $dimention[0] > 144 ? 144 : $dimention[0];
} $adminmenublock_exists = false; foreach (array_keys($block_arr) as $i) { if ($block_arr[$i]->getVar('show_func') == 'b_altsys_admin_menu_show') { $adminmenublock_exists = true; } $bcachetime = $block_arr[$i]->getVar('bcachetime'); if (empty($bcachetime)) { $xoopsTpl->xoops_setCaching(0); } else { $xoopsTpl->xoops_setCaching(2); $xoopsTpl->xoops_setCacheTime($bcachetime); } $btpl = $block_arr[$i]->getVar('template'); if ($btpl != '') { if (empty($bcachetime) || !$xoopsTpl->is_cached('db:' . $btpl, 'blk_' . $block_arr[$i]->getVar('bid'))) { $xoopsLogger->addBlock($block_arr[$i]->getVar('name')); $bresult = $block_arr[$i]->buildBlock(); if (!$bresult) { continue; } $xoopsTpl->assign_by_ref('block', $bresult); $bcontent = $xoopsTpl->fetch('db:' . $btpl, 'blk_' . $block_arr[$i]->getVar('bid')); $xoopsTpl->clear_assign('block'); } else { $xoopsLogger->addBlock($block_arr[$i]->getVar('name'), true, $bcachetime); $bcontent = $xoopsTpl->fetch('db:' . $btpl, 'blk_' . $block_arr[$i]->getVar('bid')); } } else { $bid = $block_arr[$i]->getVar('bid'); if (empty($bcachetime) || !$xoopsTpl->is_cached('db:system_dummy.html', 'blk_' . $bid)) {
$myblock->setVar('c_type', 'H'); } $msg = _AM_DBUPDATED; if ($myblock->store() != false) { $db =& Database::getInstance(); $sql = sprintf("DELETE FROM %s WHERE block_id = %u", $db->prefix('block_module_link'), $bid); $db->query($sql); foreach ($_POST['bmodule'] as $bmid) { $sql = sprintf("INSERT INTO %s (block_id, module_id) VALUES (%u, %d)", $db->prefix('block_module_link'), $bid, intval($bmid)); $db->query($sql); } include_once XOOPS_ROOT_PATH . '/class/template.php'; $xoopsTpl = new XoopsTpl(); $xoopsTpl->xoops_setCaching(2); if ($myblock->getVar('template') != '') { if ($xoopsTpl->is_cached('db:' . $myblock->getVar('template'), 'blk_' . $myblock->getVar('bid'))) { if (!$xoopsTpl->clear_cache('db:' . $myblock->getVar('template'), 'blk_' . $myblock->getVar('bid'))) { $msg = 'Unable to clear cache for block ID ' . $bid; } } } else { if ($xoopsTpl->is_cached('db:system_dummy.html', 'blk_' . $bid)) { if (!$xoopsTpl->clear_cache('db:system_dummy.html', 'blk_' . $bid)) { $msg = 'Unable to clear cache for block ID ' . $bid; } } } } else { $msg = 'Failed update of block. ID:' . $bid; } redirect_header('admin.php?fct=blocksadmin&t=' . time(), 1, $msg);
} else { $block_arr =& $xoopsblock->getAllByGroupModule(XOOPS_GROUP_ANONYMOUS, 0, false, XOOPS_BLOCK_VISIBLE); } } } foreach (array_keys($block_arr) as $i) { $bcachetime = $block_arr[$i]->getVar('bcachetime'); if (empty($bcachetime)) { $xoopsTpl->xoops_setCaching(0); } else { $xoopsTpl->xoops_setCaching(2); $xoopsTpl->xoops_setCacheTime($bcachetime); } $btpl = $block_arr[$i]->getVar('template'); if ($btpl != '') { if (empty($bcachetime) || !$xoopsTpl->is_cached('db:' . $btpl)) { $xoopsLogger->addBlock($block_arr[$i]->getVar('name')); $bresult =& $block_arr[$i]->buildBlock(); if (!$bresult) { continue; } $xoopsTpl->assign_by_ref('block', $bresult); $bcontent =& $xoopsTpl->fetch('db:' . $btpl); $xoopsTpl->clear_assign('block'); } else { $xoopsLogger->addBlock($block_arr[$i]->getVar('name'), true, $bcachetime); $bcontent =& $xoopsTpl->fetch('db:' . $btpl); } } else { $bid = $block_arr[$i]->getVar('bid'); if (empty($bcachetime) || !$xoopsTpl->is_cached('db:system_dummy.html', 'blk_' . $bid)) {
$xoopsTpl->assign('xoops_dirname', $xoopsModule->getVar('dirname')); } else { $xoopsTpl->assign('xoops_pagetitle', htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES)); $xoopsTpl->assign('xoops_dirname', "system"); } if (xoops_getenv('REQUEST_METHOD') != 'POST' && !empty($xoopsModule) && !empty($xoopsConfig['module_cache'][$xoopsModule->getVar('mid')])) { $xoopsTpl->xoops_setCaching(2); $xoopsTpl->xoops_setCacheTime($xoopsConfig['module_cache'][$xoopsModule->getVar('mid')]); if (!isset($xoopsOption['template_main'])) { $xoopsCachedTemplate = 'db:system_dummy.html'; } else { $xoopsCachedTemplate = 'db:' . $xoopsOption['template_main']; } // generate safe cache Id $xoopsCachedTemplateId = 'mod_' . $xoopsModule->getVar('dirname') . '|' . md5(str_replace(XOOPS_URL, '', $GLOBALS['xoopsRequestUri'])); if ($xoopsTpl->is_cached($xoopsCachedTemplate, $xoopsCachedTemplateId)) { $xoopsLogger->addExtra($xoopsCachedTemplate, sprintf('Cached (regenerates every %d seconds)', $xoopsConfig['module_cache'][$xoopsModule->getVar('mid')])); $xoopsTpl->assign('xoops_contents', $xoopsTpl->fetch($xoopsCachedTemplate, $xoopsCachedTemplateId)); $xoopsTpl->xoops_setCaching(0); if (!headers_sent()) { header('Content-Type:text/html; charset=' . _CHARSET); } $xoopsTpl->display($xoopsConfig['theme_set'] . '/theme.html'); if ($xoopsConfig['debug_mode'] == 2 && $xoopsUserIsAdmin) { echo '<script type="text/javascript"> <!--// debug_window = openWithSelfMain("", "popup", 680, 450, true); debug_window.document.clear(); '; $content = '<html><head><meta http-equiv="content-type" content="text/html; charset=' . _CHARSET . '" /><meta http-equiv="content-language" content="' . _LANGCODE . '" /><title>' . $xoopsConfig['sitename'] . '</title><link rel="stylesheet" type="text/css" media="all" href="' . getcss($xoopsConfig['theme_set']) . '" /></head><body>' . $xoopsLogger->dumpAll() . '<div style="text-align:center;"><input class="formButton" value="' . _CLOSE . '" type="button" onclick="javascript:window.close();" /></div></body></html>'; $lines = preg_split("/(\r\n|\r|\n)( *)/", $content);
function update_block($bid, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $options = array()) { global $xoopsConfig; $block = new XoopsBlock($bid); if ($bside >= 0) { $block->setVar('side', $bside); } $block->setVar('weight', $bweight); $block->setVar('visible', $bvisible); $block->setVar('title', $btitle); if (isset($bcontent)) { $block->setVar('content', $bcontent); } if (isset($bctype)) { $block->setVar('c_type', $bctype); } $block->setVar('bcachetime', $bcachetime); if (is_array($options) && count($options) > 0) { $block->setVar('options', implode('|', $options)); } if ($block->getVar('block_type') == 'C') { $name = $this->get_blockname_from_ctype($block->getVar('c_type')); $block->setVar('name', $name); } $msg = _MD_A_MYBLOCKSADMIN_DBUPDATED; if ($block->store() != false) { include_once XOOPS_ROOT_PATH . '/class/template.php'; $xoopsTpl = new XoopsTpl(); $xoopsTpl->xoops_setCaching(2); if ($block->getVar('template') != '') { if ($xoopsTpl->is_cached('db:' . $block->getVar('template'))) { if (!$xoopsTpl->clear_cache('db:' . $block->getVar('template'))) { $msg = 'Unable to clear cache for block ID' . $bid; } } } else { if ($xoopsTpl->is_cached('db:system_dummy.html', 'blk_' . $bid)) { if (!$xoopsTpl->clear_cache('db:system_dummy.html', 'blk_' . $bid)) { $msg = 'Unable to clear cache for block ID' . $bid; } } } } else { $msg = 'Failed update of block. ID:' . $bid; } return $msg; }
return $text; } } $tpl = new XoopsTpl(); $xoopsConfig['generator'] = $mydirname . ' ' . $xoopsModule->getVar('version'); $tpl->assign('config', $xoopsConfig); $tpl->assign('builddate', formatTimestamp(time(), 'rss')); if (preg_match('/(iPod|iTunes)/', $name)) { $cache_id = "{$mydirname}/track.php?lid={$lid}"; header("Content-Type: text/xml; charset=UTF-8"); header("Content-Disposition:attachment;filename=\"{$mydirname}.xml\""); header("Cache-Control: public"); header("Pragma: public"); $tpl->xoops_setCaching(2); $tpl->xoops_setCacheTime(3600); if (true || !$tpl->is_cached('db:medialinks_rss.xml', $cache_id)) { include_once 'functions.php'; $content = new MediaContent($mid); $tpl->assign('pubdate', formatTimestamp($content->getVar('mtime'), 'rss')); $item = $content->dispVars(); $item['url'] = $url; $item['item_title'] = htmlspecialchars($name); if (preg_match('/\\.mov$/i', $url)) { $type = 'video/quicktime'; } elseif (preg_match('/\\.(m4v|mp4)$/i', $url)) { $type = 'video/mp4'; } elseif (preg_match('/\\.(wmv|avi)$/i', $url)) { $type = 'video/x-msvideo'; } $item['mimetype'] = $type; $item['pubdate'] = formatTimestamp($content->getVar('mtime'), 'rss');
$myuid = empty($xoopsUser) ? 0 : $xoopsUser->getVar("uid"); $isAuthor = $article_obj->isNew() || $myuid == $article_obj->getVar("uid"); $isAdmin = $category_handler->getPermission($category_obj, "moderate"); if ($isAuthor || $isAdmin && $article_handler->getCategoryStatus($category_id, $article_id) !== NULL) { } elseif (empty($category_id) || !$category_handler->getPermission($category_obj, "view") || !$article_obj->getVar("art_time_publish")) { art_trackback_response(1, art_constant("MD_NOACCESS")); } } $xml_charset = empty($xoopsModuleConfig["do_rssutf8"]) ? _CHARSET : "UTF-8"; include_once XOOPS_ROOT_PATH . '/class/template.php'; $tpl = new XoopsTpl(); $tpl->caching = 2; $tpl->cache_lifetime = 3600; load_functions("cache"); $xoopsCachedTemplateId = md5(mod_generateCacheId() . str_replace(XOOPS_URL, '', $_SERVER['REQUEST_URI'])); if (!$tpl->is_cached('db:system_dummy.html', $xoopsCachedTemplateId)) { if (!empty($article_id)) { $source = "article"; } elseif (!empty($category_id)) { $source = "category"; } elseif (!empty($uid)) { $source = "author"; } else { $source = "index"; } $items = array(); switch ($source) { case "article": $category_id = empty($category_id) ? $article_obj->getVar("cat_id") : $category_id; $category_obj =& $category_handler->get($category_id); if (empty($category_obj) || !$category_handler->getPermission($category_obj, "view")) {
} if (count($valid_forums) == 0) { newbb_trackback_response(1, _NOPERM); } $charset = 'UTF-8'; header('Content-Type:text/xml; charset=' . $charset); $tpl = new XoopsTpl(); $tpl->caching = 2; $tpl->cache_lifetime = $xoopsModuleConfig['rss_cachetime'] * 60; if (!empty($xoopsConfig['rewrite'])) { $tpl->load_filter('output', 'xoRewriteModule'); } mod_loadFunctions("cache"); $xoopsCachedTemplateId = md5(mod_generateCacheId_byGroup() . str_replace(XOOPS_URL, '', $_SERVER['REQUEST_URI'])); $compile_id = NULL; if (!$tpl->is_cached('db:newbb_rss.html', $xoopsCachedTemplateId, $compile_id)) { mod_loadFunctions("time", "newbb"); $xmlrss_handler =& xoops_getmodulehandler('xmlrss', 'newbb'); $rss = $xmlrss_handler->create(); $rss->setVarRss('channel_title', $xoopsConfig['sitename'] . ' :: ' . _MD_FORUM); $rss->channel_link = XOOPS_URL . '/'; $rss->setVarRss('channel_desc', $xoopsConfig['slogan'] . ' :: ' . $xoopsModule->getInfo('description')); // There is a "bug" with xoops function formatTimestamp(time(), 'rss') // We have to make a customized function //$rss->channel_lastbuild = formatTimestamp(time(), 'rss'); $rss->setVarRss('channel_lastbuild', newbb_formatTimestamp(time(), 'rss')); $rss->channel_webmaster = $xoopsConfig['adminmail']; $rss->channel_editor = $xoopsConfig['adminmail']; $rss->setVarRss('channel_category', $xoopsModule->getVar('name')); $rss->channel_generator = "CBB " . $xoopsModule->getInfo('version'); $rss->channel_language = _LANGCODE;
/** * xos_opal_Theme::checkCache() * * @return bool */ public function checkCache() { if ($_SERVER['REQUEST_METHOD'] !== 'POST' && $this->contentCacheLifetime) { $template = $this->contentTemplate ?: 'db:system_dummy.tpl'; $this->template->caching = 2; $this->template->cache_lifetime = $this->contentCacheLifetime; $uri = str_replace(XOOPS_URL, '', $_SERVER['REQUEST_URI']); // Clean uri by removing session id if (defined('SID') && SID && strpos($uri, SID)) { $uri = preg_replace("/([\\?&])(" . SID . "\$|" . SID . '&)/', "\\1", $uri); } $this->contentCacheId = $this->generateCacheId('page_' . substr(md5($uri), 0, 8)); if ($this->template->is_cached($template, $this->contentCacheId)) { $xoopsLogger = XoopsLogger::getInstance(); $xoopsLogger->addExtra($template, sprintf('Cached (regenerates every %d seconds)', $this->contentCacheLifetime)); $this->render(null, null, $template); return true; } } return false; }
if (!empty($xoopsOption['show_cblock'])) { $toppage = true; } } // Get blocks $block_arr =& $xoopsblock->getAllByGroupModule($groups, $moduleid, $toppage, XOOPS_BLOCK_VISIBLE); foreach (array_keys($block_arr) as $i) { $bcachetime = $block_arr[$i]->getVar('bcachetime'); if (empty($bcachetime)) { $xoopsTpl->xoops_setCaching(0); } else { $xoopsTpl->xoops_setCaching(2); $xoopsTpl->xoops_setCacheTime($bcachetime); } $btpl = $block_arr[$i]->getVar('template') != '' ? $block_arr[$i]->getVar('template') : "system_block_dummy.html"; if (empty($bcachetime) || !$xoopsTpl->is_cached('db:' . $btpl, 'blk_' . $block_arr[$i]->getVar('bid'))) { $xoopsLogger->addBlock($block_arr[$i]->getVar('name')); $bresult =& $block_arr[$i]->buildBlock(); if (!$bresult) { continue; } $xoopsTpl->assign_by_ref('block', $bresult); $bcontent =& $xoopsTpl->fetch('db:' . $btpl, 'blk_' . $block_arr[$i]->getVar('bid')); $xoopsTpl->clear_assign('block'); } else { $xoopsLogger->addBlock($block_arr[$i]->getVar('name'), true, $bcachetime); $bcontent =& $xoopsTpl->fetch('db:' . $btpl, 'blk_' . $block_arr[$i]->getVar('bid')); } switch ($block_arr[$i]->getVar('side')) { case XOOPS_SIDEBLOCK_LEFT: if (!isset($show_lblock)) {
<?php require_once XOOPS_ROOT_PATH.'/class/template.php'; $myts =& MyTextSanitizer::getInstance(); if (function_exists('mb_http_output')) { mb_http_output('pass'); } $tpl = new XoopsTpl(); $tpl->xoops_setCaching(2); $tpl->xoops_setCacheTime(0); if (!$tpl->is_cached("db:{$mydirname}_rss.html")) { $articles = Bulletin::getAllPublished( $mydirname , 10 , 0 , 0 , 1 , true , true ,true ) ;//ver3.0 changed if (is_array($articles)) { $tpl->assign('channel_title', bulletin_utf8_encode(htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES))); $tpl->assign('channel_link', XOOPS_URL.'/'); $tpl->assign('channel_desc', bulletin_utf8_encode(htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES))); // $tpl->assign('channel_lastbuild', formatTimestamp(time(), 'rss')); $tpl->assign('channel_lastbuild', date( 'r' ) ) ; // GIJ $tpl->assign('channel_webmaster', $xoopsConfig['adminmail']); $tpl->assign('channel_editor', $xoopsConfig['adminmail']); $tpl->assign('channel_category', 'News'); $tpl->assign('channel_generator', 'XOOPS'); $tpl->assign('channel_language', _LANGCODE); $tpl->assign('image_url', XOOPS_URL.'/images/logo.gif'); $dimention = getimagesize(XOOPS_ROOT_PATH.'/images/logo.gif'); if (empty($dimention[0])) { $width = 88; } else { $width = ($dimention[0] > 144) ? 144 : $dimention[0];
} if (!$topicid) { exit; } $myts =& MyTextSanitizer::getInstance(); if (function_exists('mb_http_output')) { mb_http_output('pass'); } $restricted = getmoduleoption('restrictindex'); $newsnumber = getmoduleoption('storyhome'); header('Content-Type:text/xml; charset=utf-8'); $story = new NewsStory(); $tpl = new XoopsTpl(); $tpl->xoops_setCaching(2); $tpl->xoops_setCacheTime(0); if (!$tpl->is_cached('db:system_rss.html')) { $sarray = $story->getAllPublished($newsnumber, 0, $restricted, $topicid); if (is_array($sarray) && count($sarray) > 0) { $tpl->assign('channel_title', xoops_utf8_encode(htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES))); $tpl->assign('channel_link', XOOPS_URL . '/'); $tpl->assign('channel_desc', xoops_utf8_encode(htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES))); $tpl->assign('channel_lastbuild', formatTimestamp(time(), 'rss')); $tpl->assign('channel_webmaster', checkEmail($xoopsConfig['adminmail'], true)); // Fed up with spam $tpl->assign('channel_editor', checkEmail($xoopsConfig['adminmail'], true)); // Fed up with spam $tpl->assign('channel_category', 'News'); $tpl->assign('channel_generator', 'XOOPS'); $tpl->assign('channel_language', _LANGCODE); $tpl->assign('image_url', XOOPS_URL . '/images/logo.gif'); $dimention = getimagesize(XOOPS_ROOT_PATH . '/images/logo.gif');
if (oledrion_utils::getModuleOption('use_rss') == 0) { exit; } // Paramètre, soit rien auquel cas on prend tous les produits récents soit cat_cid $cat_cid = isset($_GET['cat_cid']) ? intval($_GET['cat_cid']) : 0; if (function_exists('mb_http_output')) { mb_http_output('pass'); } $charset = 'utf-8'; header('Content-Type:text/xml; charset=' . $charset); $tpl = new XoopsTpl(); $tpl->xoops_setCaching(2); // 1 = Cache global, 2 = Cache individuel (par template) $tpl->xoops_setCacheTime(OLEDRION_RSS_CACHE); // Temps de cache en secondes if (!$tpl->is_cached('db:oledrion_rss.tpl', $cat_cid)) { $categoryTitle = ''; if (!empty($cat_cid)) { $category = null; $category = $h_oledrion_cat->get($cat_cid); if (is_object($category)) { $categoryTitle = $category->getVar('cat_title'); } } $sitename = htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES); $email = checkEmail($xoopsConfig['adminmail'], true); $slogan = htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES); $limit = oledrion_utils::getModuleOption('perpage'); $tpl->assign('charset', $charset); $tpl->assign('channel_title', xoops_utf8_encode($sitename)); $tpl->assign('channel_link', XOOPS_URL . '/');
} $tpltpl_handler =& xoops_gethandler('tplfile'); $tplfile =& $tpltpl_handler->get($id, true); $err = array(); if (!is_object($tplfile)) { $err[] = 'Selected template (ID: $id) does not exist'; } else { if ($tplfile->getVar('tpl_tplset') != 'default') { $tplfile->setVar('tpl_source', $html); $tplfile->setVar('tpl_lastmodified', time()); if (!$tpltpl_handler->insert($tplfile)) { $err[] = 'Could not insert template file to the database.'; } else { include_once XOOPS_ROOT_PATH . '/class/template.php'; $xoopsTpl = new XoopsTpl(); if ($xoopsTpl->is_cached('db:' . $tplfile->getVar('tpl_file'))) { if (!$xoopsTpl->clear_cache('db:' . $tplfile->getVar('tpl_file'))) { } } if ($tplfile->getVar('tpl_tplset') == $xoopsConfig['template_set']) { xoops_template_touch($id); } } } else { $err[] = 'Default template files cannot be edited.'; } } if (count($err) == 0) { if (!empty($moddir)) { redirect_header('admin.php?fct=tplsets&op=edittpl&id=' . $tplfile->getVar('tpl_id'), 2, _MD_AM_DBUPDATED); } elseif (isset($redirect)) {
$new_array = mylinks_get_new($param_array); // logo image $logo = 'images/logo.gif'; $template = XOOPS_ROOT_PATH . "/modules/{$modulename}/templates/mylinks_pda.html"; $PDA_DESC_MAX = 1000; // rss output if (function_exists('mb_http_output')) { mb_http_output('pass'); } header('Content-Type:text/html'); $tpl = new XoopsTpl(); if ($cache) { $tpl->xoops_setCaching(2); $tpl->xoops_setCacheTime(3600); } if (!$tpl->is_cached("file:{$template}") || !$cache) { if (count($new_array) > 0) { $tpl->assign('xoops_charset', _CHARSET); $tpl->assign('site_url', XOOPS_URL . '/'); $tpl->assign('site_name', htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)); $tpl->assign('site_desc', htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES)); $tpl->assign('image_url', XOOPS_URL . "/{$logo}"); $i = 0; $block = array(); foreach ($new_array as $new) { $line['link'] = $new['link']; $line['title'] = wani_make_html_title($new['title']); $description = ''; if (isset($new['description'])) { $description = $new['description']; $description = wani_make_html_summary($description, $PDA_DESC_MAX);