本文整理匯總了PHP中news::recycle方法的典型用法代碼示例。如果您正苦於以下問題:PHP news::recycle方法的具體用法?PHP news::recycle怎麽用?PHP news::recycle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類news
的用法示例。
在下文中一共展示了news::recycle方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: extract
extract($r);
$addtime = timetodate($addtime);
$type_select = type_select($TYPE, 0, 'post[typeid]', $L['default_type'], $typeid);
$head_title = $L['news_title_edit'];
}
break;
case 'delete':
$itemid or message($L['news_msg_choose']);
$itemids = is_array($itemid) ? $itemid : array($itemid);
foreach ($itemids as $itemid) {
$do->itemid = $itemid;
$item = $do->get_one();
if (!$item || $item['username'] != $_username) {
message();
}
$do->recycle($itemid);
}
dmsg($L['op_del_success'], $forward);
break;
default:
$status = isset($status) ? intval($status) : 3;
in_array($status, array(1, 2, 3)) or $status = 3;
$typeid = isset($typeid) ? $typeid === '' ? -1 : intval($typeid) : -1;
$type_select = type_select($TYPE, 0, 'typeid', $L['default_type'], $typeid, '', $L['all_type']);
$condition = "username='{$_username}' AND status={$status}";
if ($keyword) {
$condition .= " AND title LIKE '%{$keyword}%'";
}
if ($typeid > -1) {
$condition .= " AND typeid={$typeid}";
}
示例2: tpl
$lists = $do->get_list('status=2' . $condition, $dorder[$order]);
include tpl('news_check', $module);
}
break;
case 'reject':
if ($itemid && !$psize) {
$do->reject($itemid);
dmsg('拒絕成功', $forward);
} else {
$lists = $do->get_list('status=1' . $condition, $dorder[$order]);
include tpl('news_reject', $module);
}
break;
case 'delete':
$itemid or msg('請選擇新聞');
isset($recycle) ? $do->recycle($itemid) : $do->delete($itemid);
dmsg('刪除成功', $forward);
break;
case 'restore':
$itemid or msg('請選擇新聞');
$do->restore($itemid);
dmsg('還原成功', $forward);
break;
case 'clear':
$do->clear();
dmsg('清空成功', $forward);
break;
case 'level':
$itemid or msg('請選擇新聞');
$level = intval($level);
$do->level($itemid, $level);