$content && $ad_obj->setAd_content($content); $hdn_target_id && $ad_obj->setTarget_id(intval($hdn_target_id)); $ckb_tpl_type && ($tpl_type = implode(',', $ckb_tpl_type)); $ad_obj->setTpl_type($tpl_type); $ad_obj->setListorder(intval($listorder)); $ad_obj->setIs_allow(intval($rdn_is_allow)); $ad_url = str_replace("union ", "union", $ad_url); $ad_obj->setAd_url($ad_url); $ad_obj->setOn_time(time()); if ($ac == 'edit') { if ($ad_type == 'text' || $ad_type == 'code') { $ad_obj->setWidth(''); $ad_obj->setHeight(''); } $ad_obj->setWhere('ad_id=' . intval($ad_id)); $result = $ad_obj->edit_keke_witkey_ad(); kekezu::admin_system_log($_lang['edit_ads_data'] . $ad_id); kekezu::admin_show_msg($result ? $_lang['edit_ads_success_jump_adslist'] : $_lang['not_make_changes_return_again'], 'index.php?do=tpl&view=ad_add&ac=edit&ad_id=' . $ad_id, 3, '', $result ? 'success' : 'warning'); } else { $result = $ad_obj->create_keke_witkey_ad(); } kekezu::admin_system_log($_lang['add_ads_data']); kekezu::admin_show_msg($result ? $_lang['add_ads_success'] : $_lang['add_fail_return_again'], 'index.php?do=tpl&view=ad_list&target_id=' . $hdn_target_id, 3, '', $result ? 'success' : 'warning'); } $page_tips = $_lang['add']; $ad_data = array(); if ($ac && $ac == 'edit') { empty($ad_id) && kekezu::admin_show_msg($_lang['edit_parameter_error_jump_listpage'], 'index.php?do=tpl&view=ad_list', 3, '', 'warning'); $page_tips = $_lang['edit']; unset($ad_data); $ad_id = intval($ad_id);
<?php defined('ADMIN_KEKE') or exit('Access Denied'); kekezu::admin_check_role(32); $target_position_arr = array('top' => $_lang['top'], 'bottom' => $_lang['bottom'], 'left' => $_lang['left'], 'right' => $_lang['right'], 'center' => $_lang['center'], 'global' => $_lang['global']); $ad_obj = new Keke_witkey_ad_class(); $table_obj = new keke_table_class('witkey_ad'); $page = isset($page) ? intval($page) : '1'; $url = "index.php?do={$do}&view={$view}&ad_id={$ad_id}&ad_type={$target_id}&ad_name={$ad_name}&target_id={$target_id}&ord={$ord}&page={$page}"; if ($action && $action == 'u_order') { !$u_id && exit; !$u_value && exit; $ad_obj->setListorder(intval($u_value)); $ad_obj->setWhere('ad_id=' . intval($u_id)); $ad_obj->edit_keke_witkey_ad(); exit; } if ($ac == 'del' && $ad_id && $target_id) { $result = AdClass::delAdByAdId($ad_id); kekezu::admin_system_log($_lang['delete_ads'] . $ad_id); kekezu::admin_show_msg($result ? $_lang['ads_delete_success'] : $_lang['no_operation'], "index.php?do={$do}&view={$view}&target_id={$target_id}&ord={$ord}&page={$page}", 3, '', $result ? 'success' : 'warning'); } $targets_arr = kekezu::get_table_data('*', 'witkey_ad_target', '', '', '', '', 'target_id'); $pagesize = isset($page_size) ? intval($page_size) : '10'; $where = '1=1'; $where .= $ad_id ? ' and ad_id="' . intval($ad_id) . '"' : ''; $where .= $target_id && !$ad_id ? ' and target_id="' . intval($target_id) . '"' : ''; $where .= $ad_name && !$ad_id ? ' and ad_name like "%' . $ad_name . '%"' : ''; is_array($w['ord']) and $where .= ' order by ' . $ord[0] . ' ' . $ord[1]; $ad_arr = $table_obj->get_grid($where, $url, $page, $pagesize, null, 1, 'ajax_dom'); $pages = $ad_arr['pages'];