$ad_obj->setAd_type($ad_type); $ad_obj->setAd_position($ad_position); $width = ${$type . '_width'}; $width && $ad_obj->setWidth($width); $height = ${$type . '_height'}; $height && $ad_obj->setHeight($height); $content = ${$type . '_content'}; if ($ad_type == 'code') { $content = htmlspecialchars_decode($content); } $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(); }