Example #1
0
function cms_spread($uid, $mode = 0)
{
    global $db, $tblprefix, $onlineip, $timestamp, $curuser, $m_cookie;
    if (empty($uid) && $mode == 1) {
        $uid = empty($m_cookie['spread_uid']) ? '' : $m_cookie['spread_uid'];
    } else {
        $uid = trim($uid);
    }
    if (empty($uid) || !($commu = read_cache('commu', 9)) || empty($commu['available']) || empty($commu['setting'][$mode])) {
        return;
    }
    $user = new cls_userinfo();
    $user->activeuserbyname($uid);
    if (!($mid = $user->info['mid']) || $mid == $curuser->info['mid']) {
        return;
    }
    $s =& $commu['setting'][$mode];
    $ip = ip2long($onlineip);
    $time = getdate($timestamp);
    $time = mktime(0, 0, 0, $time['mon'], $time['mday'], $time['year']);
    $record = $db->result_one("SELECT COUNT(*) FROM {$tblprefix}spreads WHERE mid='{$mid}' AND ip={$ip} AND mode={$mode} AND time>{$time}");
    if ($s['value'] && (!$s['count'] || $s['count'] > $db->result_one("SELECT COUNT(*) FROM {$tblprefix}spreads WHERE mid='{$mid}' AND time>{$time}")) && !$record) {
        $user->updatecrids(array($s['crid'] => $s['value']), 1);
    }
    $record || $db->query("INSERT INTO {$tblprefix}spreads(mid,ip,mode,time) VALUES('{$mid}',{$ip},{$mode},{$timestamp})");
    $mode ? mclearcookie('spread_uid') : msetcookie('spread_uid', $uid);
}
Example #2
0
<?php

include_once dirname(dirname(__FILE__)) . '/include/general.inc.php';
include_once M_ROOT . './include/common.fun.php';
$forward = empty($forward) ? M_REFERER : $forward;
$forwardstr = '&forward=' . rawurlencode($forward);
if (!($mcommu = read_cache('mcommu', 3))) {
    message('setmemcommitem');
}
if (empty($mcommu['ucadd'])) {
    $mid = empty($mid) ? 0 : max(0, intval($mid));
    if (!$mid) {
        message('chooseflinkofmember');
    }
    $actuser = new cls_userinfo();
    $actuser->activeuser($mid);
    if (!$actuser->info['mid']) {
        message('chooseflinkofmember');
    }
    if (!$curuser->pmbypmids('cuadd', $mcommu['setting']['apmid'])) {
        message('younoflinkpermis');
    }
    $fieldsarr = empty($mcommu['setting']['fields']) ? array() : explode(',', $mcommu['setting']['fields']);
    if (!submitcheck('newcommu')) {
        if (!empty($mcommu['setting']['norepeat']) && ($cid = $db->result_one("SELECT cid FROM {$tblprefix}mflinks WHERE mid='{$mid}' AND fromid='{$memberid}' ORDER BY cid"))) {
            message('dorepeataddflink');
        }
        if (empty($mcommu['addtpl']) || !($template = load_tpl($mcommu['addtpl']))) {
            load_cache('mlangs,mlfields');
            include_once M_ROOT . "./include/fields.cls.php";
            include_once M_ROOT . "./include/cheader.inc.php";
Example #3
0
 $aids = array();
 $hash = array();
 foreach ($goods as $v) {
     $tmp = explode(',', $v);
     if (!is_numeric($tmp[0])) {
         continue;
     }
     if ($tmp[1] == $oid) {
         $aids[] = $tmp[0];
         $hash[$tmp[0]] = $tmp[2];
     }
 }
 empty($aids) && mcmessage('nogoods');
 if ($oid) {
     //商家
     $user = new cls_userinfo();
     $user->activeuser($oid, 1);
     $shipingfee = array(1 => $user->info['shipingfee1'], 2 => $user->info['shipingfee2'], 3 => $user->info['shipingfee3']);
 } else {
     //网站
     for ($i = 1; $i < 4; $i++) {
         isset(${"shipingfee{$i}"}) || (${"shipingfee{$i}"} = -1);
     }
     $shipingfee = array(1 => $shipingfee1, 2 => $shipingfee2, 3 => $shipingfee3);
 }
 #	$ordersn = date('Ymd').'-'.$memberid.'-'.date('His').'-'.random(6,1);
 $spmodearr = array('0' => lang('noshiping'));
 foreach ($shipingfee as $k => $v) {
     $v >= 0 && ($spmodearr[$k . '_' . $v] = lang("shipingfee{$k}") . "({$v})");
 }
 $aids = join(',', $aids);
Example #4
0
             $counts = $db->result_one("SELECT count(*) {$fromsql} {$wheresql}");
             $multi = multi($counts, $atpp, $page, "?entry=inarchive&action=answers&aid={$aid}{$param_suffix}{$filterstr}");
             echo $itemstr;
             tabfooter();
             echo $multi;
             echo '<br><br>' . strbutton('barcsedit', lang('delete')) . '</form>';
             a_guide('answersedit');
         } else {
             include M_ROOT . $u_tplname;
         }
     } else {
         if (empty($selectid)) {
             amessage('pchoosecontent', M_REFERER);
         }
         $aedit = new cls_arcedit();
         $actuser = new cls_userinfo();
         $query = $db->query("SELECT aid,mid,checked FROM {$tblprefix}answers WHERE cid " . multi_str($selectid));
         while ($row = $db->fetch_array($query)) {
             $aedit->set_aid($row['aid']);
             $row['checked'] && $aedit->arc_nums('adopts', -1, 0);
             $aedit->arc_nums('answers', -1, 1);
             $aedit->init();
             $actuser->activeuser($row['mid']);
             $actuser->basedeal('answer', 0, 1, 1);
             $actuser->init();
         }
         $db->query("DELETE FROM {$tblprefix}answers WHERE cid " . multi_str($selectid), 'UNBUFFERED');
         adminlog(lang('answersetsucceed'), lang('answersetsucceed'));
         amessage('contentsetsucceed', "?entry=inarchive&action=answers&aid={$aid}{$param_suffix}&page={$page}{$filterstr}");
     }
 } else {
Example #5
0
function follow_dynamic($aid = 0, $mode = 'down', $temparr = array())
{
    global $db, $tblprefix, $arc, $sptpls, $memberid, $sid, $timestamp, $cms_abs, $cache1circle, $currencys, $curuser, $templatedir, $btags, $mconfigs, $_mp, $_actid, $_midarr, $_a_vars, $_a_var, $mpnav, $mptitle;
    @extract($mconfigs, EXTR_SKIP);
    $arc->arcid($aid);
    if (empty($arc->aid)) {
        message(lang('confchoosarchi'));
    }
    !$arc->archive['checked'] && message(lang('poinarchnoch'));
    switch_cache($arc->archive['sid']);
    $sid = $arc->archive['sid'];
    if_siteclosed($sid);
    if (!arc_allow($arc->archive, 'down')) {
        message(lang('noarchivbrowpermis'));
    }
    if ($crids = $arc->arc_crids(1)) {
        //需要对当前用户扣值
        $cridstr = '';
        foreach ($crids['total'] as $k => $v) {
            $cridstr .= ($cridstr ? ',' : '') . abs($v) . $currencys[$k]['unit'] . $currencys[$k]['cname'];
        }
        $commu = read_cache('commu', 8);
        if (empty($commu['setting']['autoatm'])) {
            //不自动扣值的情况:提示出订阅链接,选择是否订阅
            message(lang('subattachwanpaycur') . $cridstr . "<br><br><a href=\"{$cms_abs}tools/subscribe.php?aid={$aid}&isatm=1\">>>" . lang('subscribe') . "</a>");
        } else {
            //自动扣值,当前会员扣值及向出售者支付积分
            if (!$curuser->crids_enough($crids['total'])) {
                message(lang('subattachwanpaycur') . $cridstr . lang('younosuatwaencur'));
            }
            $curuser->updatecrids($crids['total'], 0, lang('subsattach'));
            $curuser->payrecord($arc->aid, 1, $cridstr, 1);
            if (!empty($crids['sale'])) {
                $actuser = new cls_userinfo();
                $actuser->activeuser($arc->archive['mid']);
                foreach ($crids['sale'] as $k => $v) {
                    $crids['sale'][$k] = -$v;
                }
                $actuser->updatecrids($crids['sale'], 1, lang('saleattach'));
                unset($actuser);
            }
        }
    }
    $arc->detail_data();
    $_da =& $arc->archive;
    arc_parse($_da);
    if (empty($temparr['tmode'])) {
        if ($temp = @unserialize($_da[$temparr['tname']])) {
            $temp = @$temp[$temparr['fid']];
        }
    } else {
        $temp = @explode('#', $arc->archive[$temparr['tname']]);
    }
    $_da['url'] = view_atmurl(@$temp['remote']);
    $_da['player'] = @$temp['player'];
    unset($temp);
    empty($_da['url']) && message(lang('noattach'));
    save_nums($aid, $mode);
    //统计下载或播放数
    if (!($tplname = $sptpls[$mode])) {
        follow_notpl($mode, $_da['url'], $_da['player']);
    }
    if ($mode == 'down') {
        $auth = authcode($memberid . "\t" . $aid . "\t" . $temparr['tname'] . "\t" . $temparr['tmode'] . "\t" . $temparr['fid'], 'ENCODE');
        $_da['trueurl'] = $cms_abs . "tools/down.php?auth={$auth}&aid=" . $arc->aid . "&tname={$temparr['tname']}&tmode={$temparr['tmode']}&fid={$temparr['fid']}";
        //真实下载地址
    } elseif ($cache1circle) {
        $auth = authcode($temparr['tname'] . "\t" . $temparr['tmode'] . "\t" . $temparr['fid'], 'ENCODE');
        $cachefile = htmlcac_dir('fw', date('Ym', $arc->archive['createdate']), 1) . cac_namepre($arc->aid, $arc->archive['createdate']) . '_' . $auth . '.php';
        if (is_file($cachefile) && filemtime($cachefile) > $timestamp - $cache1circle * 60) {
            mexit(read_htmlcac($cachefile));
        }
    }
    _aenter($_da, 1, array('url', 'player'));
    @extract($btags);
    extract($_da, EXTR_OVERWRITE);
    tpl_refresh($tplname);
    @(include M_ROOT . "template/{$templatedir}/pcache/{$tplname}.php");
    $_content = ob_get_contents();
    ob_clean();
    if ($cache1circle && $mode != 'down') {
        save_htmlcac($_content, $cachefile);
    }
    mexit($_content);
}
Example #6
0
             $a_field->deal();
             if (!empty($a_field->error)) {
                 $c_upload->rollback();
                 message($a_field->error, M_REFERER);
             }
             ${$v['tbl'] . 'arr'}[$k] = $a_field->newvalue;
             if ($arr = multi_val_arr($a_field->newvalue, $v)) {
                 foreach ($arr as $x => $y) {
                     ${$v['tbl'] . 'arr'}[$k . '_' . $x] = $y;
                 }
             }
         }
     }
 }
 unset($a_field);
 $newuser = new cls_userinfo();
 $newuser->useradd($mainarr['mname'], $mainarr['password'], $mainarr['email'], $mchid);
 $mid = $newuser->info['mid'];
 $c_upload->closure(1, $mid, 'members');
 $mid || message('memregisterfail', M_REFERER);
 if ($autocheck == 2) {
     $confirmid = random(6);
     $confirmstr = "{$timestamp}\t2\t{$confirmid}";
     $subarr['confirmstr'] = $confirmstr;
 }
 foreach (array('main', 'sub', 'custom') as $var) {
     foreach (${$var . 'arr'} as $k => $v) {
         $newuser->updatefield($k, $v, $var);
     }
 }
 $newuser->autoinit();
