示例#1
0
function _updatemembercount($uids, $dataarr = array(), $checkgroup = true, $operation = '', $relatedid = 0, $ruletxt = '')
{
    if (empty($uids)) {
        return;
    }
    if (!is_array($dataarr) || empty($dataarr)) {
        return;
    }
    if ($operation && $relatedid) {
        $writelog = true;
        $log = array('uid' => $uids, 'operation' => $operation, 'relatedid' => $relatedid, 'dateline' => time());
    } else {
        $writelog = false;
    }
    $data = array();
    foreach ($dataarr as $key => $val) {
        if (empty($val)) {
            continue;
        }
        $val = intval($val);
        $id = intval($key);
        $id = !$id && substr($key, 0, -1) == 'extcredits' ? intval(substr($key, -1, 1)) : $id;
        if (0 < $id && $id < 9) {
            $data['extcredits' . $id] = $val;
            if ($writelog) {
                $log['extcredits' . $id] = $val;
            }
        } else {
            $data[$key] = $val;
        }
    }
    if ($writelog) {
        DB::insert('common_credit_log', $log);
    }
    if ($data) {
        include_once libfile('class/credit');
        $credit =& credit::instance();
        $credit->updatemembercount($data, $uids, $checkgroup, $ruletxt);
    }
}
示例#2
0
function checkusergroup($uid = 0)
{
    $credit =& credit::instance();
    $credit->checkusergroup($uid);
}
示例#3
0
function checkusergroup($uid = 0)
{
    include_once libfile('class/credit');
    $credit =& credit::instance();
    $credit->checkusergroup($uid);
}