示例#1
0
文件: item.php 项目: TopGrd/newxb
 function get_list($data = array())
 {
     if ($data['category_id'] == 0) {
         unset($data['category_id']);
     }
     if (isset($data['status'])) {
         !$data['where'] && ($data['where'] = ' 1=1 ');
         $data['where'] .= " AND status IN ({$data['status']}) ";
         unset($data['status']);
     } else {
         $data['status'] = '1';
     }
     if ($data['with_children_category']) {
         include_once LZ_BASEPATH . '/model/category.php';
         if ($data['category_id']) {
             $category = new LZ_Category();
             $tree = $category->tree_category($data['category_id']);
             $arr = array();
             $category->flat_tree($tree, $arr);
             $ids = array();
             foreach ($arr as $_arr) {
                 $ids[] = $_arr['category_id'];
             }
             $ids[] = $data['category_id'];
             if ($data['where']) {
                 $data['where'] .= ' AND ';
             }
             $data['where'] .= ' category_id IN (' . join(',', $ids) . ')';
         }
         unset($data['with_children_category']);
         unset($data['category_id']);
     }
     if (LZ_MODULE == 'admin' && $_SESSION['login_user']['rights']['limit_category_id'] && $_SESSION['login_user']['allowed_categories']) {
         $data['where'] && ($data['where'] .= ' AND ');
         $data['where'] .= 'category_id IN (' . $_SESSION['login_user']['allowed_categories'] . ')';
     }
     !$data['order'] && ($data['order'] = "order_id DESC,publish_time DESC");
     return parent::get_list($data);
 }
示例#2
0
文件: item.php 项目: TopGrd/newxb
<?php

!defined('LZ_MODULE') && die('Access Denied');
filter_array($_GET, 'action,m,intval:item_id!', true);
if (!$item_id) {
    die('Access Denied');
}
include_once LZ_BASEPATH . 'model/item.php';
$item = new LZ_Item();
include_once LZ_BASEPATH . 'model/category.php';
$category = new LZ_Category();
//load news data from a config file
//config_data('left.config');
//add view_count
$item->add_view_count($item_id);
$this_item = $item->get_one($item_id);
$item_keywords = $item->query("select * from lz_keyword where aid = {$item_id}");
$this_category = $category->get_one($this_item['category_id']);
$category_id = $this_item['category_id'];
if ($this_category['parent_id'] > 0) {
    $view_data['parent_category'] = $category->get_one($this_category['parent_id']);
}
$position = $category->position_category($category_id);
$url = $position[count($position) - 1]['url'];
$lz_make_html_total_page = $info['total_page'];
$view_data['item'] = $this_item;
$view_data['title'] = $this_item['name'] . ' ' . $config['site_name'];
$view_data['description'] = $this_item['metadescription'];
$view_data['download'] = $this_item['file_name'];
$view_data['keywords'] = $this_item['keywords'];
$view_data['item_keywords'] = $item_keywords;
示例#3
0
文件: item.php 项目: TopGrd/newxb
<?php

