示例#1
0
 public function connectUserBindParams()
 {
     global $_G;
     $this->connectMergeMember();
     getuserprofile('birthyear');
     getuserprofile('birthmonth');
     getuserprofile('birthday');
     switch ($_G['member']['gender']) {
         case 1:
             $sex = 'male';
             break;
         case 2:
             $sex = 'female';
             break;
         default:
             $sex = 'unknown';
     }
     $is_public_email = 2;
     $is_use_qq_avatar = $_G['member']['conisqzoneavatar'] == 1 ? 1 : 2;
     $birthday = sprintf('%04d', $_G['member']['birthyear']) . '-' . sprintf('%02d', $_G['member']['birthmonth']) . '-' . sprintf('%02d', $_G['member']['birthday']);
     $agent = md5(time() . rand() . uniqid());
     $inputArray = array('uid' => $_G['uid'], 'agent' => $agent, 'time' => TIMESTAMP);
     require_once DISCUZ_ROOT . './config/config_ucenter.php';
     $input = 'uid=' . $_G['uid'] . '&agent=' . $agent . '&time=' . TIMESTAMP;
     $avatar_input = authcode($input, 'ENCODE', UC_KEY);
     $params = array('oauth_consumer_key' => $_G['setting']['connectappid'], 'u_id' => $_G['uid'], 'username' => $_G['member']['username'], 'email' => $_G['member']['email'], 'birthday' => $birthday, 'sex' => $sex, 'is_public_email' => $is_public_email, 'is_use_qq_avatar' => $is_use_qq_avatar, 's_id' => null, 'avatar_input' => $avatar_input, 'avatar_agent' => $agent, 'site_ucenter_id' => UC_APPID, 'source' => 'qzone');
     return $params;
 }
示例#2
0
function setloginstatus($member, $cookietime)
{
    global $_G;
    $_G['uid'] = $member['uid'];
    $_G['username'] = addslashes($member['username']);
    $_G['adminid'] = $member['adminid'];
    $_G['groupid'] = $member['groupid'];
    $_G['formhash'] = formhash();
    $_G['session']['invisible'] = getuserprofile('invisible');
    $_G['member'] = $member;
    loadcache('usergroup_' . $_G['groupid']);
    $discuz =& discuz_core::instance();
    $discuz->session->isnew = true;
    dsetcookie('auth', authcode("{$member['password']}\t{$member['uid']}", 'ENCODE'), $cookietime, 1, true);
    dsetcookie('loginuser');
    dsetcookie('activationauth');
    dsetcookie('pmnum');
    include_once libfile('function/stat');
    updatestat('login', 1);
    if (defined('IN_MOBILE')) {
        updatestat('mobilelogin', 1);
    }
    if ($_G['setting']['connect']['allow'] && $_G['member']['conisbind']) {
        updatestat('connectlogin', 1);
    }
    updatecreditbyaction('daylogin', $_G['uid']);
    checkusergroup($_G['uid']);
}
示例#3
0
 function common()
 {
     global $_G;
     $seccodecheck = $secqaacheck = false;
     if ($_GET['type'] == 'register') {
         $seccodecheck = $_G['setting']['seccodestatus'] & 1;
         $secqaacheck = $_G['setting']['secqaa']['status'] & 1;
     } elseif ($_GET['type'] == 'login') {
         $seccodecheck = $_G['setting']['seccodestatus'] & 2;
     } elseif ($_GET['type'] == 'post') {
         $seccodecheck = $_G['setting']['seccodestatus'] & 4 && (!$_G['setting']['seccodedata']['minposts'] || getuserprofile('posts') < $_G['setting']['seccodedata']['minposts']);
         $secqaacheck = $_G['setting']['secqaa']['status'] & 2 && (!$_G['setting']['secqaa']['minposts'] || getuserprofile('posts') < $_G['setting']['secqaa']['minposts']);
     }
     $sechash = random(8);
     if ($seccodecheck || $secqaacheck) {
         $variable = array('sechash' => $sechash);
         if ($seccodecheck) {
             $variable['seccode'] = $_G['siteurl'] . 'api/mobile/index.php?module=seccode&sechash=' . $sechash . '&version=' . (empty($_GET['secversion']) ? '1' : $_GET['secversion']);
         }
         if ($secqaacheck) {
             require_once libfile('function/seccode');
             $variable['secqaa'] = make_secqaa($sechash);
         }
     }
     mobile_core::result(mobile_core::variable($variable));
 }
示例#4
0
 public function generateSiteSignUrl($params = array())
 {
     global $_G;
     $utilService = Cloud::loadClass('Service_Util');
     @(include_once DISCUZ_ROOT . './source/discuz_version.php');
     if (!isset($_G['member']['conopenid'])) {
         $member_connect = $_G['uid'] ? C::t('#qqconnect#common_member_connect')->fetch($_G['uid']) : array();
         $_G['member'] = array_merge($_G['member'], $member_connect);
     }
     $ts = TIMESTAMP;
     $sKey = $_G['setting']['my_sitekey'];
     $params['clientIp'] = $_G['clientip'];
     $params['uid'] = $_G['uid'];
     $params['openId'] = getuserprofile('conopenid');
     $params['sId'] = $_G['setting']['siteuniqueid'];
     $params['appId'] = $_G['setting']['connectappid'];
     $params['ver'] = CLOUDCAPTCHA_VER;
     $params['dzVersion'] = DISCUZ_VERSION;
     $params['sId'] = $_G['setting']['my_siteid'];
     ksort($params);
     $str = $utilService->httpBuildQuery($params, '', '&');
     $sig = md5(sprintf('%s|%s|%s', $str, $sKey, $ts));
     $params['ts'] = $ts;
     $params['sig'] = $sig;
     $params = $utilService->httpBuildQuery($params, '', '&');
     return $params;
 }
 public function before_editpost($parameters)
 {
     $isfirstpost = $this->post['first'] ? 1 : 0;
     $isorigauthor = $this->member['uid'] && $this->member['uid'] == $this->post['authorid'];
     if ($isfirstpost) {
         if ($this->thread['special'] == 3) {
             $this->param['price'] = $isorigauthor ? $this->thread['price'] > 0 && $this->thread['price'] != $_GET['rewardprice'] ? $_GET['rewardprice'] : 0 : $this->thread['price'];
         }
         if ($this->thread['special'] == 3 && $isorigauthor) {
             $rewardprice = intval($_GET['rewardprice']);
             if ($this->thread['price'] > 0 && $this->thread['price'] != $_GET['rewardprice']) {
                 if ($rewardprice <= 0) {
                     showmessage('reward_credits_invalid');
                 }
                 $addprice = ceil($rewardprice - $this->thread['price'] + ($rewardprice - $this->thread['price']) * $this->setting['creditstax']);
                 if ($rewardprice < $this->thread['price']) {
                     showmessage('reward_credits_fall');
                 } elseif ($rewardprice < $this->group['minrewardprice'] || $this->group['maxrewardprice'] > 0 && $rewardprice > $this->group['maxrewardprice']) {
                     showmessage('reward_credits_between', '', array('minrewardprice' => $this->group['minrewardprice'], 'maxrewardprice' => $this->group['maxrewardprice']));
                 } elseif ($addprice > getuserprofile('extcredits' . $this->setting['creditstransextra'][2])) {
                     showmessage('reward_credits_shortage');
                 }
                 $realprice = ceil($this->thread['price'] + $this->thread['price'] * $this->setting['creditstax']);
                 updatemembercount($this->thread['authorid'], array($this->setting['creditstransextra'][2] => -$addprice));
                 C::t('common_credit_log')->update_by_uid_operation_relatedid($this->thread['authorid'], 'RTC', $this->thread['tid'], array('extcredits' . $this->setting['creditstransextra'][2] => $realprice));
             }
             if (!$this->forum['ismoderator']) {
                 if ($this->thread['replies'] > 1) {
                     $this->param['subject'] = addslashes($this->thread['subject']);
                 }
             }
             $this->param['price'] = $rewardprice;
         }
     }
 }
