$_POST['institution'] = $institution; $_POST['institutionen'] = $institutionen; $_POST['keywords'] = $keywords; $data = filter_array($_POST, 'periodsAndpage,DOI,reference,file_name,classnum,name!,name_en,time,html,description,keywords,intval:category_id!,intval:order_id,author,authoren,institution,institutionen'); $publish_time = mktime($data['time']['hour'], $data['time']['minute'], 0, $data['time']['month'], $data['time']['day'], $data['time']['year']); $item_arr = $item->get_one($item_id); if ($data) { unset($data['time']); $data['pic_url'] = get_first_image_url($data['description']); $data['has_pic'] = $data['pic_url'] ? 1 : 0; $data['update_time'] = time(); $data['publish_time'] = $publish_time; $data['update_user_id'] = $_SESSION['login_user']['user_id']; if ($item->update($item_id, $data)) { if ($page_type == 'category') { $this_category = $category->get_one($data['category_id']); $return_to = 'admin.php?p=category&category_id=' . $this_category['parent_id']; } else { if ($page_type == 'preview') { $return_to = 'index.php?p=item&item_id=' . $item_id . '&preview=true'; } else { $return_to = 'admin.php?p=item&category_id=' . $data['category_id']; } } lz_exit(lang('ITEM_EDIT_SUCCESS'), $return_to, 1); } else { $action = 'edit_item'; $err_msg = lang('ITEM_UNKNOWN_ERROR'); } } else { $action = 'edit_item';
!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;
} else { $action = 'new_category'; $err_msg = lang('CATEGOTY_NEW_ERROR'); } } else { $action = 'new_category'; $err_msg = lang('CATEGOTY_FILL_ALL'); $view_data['category'] = $_POST; } } //显示分类和项目列表 $categories = $category->get_list(array('parent_id' => $category_id)); $_tree = $category->tree_category(0); $view_data['all_category'] = print_category_tree_link('admin.php?p=category&category_id=', $_tree, $category_id); $view_data['categories'] = $categories; $view_data['page_description'] = lang('CATEGORIES_LIST'); $view_data['err_msg'] = $err_msg; $view_data['success_msg'] = $success_msg; $view_data['category_id'] = $category_id; $view_data['position'] = $category->position_category($category_id); $view_data['this_category'] = $category->get_one($category_id); $statuses = array(); foreach ($category_status as $key => $val) { $statuses[] = array('index' => $key, 'value' => $val); } $view_data['statuses'] = $statuses; function show_status($s) { global $category_status; return $category_status[$s] ? $category_status[$s] : "未知"; }