コード例 #1
0
ファイル: category.php プロジェクト: TopGrd/newxb
 function update($id, $data)
 {
     global $cache;
     check_allowed_category($id, LZ_RESPONSE == 'text');
     if ($data['status'] == 2) {
         include_once LZ_BASEPATH . 'model/item.php';
         $item = new LZ_Item();
         if (!$item->exists(array('status' => 3, 'category_id' => $id))) {
             $data['item_id'] = $item->add(array('category_id' => $id, 'status' => 3, 'publish_time' => time()));
         } else {
             $this_item = $item->get_one(array('status' => 3, 'category_id' => $id));
             $data['item_id'] = $this_item['item_id'];
         }
     }
     $re = parent::update($id, $data);
     $cache->clear_uri('#admin/category');
     return $re;
 }
コード例 #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
ファイル: 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);
$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['keywords'] = $this_item['keywords'];
$view_data['item_id'] = $item_id;
$view_data['category_id'] = $category_id;
$view_data['position'] = $position;
コード例 #6
0
ファイル: recommend.php プロジェクト: TopGrd/newxb
<?php

LZ_MODULE != 'admin' && die('Access Denied');
include_once 'model/category.php';
$category = new LZ_Category();
include_once 'model/item.php';
$item = new LZ_Item();
$result = $item->update($_POST['id'], array("recommend" => $_POST['recommend']));
if ($result) {
    lz_exit(lang('提交成功'), 'admin.php?p=item', 1);
} else {
    lz_exit(lang('提交失败'), 'admin.php?p=item', 1);
}
コード例 #7
0
ファイル: html.php プロジェクト: TopGrd/newxb
function get_item_path($data)
{
    if (!is_array($data) && @intval($data) > 0) {
        $data = array('item_id' => $data);
    }
    if (!$data['url_name'] && $data['item_id']) {
        include_once 'model/item.php';
        $item = new LZ_Item();
        $_arr = $item->get_one($data['item_id']);
        $data['url_name'] = $_arr['url_name'];
        $data['publish_time'] = $_arr['publish_time'];
    }
    if ($data['url_name'] && $data['publish_time']) {
        return date('Y', $data['publish_time']) . '/' . date('m', $data['publish_time']) . '/' . $data['url_name'] . '/';
    } else {
        return '';
    }
}
コード例 #8
0
ファイル: guestbook.php プロジェクト: TopGrd/newxb
<?php

!defined('LZ_MODULE') && die('Access Denied');
$m = $_GET['m'];
include_once 'model/guestbook.php';
$obj = new LZ_Guestbook();
include_once 'model/item.php';
$item = new LZ_Item();
if ($m == 'new') {
    $data = filter_array($_POST, 'htmlspecialchars:name!,htmlspecialchars:email,htmlspecialchars:content!');
    if ($data) {
        $data['time'] = time();
        echo $obj->add($data) ? 'success' : 'error';
    } else {
        echo lang('FILL_ALL');
    }
    die;
}
$items = lz_page($obj, array('status' => 1), intval($config['guestbook_per_page']) ? intval($config['guestbook_per_page']) : 10);
$view_data['items'] = $items;
$view_data['title'] = lang('TITLE') . ' ' . $config['site_name'];
$view_data['item'] = $item->get_one(array('category_id' => 83, 'status' => 3));