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


PHP ui::get_news方法代码示例

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


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

示例1: replace_var

function replace_var($vars)
{
    $var = $vars[1];
    if (substr($var, 0, 9) == '?sitemgr:') {
        $params = explode(',', substr($var, 9));
        switch (count($params)) {
            case 0:
                $val = '';
                break;
            case 1:
                $val = sitemgr_link2('', $params[0]);
                break;
            case 2:
                $val = sitemgr_link2($params[0], $params[1]);
                break;
            default:
                $val = $var;
        }
    } elseif (substr($var, 0, 7) == '?phpgw:') {
        $params = explode(',', substr($var, 7));
        switch (count($params)) {
            case 0:
                $val = '';
                break;
            case 1:
                $val = phpgw_link('', $params[0]);
                break;
            case 2:
                $val = phpgw_link($params[0], $params[1]);
                break;
            default:
                $val = $var;
        }
    } elseif (substr($var, 0, 1) == '?') {
        $val = sitemgr_link2('/index.php', substr($var, 1));
    } elseif ($var == 'news') {
        $ui = new ui();
        $val = $ui->get_news();
        unset($ui);
    } elseif (substr($var, 0, 6) == 'block-') {
        if (file_exists('blocks/' . $var . '.php')) {
            $title = ereg_replace('_', ' ', substr($var, 6));
            include 'blocks/' . $var . '.php';
        } else {
            $title = lang('Block not found.');
            $content = lang('Contact the administrator.');
        }
        add_theme_var('block_title', $title);
        add_theme_var('block_content', $content);
        if (function_exists('themecenterbox')) {
            $val = themecenterbox($title, $content);
        } else {
            $val = parse_theme_vars(implode("", file('templates/' . $GLOBALS['sitemgr_info']['themesel'] . '/centerblock.tpl')));
        }
    } else {
        /* Check for reserved vars first, otherwise
        			   get from the global theme_vars
        			*/
        switch (strtolower($var)) {
            case 'opentable':
                $val = OpenTable();
                break;
            case 'opentable2':
                $val = OpenTable2();
                break;
            case 'closetable':
                $val = CloseTable();
                break;
            case 'closetable2':
                $val = CloseTable2();
                break;
            default:
                $val = $GLOBALS['theme_vars'][$var];
        }
    }
    return $val;
}
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:77,代码来源:phpnuke.compat.inc.php


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