LZ_MODULE != 'admin' && die('Access Denied');
filter_array($_GET, 'm,action,intval:item_id,intval:category_id,page_type,has_pic,status', true);
$_authorized = false;
$status = isset($_GET['status']) ? $_GET['status'] : '0,1,2';
include_once 'model/category.php';
$category = new LZ_Category();
include_once 'model/item.php';
$item = new LZ_Item();
if (!$item_id && $page_type == 'category' && $category_id) {
    $this_item = $item->get_one(array('status' => 3, 'category_id' => $category_id));
    if ($this_item && $this_item['item_id']) {
        $item_id = $this_item['item_id'];
    } else {
        lz_exit(lang('INPUT_VAR_ERROR'), 'javascript:history.go(-1)', 5);
    }
}
//添加文章
if ($m == 'new_item') {
    AdminItemWordsPreprocess();
    $author = "";
    $authoren = "";
    $institution = "";
    $institutionen = "";
    $keywords = "";
    $count = count($_POST['_author']);
    $count_keyword = count($_POST['_keywords']);
    $itemid = "";
    $prev_author = "";
    $prev_authoren = "";
示例#4
0
文件: category.php 项目: TopGrd/newxb
<?php

!defined('LZ_MODULE') && die('Access Denied');
filter_array($_GET, 'action,m,intval:category_id!', true);
include_once LZ_BASEPATH . 'model/item.php';
$item = new LZ_Item();
include_once LZ_BASEPATH . 'model/category.php';
$category = new LZ_Category();
$this_category = $category->get_one($category_id);
if ($this_category['parent_id'] > 0) {
    $view_data['parent_category'] = $category->get_one($this_category['parent_id']);
}
$position = $category->position_category($category_id);
$view_data['category_id'] = $category_id;
$view_data['category'] = $this_category;
$view_data['position'] = $position;
$view_data['description'] = $this_category['description'];
$view_data['title'] = $this_category['name'] . ' ' . $config['site_name'];
$view_data['category_tree'] = $category->tree_category($category_id);
if (count($view_data['category_tree']) <= 0) {
    $view_data['sibling_category'] = $category->tree_category($this_category['parent_id']);
    if ($this_category['parent_id'] == "0") {
        $view_data['sibling_category'] = array($this_category);
    }
} else {
    $view_data['sibling_category'] = $view_data['category_tree'];
}
if ($this_category['status'] == 2) {
    $view_data['page_type'] = 'page';
    $view_data['item'] = $item->get_one($this_category['item_id']);
} else {
示例#5
0
文件: category.php 项目: TopGrd/newxb
<?php

LZ_MODULE != 'admin' && die('Access Denied');
$action = $_GET['action'];
$m = $_GET['m'];
$_authorized = false;
if ($_SESSION['login_user']['status'] == 'admin') {
    $_authorized = true;
}
$category_id = intval($_GET['category_id']);
$item_id = intval($_GET['item_id']);
$_SESSION['category_id'] = $category_id;
include_once 'model/category.php';
$category = new LZ_Category();
include_once 'model/item.php';
$item = new LZ_Item();
if ($m == 'new_category') {
    $data = filter_array($_POST, 'name!');
    $data['parent_id'] = $category_id;
    if (!$data['parent_id']) {
        $data['parent_id'] = 0;
    }
    if ($data) {
        if ($category->add($data)) {
            lz_exit(lang('CATEGORY_NEW_SUCCESS'), 'admin.php?p=category&category_id=' . $data['parent_id'], 1);
        } else {
            $action = 'new_category';
            $err_msg = lang('CATEGOTY_NEW_ERROR');
        }
    } else {
        $action = 'new_category';
示例#6
0
文件: sidebar.php 项目: TopGrd/newxb
<?php

if (!$view_data['categories']) {
    include_once 'model/category.php';
    $category = new LZ_Category();
    $view_data['categories'] = $category->tree_category(0);
}
示例#7
0
文件: rights.php 项目: TopGrd/newxb
<?php

LZ_MODULE != 'admin' && die('Access Denied');
include_once 'model/rights.php';
$rights = new LZ_Rights();
$m = $_GET['m'];
include_once 'model/category.php';
$category = new LZ_Category();
$rights_id = $_GET['rights_id'];
if ($m == 'new_group') {
    $data = filter_array($_POST, 'name!');
    if ($data && $rights->add($data)) {
        lz_exit(lang('rights_add_success'), 'admin.php?p=rights');
    } else {
        lz_exit(lang('rights_add_failed'), 'admin.php?p=rights');
    }
} elseif ($m == 'config' && $rights_id) {
    $r = array();
    foreach ($_POST as $key => $val) {
        if (strtolower($val) == 'on') {
            $r[] = $key;
        }
    }
    $data['rights'] = join(',', $r);
    if ($rights->update($rights_id, $data)) {
        lz_exit(lang('rights_updated'), 'admin.php?p=rights');
    }
}
if ($rights_id) {
    $_SESSION['login_user']['rights']['limit_category_id'] = false;
    $view_data['rights'] = $lz_rights;
示例#8
0
文件: html.php 项目: TopGrd/newxb
$time = intval($_GET['time']);
$pertime = intval($_GET['pertime']);
$content = $_POST['content'];
$_GET = array();
$_POST = array();
$_REQUEST = array();
list($_usec, $_sec) = explode(' ', microtime());
$_make_html_time_start = (double) $_usec + (double) $_sec;
if ($make == 'index') {
    $lz_make_html_path = LZ_TOPPATH . 'index.html';
    include LZ_BASEPATH . 'index.php';
    echo $lz_make_html_status ? 'success ' . $lz_time_used : 'error';
} else {
    if ($make == 'category') {
        include_once LZ_BASEPATH . 'model/category.php';
        $category = new LZ_Category();
        $category_id = intval($_GET['category_id']);
        $tree = $category->tree_category($category_id);
        $categories = array();
        $category->flat_tree($tree, $categories);
        $_html_out = '';
        foreach ($categories as $c) {
            $_GET = array();
            $_POST = array();
            $_REQUEST = array();
            $_GET['p'] = 'category';
            $_GET['category_id'] = $c['category_id'];
            $lz_make_html_total_page = 0;
            $lz_make_html_path = str_replace('//', '/', LZ_TOPPATH . $c['url'] . 'index.html');
            include LZ_BASEPATH . 'index.php';
            $_html_out .= 'make ' . $c['name'] . ' ';