本文整理匯總了PHP中news::get_one方法的典型用法代碼示例。如果您正苦於以下問題:PHP news::get_one方法的具體用法?PHP news::get_one怎麽用?PHP news::get_one使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類news
的用法示例。
在下文中一共展示了news::get_one方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: dmsg
$post['status'] = get_status(3, $need_check);
$do->add($post);
dmsg($L['op_add_success'], $MOD['linkurl'] . 'news.php?status=' . $post['status']);
} else {
message($do->errmsg);
}
} else {
$addtime = timetodate($DT_TIME);
$type_select = type_select('news-' . $_userid, 0, 'post[typeid]', $L['default_type']);
$head_title = $L['news_title_add'];
}
break;
case 'edit':
$itemid or message();
$do->itemid = $itemid;
$r = $do->get_one();
if (!$r || $r['username'] != $_username) {
message();
}
if ($submit) {
if ($do->pass($post)) {
$post['username'] = $_username;
$need_check = $MOD['news_check'] == 2 ? $MG['check'] : $MOD['news_check'];
$post['status'] = get_status($r['status'], $need_check);
$post['level'] = $r['level'];
$do->edit($post);
dmsg($L['op_edit_success'], $forward);
} else {
message($do->errmsg);
}
} else {
示例2: message
message($do->errmsg);
}
} else {
foreach ($do->fields as $v) {
${$v} = '';
}
$content = '';
$typeid = 0;
$type_select = type_select($TYPE, 0, 'post[typeid]', $L['default_type']);
$head_title = $L['news_title_add'];
}
break;
case 'edit':
$itemid or message();
$do->itemid = $itemid;
$r = $do->get_one();
if (!$r || $r['username'] != $_username) {
message();
}
if ($submit) {
if ($do->pass($post)) {
$post['username'] = $_username;
$need_check = $MOD['news_check'] == 2 ? $MG['check'] : $MOD['news_check'];
$post['status'] = get_status($r['status'], $need_check);
$post['level'] = $r['level'];
$do->edit($post);
dmsg($L['op_edit_success'], $forward);
} else {
message($do->errmsg);
}
} else {
示例3: tpl
$menuid = 0;
include tpl('news_edit', $module);
}
break;
case 'edit':
$itemid or msg();
$do->itemid = $itemid;
if ($submit) {
if ($do->pass($post)) {
$do->edit($post);
dmsg('修改成功', $forward);
} else {
msg($do->errmsg);
}
} else {
extract($do->get_one());
$addtime = timetodate($addtime);
$menuon = array('4', '3', '2', '1');
$menuid = $menuon[$status];
include tpl('news_edit', $module);
}
break;
case 'push':
$MODULE[$aid]['module'] == 'article' or msg('請選擇文章模型');
if ($submit) {
$catid or msg('請選擇分類');
$tb = get_table($aid);
$tb_data = get_table($aid, 1);
$result = $db->query("SELECT * FROM {$DT_PRE}news WHERE itemid IN ({$ids})");
$i = 0;
while ($r = $db->fetch_array($result)) {