示例#6
0
 function updatemembercount($creditarr, $uids = 0, $checkgroup = true, $ruletxt = '')
 {
     global $_G;
     if (!$uids) {
         $uids = intval($_G['uid']);
     }
     $uids = is_array($uids) ? $uids : array($uids);
     if ($uids && ($creditarr || $this->extrasql)) {
         if ($this->extrasql) {
             $creditarr = array_merge($creditarr, $this->extrasql);
         }
         $sql = array();
         $allowkey = array('extcredits1', 'extcredits2', 'extcredits3', 'extcredits4', 'extcredits5', 'extcredits6', 'extcredits7', 'extcredits8', 'friends', 'posts', 'threads', 'oltime', 'digestposts', 'doings', 'blogs', 'albums', 'sharings', 'attachsize', 'views', 'todayattachs', 'todayattachsize');
         $creditnotice = $_G['setting']['creditnotice'] && $_G['uid'] && $uids == array($_G['uid']);
         if ($creditnotice) {
             if (!isset($_G['cookiecredits'])) {
                 $_G['cookiecredits'] = !empty($_COOKIE['creditnotice']) ? explode('D', $_COOKIE['creditnotice']) : array_fill(0, 9, 0);
                 for ($i = 1; $i <= 8; $i++) {
                     $_G['cookiecreditsbase'][$i] = getuserprofile('extcredits' . $i);
                 }
             }
             if ($ruletxt) {
                 $_G['cookiecreditsrule'][$ruletxt] = $ruletxt;
             }
         }
         //$critarr 各项积分参数extcredit设置的值
         $settingValue = WebUtils::getDzPluginAppbymeAppConfig('dzsyscache_forum_extcredit_base');
         foreach ($creditarr as $key => $value) {
             $mutilute = 1;
             foreach ($settingValue as $k => $v) {
                 if ($key == 'extcredits' . $k) {
                     $mutilute = $v * 0.01;
                 }
             }
             if (!empty($key) && $value && in_array($key, $allowkey)) {
                 $sql[$key] = $value * $mutilute;
                 if ($creditnotice && substr($key, 0, 10) == 'extcredits') {
                     $i = substr($key, 10);
                     $_G['cookiecredits'][$i] += $value * $mutilute;
                 }
             }
         }
         if ($creditnotice) {
             dsetcookie('creditnotice', implode('D', $_G['cookiecredits']) . 'D' . $_G['uid']);
             dsetcookie('creditbase', '0D' . implode('D', $_G['cookiecreditsbase']));
             if (!empty($_G['cookiecreditsrule'])) {
                 dsetcookie('creditrule', strip_tags(implode("\t", $_G['cookiecreditsrule'])));
             }
         }
         //var_dump($sql);die;
         if ($sql) {
             C::t('common_member_count')->increase($uids, $sql);
         }
         if ($checkgroup && count($uids) == 1) {
             $this->checkusergroup($uids[0]);
         }
         $this->extrasql = array();
     }
 }
示例#7
0
 function csc($task = array())
 {
     global $_G;
     if (getuserprofile('friends') >= 5) {
         return true;
     }
     return array('csc' => 0, 'remaintime' => 0);
 }
示例#8
0
 function output()
 {
     global $_G;
     $data = $GLOBALS['space'];
     $data['groupiconid'] = mobile_core::usergroupIconId($data['groupid']);
     if ($data['group']['type'] == 'member' && $data['group']['groupcreditslower'] != 999999999) {
         $data['upgradecredit'] = $data['group']['creditslower'] - $data['credits'];
         $data['upgradeprogress'] = 100 - ceil($data['upgradecredit'] / ($data['group']['creditslower'] - $data['group']['creditshigher']) * 100);
         $data['upgradeprogress'] = max($data['upgradeprogress'], 2);
     }
     unset($data['password'], $data['email'], $data['regip'], $data['lastip'], $data['regip_loc'], $data['lastip_loc']);
     $variable = array('space' => $data, 'extcredits' => $_G['setting']['extcredits'], 'wsq' => array('wsq_apicredit' => getuserprofile('extcredits' . $_G['wechat']['setting']['wsq_apicredit'])));
     mobile_core::result(mobile_core::variable($variable));
 }
示例#9
0
function setloginstatus($member, $cookietime)
{
    global $_G;
    $_G['uid'] = $member['uid'];
    $_G['username'] = $member['username'];
    $_G['adminid'] = $member['adminid'];
    $_G['groupid'] = $member['groupid'];
    $_G['formhash'] = formhash();
    $_G['session']['invisible'] = getuserprofile('invisible');
    $_G['member'] = $member;
    $_G['core']->session->isnew = 1;
    dsetcookie('auth', authcode("{$member['password']}\t{$member['uid']}", 'ENCODE'), $cookietime, 1, true);
    dsetcookie('loginuser');
    dsetcookie('activationauth');
    dsetcookie('pmnum');
}
示例#10
0
function setloginstatus($member, $cookietime)
{
    global $_G;
    foreach ($_G['cookie'] as $k => $v) {
        dsetcookie($k);
    }
    $_G['uid'] = $member['uid'];
    $_G['username'] = addslashes($member['username']);
    $_G['adminid'] = $member['adminid'];
    $_G['groupid'] = $member['groupid'];
    $_G['formhash'] = formhash();
    $_G['session']['invisible'] = getuserprofile('invisible');
    $_G['member'] = $member;
    $discuz =& discuz_core::instance();
    $discuz->session->isnew = true;
    dsetcookie('auth', authcode("{$member['password']}\t{$member['uid']}", 'ENCODE'), $cookietime, 1, true);
    dsetcookie('loginuser');
    dsetcookie('activationauth');
    dsetcookie('pmnum');
}
 function get_menu_foot($brandresult)
 {
     global $_G;
     $bid = $brandresult['bid'];
     $tid = $brandresult['tid'];
     $perpage = 5;
     $page = intval($_G[sr_page]);
     $page = max(1, intval($page));
     $start = ($page - 1) * $perpage;
     $start = max(0, $start);
     require_once libfile('function/discuzcode');
     $count = C::t('#sanree_brand#forum_post')->count_by_tid_post(0, $tid);
     if ($count > 0) {
         $postthread = C::t('#sanree_brand#forum_post')->fetch_all_by_tid(0, $tid, true, ' desc', ($page - 1) * $perpage, $perpage, 0, 0);
         foreach ($postthread as $key => $val) {
             $postthread[$key]['message'] = discuzcode($val['message'], 0, 0, 0, 1);
             $postthread[$key]['satisfaction'] = C::t('#sanree_brand#sanree_brand_voterlog')->getstar_by_tid_uid($val['authorid'], $tid) * 20;
             $postthread[$key]['dateline'] = dgmdate($val['dateline']);
             $postthread[$key]['img'] = avatar($val['authorid'], 'middle', 1);
         }
         $murl = $_G['item_detail'] == 'item' ? $is_rewrite ? getburl($brandresult) . '?t' . $extra : getburl($brandresult) . $extra : ($is_rewrite ? getdetailurl($brandresult) . '?t' . $extra : getdetailurl($brandresult) . $extra);
         $multi = multi($count, $perpage, $page, $murl);
     }
     $satisfaction = C::t('#sanree_brand#sanree_brand_voterlog')->getstar_by_tid_uid($_G['uid'], $tid) * 20;
     $seditor = array('fastpost', array('bold', 'color', 'link', 'quote', 'smilies'));
     $selfimg = avatar($_G['uid'], 'middle', 1);
     $wx_prefix = $_G['setting']['attachurl'] . 'category/';
     $appVer = $_G['setting']['version'];
     $dzv = array('X3.2', 'X3.1');
     if (in_array($appVer, $dzv)) {
         list($seccodecheck) = seccheck('publish');
         $dzvflag = true;
         $sectpl = '<div class="rfm"><table><tr><th><sec>: </th><td><span id="sec<hash>" onclick="showMenu({\'ctrlid\':\'sec<hash>\',\'pos\':\'*\'})"><sec></span><br /><div id="sec<hash>_menu" class="p_pop p_opt" style="display:none"><sec></div></td></tr></table></div>';
     } else {
         $seccodecheck = $_G['setting']['seccodestatus'] & 4 && (!$_G['setting']['seccodedata']['minposts'] || getuserprofile('posts') < $_G['setting']['seccodedata']['minposts']);
         $secqaacheck = $_G['setting']['secqaa']['status'] & 2 && (!$_G['setting']['secqaa']['minposts'] || getuserprofile('posts') < $_G['setting']['secqaa']['minposts']);
         $dzvflag = false;
     }
     include templateEx($this->_identifier . ':' . $this->_template . '/srfoot');
     $GLOBALS['srfoot'] = $srfoot;
 }