Example #7
0
     if (empty($pages)) {
         $counts = $db->result_one("SELECT count(*) {$fromsql} {$wheresql}");
         $pages = @ceil($counts / $atpp);
     }
     if ($npage <= $pages) {
         $fromstr = empty($fromid) ? "" : "cu.cid<{$fromid}";
         $nwheresql = !$wheresql ? $fromstr ? "WHERE {$fromstr}" : "" : $wheresql . ($fromstr ? " AND " : "") . $fromstr;
         $query = $db->query("SELECT cu.cid {$fromsql} {$nwheresql} ORDER BY cu.cid DESC LIMIT 0,{$atpp}");
         while ($item = $db->fetch_array($query)) {
             $selectid[] = $item['cid'];
         }
     }
 }
 if (!empty($arcdeal['delete'])) {
     $aedit = new cls_arcedit();
     $actuser = new cls_userinfo();
     $query = $db->query("SELECT aid,mid FROM {$tblprefix}comments WHERE cid " . multi_str($selectid));
     while ($row = $db->fetch_array($query)) {
         $aedit->set_aid($row['aid']);
         $aedit->arc_nums('comments', -1, 1);
         $aedit->init();
         $actuser->activeuser($row['mid']);
         $actuser->basedeal('comment', 0, 1, 1);
         $actuser->init();
     }
     $db->query("DELETE FROM {$tblprefix}comments WHERE cid " . multi_str($selectid), 'UNBUFFERED');
 } else {
     if (!empty($arcdeal['check'])) {
         $db->query("UPDATE {$tblprefix}comments SET checked='1' WHERE cid " . multi_str($selectid));
     }
     if (!empty($arcdeal['uncheck'])) {
Example #8
0
 function showlist()
 {
     global $db, $tblprefix, $curuser, $eid, $atpp, $page, $mid, $mname, $checked, $dmode, $date1, $date2;
     if ($eid) {
         return $this->isadmin ? $this->check() : ($eid == 'new' ? $this->addnew() : $this->show());
     }
     if (!submitcheck('bextedit')) {
         if (defined('M_MCENTER')) {
             $css = array('L' => 'item2', 'R' => 'item right', 'C' => 'item');
             $membercname = lang('membercname');
             $checkstate = lang('checkstate');
         } else {
             $css = array('L' => 'txtL', 'R' => 'txtR', 'C' => 'txtC');
             $membercname = lang('member_cname');
             $checkstate = lang('check_state');
         }
         $page = !empty($page) ? max(1, intval($page)) : 1;
         submitcheck('bfilter') && ($page = 1);
         if ($this->isadmin) {
             $wheresql = ' 1=1';
             $u_lists = array('mname', 'integral', 'total', 'rate', 'checkdate', 'createdate', 'view');
         } else {
             $wheresql = " mid={$curuser->info['mid']}";
             $u_lists = array('integral', 'total', 'rate', 'checkdate', 'createdate', 'view');
         }
         $mname && ($wheresql .= " AND mname LIKE '%" . str_replace(array(' ', '*'), '%', addcslashes($mname, '%_')) . "%'");
         isset($checked) || ($checked = '-1');
         $checked != '-1' && ($wheresql .= ' AND checkdate' . ($checked ? '!' : '') . '=0');
         $datefield = $dmode ? 'checkdate' : 'createdate';
         if ($date1 && preg_match("/\\s*(\\d{4})-(\\d{1,2})-(\\d{1,2})(?:\\s+(\\d{1,2}):(\\d{1,2}):(\\d{1,2}))?\\s*\$/", $date1, $match)) {
             $date = mktime(empty($match[4]) ? 0 : $match[4], empty($match[5]) ? 0 : $match[5], empty($match[6]) ? 0 : $match[6], $match[2], $match[3], $match[1]);
             $date && $date > 0 && ($wheresql .= " AND {$datefield}>='{$date}'");
         }
         if ($date2 && preg_match("/\\s*(\\d{4})-(\\d{1,2})-(\\d{1,2})(?:\\s+(\\d{1,2}):(\\d{1,2}):(\\d{1,2}))?\\s*\$/", $date2, $match)) {
             $date = mktime(empty($match[4]) ? 24 : $match[4], empty($match[5]) ? 59 : $match[5], empty($match[6]) ? 59 : $match[6], $match[2], $match[3], $match[1]);
             $date && $date > 0 && ($wheresql .= " AND {$datefield}<='{$date}'");
         }
         echo form_str('extract_list', "?{$_SERVER['QUERY_STRING']}");
         if ($this->isadmin) {
             //搜索区块
             tabheader_e();
             echo "<tr><td colspan=\"2\" class=\"txt txtleft\">";
             //关键词固定显示
             echo $membercname . "&nbsp; <input class=\"text\" name=\"mname\" type=\"text\" value=\"{$mname}\" size=\"8\" style=\"vertical-align: middle;\">&nbsp; ";
             $checkarr = array('-1' => lang('nolimit'), '0' => lang('nocheck'), '1' => lang('checked'));
             echo "<select style=\"vertical-align: middle;\" name=\"checked\">" . makeoption($checkarr, $checked) . "</select>&nbsp; ";
             $dmodearr = array('0' => lang('needtime'), '1' => lang('checkdate'));
             echo "<select style=\"vertical-align: middle;\" name=\"dmode\">" . makeoption($dmodearr, $dmode) . "</select>&nbsp; " . "<input class=\"text\" id=\"extract_date1\" name=\"date1\" type=\"text\" value=\"{$date1}\" onclick=\"ShowCalendar(this.id);\" style=\"vertical-align: middle;width:120px\">&nbsp; -&nbsp; " . "<input class=\"text\" id=\"extract_date2\" name=\"date2\" type=\"text\" value=\"{$date2}\" onclick=\"ShowCalendar(this.id);\" style=\"vertical-align: middle;width:120px\">&nbsp; " . "<input class=\"btn\" type=\"submit\" name=\"bfilter\" id=\"bfilter\" value=\"" . lang('filter0') . "\">&nbsp;" . "</td></tr>";
             tabfooter();
         }
         $pagetmp = $page;
         do {
             $query = $db->query("SELECT * FROM {$tblprefix}extracts WHERE {$wheresql} ORDER BY {$datefield} DESC LIMIT " . ($pagetmp - 1) * $atpp . ",{$atpp}");
             $pagetmp--;
         } while (!$db->num_rows($query) && $pagetmp);
         $count = $db->result_one("SELECT count(*) FROM {$tblprefix}extracts WHERE {$wheresql}");
         $view = lang('message');
         tabheader(lang('extract_list') . ($this->isadmin ? '' : "&nbsp;[<a href=\"?{$_SERVER['QUERY_STRING']}&eid=new\" onclick=\"return floatwin('open_extractview',this)\">" . lang('submit_extract') . '</a>]'), '', '', count($u_lists) + 1);
         $cy_arr = array();
         $this->isadmin && ($cy_arr[] = '<input class="checkbox" type="checkbox" name="chkall" onclick="checkall(this.form, \'selectid\', \'chkall\')">');
         in_array('mname', $u_lists) && ($cy_arr[] = array($membercname, $css['L']));
         in_array('integral', $u_lists) && ($cy_arr[] = lang('extract_count'));
         in_array('total', $u_lists) && ($cy_arr[] = lang('extract_getcount'));
         in_array('rate', $u_lists) && ($cy_arr[] = lang('extract_discount'));
         in_array('checkdate', $u_lists) && ($cy_arr[] = lang('checkdate'));
         in_array('createdate', $u_lists) && ($cy_arr[] = lang('needtime'));
         #			in_array('delstate',$u_lists) && $cy_arr[] = lang('delstate');
         in_array('view', $u_lists) && ($cy_arr[] = $view);
         trcategory($cy_arr);
         while ($item = $db->fetch_array($query)) {
             #				$checked = $item['checked'] ? 'Y' : '-';
             #				$delete = $item['delstate'] ? 'Y' : '-';
             $checkdate = $item['checkdate'] ? date('Y-m-d', $item['checkdate']) : '-';
             $createdate = date('Y-m-d', $item['createdate']);
             $itemstr = '<tr class="txt">';
             $this->isadmin && ($itemstr .= "<td class=\"{$css['C']} w40\" ><input class=\"checkbox\" type=\"checkbox\" name=\"selectid[{$item['eid']}]\" value=\"{$item['eid']}\"></td>\n");
             in_array('mname', $u_lists) && ($itemstr .= "<td class=\"{$css['L']}\">{$item['mname']}</td>\n");
             in_array('integral', $u_lists) && ($itemstr .= "<td class=\"{$css['C']}\">{$item['integral']}</td>\n");
             in_array('total', $u_lists) && ($itemstr .= "<td class=\"{$css['C']}\">{$item['total']}</td>\n");
             in_array('rate', $u_lists) && ($itemstr .= "<td class=\"{$css['C']}\">{$item['rate']}%</td>\n");
             in_array('checkdate', $u_lists) && ($itemstr .= "<td class=\"{$css['C']}\">{$checkdate}</td>\n");
             in_array('createdate', $u_lists) && ($itemstr .= "<td class=\"{$css['C']}\">{$createdate}</td>\n");
             #				in_array('delstate',$u_lists) && $itemstr .= "<td class=\"$css[C]\">$delete</td>\n";
             in_array('view', $u_lists) && ($itemstr .= "<td class=\"{$css['C']}\"><a href=\"?{$_SERVER['QUERY_STRING']}&eid={$item['eid']}\" onclick=\"return floatwin('open_extractview',this)\">{$view}</a></td>\n");
             $itemstr .= "</tr>\n";
             echo $itemstr;
         }
         tabfooter();
         echo multi($count, $atpp, $page, preg_replace("/[?&]page=\\d+\$|([?&])page=\\d+&/", '$1', "?{$_SERVER['QUERY_STRING']}"));
         if ($this->isadmin) {
             tabheader(lang('operate_item'));
             trbasic(lang('choose_item'), '', '<input class="checkbox" type="checkbox" name="extdeal[delete]" id="extdeal_delete" value="1"><label for="extdeal_delete" >' . lang('delete') . '</label>&nbsp;<input class="checkbox" type="checkbox" name="extdeal[check]" id="extdeal_check" value="1"><label for="extdeal_check" >' . lang('check') . '</label>&nbsp;', '');
             tabfooter('bextedit');
         }
     } elseif ($this->isadmin) {
         global $selectid, $extdeal, $timestamp;
         if (function_exists('mcmessage')) {
             $message = 'mcmessage';
             $empty_item = 'selectoperateitem';
         } else {
             $message = 'amessage';
             $empty_item = 'selectoperateitem';
         }
         empty($extdeal) && $message($empty_item, axaction(1, M_REFERER));
         empty($selectid) && $message('select_extract', axaction(1, M_REFERER));
         $wheresql = $this->isadmin ? '' : " AND mid={$curuser->info['mid']}";
         $user = new cls_userinfo();
         foreach ($selectid as $eid) {
             if (!empty($extdeal['delete'])) {
                 if ($row = $db->fetch_one("SELECT mid,integral,checkdate FROM {$tblprefix}extracts WHERE eid='{$eid}'{$wheresql} LIMIT 0,1")) {
                     /*						if($this->isadmin){
                     							$sql = $row['delstate'] == 2 || !$row['checked'] ? "DELETE FROM {$tblprefix}extracts" :($row['delstate'] == 0 ? "UPDATE {$tblprefix}extracts SET delstate=1" : '');
                     						}else{
                     							$sql = $row['delstate'] == 1 || !$row['checked'] ? "DELETE FROM {$tblprefix}extracts" :($row['delstate'] == 0 ? "UPDATE {$tblprefix}extracts SET delstate=2" : '');
                     						}
                     						$sql && $db->query("$sql WHERE eid='$eid'");*/
                     if ($row['checkdate'] == 0) {
                         $user->activeuser($row['mid']);
                         $user->updatecrids(array('0' => $row['integral']), 1);
                     }
                     $db->query("DELETE FROM {$tblprefix}extracts WHERE eid='{$eid}'");
                 }
                 continue;
             }
             $this->isadmin && $db->query("UPDATE {$tblprefix}extracts SET checkdate={$timestamp} WHERE checkdate=0 AND eid='{$eid}'");
         }
         $this->isadmin && !empty($extdeal['delete']) && adminlog(lang('extract_admin'), lang('extract_operate'));
         $message('extract_operate_finish', M_REFERER);
     }
 }
Example #9
0
}
include_once M_ROOT . './include/general.fun.php';
include_once M_ROOT . './include/parse/general.php';
load_cache('mconfigs');
@extract($mconfigs);
!empty($cmsclosed) && exit('System Closed');
empty($rss_enabled) && exit('RSS Disabled');
$rss_num = 20;
include_once M_ROOT . './include/mysql.cls.php';
$db = new cls_mysql();
$db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect, true, $dbcharset);
include_once M_ROOT . './include/userinfo.cls.php';
load_cache('grouptypes');
sys_cache('nouserinfos');
$authorization = md5($authkey);
$curuser = new cls_userinfo();
$curuser->rss_user();
load_cache('cotypes,permissions');
$querystr = $_SERVER['QUERY_STRING'];
parse_str($querystr, $temparr);
//参数有先后排序
$sid = empty($temparr['sid']) ? 0 : max(0, intval($temparr['sid']));
load_cache('catalogs,cnodes', $sid);
$vararr = array('caid');
foreach ($cotypes as $coid => $cotype) {
    $cotype['sortable'] && ($vararr[] = 'ccid' . $coid);
}
$cnstr = '';
$cn_name = $cmsname;
$sqlstr = '';
foreach ($temparr as $k => $v) {
Example #10
0
         $itemnew['checked'] = empty($itemnew['checked']) ? 0 : 1;
         if ($itemnew['checked'] != $items[$cid]['checked']) {
             $sql_asw .= "checked=" . $itemnew['checked'];
             $adoptsnew += $itemnew['checked'] - $items[$cid]['checked'];
         }
         $itemnew['currency'] = max(0, intval($itemnew['currency']));
         if (min($itemnew['currency'], $sparenew) != $items[$cid]['currency']) {
             $sql_asw .= ($sql_asw ? ',' : '') . "currency=" . min($itemnew['currency'], $sparenew);
         }
         $sql_asw && $db->query("UPDATE {$tblprefix}answers SET {$sql_asw} WHERE aid={$aid} AND cid={$cid}");
         $sparenew = max(0, $sparenew - $itemnew['currency']);
     }
     $sql_arc .= ($sql_arc ? ',' : '') . "adopts={$adoptsnew}";
 }
 if (!empty($archivenew['notaclosed'])) {
     $auser = new cls_userinfo();
     $query = $db->query("SELECT * FROM {$tblprefix}answers WHERE aid={$aid}");
     while ($item = $db->fetch_array($query)) {
         if ($item['currency']) {
             $auser->activeuser($item['mid']);
             $auser->updatecrids(array($item['crid'] => $item['currency']), 1, lang('answer_reward'));
             $auser->init();
         }
     }
     $auser->activeuser($aedit->archive['mid']);
     $commu = read_cache('commu', $channels[$aedit->archive['chid']]['cuid']);
     if ($commu['setting']['credit']) {
         $auser->sub_data();
         $auser->updatefield('credits', $auser->info['credits'] + ($aedit->archive['currency'] - $sparenew) * $commu['setting']['credit'], 'sub');
     }
     $auser->updatecrids(array($aedit->archive['crid'] => $sparenew), 1, lang('answer_reward'));
Example #11
0
}
if (empty($mcommu['ucadd'])) {
    if (empty($mcommu['available'])) {
        cumessage('scorefunclosed');
    }
    if (!$curuser->pmbypmids('cuadd', $mcommu['setting']['apmid'])) {
        cumessage('younoscorepermis', $forward);
    }
    if (!empty($mcommu['setting']['norepeat']) || !empty($mcommu['setting']['repeattime'])) {
        if (empty($m_cookie['08cms_mcuid_1_' . $mid])) {
            msetcookie('08cms_mcuid_1_' . $mid, '1', !empty($mcommu['setting']['norepeat']) ? 365 * 24 * 3600 : $mcommu['setting']['repeattime'] * 60);
        } else {
            cumessage(empty($mcommu['setting']['norepeat']) ? 'overquick' : 'dontrepeatscore', $forward);
        }
    }
    $actuser = new cls_userinfo();
    $actuser->activeuser($mid, 1);
    if (!$actuser->info['mid']) {
        cumessage('choosemember', $forward);
    }
    $score = empty($score) ? 0 : max(0, intval($score));
    $score = max(1, min(5, $score));
    //统计原有评分数
    $counts = 0;
    for ($i = 1; $i <= 5; $i++) {
        $counts += $actuser->info['mscores' . $i];
    }
    $actuser->updatefield('mscores' . $score, $actuser->info['mscores' . $score] + 1, 'sub');
    $actuser->updatefield('mavgscore', round(($counts * $actuser->info['mavgscore'] + $score) / ($counts + 1), 2), 'sub');
    //平均分
    $actuser->updatedb();
Example #12
0
        $savingmodearr = array('0' => lang('saving'), '1' => lang('deductvalue'));
        tabheader(lang('member_inout'), 'currencysaving', '?entry=currencys&action=currencysaving');
        trbasic(lang('member_cname'), 'crsaving[mname]');
        trbasic(lang('choose_cutype'), '', makeradio('crsaving[crid]', $crids), '');
        trbasic(lang('operate_type'), '', makeradio('crsaving[savingmode]', $savingmodearr), '');
        trbasic(lang('currency_amount'), 'crsaving[currency]');
        tabfooter('bcurrencysaving');
        a_guide('currencysaving');
    } else {
        $crsaving['mname'] = trim($crsaving['mname']);
        $crsaving['currency'] = max(0, round($crsaving['currency'], 2));
        if (empty($crsaving['mname']) || empty($crsaving['currency'])) {
            amessage('datamissing', '?entry=currencys&action=currencysaving');
        }
        $mnames = array_filter(explode(',', $crsaving['mname']));
        $actuser = new cls_userinfo();
        foreach ($mnames as $v) {
            $v = trim($v);
            if (empty($v)) {
                continue;
            }
            $actuser->activeuserbyname($v);
            $actuser->cridsaving($crsaving['crid'], $crsaving['savingmode'] ? 0 : 1, $crsaving['currency']);
        }
        unset($actuser);
        adminlog(lang('member_cu_saving'), lang('member_cu_saving'));
        amessage('currencyinoutfinish', '?entry=currencys&action=currencysaving');
    }
} elseif ($action == 'cradminlogs') {
    backallow('save') || amessage('no_apermission');
    $url_type = 'cysave';
Example #13
0
    url_nav(lang('repurelate'), $urlsarr, 'hand');
    if (!submitcheck('brepuadd')) {
        $modearr = array('0' => lang('increase'), '1' => lang('deductvalue'));
        tabheader(lang('hand_repu'), 'repuadd', "?entry={$entry}&action={$action}");
        trbasic(lang('member_cname'), 'repuadd[mname]', '', 'text', lang('agmultiuser'));
        trbasic(lang('operate_type'), '', makeradio('repuadd[mode]', $modearr), '');
        trbasic(lang('amount'), 'repuadd[repus]');
        trbasic(lang('reason'), 'repuadd[reason]', '', 'btext');
        tabfooter('brepuadd');
    } else {
        $repuadd['mname'] = trim($repuadd['mname']);
        $repuadd['repus'] = max(0, round($repuadd['repus'], 2));
        if (empty($repuadd['mname']) || empty($repuadd['repus'])) {
            amessage('datamissing', M_REFERER);
        }
        $repus = empty($repuadd['mode']) ? $repuadd['repus'] : -$repuadd['repus'];
        $mnames = array_filter(explode(',', $repuadd['mname']));
        $actuser = new cls_userinfo();
        foreach ($mnames as $v) {
            $v = trim($v);
            if (empty($v)) {
                continue;
            }
            $actuser->activeuserbyname($v);
            $actuser->repuadd($repus, $repuadd['reason'], 1);
        }
        unset($actuser);
        adminlog(lang('hand_repu'), lang('hand_repu'));
        amessage('handrepufin', "?entry={$entry}&action={$action}");
    }
}
Example #14
0
 function setStatus($status, $remark = '')
 {
     global $db, $tblprefix, $timestamp, $onlineautosaving;
     switch ($this->status = $status) {
         case PAY_FINISHED:
             //交易完成
             $remark || ($remark = '交易完成');
             break;
         case PAY_FAIL:
             //交易失败
             $remark || ($remark = '交易失败');
             break;
         case PAY_WAIT_PAY:
             //等待付款
             $remark || ($remark = '等待付款');
             break;
         case PAY_WAIT_GOODS:
             //等待发货
             $remark || ($remark = '等待发货');
             break;
         case PAY_CONFIRM_GOODS:
             //等待买家确认收货
             $remark || ($remark = '等待买家确认收货');
             break;
         default:
             $this->message(array('title' => '调用错误', 'content' => "未定义的交易状态 “{$status”!}"));
     }
     switch ($this->by) {
         case 'orders':
             $upsql = ",remark='" . addslashes($remark) . "'";
             ($status == PAY_WAIT_GOODS || $status == PAY_FINISHED && !$this->totalfee) && ($upsql .= ",payed=totalfee");
             $db->query("UPDATE {$tblprefix}orders SET state={$status},updatedate={$timestamp}{$upsql} WHERE ({$status}<0 OR state<{$status}) AND oid='{$this->order_id}'");
             if ($ret = $db->affected_rows()) {
                 $query = $db->query("SELECT aid,tocid as cid,price,nums FROM {$tblprefix}purchases WHERE oid='{$this->order_id}'");
                 $nums = 0;
                 $aedit = new cls_arcedit();
                 while ($row = $db->fetch_array($query)) {
                     $nums += $row['nums'];
                     if ($row['cid']) {
                         //商家商品
                     } else {
                         //网站商品
                         $aedit->init();
                         $aedit->set_aid($row['aid']);
                         $aedit->arc_nums('orders', $row['nums']);
                         $aedit->arc_nums('ordersum', $row['price'] * $row['nums'], 1);
                     }
                 }
                 $user = new cls_userinfo();
                 $user->activeuser($this->mid, 1);
                 $user->basedeal('purchase', 1, $nums, 1);
             }
             break;
         case 'pays':
             $upsql = $onlineautosaving ? ",transdate={$timestamp}" : '';
             $db->query("UPDATE {$tblprefix}pays SET receivedate={$timestamp}{$upsql} WHERE receivedate=0 AND pid='{$this->order_id}'");
             $ret = $db->affected_rows();
             if ($ret && $upsql) {
                 $user = new cls_userinfo();
                 $user->activeuser($this->mid);
                 $user->updatecrids(array(0 => $this->totalfee), 1);
             }
             break;
         default:
             $this->message(array('title' => '调用错误', 'content' => "未定义的交易!"));
     }
     return $ret;
 }
