本文整理汇总了PHP中updatemembercount函数的典型用法代码示例。如果您正苦于以下问题:PHP updatemembercount函数的具体用法?PHP updatemembercount怎么用?PHP updatemembercount使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了updatemembercount函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: usesubmit
function usesubmit()
{
global $_G;
if (empty($_GET['pid'])) {
showmessage(lang('magic/repent', 'repent_info_nonexistence'));
}
$_G['tid'] = $_GET['ptid'];
$post = getpostinfo($_GET['pid'], 'pid', array('p.first', 'p.tid', 'p.fid', 'p.authorid', 'p.replycredit', 't.status as thread_status'));
$this->_check($post);
require_once libfile('function/post');
require_once libfile('function/delete');
if ($post['first']) {
if ($have_replycredit = C::t('forum_replycredit')->fetch($post['tid'])) {
$thread = C::t('forum_thread')->fetch($post['tid']);
if ($thread['replycredit']) {
updatemembercount($post['authorid'], array($_G['setting']['creditstransextra'][10] => $replycredit));
}
C::t('forum_replycredit')->delete($post['tid']);
C::t('common_credit_log')->delete_by_operation_relatedid(array('RCT', 'RCA', 'RCB'), $post['tid']);
}
deletethread(array($post['tid']));
updateforumcount($post['fid']);
} else {
if ($post['replycredit'] > 0) {
updatemembercount($post['authorid'], array($_G['setting']['creditstransextra'][10] => -$post['replycredit']));
C::t('common_credit_log')->delete_by_uid_operation_relatedid($post['authorid'], 'RCA', $post['tid']);
}
deletepost(array($_GET['pid']));
updatethreadcount($post['tid']);
}
usemagic($this->magic['magicid'], $this->magic['num']);
updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, 'tid', $_G['tid']);
showmessage(lang('magic/repent', 'repent_succeed'), $post['first'] ? 'forum.php?mod=forumdisplay&fid=' . $post['fid'] : dreferer(), array(), array('alert' => 'right', 'showdialog' => 1, 'locationtime' => true));
}
示例2: usesubmit
function usesubmit()
{
global $_G;
if (empty($_G['gp_pid'])) {
showmessage(lang('magic/repent', 'repent_info_nonexistence'));
}
$_G['tid'] = $_G['gp_ptid'];
$post = getpostinfo($_G['gp_pid'], 'pid', array('p.first', 'p.tid', 'p.fid', 'p.authorid', 'p.replycredit', 't.status as thread_status'));
$this->_check($post);
require_once libfile('function/post');
require_once libfile('function/delete');
if ($post['first']) {
if ($have_replycredit = DB::fetch_first("SELECT * FROM " . DB::table('forum_replycredit') . " WHERE tid ='{$post['tid']}' LIMIT 1")) {
if ($replycredit = DB::result_first("SELECT replycredit FROM " . DB::table('forum_thread') . " WHERE tid = '{$post['tid']}'")) {
updatemembercount($post['authorid'], array($_G['setting']['creditstransextra'][10] => $replycredit));
}
DB::delete('forum_replycredit', "tid = '{$post['tid']}'");
DB::delete('common_credit_log', "operation IN ('RCT', 'RCA', 'RCB') AND relatedid IN({$post['tid']})");
}
deletethread(array($post['tid']));
updateforumcount($post['fid']);
} else {
if ($post['replycredit'] > 0) {
updatemembercount($post['authorid'], array($_G['setting']['creditstransextra'][10] => -$post['replycredit']));
DB::delete('common_credit_log', "uid = '{$post['authorid']}' AND operation = 'RCA' AND relatedid IN({$post['tid']})");
}
deletepost(array($_G['gp_pid']));
updatethreadcount($post['tid']);
}
usemagic($this->magic['magicid'], $this->magic['num']);
updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, 'tid', $_G['tid']);
showmessage(lang('magic/repent', 'repent_succeed'), $post['first'] ? 'forum.php?mod=forumdisplay&fid=' . $post['fid'] : dreferer(), array(), array('showdialog' => 1, 'locationtime' => true));
}
示例3: usesubmit
function usesubmit()
{
global $_G;
$info = array('credits' => intval($_POST['credits']), 'percredit' => intval($_POST['percredit']), 'credittype' => $_G['gp_credittype'], 'left' => intval($_POST['credits']), 'magicid' => intval($this->magic['magicid']), 'receiver' => array());
if ($info['credits'] < 1) {
showmessage(lang('magic/gift', 'gift_bad_credits_input'));
}
if ($info['percredit'] < 1 || $info['percredit'] > $info['credits']) {
showmessage(lang('magic/gift', 'gift_bad_percredit_input'));
}
$member = array();
if (preg_match('/^extcredits[1-8]$/', $info['credittype'])) {
$member = DB::fetch_first('SELECT * FROM ' . DB::table('common_member_count') . " WHERE uid = '{$_G['uid']}'");
if ($member[$info['credittype']] < $info['credits']) {
showmessage(lang('magic/gift', 'gift_credits_out_of_own'));
}
$extcredits = str_replace('extcredits', '', $info['credittype']);
updatemembercount($_G['uid'], array($extcredits => -$info['credits']), 1, 'BGC', $this->magic['magicid']);
} else {
showmessage(lang('magic/gift', 'gift_bad_credittype_input'));
}
DB::update('common_member_field_home', array('magicgift' => addslashes(serialize($info))), array('uid' => $_G['uid']));
usemagic($this->magic['magicid'], $this->magic['num']);
updatemagiclog($this->magic['magicid'], '2', '1', '0', '0', 'uid', $_G['uid']);
showmessage(lang('magic/gift', 'gift_succeed'), dreferer(), array(), array('showdialog' => 1, 'locationtime' => true));
}
示例4: usesubmit
function usesubmit()
{
global $_G;
$getmoney = rand(1, intval($this->magic['price'] * 1.5));
updatemembercount($_G['uid'], array($_G['setting']['creditstransextra'][3] => $getmoney), 1, 'MRC', $this->magic['magicid']);
usemagic($this->magic['magicid'], $this->magic['num']);
updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, 'uid', $_G['uid']);
showmessage('magics_credit_message', '', array('credit' => $_G['setting']['extcredits'][$_G['setting']['creditstransextra'][3]]['title'] . ' ' . $getmoney . ' ' . $_G['setting']['extcredits'][$_G['setting']['creditstransextra'][3]]['unit']), array('showdialog' => 1));
}
示例5: memcp_get_succeed
function memcp_get_succeed($setting)
{
global $_G;
if ($setting['MarketCredit']) {
$creditArr = $setting['MarketCredit'];
foreach ($creditArr as $id => &$value) {
$value *= -1;
}
updatemembercount($_G['uid'], $creditArr);
}
}
示例6: expiration_finished
public function expiration_finished($days)
{
$expiration = TIMESTAMP - intval($days) * 86400;
$logs = DB::fetch_all("SELECT * FROM %t WHERE sellerid>0 AND status=5 AND lastupdate<%d", array($this->_table, $expiration));
$members = array();
foreach ($logs as $log) {
$members[$log['sellerid']]['extcredits' . $log['basecredit']] += $log['credit'];
}
foreach ($members as $uid => $data) {
updatemembercount($uid, $data);
}
DB::query("DELETE FROM %t WHERE sellerid>0 AND status=5 AND lastupdate<%d", array($this->_table, $expiration));
}
示例7: dsu_amucallme_output
function dsu_amucallme_output($a)
{
global $_G;
if ($_G['uid'] && in_array($_G['fid'], $this->fids)) {
$turl = "forum.php?mod=redirect&goto=findpost&ptid={$a['values']['tid']}&pid={$a['values']['pid']}";
$url = $_G["siteurl"] . $turl;
$msg = $this->message;
$reply = $_G["siteurl"] . "forum.php?mod=post&action=reply&tid={$a['values']['tid']}&repquote={$a['values']['pid']}";
if (!$msg) {
if (!function_exists('discuzcode')) {
include libfile('function/discuzcode');
}
$msg = ' ' . cutstr(strip_tags(discuzcode($_G['gp_message'], 1, 0)), 40, '...');
}
$sendmsg = lang('plugin/dsu_amucallme', 'sendmsg', array('username' => $_G['username'], 'url' => $url, 'reply' => $reply, 'message' => $msg));
$cmcost = array();
if (file_exists('./data/plugindata/dsu_amucallme.data.php')) {
require_once DISCUZ_ROOT . './data/plugindata/dsu_amucallme.data.php';
$data_f2a = dstripslashes($data_f2a);
$cmcost = $data_f2a[$_G['groupid']];
$cmcost['cost'] = $cmcost['cost'] * '-1';
}
$max = 0;
if ($cmcost['extcredits'] && $cmcost['cost']) {
$max = intval($_G['member']["extcredits{$cmcost['extcredits']}"] / $cmcost['cost']);
} else {
$max = 100;
}
if ($a['values']['tid'] && $a['values']['pid'] && $max) {
foreach ($this->usernames as $key => $val) {
if ($val && $_G['uid'] != $val && $max) {
updatemembercount($_G['uid'], array("extcredits{$cmcost['extcredits']}" => $cmcost['cost']), true, '', 0);
notification_add($val, $_G['uid'], $sendmsg, '', 0);
$max--;
}
}
foreach ($this->gusernames as $key => $val) {
if ($val && $_G['uid'] != $val && $max) {
updatemembercount($_G['uid'], array("extcredits{$cmcost['extcredits']}" => $cmcost['cost']), true, '', 0);
notification_add($val, $_G['uid'], $sendmsg, '', 0);
$max--;
}
}
}
}
}
示例8: global_header
function global_header()
{
global $_G;
$sendConfig = array();
$sendConfig = $_G['cache']['plugin']['send_jinbi'];
//缓存插件变量值
if (intval($sendConfig['status']) == 1) {
//是否启动插件
if (isset($_POST['regsubmit'])) {
//会员注册后
$uid = intval($_G['member']['uid']);
if ($uid) {
$jinbi_num = intval($sendConfig['jinbi_num']);
//送金币数量
updatemembercount($uid, array("extcredits2" => $jinbi_num));
//更新金币数 (这个是function_core.php的现成函数)
//这里可以进行任何数据库的操作
}
}
}
}
示例9: common
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));
}
示例10: foreach
// 特殊奖励(N)非循环
if (is_array($teshu)) {
foreach ($teshu as $id => $result) {
updatemembercount($_G['uid'], array("extcredits{$result['extcredits']}" => $result['reward']), true, '', 0);
}
}
updatemembercount($_G['uid'], array("extcredits{$thisvars['ptjf']}" => $pt), true, '', 0);
break;
case 4:
// 特殊奖励(Y)循环
if (is_array($teshu)) {
foreach ($teshu as $id => $result) {
updatemembercount($_G['uid'], array("extcredits{$result['extcredits']}" => $result['reward']), true, '', 0);
}
}
updatemembercount($_G['uid'], array("extcredits{$thisvars['ptjf']}" => $pt), true, '', 0);
break;
}
}
}
}
}
//elseif($this_time == 0 && $this_H){
// //今天连续打卡&整点打卡
// $Hreward = rand($this_Hs['minreward'],$this_Hs['maxreward']);
// $return_msg = '整点签到成功! 获得额外奖励'.$ptjfname.'+'.$Hreward;
// C::t('#dsu_amupper#plugin_dsuamupper')->update($_G['uid'],array('lasttime'=> $_G['timestamp']));
// updatemembercount($_G['uid'], array("extcredits{$thisvars['ptjf']}" => $Hreward), true,'',0);
//}
if ($return_msg) {
if (defined('VIP_INITED')) {
示例11: showmessage
showmessage('activity_exile_field');
}
$ufielddata['userfield'][$key] = $value;
}
}
if (!empty($activity['ufield']['extfield'])) {
foreach ($activity['ufield']['extfield'] as $fieldid) {
$value = cutstr(dhtmlspecialchars(trim($_GET['' . $fieldid])), 50, '.');
$ufielddata['extfield'][$fieldid] = $value;
}
}
$ufielddata = !empty($ufielddata) ? serialize($ufielddata) : '';
}
if ($_G['setting']['activitycredit'] && $activity['credit'] && empty($applyinfo['verified'])) {
checklowerlimit(array('extcredits' . $_G['setting']['activitycredit'] => '-' . $activity['credit']));
updatemembercount($_G['uid'], array($_G['setting']['activitycredit'] => '-' . $activity['credit']), true, 'ACC', $_G['tid']);
}
if ($applyinfo && $applyinfo['verified'] == 2) {
$newinfo = array('tid' => $_G['tid'], 'username' => $_G['username'], 'uid' => $_G['uid'], 'message' => $message, 'verified' => $verified, 'dateline' => $_G['timestamp'], 'payment' => $payment, 'ufielddata' => $ufielddata);
C::t('forum_activityapply')->update($applyinfo['appyid'], $newinfo);
} else {
$data = array('tid' => $_G['tid'], 'username' => $_G['username'], 'uid' => $_G['uid'], 'message' => $message, 'verified' => $verified, 'dateline' => $_G['timestamp'], 'payment' => $payment, 'ufielddata' => $ufielddata);
C::t('forum_activityapply')->insert($data);
}
$applynumber = C::t('forum_activityapply')->fetch_count_for_thread($_G['tid']);
C::t('forum_activity')->update($_G['tid'], array('applynumber' => $applynumber));
if ($thread['authorid'] != $_G['uid']) {
notification_add($thread['authorid'], 'activity', 'activity_notice', array('tid' => $_G['tid'], 'subject' => $thread['subject']));
$space = array();
space_merge($space, 'field_home');
if (!empty($space['privacy']['feed']['newreply'])) {
示例12: before_deletepost
public function before_deletepost($parameters)
{
$isfirstpost = $this->post['first'] ? 1 : 0;
if ($this->thread['special'] == 3) {
if ($this->thread['price'] < 0 && $this->thread['dateline'] + 1 == $this->post['dateline']) {
showmessage('post_edit_reward_nopermission', NULL);
}
}
if ($this->thread['special'] == 3 && $isfirstpost) {
updatemembercount($this->post['authorid'], array($this->setting['creditstransextra'][2] => $this->thread['price']));
C::t('common_credit_log')->delete_by_uid_operation_relatedid($this->thread['authorid'], 'RTC', $this->thread['tid']);
}
}
示例13: empty
$discuz = C::app();
$discuz->init();
$apitype = empty($_GET['attach']) || !preg_match('/^[a-z0-9]+$/i', $_GET['attach']) ? 'alipay' : $_GET['attach'];
require_once DISCUZ_ROOT . './api/trade/api_' . $apitype . '.php';
$PHP_SELF = $_SERVER['PHP_SELF'];
$_G['siteurl'] = dhtmlspecialchars('http://' . $_SERVER['HTTP_HOST'] . preg_replace("/\\/+(api\\/trade)?\\/*\$/i", '', substr($PHP_SELF, 0, strrpos($PHP_SELF, '/'))) . '/');
$notifydata = trade_notifycheck('credit');
if ($notifydata['validator']) {
$orderid = $notifydata['order_no'];
$postprice = $notifydata['price'];
$order = C::t('forum_order')->fetch($orderid);
$order = array_merge($order, C::t('common_member')->fetch_by_username($order['uid']));
if ($order && floatval($postprice) == floatval($order['price']) && ($apitype == 'tenpay' || strtolower($_G['setting']['ec_account']) == strtolower($_REQUEST['seller_email']))) {
if ($order['status'] == 1) {
C::t('forum_order')->update($orderid, array('status' => '2', 'buyer' => "{$notifydata['trade_no']}\t{$apitype}", 'confirmdate' => $_G['timestamp']));
updatemembercount($order['uid'], array($_G['setting']['creditstrans'] => $order['amount']), 1, 'AFD', $order['uid']);
updatecreditbyaction($action, $uid = 0, $extrasql = array(), $needle = '', $coef = 1, $update = 1, $fid = 0);
C::t('forum_order')->delete_by_submitdate($_G['timestamp'] - 60 * 86400);
$submitdate = dgmdate($order['submitdate']);
$confirmdate = dgmdate(TIMESTAMP);
notification_add($order['uid'], 'credit', 'addfunds', array('orderid' => $order['orderid'], 'price' => $order['price'], 'value' => $_G['setting']['extcredits'][$_G['setting']['creditstrans']]['title'] . ' ' . $order['amount'] . ' ' . $_G['setting']['extcredits'][$_G['setting']['creditstrans']]['unit']), 1);
}
}
}
if ($notifydata['location']) {
$url = rawurlencode('home.php?mod=spacecp&ac=credit');
if ($apitype == 'tenpay') {
echo <<<EOS
<meta name="TENCENT_ONLINE_PAYMENT" content="China TENCENT">
<html>
<body>
示例14: reward_credit
function reward_credit($extcreditid, $credits)
{
global $_G;
$creditsarray[$extcreditid] = $credits;
updatemembercount($_G['uid'], $creditsarray, 1, 'TRC', $this->task['taskid']);
}
示例15: array
C::t('common_member_field_home')->update($uid, array('magicgift' => $info['left'] > 0 ? serialize($info) : ''));
$credittype = '';
if (preg_match('/^extcredits[1-8]$/', $info['credittype'])) {
$extcredits = str_replace('extcredits', '', $info['credittype']);
updatemembercount($_G['uid'], array($extcredits => $percredit), 1, 'AGC', $info['magicid']);
$credittype = $_G['setting']['extcredits'][$extcredits]['title'];
}
showmessage('haved_red_bag_gain', dreferer(), array('percredit' => $percredit, 'credittype' => $credittype), array('showdialog' => 1, 'locationtime' => true));
}
showmessage('space_no_red_bag', dreferer(), array(), array('showdialog' => 1, 'locationtime' => true));
} elseif ($op == 'retiregift') {
$mid = 'gift';
$memberfieldhome = C::t('common_member_field_home')->fetch($_G['uid']);
$info = $memberfieldhome['magicgift'] ? dunserialize($memberfieldhome['magicgift']) : array();
unset($memberfieldhome);
$leftcredit = intval($info['left']);
if ($leftcredit <= 0) {
C::t('common_member_field_home')->update($_G['uid'], array('magicgift' => ''));
showmessage('red_bag_no_credits');
}
$extcredits = str_replace('extcredits', '', $info['credittype']);
$credittype = $_G['setting']['extcredits'][$extcredits]['title'];
if (submitcheck('cancelsubmit')) {
C::t('common_member_field_home')->update($_G['uid'], array('magicgift' => ''));
if (preg_match('/^extcredits[1-8]$/', $info['credittype'])) {
updatemembercount($_G['uid'], array($extcredits => $leftcredit), 1, 'RGC', $info['magicid']);
}
showmessage('return_red_bag', dreferer(), array('leftcredit' => $leftcredit, 'credittype' => $credittype), array('showdialog' => 1, 'locationtime' => true));
}
}
include_once template('home/spacecp_magic');