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; }
<?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;
<?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 = "";
$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 { $view_data['page_type'] = 'category'; $view_data['keywords'] = $this_category['keywords']; $items = lz_page($item, array('category_id' => $category_id, 'with_children_category' => 1), intval($config['category_list_page_size']) ? intval($config['category_list_page_size']) : 9); $view_data['items'] = $items; foreach ($view_data['category_tree'] as $_key => $_cat) { $view_data['category_tree'][$_key]['items'] = $item->get_list(array('category_id' => $_cat['category_id'], 'with_children_category' => 1, 'total' => $config['children_category_items_num'] ? $config['children_category_items_num'] : 7)); } } $_categories_array = $category->get_list(array()); $categories_array = array(); foreach ($_categories_array as $_cat) { $categories_array[$_cat['category_id']] = $_cat; } function category_name($id)
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 ''; } }
<?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));