Esempio n. 1
0
$db = get_db();
$c = array();
array_push($c, "language_tag={$language_tag}");
array_push($c, "category_id is not null");
if ($title != '') {
    array_push($c, "title like '%" . trim($title) . "%' or keywords like '%" . trim($title) . "%' or description like '%" . trim($title) . "%' or author like '%{$title}%'");
}
if ($category_id > 0) {
    $cate_ids = implode(',', $category->children_map($category_id));
    array_push($c, "category_id in({$cate_ids})");
}
array_push($c, "is_adopt=0");
if ($up != '') {
    array_push($c, "set_up={$up}");
}
if (role_name() == 'column_editor' || role_name() == 'column_writer') {
    $c[] = "publisher={$_SESSION['admin_user_id']}";
}
$news = new table_class($tb_news);
$record = $news->paginate('all', array('conditions' => implode(' and ', $c), 'order' => 'created_at desc,category_id'), 30);
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv=Content-Type content="text/html; charset=utf-8">
	<meta http-equiv=Content-Language content=zh-CN>
	<title>发布新闻</title>
	<?php 
css_include_tag('admin');
use_jquery();
Esempio n. 2
0
if (role_name() == 'column_editor' || role_name() == 'column_writer') {
    ?>
	<script>
		var uncheck_keyword = true;
	</script>		
<?php 
}
?>
<body>
	<?php 
$id = $_REQUEST['id'];
$news = new table_class($tb_news);
if ($id) {
    $news->find($id);
}
if ($_REQUEST['language_tag']) {
    $news->language_tag = $_REQUEST['language_tag'];
}
if ($news->language_tag == 1 || $_REQUEST['chinese_id']) {
    include '_english_news_edit.php';
} else {
    if (in_array(role_name(), $column_roles)) {
        include "_column_news_edit.php";
    } else {
        include "_news_edit.php";
    }
}
?>
</body>
</html>