本文整理汇总了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)) {