-
Notifications
You must be signed in to change notification settings - Fork 0
/
item.php
73 lines (62 loc) · 2.45 KB
/
item.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?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;
$view_data['item_id'] = $item_id;
$view_data['category_id'] = $category_id;
$view_data['position'] = $position;
$view_data['category_tree'] = $category->tree_category($category_id);
$view_data['category_tree'] = $category->tree_category($category_id);
$view_data['this_category'] = $this_category;
// set revelant articles
$RAs = $item->get_revelant_articles($item_id);
$view_data['article'] = $RAs;
// set authors revelant articles
$authorArticles = $item->get_same_author_articles($item_id);
$view_data['author_articles'] = $authorArticles;
if (count($view_data['category_tree']) <= 0)
{
$view_data['sibling_category'] = $category->tree_category($this_category['parent_id']);
}
else
{
$view_data['sibling_category'] = $view_data['category_tree'];
}
if ($this_category['parent_id'] == "0" ) $view_data['sibling_category'] = array($this_category);
$view_data['category'] = $this_category;
if ($this_item['status'] == 3 && count($view_data['category_tree']) == 0)
{
$view_data['category'] = $category->get_one($this_category['parent_id']);
$view_data['category_tree'] = $category->tree_category($this_category['parent_id']);
}
if ($_GET['preview'])
{
$_SESSION['referer'] = $_SERVER['HTTP_REFERER'];
}
else if ($this_item['status'] != '1' && $this_item['status'] != '3') die('Access Denied');
?>