本文整理匯總了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;
}