} $is_conflict = false; if ($file_name != $old_file_name || $stopic_service->isFileUsed($stopic_id, $file_name)) { if (file_exists($stopic_service->getStopicDir($stopic_id, $file_name))) { $is_conflict = true; } } if ($is_conflict && !$is_cover) { $job = 'showconfirm'; include stopic_use_layout('ajax'); } else { $new_config = array(); if (isset($block_config['container'])) { foreach ($block_config['container'] as $layout_id) { foreach ($block_config as $block_container => $blocks) { if (false !== strpos($block_container, $layout_id)) { $new_config[$layout_id][substr($block_container, strlen($layout_id) + 1)] = $block_config[$block_container]; unset($block_config[$block_container]); } } } } $update_fields = array('category_id' => $category_id, 'title' => $stopic_title, 'block_config' => $new_config, 'file_name' => $file_name); if ('' == $stopic_data['layout_config']) { $update_fields['layout_config'] = $stopic_service->getLayoutDefaultSet(); } $stopic_service->updateSTopicById($stopic_id, $update_fields); $stopic_service->creatStopicHtml($stopic_id); $stopicUrl = $stopic_service->getStopicUrl($stopic_id, $file_name); include stopic_use_layout('ajax'); }
<?php !defined('P_W') && exit('Forbidden'); S::gp(array('jobact')); if ("delete" == $jobact) { S::gp(array('stopic_ids')); if (!is_array($stopic_ids) || !count($stopic_ids)) { Showmsg('没选择要删除的专题,请您重试', $stopic_admin_url . "&job={$job}"); } if (!$stopic_service->deleteSTopics($stopic_ids)) { Showmsg('所有信息均未修改,请您重试', $stopic_admin_url . "&job={$job}"); } ObHeader($stopic_admin_url . "&job={$job}"); } else { S::gp(array('page', 'search_title', 'search_cid')); $page = intval($page); $sum = $stopic_service->countSTopic($search_title, $search_cid); $total = ceil($sum / $db_perpage); if ($page <= 0) { $page = 1; } if ($page > $total) { $page = $total; } $pages = numofpage($sum, $page, $total, $stopic_admin_url . "&job={$job}&search_title={$search_title}&search_cid={$search_cid}&"); $stopic_list = $stopic_service->findSTopicInPage($page, $db_perpage, $search_title, $search_cid); $category_list = $stopic_service->getCategorys(); } include stopic_use_layout('admin');
if ($is_new_bg) { $bg_id = 0; } if ($is_new_bg && count($_FILES) == 1 && $_FILES["background"]["name"] && $_FILES["background"]["size"]) { $new_bg_id = $stopic_service->uploadPicture($_FILES, $category_id, $admin_name); !$new_bg_id && Showmsg("对不起,背景图片增加失败", "javascript:history.back();"); $bg_id = $new_bg_id; } $bg_id = $is_new_bg == 2 ? 0 : $bg_id; $stopic_service->updateSTopicById($stopic_id, array("title" => $stopic_title, "category_id" => $category_id, "layout_config" => $layout_set, "bg_id" => $bg_id, "seo_keyword" => $seo_keyword, "seo_desc" => $seo_desc)); $GLOBALS['ifDelOldUnit'] = true; $stopic_service->creatStopicHtml($stopic_id); ObHeader($basename . "&job={$job}&stopic_id={$stopic_id}"); } else { if ($stopic_id) { $stopic_data = $stopic_service->getSTopicInfoById($stopic_id); if (null == $stopic_data) { $stopic_id = 0; } $layout_data = $stopic_data['layout_config']; } if (empty($layout_data)) { $layout_data = $stopic_service->getLayoutDefaultSet(); } $styles = $stopic_service->getStyles(); $category_id = $category_id ? $category_id : ($stopic_data ? $stopic_data['category_id'] : 0); $bg_list = $stopic_service->getPicturesAndDefaultBGs($category_id); $bg_total_page = ceil(count($bg_list) / $bg_perpage); $is_new_bg = $stopic_data['bg_id'] == 0 ? "checked" : ""; include stopic_use_layout('iframe'); }