示例#12
0
 function common()
 {
     global $_G;
     if (!$_G['uid'] || !in_array('wechat', $_G['setting']['plugins']['available'])) {
         mobile_core::result(mobile_core::variable(array()));
     }
     $_G['wechat']['setting'] = unserialize($_G['setting']['mobilewechat']);
     if (!$_G['wechat']['setting']['wsq_apicredit']) {
         mobile_core::result(mobile_core::variable(array()));
     }
     $extcredit = 'extcredits' . $_G['wechat']['setting']['wsq_apicredit'];
     $ac = $_GET['ac'];
     $return = array();
     if (submitcheck('creditsubmit') && ($ac == 'inc' || $ac == 'dec') && $_GET['value'] > 0) {
         $v = $ac == 'inc' ? $_GET['value'] : -$_GET['value'];
         $log = lang('plugin/wechat', 'wsq_apicredit_log_' . $ac);
         updatemembercount(array($_G['uid']), array($extcredit => $v), true, '', 0, '', $log);
         $data = C::t('common_member_count')->fetch($_G['uid']);
         $return['extcredit'] = $data[$extcredit];
     } elseif ($ac == 'get') {
         $return['extcredit'] = getuserprofile($extcredit);
     }
     mobile_core::result(mobile_core::variable($return));
 }
