当前位置: 首页>>代码示例>>PHP>>正文


PHP XoopsTpl::is_cached方法代码示例

本文整理汇总了PHP中XoopsTpl::is_cached方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsTpl::is_cached方法的具体用法?PHP XoopsTpl::is_cached怎么用?PHP XoopsTpl::is_cached使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XoopsTpl的用法示例。


在下文中一共展示了XoopsTpl::is_cached方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: isset

*/
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();
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:backend.php

示例2: NewsStory

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');
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:backendt.php

示例3: myblocksadmin_update_block

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 +
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:77,代码来源:blocksadmin.inc.php

示例4: intval

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) {
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:rss.php

示例5: list


//.........这里部分代码省略.........
             $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}";
 }
开发者ID:nouphet,项目名称:rata,代码行数:101,代码来源:xoopsblock.inc.php

示例6: update_block

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&amp;t=' . time(), 1, $msg);
    exit;
//.........这里部分代码省略.........
开发者ID:gauravsaxena21,项目名称:simantz,代码行数:101,代码来源:blocksadmin.php

示例7: isset

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 . '/');
开发者ID:naao,项目名称:myshop,代码行数:31,代码来源:rss.php

示例8: make_cblock

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";
    }
}
开发者ID:yunsite,项目名称:xoopsdc,代码行数:90,代码来源:old_functions.php

示例9: isset

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) {
开发者ID:trabisdementia,项目名称:xuups,代码行数:31,代码来源:backend.php

示例10: XoopsTpl

$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];
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:31,代码来源:rss.php

示例11:

}
$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)) {
开发者ID:hiro1173,项目名称:legacy,代码行数:31,代码来源:admin_in_theme_header.inc.php

示例12: sprintf

     $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&amp;t=' . time(), 1, $msg);
开发者ID:koki-h,项目名称:xoops_utf8,代码行数:31,代码来源:main.php

示例13: foreach

         } 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)) {
开发者ID:amjadtbssm,项目名称:website,代码行数:31,代码来源:header.php

示例14: htmlspecialchars

    $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);
开发者ID:BackupTheBerlios,项目名称:xoops4-svn,代码行数:31,代码来源:header.php

示例15: array

 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;
 }
开发者ID:BackupTheBerlios,项目名称:peakxoops-svn,代码行数:47,代码来源:MyBlocksAdmin.class.php


注:本文中的XoopsTpl::is_cached方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。