예제 #1
0
 $end_time && $ad_obj->setEnd_time(strtotime($end_time));
 $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();
예제 #2
0
<?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'];