本文整理汇总了PHP中iPHP::warning方法的典型用法代码示例。如果您正苦于以下问题:PHP iPHP::warning方法的具体用法?PHP iPHP::warning怎么用?PHP iPHP::warning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iPHP
的用法示例。
在下文中一共展示了iPHP::warning方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: user_data
function user_data($vars = null)
{
$vars['uid'] or iPHP::warning('iCMS:user:data 标签出错! 缺少"uid"属性或"uid"值为空.');
$uid = $vars['uid'];
if ($uid == 'me') {
$uid = 0;
$auth = user::get_cookie();
$auth && ($uid = user::$userid);
}
if (strpos($uid, ',') === false) {
$user = (array) user::get($uid);
if ($vars['data']) {
$user += (array) user::data($uid);
}
} else {
$uid_array = explode(',', $uid);
foreach ($uid_array as $key => $value) {
$user[$key] = (array) user::get($uid);
if ($vars['data']) {
$user[$key] += (array) user::data($uid);
}
}
}
return $user[0] === false ? false : (array) $user;
}
示例2: marker_html
/**
* @package iCMS
* @copyright 2007-2010, iDreamSoft
* @license http://www.idreamsoft.com iDreamSoft
* @author coolmoo <idreamsoft@qq.com>
* @$Id: push.tpl.php 1392 2013-05-20 12:28:08Z coolmoo $
*/
function marker_html($vars)
{
$where_sql = "WHERE `status`='1'";
$vars['key'] or iPHP::warning('iCMS:marker:html 标签出错! 缺少"key"属性或"key"值为空.');
if (isset($vars['cid']) && $vars['cid'] != '') {
$where_sql .= " AND `cid`='{$vars['cid']}'";
}
if (isset($vars['pid']) && $vars['pid'] != '') {
$where_sql .= " AND `pid`='{$vars['pid']}'";
}
if (isset($vars['key']) && $vars['key'] != '') {
$where_sql .= " AND `key`='{$vars['key']}'";
}
if (isset($vars['id']) && $vars['id'] != '') {
$where_sql .= " AND `id`='{$vars['id']}'";
}
$marker = iDB::row("SELECT * FROM `#iCMS@__marker` {$where_sql}", ARRAY_A);
iPHP_SQL_DEBUG && iDB::debug(1);
if ($marker) {
echo $marker['data'];
}
}
示例3: tpl_block_cache
public static function tpl_block_cache($vars, $content, &$tpl)
{
$vars['id'] or iPHP::warning('cache 标签出错! 缺少"id"属性或"id"值为空.');
$cache_time = isset($vars['time']) ? (int) $vars['time'] : -1;
$cache_name = iPHP_DEVICE . '/part/' . $vars['id'];
$cache = iCache::get($cache_name);
if (empty($cache)) {
if ($content === null) {
return false;
}
$cache = $content;
iCache::set($cache_name, $content, $cache_time);
unset($content);
}
if ($vars['assign']) {
$tpl->assign($vars['assign'], $cache);
return;
}
if ($content === null) {
return $cache;
}
// return $cache;
}
示例4: comment_form
function comment_form($vars)
{
if (!iCMS::$hooks['enable_comment']) {
iPHP::warning('此页面禁止调用 iCMS:comment:form 标签!');
}
if ($vars['ref']) {
$_vars = iCMS::app_ref($vars['ref']);
unset($vars['ref']);
$vars = array_merge($vars, $_vars);
}
$vars['iid'] or iPHP::warning('iCMS:comment:form 标签出错! 缺少"iid"属性或"iid"值为空.');
$vars['cid'] or iPHP::warning('iCMS:comment:form 标签出错! 缺少"cid"属性或"cid"值为空.');
$vars['appid'] or iPHP::warning('iCMS:comment:form 标签出错! 缺少"appid"属性或"appid"值为空.');
$vars['title'] or iPHP::warning('iCMS:comment:form 标签出错! 缺少"title"属性或"title"值为空.');
switch ($vars['display']) {
case 'iframe':
$tpl = 'form.iframe';
$vars['do'] = 'form';
break;
default:
isset($vars['_display']) && ($vars['display'] = $vars['_display']);
$vars['param'] = array('suid' => $vars['suid'], 'iid' => $vars['iid'], 'cid' => $vars['cid'], 'appid' => $vars['appid'], 'title' => $vars['title']);
$tpl = 'form.default';
break;
}
unset($vars['method'], $vars['_display']);
$vars['query'] = http_build_query($vars);
iPHP::assign('comment_vars', $vars);
echo iPHP::view('iCMS://comment/' . $tpl . '.htm');
}
示例5: article_data
function article_data($vars)
{
$vars['aid'] or iPHP::warning('iCMS:article:data 标签出错! 缺少"aid"属性或"aid"值为空.');
$data = iDB::row("SELECT body,subtitle FROM `#iCMS@__article_data` WHERE aid='" . (int) $vars['aid'] . "' LIMIT 1;", ARRAY_A);
if ($data['body']) {
$articleApp = iPHP::app("article");
$data['body'] = $articleApp->ubb($data['body']);
if (strpos($data['body'], '#--iCMS.Markdown--#') !== false) {
$data['body'] = iPHP::Markdown($data['body']);
}
$data['body'] = $articleApp->keywords($data['body']);
$data['body'] = $articleApp->taoke($data['body']);
}
return $data;
}