예제 #1
0
 function create_prom_relation($uid, $username, $url_data, $relation_status = 1)
 {
     global $_lang;
     $relate_obj = new Keke_witkey_prom_relation_class();
     if ($this->_prom_open) {
         if ($url_data['uid'] == $uid) {
             return false;
         } else {
             $prom_relation = $this->get_prom_relation($uid, $url_data['p']);
             $r_status = intval($prom_relation['relation_status']);
             $r_status == 3 || $r_status == 0 and $p_status = 1 or $p_status = 2;
             if ($p_status == 2) {
             } else {
                 $p_info = kekezu::get_user_info($url_data['u']);
                 $relate_obj->setUid($uid);
                 $relate_obj->setUsername($username);
                 $relate_obj->setProm_uid($p_info['uid']);
                 $relate_obj->setProm_username($p_info['username']);
                 $relate_obj->setProm_type($url_data['p']);
                 $relate_obj->setRelation_status(intval($relation_status));
                 $relate_obj->setOn_time(time());
                 return $relate_obj->create_keke_witkey_prom_relation();
             }
         }
     } else {
         return false;
     }
 }
예제 #2
0
<?php

defined('ADMIN_KEKE') or exit('Access Denied');
kekezu::admin_check_role(214);
$prom_relation_obj = new Keke_witkey_prom_relation_class();
$page_size = isset($w['page_size']) ? intval($w['page_size']) : 10;
$page = $page ? intval($page) : '1';
$url = "index.php?do={$do}&view={$view}&w[relation_id]={$w['relation_id']}&w[prom_username]={$w['prom_username']}&w[username]={$w['username']}&w[prom_type]={$w['prom_type']}&w[relation_status]={$w['relation_status']}&w[page_size]={$page_size}&w[ord]={$w['ord']}&page={$page}";
$ac_url = "index.php?do={$do}&view={$view}&w[prom_type]={$w['prom_type']}&w[relation_status]={$w['relation_status']}&w[page_size]={$page_size}&w[ord]={$w['ord']}&page={$page}";
if (isset($ac)) {
    if ($relation_id && ($ac = 'del')) {
        $prom_relation_obj->setWhere('relation_id=' . intval($relation_id));
        $res = $prom_relation_obj->del_keke_witkey_prom_relation();
        kekezu::admin_system_log($_lang['delete_prom_relation'] . $relation_id);
        kekezu::admin_show_msg($res ? $_lang['delete_success'] : $_lang['delete_fail'], $url, 3, '', $res ? 'success' : 'warning');
    }
} elseif (isset($sbt_action)) {
    $ckb_string = $ckb;
    is_array($ckb_string) and $ckb_string = implode(',', $ckb_string);
    if (count($ckb_string)) {
        $prom_relation_obj->setWhere(' relation_id in (' . $ckb_string . ') ');
        $res = $prom_relation_obj->del_keke_witkey_prom_relation();
        kekezu::admin_system_log($_lang['mulit_delete_prom_relation'] . $ckb_string);
        kekezu::admin_show_msg($res ? $_lang['mulit_operate_success'] : $_lang['mulit_operate_fail'], $url, 3, '', $res ? 'success' : 'warning');
    }
} else {
    $status_arr = keke_prom_class::get_prelation_status();
    $type_arr = keke_prom_class::get_prom_type();
    $where = '1=1';
    $w['relation_id'] and $where .= " and relation_id = '{$w['relation_id']}'";
    $w['username'] and $where .= " and username like '%{$w['username']}%'";