示例#1
0
 static function delAdByAdId($ad_id)
 {
     $info = self::getAdByAdId($ad_id);
     if (!$info) {
         return false;
     }
     $ad_file = $info['ad_file'];
     if ($ad_file && file_exists(S_ROOT . '/' . $ad_file)) {
         unlink(S_ROOT . '/' . $ad_file);
     }
     $adObj = new Keke_witkey_ad_class();
     $adObj->setWhere("ad_id='{$ad_id}'");
     return $adObj->del_keke_witkey_ad();
 }
示例#2
0
<?php

defined('ADMIN_KEKE') or exit('Access Denied');
kekezu::admin_check_role(32);
$tag_obj = new Keke_witkey_tag_class();
$ad_obj = new Keke_witkey_ad_class();
$table_obj = new keke_table_class('witkey_tag');
$url = "index.php?do={$do}&view={$view}&order_type={$order_type}&w[tpl_type]={$w['tpl_type']}&w[page_size]={$page_size}&w[ord]={$w['ord']}&page={$page}";
if ($sbt_action == $_lang['mulit_delete'] || $ac == 'del') {
    if (!empty($delid)) {
        $ad_name = db_factory::get_count("select tagname from " . TABLEPRE . "witkey_tag where tag_id = '{$delid}'");
        $ad_obj->setWhere("ad_name='{$ad_name}'");
        $ad_result = $ad_obj->del_keke_witkey_ad();
        $tag_obj->setWhere('tag_id=' . $delid);
        $result = $tag_obj->del_keke_witkey_tag();
        kekezu::admin_system_log($_lang['delete_ads_tags_id'] . $delid . 'name:' . $ad_name . $_lang['corresponding_ads_data'] . $ad_result . $_lang['tiao']);
        kekezu::admin_show_msg($result ? $_lang['delete_ads_tags_success'] : $_lang['delete_fail'], $url, 3, '', $result ? 'success' : 'warning');
    } else {
        if (!empty($ckb)) {
            $ids = is_array($ckb) && count($ckb) > 0 ? implode(',', $ckb) : kekezu::admin_show_msg($_lang['delete_fail_select_operation'], $url, 3, '', 'warning');
            $tag_name_arr = db_factory::query(' select tagname from ' . TABLEPRE . "witkey_tag where tag_id in({$ids}) ");
            while (list($key, $value) = each($tag_name_arr)) {
                $ad_obj->setWhere('ad_name = "' . $value['tagname'] . '"');
                $ad_result .= $ad_obj->del_keke_witkey_ad();
            }
            $tag_obj->setWhere('tag_id in(' . $ids . ')');
            $result = $tag_obj->del_keke_witkey_tag();
            kekezu::admin_system_log($_lang['mulit_delete_ads_tags'] . $ids . $_lang['is_corresponding_ads_data'] . $ad_result . $_lang['tiao']);
            kekezu::admin_show_msg($result ? $_lang['mulit_delete_ads_tags_success'] : $_lang['delete_fail'], $url, 3, '', $res ? 'success' : 'warning');
        }
    }
示例#3
0
<?php

$target_range_arr = array("index" => $_lang['home'], "task_list" => $_lang['task_list'], "shop" => $_lang['shop_list'], "space" => $_lang['space_home'], "task" => $_lang['task_home'], "article" => $_lang['articles_home'], "case" => $_lang['case_page']);
$target_position_arr = array('top' => $_lang['top'], 'bottom' => $_lang['bottom'], 'left' => $_lang['left'], 'right' => $_lang['right'], 'center' => $_lang['center'], 'global' => $_lang['global']);
if ($target_id && $ac != 'edit') {
    $target_info = db_factory::get_one(sprintf("select * from %switkey_ad_target where target_id = %d", TABLEPRE, $target_id));
    $ad_num = $target_info[ad_num];
    $have_ad_num = db_factory::get_count(sprintf("select count(ad_id) count from %switkey_ad where target_id = %d", TABLEPRE, $target_id));
    if ($have_ad_num >= $ad_num) {
        kekezu::admin_show_msg($_lang['ads_num_over'], 'index.php?do=tpl&view=ad', '3', '', 'warning');
    }
}
$ad_obj = new Keke_witkey_ad_class();
if ($sbt_action) {
    $type = 'ad_type_' . $ad_type;
    switch ($ad_type) {
        case "image":
            if ($_FILES['ad_type_image_file']['name']) {
                $file_path = keke_file_class::upload_file('ad_type_image_file', '', 1, 'ad/');
            } else {
                $file_path = $ad_type_image_path;
            }
            break;
        case "flash":
            if ($flash_method == 'url') {
                $file_path = $ad_type_flash_url;
            }
            if ($flash_method == 'file' && $_FILES['ad_type_flash_file']['name']) {
                $file_path = keke_file_class::upload_file('ad_type_flash_file', '', 1, 'ad/');
            }
            break;
示例#4
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'];