示例#13
0
    if ($do != 'profile' && !ckprivacy($do, 'view')) {
        $_G['privacy'] = 1;
        require_once libfile('space/profile', 'include');
        include template('home/space_privacy');
        exit;
    }
    $widths = getlayout($userdiy['currentlayout']);
    $leftlist = formatdata($userdiy, 'left', $space);
    $centerlist = formatdata($userdiy, 'center', $space);
    $rightlist = formatdata($userdiy, 'right', $space);
    dsetcookie('home_diymode', 1);
}
$navtitle = !empty($space['spacename']) ? $space['spacename'] : lang('space', 'sb_space', array('who' => $space['username']));
$metakeywords = lang('space', 'sb_space', array('who' => $space['username']));
$metadescription = lang('space', 'sb_space', array('who' => $space['username']));
$space['medals'] = getuserprofile('medals');
if ($space['medals']) {
    loadcache('medals');
    foreach ($space['medals'] = explode("\t", $space['medals']) as $key => $medalid) {
        list($medalid, $medalexpiration) = explode("|", $medalid);
        if (isset($_G['cache']['medals'][$medalid]) && (!$medalexpiration || $medalexpiration > TIMESTAMP)) {
            $space['medals'][$key] = $_G['cache']['medals'][$medalid];
        } else {
            unset($space['medals'][$key]);
        }
    }
}
include_once template('home/space_index');
function formatdata($data, $position, $space)
{
    $list = array();
示例#14
0
$_G['group']['allowpostimage'] = $_G['forum']['allowpostimage'] != -1 && ($_G['forum']['allowpostimage'] == 1 || !$_G['forum']['postimageperm'] && $_G['group']['allowpostimage'] || $_G['forum']['postimageperm'] && forumperm($_G['forum']['postimageperm']));
$_G['group']['attachextensions'] = $_G['forum']['attachextensions'] ? $_G['forum']['attachextensions'] : $_G['group']['attachextensions'];
require_once libfile('function/upload');
$swfconfig = getuploadconfig($_G['uid'], $_G['fid']);
$imgexts = str_replace(array(';', '*.'), array(', ', ''), $swfconfig['imageexts']['ext']);
$allowuploadnum = $allowuploadtoday = TRUE;
if ($_G['group']['allowpostattach'] || $_G['group']['allowpostimage']) {
    if ($_G['group']['maxattachnum']) {
        $allowuploadnum = $_G['group']['maxattachnum'] - getuserprofile('todayattachs');
        $allowuploadnum = $allowuploadnum < 0 ? 0 : $allowuploadnum;
        if (!$allowuploadnum) {
            $allowuploadtoday = false;
        }
    }
    if ($_G['group']['maxsizeperday']) {
        $allowuploadsize = $_G['group']['maxsizeperday'] - getuserprofile('todayattachsize');
        $allowuploadsize = $allowuploadsize < 0 ? 0 : $allowuploadsize;
        if (!$allowuploadsize) {
            $allowuploadtoday = false;
        }
        $allowuploadsize = $allowuploadsize / 1048576 >= 1 ? round($allowuploadsize / 1048576, 1) . 'MB' : round($allowuploadsize / 1024) . 'KB';
    }
}
$allowpostimg = $_G['group']['allowpostimage'] && $imgexts;
$enctype = $_G['group']['allowpostattach'] || $_G['group']['allowpostimage'] ? 'enctype="multipart/form-data"' : '';
$maxattachsize_mb = $_G['group']['maxattachsize'] / 1048576 >= 1 ? round($_G['group']['maxattachsize'] / 1048576, 1) . 'MB' : round($_G['group']['maxattachsize'] / 1024) . 'KB';
$_G['group']['maxprice'] = isset($_G['setting']['extcredits'][$_G['setting']['creditstrans']]) ? $_G['group']['maxprice'] : 0;
$extra = !empty($_GET['extra']) ? rawurlencode($_GET['extra']) : '';
$notifycheck = empty($emailnotify) ? '' : 'checked="checked"';
$stickcheck = empty($sticktopic) ? '' : 'checked="checked"';
$digestcheck = empty($addtodigest) ? '' : 'checked="checked"';
function protectguard($protect)
{
    global $_G, $member_verifys;
    if (!isset($member_verifys) && $_G['setting']['verify']['enabled']) {
        $member_verifys = array();
        getuserprofile('verify1');
        foreach ($_G['setting']['verify'] as $vid => $verify) {
            if ($verify['available'] && $_G['member']['verify' . $vid] == 1) {
                $member_verifys[] = $vid;
            }
        }
    }
    $verifyflag = 0;
    if ($_G['setting']['verify']['enabled'] && $protect['verify']) {
        if (array_intersect(explode("\t", $protect['verify']), $member_verifys)) {
            $verifyflag = 1;
        }
    }
    if ($protect['usergroup'] && strstr("\t" . $protect['usergroup'] . "\t", "\t{$_G['groupid']}\t") || empty($protect['usergroup']) && empty($protect['verify']) || $verifyflag || $_G['forum_thread']['authorid'] == $_G['uid']) {
        return false;
    } else {
        return true;
    }
}
 public function updatesession()
 {
     static $updated = false;
     if (!$updated && $this->isnew) {
         global $_G;
         C::t('common_member_status')->update($_G['uid'], array('lastip' => $_G['clientip'], 'lastactivity' => TIMESTAMP, 'lastvisit' => TIMESTAMP));
         dsetcookie('ulastactivity', TIMESTAMP . '|' . getuserprofile('invisible'), 31536000);
         $updated = true;
     }
     return $updated;
 }
示例#17
0
}
if ($_G['forum_thread']['stamp'] >= 0) {
    $_G['forum_threadstamp'] = $_G['cache']['stamps'][$_G['forum_thread']['stamp']];
}
$lastmod = viewthread_lastmod($_G['forum_thread']);
$showsettings = str_pad(decbin($_G['setting']['showsettings']), 3, '0', STR_PAD_LEFT);
$showsignatures = $showsettings[0];
$showavatars = $showsettings[1];
$_G['setting']['showimages'] = $showsettings[2];
$highlightstatus = isset($_GET['highlight']) && str_replace('+', '', $_GET['highlight']) ? 1 : 0;
$_G['forum']['allowreply'] = isset($_G['forum']['allowreply']) ? $_G['forum']['allowreply'] : '';
$_G['forum']['allowpost'] = isset($_G['forum']['allowpost']) ? $_G['forum']['allowpost'] : '';
$allowpostreply = $_G['forum']['allowreply'] != -1 && ($_G['forum_thread']['isgroup'] || !$_G['forum_thread']['closed'] && !checkautoclose($_G['forum_thread']) || $_G['forum']['ismoderator']) && (!$_G['forum']['replyperm'] && $_G['group']['allowreply'] || $_G['forum']['replyperm'] && forumperm($_G['forum']['replyperm']) || $_G['forum']['allowreply']);
$fastpost = $_G['setting']['fastpost'] && !$_G['forum_thread']['archiveid'] && ($_G['forum']['status'] != 3 || $_G['isgroupuser']);
$allowfastpost = $_G['setting']['fastpost'] && $allowpostreply;
if (!$_G['uid'] && ($_G['setting']['need_avatar'] || $_G['setting']['need_email'] || $_G['setting']['need_friendnum']) || !$_G['adminid'] && (!cknewuser(1) || $_G['setting']['newbiespan'] && (!getuserprofile('lastpost') || TIMESTAMP - getuserprofile('lastpost') < $_G['setting']['newbiespan'] * 60) && TIMESTAMP - $_G['member']['regdate'] < $_G['setting']['newbiespan'] * 60)) {
    $allowfastpost = false;
}
$_G['group']['allowpost'] = $_G['forum']['allowpost'] != -1 && (!$_G['forum']['postperm'] && $_G['group']['allowpost'] || $_G['forum']['postperm'] && forumperm($_G['forum']['postperm']) || $_G['forum']['allowpost']);
$_G['forum']['allowpostattach'] = isset($_G['forum']['allowpostattach']) ? $_G['forum']['allowpostattach'] : '';
$allowpostattach = $allowpostreply && ($_G['forum']['allowpostattach'] != -1 && ($_G['forum']['allowpostattach'] == 1 || !$_G['forum']['postattachperm'] && $_G['group']['allowpostattach'] || $_G['forum']['postattachperm'] && forumperm($_G['forum']['postattachperm'])));
if ($_G['group']['allowpost']) {
    $_G['group']['allowpostpoll'] = $_G['group']['allowpostpoll'] && $_G['forum']['allowpostspecial'] & 1;
    $_G['group']['allowposttrade'] = $_G['group']['allowposttrade'] && $_G['forum']['allowpostspecial'] & 2;
    $_G['group']['allowpostreward'] = $_G['group']['allowpostreward'] && $_G['forum']['allowpostspecial'] & 4 && isset($_G['setting']['extcredits'][$_G['setting']['creditstrans']]);
    $_G['group']['allowpostactivity'] = $_G['group']['allowpostactivity'] && $_G['forum']['allowpostspecial'] & 8;
    $_G['group']['allowpostdebate'] = $_G['group']['allowpostdebate'] && $_G['forum']['allowpostspecial'] & 16;
} else {
    $_G['group']['allowpostpoll'] = $_G['group']['allowposttrade'] = $_G['group']['allowpostreward'] = $_G['group']['allowpostactivity'] = $_G['group']['allowpostdebate'] = FALSE;
}
$_G['forum']['threadplugin'] = $_G['group']['allowpost'] && $_G['setting']['threadplugins'] ? is_array($_G['forum']['threadplugin']) ? $_G['forum']['threadplugin'] : dunserialize($_G['forum']['threadplugin']) : array();
示例#18
0
     } elseif ($apitype == 'tenpay') {
         $paytype = 2;
     }
     C::t('forum_tradelog')->update($orderid, array('paytype' => $paytype));
     showmessage('trade_directtopay', $payurl);
 }
 if (submitcheck('offlinesubmit') && in_array($_GET['offlinestatus'], trade_offline($tradelog, 0))) {
     loaducenter();
     $ucresult = uc_user_login($_G['username'], $_GET['password']);
     list($tmp['uid']) = daddslashes($ucresult);
     if ($tmp['uid'] <= 0) {
         showmessage('trade_password_error', 'forum.php?mod=trade&orderid=' . $orderid);
     }
     if ($_GET['offlinestatus'] == 4) {
         if ($_G['setting']['creditstransextra'][5] != -1 && $tradelog['credit']) {
             if ($tradelog['credit'] > getuserprofile('extcredits' . $_G['setting']['creditstransextra'][5])) {
                 showmessage('trade_credit_lack');
             }
             updatemembercount($tradelog['buyerid'], array($_G['setting']['creditstransextra'][5] => -$tradelog['credit']));
         }
         $trade = C::t('forum_trade')->fetch_goods($tradelog['tid'], $tradelog['pid']);
         notification_add($tradelog['sellerid'], 'goods', 'trade_seller_send', array('buyerid' => $tradelog['buyerid'], 'buyer' => $tradelog['buyer'], 'orderid' => $orderid, 'subject' => $tradelog['subject']));
     } elseif ($_GET['offlinestatus'] == 5) {
         notification_add($tradelog['buyerid'], 'goods', 'trade_buyer_confirm', array('sellerid' => $tradelog['sellerid'], 'seller' => $tradelog['seller'], 'orderid' => $orderid, 'subject' => $tradelog['subject']));
     } elseif ($_GET['offlinestatus'] == 7) {
         if ($_G['setting']['creditstransextra'][5] != -1 && $tradelog['basecredit']) {
             $netcredit = round($tradelog['number'] * $tradelog['basecredit'] * (1 - $_G['setting']['creditstax']));
             updatemembercount($tradelog['sellerid'], array($_G['setting']['creditstransextra'][5] => $netcredit));
         } else {
             $netcredit = 0;
         }
示例#19
0
function checkflood()
{
    global $_G;
    if (!$_G['group']['disablepostctrl'] && $_G['uid']) {
        $isflood = $_G['setting']['floodctrl'] && TIMESTAMP - $_G['setting']['floodctrl'] <= getuserprofile('lastpost');
        if (empty($isflood)) {
            return FALSE;
        } else {
            return TRUE;
        }
    }
    return FALSE;
}
示例#20
0
function checkfollowfeed()
{
    global $_G;
    if ($_G['uid']) {
        $lastcheckfeed = 0;
        if (!empty($_G['cookie']['lastcheckfeed'])) {
            $time = explode('|', $_G['cookie']['lastcheckfeed']);
            if ($time[0] == $_G['uid']) {
                $lastcheckfeed = $time[1];
            }
        }
        if (!$lastcheckfeed) {
            $lastcheckfeed = getuserprofile('lastactivity');
        }
        dsetcookie('lastcheckfeed', $_G['uid'] . '|' . TIMESTAMP, 31536000);
        $followuser = C::t('home_follow')->fetch_all_following_by_uid($_G['uid']);
        $uids = array_keys($followuser);
        if (!empty($uids)) {
            $count = C::t('home_follow_feed')->count_by_uid_dateline($uids, $lastcheckfeed);
            if ($count) {
                notification_add($_G['uid'], 'follow', 'member_follow', array('count' => $count, 'from_id' => $_G['uid'], 'from_idtype' => 'follow'), 1);
            }
        }
    }
    dsetcookie('checkfollow', 1, 30);
}
示例#21
0
        } else {
            C::t('forum_postcomment')->insert(array('tid' => $post['tid'], 'pid' => $post['pid'], 'author' => '', 'authorid' => '-1', 'dateline' => TIMESTAMP + 1, 'comment' => $totalv));
        }
    }
    C::t('forum_postcache')->delete($post['pid']);
    showmessage('comment_add_succeed', "forum.php?mod=viewthread&tid={$post['tid']}&pid={$post['pid']}&page={$_GET['page']}&extra={$extra}#pid{$post['pid']}", array('tid' => $post['tid'], 'pid' => $post['pid']));
}
if ($special == 127) {
    $postinfo = C::t('forum_post')->fetch_threadpost_by_tid_invisible($_G['tid']);
    $sppos = strrpos($postinfo['message'], chr(0) . chr(0) . chr(0));
    $specialextra = substr($postinfo['message'], $sppos + 3);
}
if (getstatus($thread['status'], 3)) {
    $rushinfo = C::t('forum_threadrush')->fetch($_G['tid']);
    if ($rushinfo['creditlimit'] != -996) {
        $checkcreditsvalue = $_G['setting']['creditstransextra'][11] ? getuserprofile('extcredits' . $_G['setting']['creditstransextra'][11]) : $_G['member']['credits'];
        if ($checkcreditsvalue < $rushinfo['creditlimit']) {
            $creditlimit_title = $_G['setting']['creditstransextra'][11] ? $_G['setting']['extcredits'][$_G['setting']['creditstransextra'][11]]['title'] : lang('forum/misc', 'credit_total');
            showmessage('post_rushreply_creditlimit', '', array('creditlimit_title' => $creditlimit_title, 'creditlimit' => $rushinfo['creditlimit']));
        }
    }
}
if (!submitcheck('replysubmit', 0, $seccodecheck, $secqaacheck)) {
    $st_p = $_G['uid'] . '|' . TIMESTAMP;
    dsetcookie('st_p', $st_p . '|' . md5($st_p . $_G['config']['security']['authkey']));
    if ($thread['special'] == 2 && ((!isset($_GET['addtrade']) || $thread['authorid'] != $_G['uid']) && !($tradenum = C::t('forum_trade')->fetch_counter_thread_goods($_G['tid'])))) {
        showmessage('trade_newreply_nopermission', NULL);
    }
    $language = lang('forum/misc');
    $noticeauthor = $noticetrimstr = '';
    if (isset($_GET['repquote']) && ($_GET['repquote'] = intval($_GET['repquote']))) {
示例#22
0
         DB::query("DELETE FROM " . DB::table('forum_poll') . " WHERE tid='{$_G['tid']}'");
         DB::query("DELETE FROM " . DB::table('forum_polloption') . " WHERE tid='{$_G['tid']}'");
     }
 } elseif ($thread['special'] == 3 && $isorigauthor) {
     $rewardprice = intval($_G['gp_rewardprice']);
     if ($thread['price'] > 0 && $thread['price'] != $_G['gp_rewardprice']) {
         if ($rewardprice <= 0) {
             showmessage("reward_credits_invalid");
         }
         $addprice = ceil($rewardprice - $thread['price'] + ($rewardprice - $thread['price']) * $_G['setting']['creditstax']);
         if (!$_G['forum']['ismoderator']) {
             if ($rewardprice < $thread['price']) {
                 showmessage('reward_credits_fall');
             } elseif ($rewardprice < $_G['group']['minrewardprice'] || $_G['group']['maxrewardprice'] > 0 && $rewardprice > $_G['group']['maxrewardprice']) {
                 showmessage('reward_credits_between', '', array('minrewardprice' => $_G['group']['minrewardprice'], 'maxrewardprice' => $_G['group']['maxrewardprice']));
             } elseif ($addprice > getuserprofile('extcredits' . $_G['setting']['creditstransextra'][2])) {
                 showmessage('reward_credits_shortage');
             }
         }
         $realprice = ceil($thread['price'] + $thread['price'] * $_G['setting']['creditstax']);
         updatemembercount($thread['authorid'], array($_G['setting']['creditstransextra'][2] => -$addprice));
         DB::update('common_credit_log', array('extcredits' . $_G['setting']['creditstransextra'][2] => $realprice), array('uid' => $thread['authorid'], 'operation' => 'RTC', 'relatedid' => $_G['tid']));
     }
     if (!$_G['forum']['ismoderator']) {
         if ($thread['replies'] > 1) {
             $subject = addslashes($thread['subject']);
         }
     }
     $price = $rewardprice;
 } elseif ($thread['special'] == 4 && $_G['group']['allowpostactivity']) {
     $activitytime = intval($_G['gp_activitytime']);
示例#23
0
 public function newthread($parameters)
 {
     require_once libfile('function/post');
     $this->tid = $this->pid = 0;
     $this->_init_parameters($parameters);
     if (trim($this->param['subject']) == '') {
         return $this->showmessage('post_sm_isnull');
     }
     if (!$this->param['sortid'] && !$this->param['special'] && trim($this->param['message']) == '') {
         return $this->showmessage('post_sm_isnull');
     }
     list($this->param['modnewthreads'], $this->param['modnewreplies']) = threadmodstatus($this->param['subject'] . "\t" . $this->param['message'] . $this->param['extramessage']);
     if ($post_invalid = checkpost($this->param['subject'], $this->param['message'], $this->param['special'] || $this->param['sortid'])) {
         return $this->showmessage($post_invalid, '', array('minpostsize' => $this->setting['minpostsize'], 'maxpostsize' => $this->setting['maxpostsize']));
     }
     if (checkflood()) {
         return $this->showmessage('post_flood_ctrl', '', array('floodctrl' => $this->setting['floodctrl']));
     } elseif (checkmaxperhour('tid')) {
         return $this->showmessage('thread_flood_ctrl_threads_per_hour', '', array('threads_per_hour' => $this->group['maxthreadsperhour']));
     }
     $this->param['save'] = $this->member['uid'] ? $this->param['save'] : 0;
     $this->param['typeid'] = isset($this->param['typeid']) && isset($this->forum['threadtypes']['types'][$this->param['typeid']]) && (!$this->forum['threadtypes']['moderators'][$this->param['typeid']] || $this->forum['ismoderator']) ? $this->param['typeid'] : 0;
     $this->param['displayorder'] = $this->param['modnewthreads'] ? -2 : ($this->forum['ismoderator'] && $this->group['allowstickthread'] && !empty($this->param['sticktopic']) ? 1 : (empty($this->param['save']) ? 0 : -4));
     if ($this->param['displayorder'] == -2) {
         C::t('forum_forum')->update($this->forum['fid'], array('modworks' => '1'));
     }
     $this->param['digest'] = $this->forum['ismoderator'] && $this->group['allowdigestthread'] && !empty($this->param['digest']) ? 1 : 0;
     $this->param['readperm'] = $this->group['allowsetreadperm'] ? $this->param['readperm'] : 0;
     $this->param['isanonymous'] = $this->group['allowanonymous'] && $this->param['isanonymous'] ? 1 : 0;
     $this->param['price'] = intval($this->param['price']);
     if (!$this->param['special']) {
         $this->param['price'] = $this->group['maxprice'] ? $this->param['price'] <= $this->group['maxprice'] ? $this->param['price'] : $this->group['maxprice'] : 0;
     }
     if (!$this->param['typeid'] && $this->forum['threadtypes']['required'] && !$this->param['special']) {
         return $this->showmessage('post_type_isnull');
     }
     if (!$this->param['sortid'] && $this->forum['threadsorts']['required'] && !$this->param['special']) {
         return $this->showmessage('post_sort_isnull');
     }
     if (!$this->param['special'] && $this->param['price'] > 0 && floor($this->param['price'] * (1 - $this->setting['creditstax'])) == 0) {
         return $this->showmessage('post_net_price_iszero');
     }
     $this->param['sortid'] = $this->param['special'] && $this->forum['threadsorts']['types'][$this->param['sortid']] ? 0 : $this->param['sortid'];
     $this->param['typeexpiration'] = intval($this->param['typeexpiration']);
     if ($this->forum['threadsorts']['expiration'][$this->param['typeid']] && !$this->param['typeexpiration']) {
         return $this->showmessage('threadtype_expiration_invalid');
     }
     $author = !$this->param['isanonymous'] ? $this->member['username'] : '';
     $this->param['moderated'] = $this->param['digest'] || $this->param['displayorder'] > 0 ? 1 : 0;
     $this->param['ordertype'] && ($this->param['tstatus'] = setstatus(4, 1, $this->param['tstatus']));
     $this->param['imgcontent'] && ($this->param['tstatus'] = setstatus(15, $this->param['imgcontent'], $this->param['tstatus']));
     $this->param['hiddenreplies'] && ($this->param['tstatus'] = setstatus(2, 1, $this->param['tstatus']));
     $this->param['allownoticeauthor'] && ($this->param['tstatus'] = setstatus(6, 1, $this->param['tstatus']));
     $this->param['isgroup'] = $this->forum['status'] == 3 ? 1 : 0;
     $this->param['publishdate'] = !$this->param['modnewthreads'] ? $this->param['publishdate'] : TIMESTAMP;
     $newthread = array('fid' => $this->forum['fid'], 'posttableid' => 0, 'readperm' => $this->param['readperm'], 'price' => $this->param['price'], 'typeid' => $this->param['typeid'], 'sortid' => $this->param['sortid'], 'author' => $author, 'authorid' => $this->member['uid'], 'subject' => $this->param['subject'], 'dateline' => $this->param['publishdate'], 'lastpost' => $this->param['publishdate'], 'lastposter' => $author, 'displayorder' => $this->param['displayorder'], 'digest' => $this->param['digest'], 'special' => $this->param['special'], 'attachment' => 0, 'moderated' => $this->param['moderated'], 'status' => $this->param['tstatus'], 'isgroup' => $this->param['isgroup'], 'replycredit' => $this->param['replycredit'], 'closed' => $this->param['closed'] ? 1 : 0);
     $this->tid = C::t('forum_thread')->insert($newthread, true);
     C::t('forum_newthread')->insert(array('tid' => $this->tid, 'fid' => $this->forum['fid'], 'dateline' => $this->param['publishdate']));
     useractionlog($this->member['uid'], 'tid');
     if (!getuserprofile('threads') && $this->setting['newbie']) {
         C::t('forum_thread')->update($this->tid, array('icon' => $this->setting['newbie']));
     }
     if ($this->param['publishdate'] != TIMESTAMP) {
         $cron_publish_ids = dunserialize($this->cache('cronpublish'));
         $cron_publish_ids[$this->tid] = $this->tid;
         $cron_publish_ids = serialize($cron_publish_ids);
         savecache('cronpublish', $cron_publish_ids);
     }
     if (!$this->param['isanonymous']) {
         C::t('common_member_field_home')->update($this->member['uid'], array('recentnote' => $this->param['subject']));
     }
     if ($this->param['moderated']) {
         updatemodlog($this->tid, $this->param['displayorder'] > 0 ? 'STK' : 'DIG');
         updatemodworks($this->param['displayorder'] > 0 ? 'STK' : 'DIG', 1);
     }
     $this->param['bbcodeoff'] = checkbbcodes($this->param['message'], !empty($this->param['bbcodeoff']));
     $this->param['smileyoff'] = checksmilies($this->param['message'], !empty($this->param['smileyoff']));
     $this->param['parseurloff'] = !empty($this->param['parseurloff']);
     $this->param['htmlon'] = $this->group['allowhtml'] && !empty($this->param['htmlon']) ? 1 : 0;
     $this->param['usesig'] = !empty($this->param['usesig']) && $this->group['maxsigsize'] ? 1 : 0;
     $class_tag = new tag();
     $this->param['tagstr'] = $class_tag->add_tag($this->param['tags'], $this->tid, 'tid');
     $this->param['pinvisible'] = $this->param['modnewthreads'] ? -2 : (empty($this->param['save']) ? 0 : -3);
     $this->param['message'] = preg_replace('/\\[attachimg\\](\\d+)\\[\\/attachimg\\]/is', '[attach]\\1[/attach]', $this->param['message']);
     $this->param['pstatus'] = intval($this->param['pstatus']);
     defined('IN_MOBILE') && ($this->param['pstatus'] = setstatus(4, 1, $this->param['pstatus']));
     if ($this->param['imgcontent']) {
         stringtopic($this->param['message'], $this->tid, true, $this->param['imgcontentwidth']);
     }
     $this->pid = insertpost(array('fid' => $this->forum['fid'], 'tid' => $this->tid, 'first' => '1', 'author' => $this->member['username'], 'authorid' => $this->member['uid'], 'subject' => $this->param['subject'], 'dateline' => $this->param['publishdate'], 'message' => $this->param['message'], 'useip' => $this->param['clientip'] ? $this->param['clientip'] : getglobal('clientip'), 'port' => $this->param['remoteport'] ? $this->param['remoteport'] : getglobal('remoteport'), 'invisible' => $this->param['pinvisible'], 'anonymous' => $this->param['isanonymous'], 'usesig' => $this->param['usesig'], 'htmlon' => $this->param['htmlon'], 'bbcodeoff' => $this->param['bbcodeoff'], 'smileyoff' => $this->param['smileyoff'], 'parseurloff' => $this->param['parseurloff'], 'attachment' => '0', 'tags' => $this->param['tagstr'], 'replycredit' => 0, 'status' => $this->param['pstatus']));
     $statarr = array(0 => 'thread', 1 => 'poll', 2 => 'trade', 3 => 'reward', 4 => 'activity', 5 => 'debate', 127 => 'thread');
     include_once libfile('function/stat');
     updatestat($this->param['isgroup'] ? 'groupthread' : $statarr[$this->param['special']]);
     if ($this->param['geoloc'] && IN_MOBILE == 2) {
         list($mapx, $mapy, $location) = explode('|', $this->param['geoloc']);
         if ($mapx && $mapy && $location) {
             C::t('forum_post_location')->insert(array('pid' => $this->pid, 'tid' => $this->tid, 'uid' => $this->member['uid'], 'mapx' => $mapx, 'mapy' => $mapy, 'location' => $location));
         }
     }
     if ($this->param['modnewthreads']) {
         updatemoderate('tid', $this->tid);
         C::t('forum_forum')->update_forum_counter($this->forum['fid'], 0, 0, 1);
         manage_addnotify('verifythread');
         return 'post_newthread_mod_succeed';
     } else {
         if ($this->param['displayorder'] != -4) {
             if ($this->param['digest']) {
                 updatepostcredits('+', $this->member['uid'], 'digest', $this->forum['fid']);
             }
             updatepostcredits('+', $this->member['uid'], 'post', $this->forum['fid']);
             if ($this->param['isgroup']) {
                 C::t('forum_groupuser')->update_counter_for_user($this->member['uid'], $this->forum['fid'], 1);
             }
             $subject = str_replace("\t", ' ', $this->param['subject']);
             $lastpost = "{$this->tid}\t" . $subject . "\t" . TIMESTAMP . "\t{$author}";
             C::t('forum_forum')->update($this->forum['fid'], array('lastpost' => $lastpost));
             C::t('forum_forum')->update_forum_counter($this->forum['fid'], 1, 1, 1);
             if ($this->forum['type'] == 'sub') {
                 C::t('forum_forum')->update($this->forum['fup'], array('lastpost' => $lastpost));
             }
         }
         if ($this->param['isgroup']) {
             C::t('forum_forumfield')->update($this->forum['fid'], array('lastupdate' => TIMESTAMP));
             require_once libfile('function/grouplog');
             updategroupcreditlog($this->forum['fid'], $this->member['uid']);
         }
         C::t('forum_sofa')->insert(array('tid' => $this->tid, 'fid' => $this->forum['fid']));
         return 'post_newthread_succeed';
     }
 }
示例#24
0
                if ($_G['group']['allowposturl'] == 0) {
                    showmessage('post_url_nopermission');
                } elseif ($_G['group']['allowposturl'] == 1) {
                    $modnewthreads = $modnewreplies = 1;
                    break;
                } elseif ($_G['group']['allowposturl'] == 2) {
                    $message = str_replace('[url]' . $urllist[0][$key] . '[/url]', $urllist[0][$key], $message);
                    $message = preg_replace("@\\[url={$urllist[0][$key]}\\](.*?)\\[/url\\]@i", '\\1', $message);
                }
            }
        }
    }
}
$urloffcheck = $usesigcheck = $smileyoffcheck = $codeoffcheck = $htmloncheck = $emailcheck = '';
$seccodecheck = $_G['setting']['seccodestatus'] & 4 && (!$_G['setting']['seccodedata']['minposts'] || getuserprofile('posts') < $_G['setting']['seccodedata']['minposts']);
$secqaacheck = $_G['setting']['secqaa']['status'] & 2 && (!$_G['setting']['secqaa']['minposts'] || getuserprofile('posts') < $_G['setting']['secqaa']['minposts']);
$_G['group']['allowpostpoll'] = $_G['group']['allowpost'] && $_G['group']['allowpostpoll'] && $_G['forum']['allowpostspecial'] & 1;
$_G['group']['allowposttrade'] = $_G['group']['allowpost'] && $_G['group']['allowposttrade'] && $_G['forum']['allowpostspecial'] & 2;
$_G['group']['allowpostreward'] = $_G['group']['allowpost'] && $_G['group']['allowpostreward'] && $_G['forum']['allowpostspecial'] & 4 && isset($_G['setting']['extcredits'][$_G['setting']['creditstrans']]);
$_G['group']['allowpostactivity'] = $_G['group']['allowpost'] && $_G['group']['allowpostactivity'] && $_G['forum']['allowpostspecial'] & 8;
$_G['group']['allowpostdebate'] = $_G['group']['allowpost'] && $_G['group']['allowpostdebate'] && $_G['forum']['allowpostspecial'] & 16;
$usesigcheck = $_G['uid'] && $_G['group']['maxsigsize'] ? 'checked="checked"' : '';
$ordertypecheck = !empty($thread['tid']) && getstatus($thread['status'], 4) ? 'checked="checked"' : '';
$specialextra = !empty($_G['gp_specialextra']) ? $_G['gp_specialextra'] : '';
if ($specialextra && $_G['group']['allowpost'] && $_G['setting']['threadplugins'] && (!array_key_exists($specialextra, $_G['setting']['threadplugins']) || !@in_array($specialextra, is_array($_G['forum']['threadplugin']) ? $_G['forum']['threadplugin'] : unserialize($_G['forum']['threadplugin'])) || !@in_array($specialextra, $_G['group']['allowthreadplugin']))) {
    $specialextra = '';
}
$_G['group']['allowanonymous'] = $_G['forum']['allowanonymous'] || $_G['group']['allowanonymous'] ? 1 : 0;
if ($_G['gp_action'] == 'newthread' && $_G['forum']['allowspecialonly'] && !$special) {
    if ($_G['group']['allowpostpoll']) {
        $special = 1;
示例#25
0
 $_POST['replycredit_extcredits'] = intval($_POST['replycredit_extcredits']);
 $_POST['replycredit_times'] = intval($_POST['replycredit_times']);
 $_POST['replycredit_membertimes'] = intval($_POST['replycredit_membertimes']) > 0 ? intval($_POST['replycredit_membertimes']) : 1;
 $_POST['replycredit_random'] = intval($_POST['replycredit_random']) < 0 || intval($_POST['replycredit_random']) > 99 ? 0 : intval($_POST['replycredit_random']);
 if ($_POST['replycredit_extcredits'] > 0 && $_POST['replycredit_times'] > 0) {
     $replycredit = $_POST['replycredit_extcredits'] * $_POST['replycredit_times'];
     $replycredit_diff = $replycredit - $thread['replycredit'];
     if ($replycredit_diff > 0) {
         $replycredit_diff = ceil($replycredit_diff + $replycredit_diff * $_G['setting']['creditstax']);
         if (!$replycredit_rule) {
             $replycredit_rule = array();
             if ($_G['setting']['creditstransextra']['10']) {
                 $replycredit_rule['extcreditstype'] = $_G['setting']['creditstransextra']['10'];
             }
         }
         if ($replycredit_diff > getuserprofile('extcredits' . $replycredit_rule['extcreditstype'])) {
             showmessage('post_edit_thread_replaycredit_nocredit');
         }
     }
     if ($replycredit_diff) {
         updatemembercount($_G['uid'], array($replycredit_rule['extcreditstype'] => $replycredit_diff > 0 ? -$replycredit_diff : abs($replycredit_diff)), 1, $replycredit_diff > 0 ? 'RCT' : 'RCB', $_G['tid']);
     }
 } elseif (($_POST['replycredit_extcredits'] == 0 || $_POST['replycredit_times'] == 0) && $thread['replycredit'] > 0) {
     $replycredit = 0;
     DB::query("DELETE FROM " . DB::table('forum_replycredit') . " WHERE tid = '{$_G['tid']}'");
     updatemembercount($thread['authorid'], array($replycredit_rule['extcreditstype'] => $thread['replycredit']), 1, 'RCB', $_G['tid']);
     $replycreditadd = ", replycredit = '0'";
 } else {
     $replycredit = $thread['replycredit'];
 }
 if ($replycredit) {
     }
 }
 if (!$outexange && !$_G['setting']['extcredits'][$tocredits]['ratio']) {
     showmessage('credits_exchange_invalid', '', array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true));
 }
 if (!$outexange && !$_G['setting']['extcredits'][$fromcredits]['allowexchangeout']) {
     showmessage('extcredits_disallowexchangeout', '', array('credittitle' => $_G['setting']['extcredits'][$fromcredits]['title']), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true));
 }
 if (!$outexange && !$_G['setting']['extcredits'][$tocredits]['allowexchangein']) {
     showmessage('extcredits_disallowexchangein', '', array('credittitle' => $_G['setting']['extcredits'][$tocredits]['title']), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true));
 }
 if (!$netamount) {
     showmessage('memcp_credits_exchange_msg_balance_insufficient', '', array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true));
 } elseif ($exchangeamount <= 0) {
     showmessage('credits_transaction_amount_invalid', '', array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true));
 } elseif (getuserprofile('extcredits' . $fromcredits) - $netamount < ($minbalance = $_G['setting']['exchangemincredits'])) {
     showmessage('credits_exchange_balance_insufficient', '', array('title' => $_G['setting']['extcredits'][$fromcredits]['title'], 'minbalance' => $minbalance), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true));
 }
 loaducenter();
 $ucresult = uc_user_login(addslashes($_G['username']), $_GET['password']);
 list($tmp['uid']) = $ucresult;
 if ($tmp['uid'] <= 0) {
     showmessage('credits_password_invalid', '', array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true));
 }
 if (!$outexange) {
     updatemembercount($_G['uid'], array($fromcredits => -$netamount, $tocredits => $exchangeamount), 1, 'CEC', $_G['uid']);
 } else {
     if (!array_key_exists($fromcredits, $_CACHE['creditsettings'][$tocredits]['creditsrc'])) {
         showmessage('extcredits_dataerror', NULL);
     }
     list($toappid, $tocredits) = explode('|', $tocredits);
示例#27
0
    foreach ($warnings as $key => $warning) {
        $warning['dateline'] = dgmdate($warning['dateline'], 'u');
        $warning['reason'] = dhtmlspecialchars($warning['reason']);
        $warnings[$key] = $warning;
    }
    $warnnum = count($warnings);
    include template('forum/warn_view');
} elseif ($_GET['action'] == 'pay') {
    if (!isset($_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]])) {
        showmessage('credits_transaction_disabled');
    } elseif ($thread['price'] <= 0 || $thread['special'] != 0) {
        showmessage('thread_pay_error', NULL);
    } elseif (!$_G['uid']) {
        showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1));
    }
    if (($balance = getuserprofile('extcredits' . $_G['setting']['creditstransextra'][1]) - $thread['price']) < ($minbalance = 0)) {
        if ($_G['setting']['creditstrans'][0] == $_G['setting']['creditstransextra'][1]) {
            showmessage('credits_balance_insufficient_and_charge', '', array('title' => $_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]]['title'], 'minbalance' => $thread['price']));
        } else {
            showmessage('credits_balance_insufficient', '', array('title' => $_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]]['title'], 'minbalance' => $thread['price']));
        }
    }
    if (C::t('common_credit_log')->count_by_uid_operation_relatedid($_G['uid'], 'BTC', $_G['tid'])) {
        showmessage('credits_buy_thread', 'forum.php?mod=viewthread&tid=' . $_G['tid'] . ($_GET['from'] ? '&from=' . $_GET['from'] : ''));
    }
    $thread['netprice'] = floor($thread['price'] * (1 - $_G['setting']['creditstax']));
    if (!submitcheck('paysubmit')) {
        include template('forum/pay');
    } else {
        $updateauthor = true;
        $authorEarn = $thread['netprice'];
示例#28
0
<?php

if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
$wirror_stockjf = $setContent['wirror_stockjf'];
$extstr = "extcredits" . $wirror_stockjf;
$extstr = getuserprofile($extstr);
$exttitle = $_G['setting']['extcredits'][$wirror_stockjf]['title'];
$wirror_op = daddslashes($_GET['op']);
$zjdata = C::t('#wirror_stock#wirror_stock')->fetch_by_uid($_G['uid']);
if ($wirror_op == 'submitchange') {
    $money = intval($_GET['money']);
    $money = intval($money * $setContent['wirror_stockprice']);
    if ($extstr < $money) {
        showmessage('您的' . $exttitle . '不够无法转移资金', 'plugin.php?id=wirror_stock', "", array('alert' => 'error'));
    }
    if (time() > 1448640000) {
        //return;
    }
    $zjdata = C::t('#wirror_stock#wirror_stock')->fetch_by_uid($_G['uid']);
    if (!$zjdata) {
        $zjdata = array('uid' => $_G['uid'], 'username' => $_G['username'], 'stockzj' => $money, 'createtime' => time(), 'updatetime' => time());
        C::t('#wirror_stock#wirror_stock')->insert($zjdata);
    } else {
        $tmp = $zjdata['stockzj'] + $money;
        C::t('#wirror_stock#wirror_stock')->update_by_uid($_G['uid'], $tmp);
    }
    $userstock = C::t('#wirror_stock#wirror_stock')->fetch_by_uid($_G['uid']);
    $buylogdata = array('uid' => $_G['uid'], 'username' => $_G['username'], 'tradename' => '资金转入', 'tradeamount' => $money, 'amountze' => $userstock['stockzj'], 'tradetype' => 3, 'createtime' => time());
    C::t('#wirror_stock#wirror_stocklog')->insert($buylogdata);
示例#29
0
    } else {
        $gid = 0;
    }
} elseif ($sgid) {
    if (!empty($second[$sgid])) {
        $curtype = $second[$sgid];
        $fup = $curtype['fup'];
        $groupids = array($sgid);
        $url .= '?sgid=' . $sgid;
    } else {
        $sgid = 0;
    }
}
if (empty($curtype)) {
    if ($_G['uid'] && empty($_G['mod'])) {
        $usergroups = getuserprofile('groups');
        if (!empty($usergroups)) {
            dheader('Location:group.php?mod=my');
            exit;
        }
    }
    $curtype = array();
} else {
    $nav = get_groupnav($curtype);
    $groupnav = $nav['nav'];
    $_G['grouptypeid'] = $curtype['fid'];
    $perpage = 10;
    if ($curtype['forumcolumns'] > 1) {
        $curtype['forumcolwidth'] = floor(100 / $curtype['forumcolumns']) - 0.1 . '%';
        $perpage = $curtype['forumcolumns'] * 10;
    }
示例#30
0
         if ($_G['gp_jointypenew'] == '-1' && $_G['uid'] != $_G['forum']['founderuid']) {
             showmessage('group_close_only_founder');
         }
         $_G['gp_gviewpermnew'] = intval($_G['gp_gviewpermnew']);
         DB::query("UPDATE " . DB::table('forum_forumfield') . " SET description='{$_G['gp_descriptionnew']}', jointype='{$_G['gp_jointypenew']}', gviewperm='{$_G['gp_gviewpermnew']}'{$iconsql} WHERE fid='{$_G['fid']}'");
         showmessage('group_setup_succeed', $url);
     } else {
         $firstgid = $_G['cache']['grouptype']['second'][$_G['forum']['fup']]['fup'];
         $groupselect = get_groupselect($firstgid, $_G['forum']['fup']);
         $gviewpermselect = $jointypeselect = array('', '', '');
         $_G['forum']['descriptionnew'] = str_replace("<br />", '', $_G['forum']['description']);
         $jointypeselect[$_G['forum']['jointype']] = 'checked="checked"';
         $gviewpermselect[$_G['forum']['gviewperm']] = 'checked="checked"';
         if ($_G['setting']['allowgroupdomain'] && !empty($_G['setting']['domain']['root']['group']) && $domainlength) {
             loadcache('creditrule');
             getuserprofile('extcredits1');
             $rule = $_G['cache']['creditrule']['modifydomain'];
             $credits = $consume = $common = '';
             for ($i = 1; $i <= 8; $i++) {
                 if ($_G['setting']['extcredits'][$i] && $rule['extcredits' . $i]) {
                     $consume .= $common . $_G['setting']['extcredits'][$i]['title'] . $rule['extcredits' . $i] . $_G['setting']['extcredits'][$i]['unit'];
                     $credits .= $common . $_G['setting']['extcredits'][$i]['title'] . $_G['member']['extcredits' . $i] . $_G['setting']['extcredits'][$i]['unit'];
                     $common = ',';
                 }
             }
         }
     }
 } elseif ($_G['gp_op'] == 'checkuser') {
     $checktype = 0;
     $checkusers = array();
     if (!empty($_G['gp_uid'])) {