Example #15
0
         $fromstr = empty($fromid) ? "" : "pid<{$fromid}";
         $nwheresql = !$wheresql ? $fromstr ? "WHERE {$fromstr}" : "" : $wheresql . ($fromstr ? " AND " : "") . $fromstr;
         $query = $db->query("SELECT pid FROM {$tblprefix}pays {$nwheresql} ORDER BY pid DESC LIMIT 0,{$atpp}");
         while ($item = $db->fetch_array($query)) {
             $selectid[] = $item['pid'];
         }
     }
 }
 if (!empty($arcdeal['delete'])) {
     $db->query("DELETE FROM {$tblprefix}pays WHERE pid " . multi_str($selectid) . " AND (receivedate=0 OR transdate>0)", 'SILENT');
 } else {
     if (!empty($arcdeal['receive'])) {
         $db->query("UPDATE {$tblprefix}pays SET receivedate='" . (empty($arcreceive) ? 0 : $timestamp) . "' WHERE pid " . multi_str($selectid) . " AND transdate=0", 'SILENT');
     }
     if (!empty($arcdeal['trans'])) {
         $auser = new cls_userinfo();
         $query = $db->query("SELECT * FROM {$tblprefix}pays WHERE pid " . multi_str($selectid));
         while ($item = $db->fetch_array($query)) {
             if (!$item['amount'] || !$item['receivedate'] || $item['transdate']) {
                 continue;
             }
             $auser->activeuser($item['mid']);
             $auser->updatecrids(array(0 => $item['amount']), 1, lang('cashsav'));
             $db->query("UPDATE {$tblprefix}pays SET transdate='{$timestamp}' WHERE pid='{$item['pid']}'", 'SILENT');
             $auser->init();
         }
         unset($actuser);
     }
 }
 if (!empty($select_all)) {
     $npage++;
Example #16
0
         echo $itemstr;
         tabfooter();
         echo $multi;
         echo '<br><br>' . strbutton('barcsedit', 'submit') . '</form>';
         m_guide(@$u_guide);
     } else {
         include M_ROOT . $u_tplname;
     }
 } else {
     if ($aedit->archive['closed'] || $aedit->archive['finishdate'] && $aedit->archive['finishdate'] < $timestamp) {
         mcmessage('questionclose', M_REFERER);
     }
     if (empty($currencynew)) {
         mcmessage('chooseanswer', M_REFERER);
     }
     $auser = new cls_userinfo();
     $sparenew = $aedit->archive['spare'];
     foreach ($currencynew as $k => $v) {
         $v = max(0, intval($v));
         $v = $sparenew > $v ? $v : max($sparenew, $v);
         $sqlstr = "checked='" . (empty($selectid[$k]) ? 0 : 1) . "'";
         if ($v) {
             $row = $db->fetch_one("SELECT * FROM {$tblprefix}answers WHERE cid={$k}");
             $auser->activeuser($row['mid']);
             $auser->updatecrids(array($row['crid'] => $v), 1, 'answer');
             $sqlstr .= ",currency=currency+{$v}";
             $sparenew -= $v;
             $auser->init();
         }
         $db->query("UPDATE {$tblprefix}answers SET {$sqlstr} WHERE cid={$k}");
     }
Example #17
0
     $multi = multi($counts, $atpp, $page, "?entry=mtrans&action=mtransedit{$filterstr}");
     tabheader(lang('memchanaltli'), '', '', 8);
     trcategory(array("<input class=\"checkbox\" type=\"checkbox\" name=\"chkdel\" onclick=\"checkall(this.form,'delete','chkdel')\">" . lang('del'), lang('member_cname'), lang('sourcechannel'), lang('targetchannel'), "<input class=\"checkbox\" type=\"checkbox\" name=\"chkcheck\" onclick=\"checkall(this.form,'checkid','chkcheck')\">" . lang('check'), lang('add_date'), lang('detail')));
     echo $itemstr;
     tabfooter();
     echo $multi;
     echo "<input class=\"button\" type=\"submit\" name=\"bmtransedit\" value=\"" . lang('submit') . "\">";
 } else {
     if (empty($delete) && empty($checkid)) {
         amessage('selectaltrec', "?entry=mtrans&action=mtransedit&page={$page}{$filterstr}");
     }
     if (!empty($delete)) {
         $db->query("DELETE FROM {$tblprefix}mtrans WHERE trid " . multi_str($delete));
     }
     if (!empty($checkid)) {
         $actuser = new cls_userinfo();
         foreach ($checkid as $trid) {
             //?????????????????????????????????????????
             if (empty($delete) || !in_array($trid, $delete)) {
                 if ($minfos = $db->fetch_one("SELECT * FROM {$tblprefix}mtrans WHERE trid='{$trid}' AND checked='0'")) {
                     $minfos = array_merge($minfos, $minfos['contentarr'] ? unserialize($minfos['contentarr']) : array());
                     unset($minfos['contentarr']);
                     $actuser->activeuser($minfos['mid'], 2);
                     $omchid = $minfos['fromid'];
                     $mchid = $minfos['toid'];
                     $mchannel = $mchannels[$mchid];
                     foreach (array('additems') as $var) {
                         ${$var} = $mchannel[$var] ? explode(',', $mchannel[$var]) : array();
                     }
                     $mfields = read_cache('mfields', $mchid);
                     if (in_array('mtcid', $additems)) {
Example #18
0
     if (empty($pages)) {
         $itemcount = $db->result_one("SELECT count(*) FROM {$tblprefix}userfiles {$wheresql}");
         $pages = @ceil($itemcount / $atpp);
     }
     if ($npage <= $pages) {
         $fromstr = empty($fromid) ? "" : "ufid<{$fromid}";
         $nwheresql = !$wheresql ? $fromstr ? "WHERE {$fromstr}" : "" : $wheresql . ($fromstr ? " AND " : "") . $fromstr;
         $query = $db->query("SELECT * FROM {$tblprefix}userfiles {$nwheresql} ORDER BY ufid DESC LIMIT 0,{$atpp}");
     }
 } else {
     $query = $db->query("SELECT * FROM {$tblprefix}userfiles WHERE ufid " . multi_str($selectid) . " ORDER BY ufid");
 }
 while ($item = $db->fetch_array($query)) {
     $items[$item['ufid']] = $item;
 }
 $actuser = new cls_userinfo();
 foreach ($items as $item) {
     $actuser->activeuser($item['mid']);
     if ($item['thumbed']) {
         $actuser->updateuptotal(ceil(@filesize(local_file($item['url']) . '.s.jpg') / 1024), 'reduce');
         @unlink(local_file($item['url']) . '.s.jpg');
     }
     $actuser->updateuptotal(ceil($item['size'] / 1024), 'reduce', '1');
     @unlink(local_file($item['url']));
     $actuser->init();
 }
 $db->query("DELETE FROM {$tblprefix}userfiles WHERE ufid " . multi_str(array_keys($items)), 'UNBUFFERED');
 unset($actuser);
 if (!empty($select_all)) {
     $npage++;
     if ($npage <= $pages) {
Example #19
0
     foreach ($mchannels as $k => $v) {
         $midarr && $db->query("DELETE FROM {$tblprefix}members_{$k} WHERE mid " . multi_str($midarr), 'UNBUFFERED');
     }
 } else {
     if (!empty($arcdeal['check'])) {
         $db->query("UPDATE {$tblprefix}members SET checked='1' WHERE mid " . multi_str($selectid) . ($backamember ? '' : " AND grouptype2=0"));
     } elseif (!empty($arcdeal['uncheck'])) {
         $db->query("UPDATE {$tblprefix}members SET checked='0' WHERE mid " . multi_str($selectid) . " AND isfounder != 1" . ($backamember ? '' : " AND grouptype2=0"));
     }
     if (!empty($arcdeal['arcallowance'])) {
         $db->query("UPDATE {$tblprefix}members SET arcallowance='" . max(0, intval($arcarcallowance)) . "' WHERE mid " . multi_str($selectid));
     }
     if (!empty($arcdeal['cuallowance'])) {
         $db->query("UPDATE {$tblprefix}members SET cuallowance='" . max(0, intval($arccuallowance)) . "' WHERE mid " . multi_str($selectid));
     }
     $actuser = new cls_userinfo();
     foreach ($selectid as $id) {
         $actuser->activeuser($id);
         foreach ($grouptypes as $k => $v) {
             if ($v['mode'] < 2 && !empty($arcdeal['gtid' . $k]) && ($backamember || $k != 2)) {
                 $actuser->handgrouptype($k, ${"arcugid{$k}"}, -1);
             }
         }
         $actuser->updatedb();
         $actuser->init();
     }
     unset($actuser);
 }
 if (!empty($select_all)) {
     $npage++;
     if ($npage <= $pages) {
Example #20
0
    $arc = new cls_archive();
    !$arc->arcid($aid) && cumessage('choosearchive');
    !$arc->archive['checked'] && cumessage('poinarcnoche');
    switch_cache($arc->archive['sid']);
    $sid = $arc->archive['sid'];
    $stritem = $isatm ? 'attachment' : 'archive';
    if (!($crids = $arc->arc_crids($isatm))) {
        cumessage("youalrpurchasestritem", '', $stritem);
    }
    $cridstr = '';
    foreach ($crids['total'] as $k => $v) {
        $cridstr .= ($cridstr ? ',' : '') . abs($v) . $currencys[$k]['unit'] . $currencys[$k]['cname'];
    }
    if (!$curuser->crids_enough($crids['total'])) {
        cumessage('younopurcstriwanenocurr', '', $stritem);
    }
    $curuser->updatecrids($crids['total'], 0, lang("purchasestritem", $stritem));
    $curuser->payrecord($arc->aid, $isatm, $cridstr, 1);
    if (!empty($crids['sale'])) {
        $actuser = new cls_userinfo();
        $actuser->activeuser($arc->archive['mid']);
        foreach ($crids['sale'] as $k => $v) {
            $crids['sale'][$k] = -$v;
        }
        $actuser->updatecrids($crids['sale'], 1, lang("salestritem", $stritem));
        unset($actuser);
    }
    cumessage($inajax ? 'succeed' : 'operatesucceed');
} else {
    include M_ROOT . $commu['ucadd'];
}
Example #21
0
} elseif (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], 'unknown')) {
    $onlineip = $_SERVER['REMOTE_ADDR'];
}
preg_match("/[\\d\\.]{7,15}/", $onlineip, $onlineipmatches);
$onlineip = $onlineipmatches[0] ? $onlineipmatches[0] : '';
unset($onlineipmatches);
if (empty($_GET['use_push'])) {
    if ($gzipenable && function_exists('ob_gzhandler')) {
        ob_start('ob_gzhandler');
    } else {
        $gzipenable = 0;
        ob_start();
    }
}
$dbcharset = !$dbcharset && in_array(strtolower($mcharset), array('gbk', 'big5', 'utf-8')) ? str_replace('-', '', $mcharset) : $dbcharset;
$db = new cls_mysql();
$db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect, true, $dbcharset);
$authorization = md5($authkey);
load_cache('grouptypes,permissions,repugrades');
sys_cache('nouserinfos');
$curuser = new cls_userinfo();
if (defined('M_ANONYMOUS')) {
    $curuser->activeuser(1);
} else {
    $curuser->currentuser();
    $memberid = $curuser->info['mid'];
    if ($phpviewerror == 2 || $phpviewerror == 1 && $curuser->isadmin()) {
        //		error_reporting(2047);
        error_reporting(E_ERROR | E_WARNING | E_PARSE);
    }
}
Example #22
0
     } else {
         (empty($selectid) || empty($mcrecord)) && amessage('selectoperateitem', M_REFERER);
         $delete = array_key_exists('delete', $mcrecord);
         foreach ($selectid as $v) {
             if ($delete) {
                 $db->query("DELETE FROM {$tblprefix}mcrecords WHERE crid='{$v}'");
                 continue;
             }
         }
         amessage('mcrecord_finish', M_REFERER);
     }
     break;
 case 'check':
     //单个审核
     (empty($crid) || !($record = $db->fetch_one("SELECT * FROM {$tblprefix}mcrecords WHERE crid='{$crid}' AND checktime=0"))) && amessage('memcert_check_fail');
     $user = new cls_userinfo();
     $user->activeuser($record['mid']);
     $memcert = $memcerts[$record['mcid']];
     strpos($memcert['mchids'], ',' . $user->info['mchid'] . ',') === false && amessage('memcert_check_fail');
     $certdata = unserialize($record['certdata']);
     $values = $certdata['values'];
     empty($msgcode_mode) && ($msgcode_mode = '');
     include_once M_ROOT . "./include/upload.cls.php";
     include_once M_ROOT . "./include/fields.cls.php";
     if (!submitcheck('bmemcertcheck')) {
         tabheader(lang('memcert_check'), 'memcert_check', "?entry={$entry}&action={$action}&crid={$crid}");
         trbasic(lang('member_cname'), '', $record['mname'], '');
         trbasic(lang('memcert_title'), '', $memcert['title'], '');
         trbasic(lang('needtime'), '', date('Y-m-d', $record['needtime']), '');
         //		trbasic(lang('memcert_and_checked'), '', makeradio('memberset[check]', array(1 => lang('yes'), 0 => lang('no')), $memcerts[$record['mcid']]['check']), '');
         tabfooter();
Example #23
0
    $commu = read_cache('commu', 8);
    if (!empty($commu['setting']['autoarc'])) {
        //不自动扣值的情况:如有前导页,进前导页,否则提示出订阅链接,选择是否订阅
        if (!$pretpl) {
            message('purarcwantpaycur' . $cridstr . "<br><br><a href=\"tools/subscribe.php?aid={$aid}\">>>" . lang('subscribe') . "</a>");
        }
        $ispre = 1;
    } else {
        //自动扣值,当前会员扣值及向出售者支付积分
        if (!$curuser->crids_enough($crids['total'])) {
            message(lang('subarcwantpaycur') . $cridstr . lang('younosubsarchivewantenoughcur'));
        }
        $curuser->updatecrids($crids['total'], 0, lang('subscribearchive'));
        $curuser->payrecord($arc->aid, 0, $cridstr, 1);
        if (!empty($crids['sale'])) {
            $actuser = new cls_userinfo();
            $actuser->activeuser($arc->archive['mid']);
            foreach ($crids['sale'] as $k => $v) {
                $crids['sale'][$k] = -$v;
            }
            $actuser->updatecrids($crids['sale'], 1, lang('salearchive'));
            unset($actuser);
        }
    }
}
//读取缓存页面
if (!$enablestatic && $cache1circle) {
    $cachefile = htmlcac_dir($ispre ? 'pre' : 'arc', date('Ym', $arc->archive['createdate']), 1) . cac_namepre($arc->aid) . '_' . $page . '.php';
    if (is_file($cachefile) && filemtime($cachefile) > $timestamp - $cache1circle * 60) {
        mexit(read_htmlcac($cachefile));
    }
Example #24
0
            mcmessage('safecodeerr');
        }
        $mname = trim($mname);
        $email = trim($email);
        if (strlen($mname) < 3 || strlen($mname) > 15) {
            mcmessage('membernamelenillegal');
        }
        $guestexp = '\\xA1\\xA1|^Guest|^\\xD3\\xCE\\xBF\\xCD|\\xB9\\x43\\xAB\\xC8';
        if (preg_match("/^\\s*\$|^c:\\con\\con\$|[%,\\*\"\\s\t\\<\\>\\&]|{$guestexp}/is", $mname)) {
            mcmessage('membercnameillegal');
        }
        if (!$email || !isemail($email)) {
            mcmessage('emailillegal');
        }
        $cmember = $db->fetch_one("SELECT mid,mname,email FROM {$tblprefix}members WHERE mname='{$mname}' AND email='{$email}'");
        if (!$cmember) {
            mcmessage('nomemberemail');
        }
        $actuser = new cls_userinfo();
        $actuser->activeuser($cmember['mid']);
        if ($actuser->isadmin()) {
            mcmessage('mastercannotuse');
        }
        unset($actuser);
        $confirmid = random(6);
        $confirmstr = "{$timestamp}\t1\t{$confirmid}";
        $db->query("UPDATE {$tblprefix}members_sub SET confirmstr='{$confirmstr}' WHERE mid='{$cmember['mid']}'");
        mailto("{$mname} <{$email}>", 'member_getpwd_subject', 'member_getpwd_content', array('mid' => $cmember['mid'], 'mname' => $mname, 'url' => "{$cms_abs}tools/lostpwd.php?action=getpwd&mid={$cmember['mid']}&id={$confirmid}", 'onlineip' => $onlineip));
        mcmessage('lostpwd_send', $forward);
    }
}
Example #25
0
                $transtr .= "&barcsedit=1";
                $transtr .= "&fromid={$fromid}";
                mcmessage('operating', "?action=orders&page={$page}{$filterstr}{$transtr}{$parastr}&dealstr={$dealstr}", $pages, $npage, "<a href=\"?action=orders&page={$page}{$filterstr}\">", '</a>');
            }
        }
        adminlog(lang('orders_admin'), lang('orders_list_admin'));
        mcmessage('ordopefin', "?action=orders&page={$page}{$filterstr}");
    }
} else {
    $forward = empty($forward) ? M_REFERER : $forward;
    empty($oid) && mcmessage('chooseord', $forward);
    if (!($order = $db->fetch_one("SELECT * FROM {$tblprefix}orders WHERE mid={$memberid} AND delstate!=2 AND oid={$oid}"))) {
        mcmessage('chooseorders', $forward);
    }
    if ($order['tomid']) {
        $user = new cls_userinfo();
        $user->activeuser($order['tomid'], 1);
        $cfg_paymode = $user->info['paymode'];
        $cfg_ordermode = $user->info['ordermode'];
        $pays = array(2 => array($user->info['alipay'], $user->info['alipid'], $user->info['alikeyt']), 3 => array($user->info['tenpay'], $user->info['tenkeyt']));
    } else {
        $pays = array(2 => array(@$cfg_alipay, @$cfg_alipay_partnerid, @$cfg_alipay_keyt), 3 => array(@$cfg_tenpay, @$cfg_tenpay_keyt));
    }
    $pmodearr = array();
    foreach (array(0 => 'next', 1 => 'currency', 2 => 'alipay', 3 => 'tenpay') as $k => $v) {
        $cfg_paymode & 1 << $k && ($k < 2 || !in_array('', $pays[$k])) && ($pmodearr[$k] = lang("pay{$v}"));
    }
    empty($pmodearr) && mcmessage('nopaymode');
    if (submitcheck('borderpay')) {
        //确认付款
        $order['state'] == 1 || !$order['state'] && $cfg_ordermode || mcmessage('cheordcanmod', $forward);
Example #26
0
     //已收款订单
     $ordernew['payed'] = round(floatval($ordernew['payed']), 2);
     ($ordernew['payed'] < 0 || $order['state'] && $order['state'] != 1) && amessage('cheordcanmod', $forward);
     $db->query("UPDATE {$tblprefix}orders SET state=-1,updatedate={$timestamp},payed=payed+{$ordernew['payed']} WHERE state>=0 AND oid='{$oid}'");
     $query = $db->query("SELECT aid,price,nums FROM {$tblprefix}purchases WHERE oid='{$oid}'");
     $nums = 0;
     $aedit = new cls_arcedit();
     //商家商品
     while ($row = $db->fetch_array($query)) {
         $nums += $row['nums'];
         $aedit->init();
         $aedit->set_aid($row['aid']);
         $aedit->arc_nums('orders', $row['nums']);
         $aedit->arc_nums('ordersum', $row['price'] * $row['nums'], 1);
     }
     $user = new cls_userinfo();
     $user->activeuser($order['mid'], 1);
     $user->basedeal('purchase', 1, $nums, 1);
     amessage('ordmodfin', $forward);
 } elseif (submitcheck('bordercancel')) {
     //取消订单,返还库存
     $order['state'] && $order['state'] != 1 && amessage('cheordcanmod', $forward);
     $db->query("UPDATE {$tblprefix}orders SET state=-2,updatedate='{$timestamp}' WHERE oid='{$oid}'");
     $query = $db->query("SELECT aid,nums FROM {$tblprefix}purchases WHERE oid='{$oid}'");
     while ($row = $db->fetch_array($query)) {
         $db->query("UPDATE {$tblprefix}archives_sub SET storage=storage+{$row['nums']} WHERE aid={$row['aid']} AND storage>=0");
     }
     amessage('ordmodfin', $forward);
 } elseif (submitcheck('bordermodify')) {
     $modify || amessage('cheordcanmod', $forward);
     //修改订单已付金额
Example #27
0
<?php

(!defined('M_COM') || !defined('M_ADMIN')) && exit('No Permission');
aheader();
backallow('member') || amessage('no_apermission');
load_cache('mchannels,catalogs,acatalogs,cotypes,mtconfigs,channels,grouptypes,currencys,rprojects');
include_once M_ROOT . "./include/upload.cls.php";
include_once M_ROOT . "./include/fields.cls.php";
$backamember = backallow('amember');
$actuser = new cls_userinfo();
$actuser->activeuser($mid, 2);
empty($actuser->info['mid']) && amessage('choosemember');
!empty($actuser->info['isfounder']) && $curuser->info['mid'] != $actuser->info['mid'] && amessage('cannotmodifyfounder');
$mchid = $actuser->info['mchid'];
$mchannel = $mchannels[$mchid];
if ($action == 'memberdetail' && $mid) {
    $mfields = read_cache('mfields', $mchid);
    if (!submitcheck('bmemberdetail')) {
        $a_field = new cls_field();
        $submitstr = '';
        tabheader(lang('base_option') . '&nbsp;:&nbsp;[' . $mchannel['cname'] . ']' . $actuser->info['mname'], 'memberdetail', "?entry=member&action=memberdetail&mid={$mid}", 2, 1, 1);
        trbasic(lang('modify_pwd'), 'minfosnew[password]', '', 'password');
        trbasic('*' . lang('email'), 'minfosnew[email]', $actuser->info['email']);
        $submitstr .= makesubmitstr('minfosnew[password]', 0, 0, 0, 15);
        $submitstr .= makesubmitstr('minfosnew[email]', 1, 'email', 0, 50);
        trbasic(lang('space_tpl_prj'), 'minfosnew[mtcid]', makeoption(mtcidsarr($mchid), $actuser->info['mtcid']), 'select');
        foreach ($mfields as $k => $field) {
            if ($field['available'] && !$field['issystem'] && !$field['isfunc']) {
                $a_field->init();
                $a_field->field = $field;
                $a_field->oldvalue = isset($actuser->info[$k]) ? $actuser->info[$k] : '';
Example #28
0
     $multi = multi($counts, $atpp, $page, "?entry=utrans&action=utransedit{$filterstr}");
     tabheader(lang('useraltlist'), '', '', 8);
     trcategory(array("<input class=\"checkbox\" type=\"checkbox\" name=\"chkdel\" onclick=\"checkall(this.form,'delete','chkdel')\">" . lang('del'), lang('member_cname'), lang('sourceuser'), lang('targetusergroup'), "<input class=\"checkbox\" type=\"checkbox\" name=\"chkcheck\" onclick=\"checkall(this.form,'checkid','chkcheck')\">" . lang('check'), lang('add_date'), lang('detail')));
     echo $itemstr;
     tabfooter();
     echo $multi;
     echo "<input class=\"button\" type=\"submit\" name=\"butransedit\" value=\"" . lang('submit') . "\">";
 } else {
     if (empty($delete) && empty($checkid)) {
         amessage('selectaltrec', "?entry=utrans&action=utransedit&page={$page}{$filterstr}");
     }
     if (!empty($delete)) {
         $db->query("DELETE FROM {$tblprefix}utrans WHERE trid " . multi_str($delete));
     }
     if (!empty($checkid)) {
         $actuser = new cls_userinfo();
         foreach ($checkid as $trid) {
             if (empty($delete) || !in_array($trid, $delete)) {
                 if ($minfos = $db->fetch_one("SELECT * FROM {$tblprefix}utrans WHERE trid='{$trid}' AND checked='0'")) {
                     $actuser->activeuser($minfos['mid']);
                     $gtid = $minfos['gtid'];
                     $tugid = $minfos['toid'];
                     $mchid = $actuser->info['mchid'];
                     if (in_array($mchid, explode(',', $grouptypes[$gtid]['mchids']))) {
                         continue;
                     }
                     if ($tugid && (!($usergroup = read_cache('usergroup', $gtid, $tugid)) || !in_array($mchid, explode(',', $usergroup['mchids'])))) {
                         continue;
                     }
                     $actuser->updatefield("grouptype{$gtid}", $tugid, 'main');
                     $actuser->updatedb();