本文整理匯總了PHP中news::pass方法的典型用法代碼示例。如果您正苦於以下問題:PHP news::pass方法的具體用法?PHP news::pass怎麽用?PHP news::pass使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類news
的用法示例。
在下文中一共展示了news::pass方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: dalert
}
$MG['homepage'] && $MG['news_limit'] > -1 or dalert(lang('message->without_permission_and_upgrade'), 'goback');
require DT_ROOT . '/include/post.func.php';
$TYPE = get_type('news-' . $_userid);
require MD_ROOT . '/news.class.php';
$do = new news();
switch ($action) {
case 'add':
if ($MG['news_limit']) {
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}news WHERE username='{$_username}' AND status>0");
if ($r['num'] >= $MG['news_limit']) {
dalert(lang($L['limit_add'], array($MG['news_limit'], $r['num'])), 'goback');
}
}
if ($submit) {
if ($do->pass($post)) {
$post['username'] = $_username;
$post['level'] = $post['addtime'] = 0;
$need_check = $MOD['news_check'] == 2 ? $MG['check'] : $MOD['news_check'];
$post['status'] = get_status(3, $need_check);
$do->add($post);
dmsg($L['op_add_success'], '?status=' . $post['status']);
} else {
message($do->errmsg);
}
} else {
foreach ($do->fields as $v) {
${$v} = '';
}
$content = '';
$typeid = 0;