$username = trim($username); if (!$username) { continue; } $r = $db->get_one("SELECT username,credit FROM {$DT_PRE}member WHERE username='******'"); if (!$r) { $error .= '<br/>会员[' . $username . ']不存在'; continue; } if (!$type && $r['credit'] < abs($amount)) { $error .= '<br/>会员[' . $username . ']' . $DT['credit_name'] . '不足,当前' . $DT['credit_name'] . '为:' . $r['credit']; continue; } $reason or $reason = '奖励'; $note or $note = '手工'; credit_add($username, $amount); credit_record($username, $amount, $_username, $reason, $note); } if ($error) { message('操作成功 ' . $success . ' 位会员,发生以下错误:' . $error); } dmsg('操作成功', '?moduleid=' . $moduleid . '&file=' . $file); } else { if (isset($userid)) { if ($userid) { $userids = is_array($userid) ? implode(',', $userid) : $userid; $result = $db->query("SELECT username FROM {$DT_PRE}member WHERE userid IN ({$userids})"); while ($r = $db->fetch_array($result)) { $username .= $r['username'] . "\n"; } }
if ($could_refresh && $MOD['credit_refresh'] && $MOD['credit_refresh'] > $_credit) { $could_refresh = false; } if ($could_refresh) { $do->refresh($itemid); $s++; if ($MOD['credit_refresh']) { $_credit = $_credit - $MOD['credit_refresh']; } } else { $f++; } } if ($MOD['credit_refresh'] && $s) { $credit = $s * $MOD['credit_refresh']; credit_add($_username, -$credit); credit_record($_username, -$credit, 'system', lang($L['credit_record_refresh'], array($MOD['name'])), lang($L['refresh_total'], array($s))); } $msg = lang($L['refresh_success'], array($s)); if ($f) { $msg = $msg . ' ' . lang($L['refresh_fail'], array($f)); } dmsg($msg, $forward); break; default: $_process = $L['group_process']; $sorder = $L['group_orderby']; $dorder = array($MOD['order'], 'orders DESC', 'orders ASC', 'sales DESC', 'sales ASC', 'price DESC', 'price ASC', 'marketprice DESC', 'marketprice ASC', 'savemoney DESC', 'savemoney ASC', 'discount DESC', 'discount ASC', 'amount DESC', 'amount ASC', 'minamount DESC', 'minamount ASC', 'hits DESC', 'hits ASC'); isset($order) && isset($dorder[$order]) or $order = 0; $status = isset($status) ? intval($status) : 3; in_array($status, array(1, 2, 3, 4)) or $status = 3;
function check($itemid) { global $_username, $DT_TIME, $MOD; if (is_array($itemid)) { foreach ($itemid as $v) { $this->check($v); } } else { $this->itemid = $itemid; $item = $this->get_one(); if ($MOD['credit_add'] && $item['username'] && $item['hits'] < 1) { credit_add($item['username'], $MOD['credit_add']); credit_record($item['username'], $MOD['credit_add'], 'system', lang('my->credit_record_add', array($MOD['name'])), 'ID:' . $this->itemid); } $editdate = timetodate($DT_TIME, 3); $this->db->query("UPDATE {$this->table} SET status=3,hits=hits+1,editor='{$_username}',edittime={$DT_TIME} WHERE itemid={$itemid}"); $this->tohtml($itemid); return true; } }
if (!$_userid) { dheader($MOD['linkurl']); } if (!$mid || !$itemid || !$fee || !$currency || !$sign || !$title || !$forward) { dheader($MOD['linkurl']); } $title = rawurldecode($title); check_sign($_username . $mid . $itemid . $username . $fee . $fee_back . $currency . $forward . $title, $sign) or dalert($L['check_sign'], $forward); $note = ($mid == -9 ? $L['resume_name'] : $MODULE[$mid]['name']) . '/' . $itemid; if ($currency == 'credit') { if ($_credit >= $fee) { $db->query("INSERT INTO {$DT_PRE}finance_pay (moduleid,itemid,username,fee,currency,paytime,ip,title) VALUES ('{$mid}','{$itemid}','{$_username}','{$fee}','{$currency}','{$DT_TIME}','{$DT_IP}','" . addslashes($title) . "')"); credit_add($_username, -$fee); credit_record($_username, -$fee, 'system', $L['pay_record_view'], $note); if ($username && $fee_back) { credit_add($username, $fee_back); credit_record($username, $fee_back, 'system', $L['pay_record_back'], $note); } dheader($forward); } else { dheader($MOD['linkurl'] . 'credit.php?action=buy'); } } $discount = $MG['discount'] > 0 && $MG['discount'] < 100 ? $MG['discount'] : 100; $discount = dround($discount / 100); if ($submit) { is_payword($_username, $password) or message($L['error_payword']); $fee = dround($fee * $discount); $fee > 0 or message($L['pay_msg_fee']); $fee <= $_money or dheader($MOD['linkurl'] . 'charge.php?action=pay&amount=' . ($fee - $_money)); $db->query("INSERT INTO {$DT_PRE}finance_pay (moduleid,itemid,username,fee,currency,paytime,ip,title) VALUES ('{$mid}','{$itemid}','{$_username}','{$fee}','{$currency}','{$DT_TIME}','{$DT_IP}','" . addslashes($title) . "')");
if ($MFD) { fields_update($post_fields, $do->table_member, $do->userid, 'userid', $MFD); } if ($CFD) { fields_update($post_fields, $do->table_company, $do->userid, 'userid', $CFD); } if ($user['edittime'] == 0 && $user['inviter'] && $MOD['credit_user']) { $inviter = $user['inviter']; $r = $db->get_one("SELECT itemid FROM {$DT_PRE}finance_credit WHERE note='{$_username}' AND username='******'"); if (!$r) { credit_add($inviter, $MOD['credit_user']); credit_record($inviter, $MOD['credit_user'], 'system', $L['edit_invite'], $_username); } } if ($user['edittime'] == 0 && $MOD['credit_edit']) { credit_add($_username, $MOD['credit_edit']); credit_record($_username, $MOD['credit_edit'], 'system', $L['edit_profile'], $DT_IP); } if ($post['password']) { message($L['edit_msg_success'] . $L['edit_msg_password'], '?tab=' . $tab . '&success=1'); } dmsg($L['edit_msg_success'], '?tab=' . $tab . '&success=1'); } else { message($do->errmsg); } } else { $COM_TYPE = explode('|', $MOD['com_type']); $COM_SIZE = explode('|', $MOD['com_size']); $COM_MODE = explode('|', $MOD['com_mode']); $MONEY_UNIT = explode('|', $MOD['money_unit']); $head_title = $L['edit_title'];
function delete($itemid, $all = true) { global $MOD, $L; if (is_array($itemid)) { foreach ($itemid as $v) { $this->delete($v); } } else { $this->itemid = $itemid; $r = $this->get_one(); $userid = get_user($r['username']); if ($r['content']) { delete_local($r['content'], $userid); } $this->db->query("DELETE FROM {$this->table} WHERE itemid={$itemid}"); $this->db->query("DELETE FROM {$this->table_data} WHERE itemid={$itemid}"); if ($r['username'] && $MOD['credit_del_page']) { credit_add($r['username'], -$MOD['credit_del_page']); credit_record($r['username'], -$MOD['credit_del_page'], 'system', $L['page_record_del'], 'ID:' . $this->itemid); } } }
function credit_hook_rate_deductusercredit($uid, $amount) { // the amount is always negative to reduce balance $amount = -1 * abs($amount); return credit_add($uid, $amount); }
} } } } $fid = isset($fid) ? $fid : ''; if (isset($old) && $old && in_array($from, array('thumb', 'photo'))) { delete_upload($old, $_userid); } $_saveto = $swfupload ? str_replace('.thumb.' . $do->ext, '', $saveto) : $saveto; $_SESSION['uploads'][] = $_saveto; if ($DT['uploadlog']) { $db->query("INSERT INTO {$upload_table} (item,fileurl,filesize,fileext,upfrom,width,height,moduleid,username,ip,addtime,itemid) VALUES ('" . md5($saveto) . "','{$saveto}','{$do->file_size}','{$do->ext}','{$from}','{$img_w}','{$img_h}','{$moduleid}','{$_username}','{$DT_IP}','{$do->uptime}','{$itemid}')"); } if ($MG['uploadcredit'] > 0) { require DT_ROOT . '/include/module.func.php'; credit_add($_username, -$MG['uploadcredit']); credit_record($_username, -$MG['uploadcredit'], 'system', $L['upload'], $from); } if ($swfupload) { exit('FILEID:' . $saveto); } $pr = 'parent.document.getElementById'; if ($from == 'thumb') { $js .= 'try{' . $pr . '("d' . $fid . '").src="' . $saveto . '";}catch(e){}'; $js .= $pr . '("' . $fid . '").value="' . $saveto . '";'; $js .= 'window.parent.cDialog();'; } else { if ($from == 'album' || $from == 'photo') { $js .= 'window.parent.getAlbum("' . $saveto . '", "' . $fid . '");'; $js .= $from == 'photo' ? $pr . '("dform").submit();' : 'window.parent.cDialog();'; } else {
$continue = FALSE; $uids = $_POST['uids']; if (is_array($uids)) { foreach ($uids as $uid) { if ($user_config['status'] == 3) { $parent_uid = user_getparentbyuid($uid); if ($parent_uid == $user_config['uid']) { $continue = TRUE; } } if (auth_isadmin()) { $continue = TRUE; } $amount = -1 * abs($_POST['amount']); if ($continue && $amount < 0 && ($username = user_uid2username($uid))) { if (credit_add($uid, $amount)) { $current_balance = credit_getbalance($uid); $_SESSION['dialog']['info'][] .= _('Credit has been reduced') . ' (' . _('user') . ':' . $username . ' ' . _('amount') . ':' . $amount . ' ' . _('balance') . ':' . $current_balance . ')'; } else { $_SESSION['dialog']['info'][] .= _('Fail to reduce credit') . ' (' . _('user') . ':' . $username . ' ' . _('amount') . ':' . $amount . ')'; } } else { $_SESSION['dialog']['info'][] .= _('Wrong amount or user does not exist') . ' (' . _('User ID') . ':' . $uid . ')'; } } } header("Location: " . _u('index.php?app=main&inc=feature_credit&op=credit_reduce')); exit; break; } break;
function login($login_username, $login_password, $login_cookietime = 0, $admin = false) { global $DT_TIME, $DT_IP, $MOD, $MODULE, $L; if (!check_name($login_username)) { return $this->_($L['member_login_username_bad']); } if (!$MOD || !isset($MOD['login_times'])) { $MOD = cache_read('module-2.php'); } $login_lock = $MOD['login_times'] && $MOD['lock_hour'] ? true : false; $LOCK = array(); if ($login_lock) { $LOCK = cache_read($DT_IP . '.php', 'ban'); if ($LOCK) { if ($DT_TIME - $LOCK['time'] < $MOD['lock_hour'] * 3600) { if ($LOCK['times'] >= $MOD['login_times']) { return $this->_(lang($L['member_login_ban'], array($MOD['login_times'], $MOD['login_hour']))); } } else { $LOCK = array(); cache_delete($DT_IP . '.php', 'ban'); } } } $user = userinfo($login_username, 0); if (!$user) { $this->lock($login_lock, $LOCK, $DT_IP, $DT_TIME); return $this->_($L['member_login_not_member']); } if (!$admin) { if ($user['password'] != (is_md5($login_password) ? md5($login_password) : md5(md5($login_password)))) { $this->lock($login_lock, $LOCK, $DT_IP, $DT_TIME); return $this->_($L['member_login_password_bad']); } } if ($user['groupid'] == 2) { return $this->_($L['member_login_member_ban']); } $userid = $user['userid']; if (isset($MODULE[16])) { $cart = get_cookie('cart'); if ($cart) { $this->cart($cart, $userid, $DT_TIME); } } if ($MOD['credit_login'] > 0 && timetodate($DT_TIME, 3) != timetodate($user['logintime'], 3)) { credit_add($login_username, $MOD['credit_login']); credit_record($login_username, $MOD['credit_login'], 'system', $L['member_record_login'], $DT_IP); } $cookietime = $DT_TIME + ($login_cookietime ? intval($login_cookietime) : 86400 * 7); $auth = encrypt($user['userid'] . "\t" . $user['username'] . "\t" . $user['groupid'] . "\t" . $user['password'] . "\t" . $user['admin']); set_cookie('auth', $auth, $cookietime); set_cookie('userid', $user['userid'], $cookietime); set_cookie('username', $user['username'], $DT_TIME + 86400 * 365); $this->db->query("UPDATE {$this->table_member} SET loginip='{$DT_IP}',logintime={$DT_TIME},logintimes=logintimes+1 WHERE userid={$userid}"); return $user; }
if ($item['process'] == 2) { $a = $db->get_one("SELECT * FROM {$table}_answer WHERE qid={$itemid} ORDER BY vote DESC"); if ($a && $a['vote'] > $MOD['minvote']) { $aid = intval($a['itemid']); $expert = $a['expert'] ? $a['username'] : ''; if ($expert) { $db->query("UPDATE {$table}_expert SET best=best+1 WHERE username='******'"); } $db->query("UPDATE {$table} SET process=3,aid={$aid},expert='{$expert}',updatetime='{$DT_TIME}' WHERE itemid={$itemid}"); if ($a['username']) { if ($item['credit']) { credit_add($a['username'], $item['credit']); credit_record($a['username'], $item['credit'], 'system', lang($L['record_reward'], array($MODULE[$moduleid]['name'])), 'ID:' . $itemid); } if ($MOD['credit_best']) { credit_add($a['username'], $MOD['credit_best']); credit_record($a['username'], $MOD['credit_best'], 'system', lang($L['record_best'], array($MODULE[$moduleid]['name'])), 'ID:' . $itemid); } } } else { $db->query("UPDATE {$table} SET process=0,updatetime='{$DT_TIME}' WHERE itemid={$itemid}"); } $reload = true; } } if ($reload) { if ($MOD['show_html']) { tohtml('show', $module); } dalert('', '', 'top.window.location.reload();'); }
} } $db->query("UPDATE {$DT_PRE}comment SET quote=quote+1 WHERE itemid={$qid}"); } $db->query("INSERT INTO {$DT_PRE}comment (item_mid,item_id,item_title,item_username,content,quotation,qid,addtime,username,hidden,star,ip,status) VALUES ('{$mid}','{$itemid}','{$title}','{$username}','{$content}','{$quotation}','{$qid}','{$DT_TIME}','{$_username}','{$hidden}','{$star}','{$DT_IP}','{$status}')"); $cid = $db->insert_id(); $r = $db->get_one("SELECT sid FROM {$DT_PRE}comment_stat WHERE moduleid={$mid} AND itemid={$itemid}"); $star = 'star' . $star; if ($r) { $db->query("UPDATE {$DT_PRE}comment_stat SET comment=comment+1,`{$star}`=`{$star}`+1 WHERE sid={$r['sid']}"); } else { $db->query("INSERT INTO {$DT_PRE}comment_stat (moduleid,itemid,{$star},comment) VALUES ('{$mid}','{$itemid}','1','1')"); } if ($status == 3) { if ($_username && $MOD['credit_add_comment']) { credit_add($_username, $MOD['credit_add_comment']); credit_record($_username, $MOD['credit_add_comment'], 'system', $L['comment_record_add'], 'ID:' . $cid); } $items = isset($items) ? intval($items) + 1 : 1; $page = ceil($items / $pagesize); $forward = rewrite('index.php?mid=' . $mid . '&itemid=' . $itemid . '&page=' . $page . '&rand=' . mt_rand(10, 99)) . '#last'; dalert('', '', 'parent.window.location="' . $forward . '";'); } else { dalert($L['comment_check'], '', 'parent.window.location=parent.window.location;'); } } else { $lists = array(); $pages = ''; $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}comment WHERE item_mid={$mid} AND item_id={$itemid} AND status=3"); $items = $r['num']; $pages = pages($items, $page, $pagesize);
} if ($fee_add) { if ($fee_currency == 'money') { money_add($_username, -$fee_add); money_record($_username, -$fee_add, $L['in_site'], 'system', lang($L['credit_record_add'], array($MOD['name'])), 'ID:' . $do->itemid); } else { credit_add($_username, -$fee_add); credit_record($_username, -$fee_add, 'system', lang($L['credit_record_add'], array($MOD['name'])), 'ID:' . $do->itemid); } } if ($post['credit']) { credit_add($_username, -$post['credit']); credit_record($_username, -$post['credit'], 'system', lang($L['credit_record_reward'], array($MOD['name'])), 'ID:' . $do->itemid); } if (isset($post['hidden']) && $MOD['credit_hidden']) { credit_add($_username, -$MOD['credit_hidden']); credit_record($_username, -$MOD['credit_hidden'], 'system', lang($L['credit_record_hidden'], array($MOD['name'])), 'ID:' . $do->itemid); } if ($post['ask'] && check_name($post['ask'])) { $db->query("UPDATE {$table}_expert SET ask=ask+1 WHERE username='******'ask']}'"); $touser = $post['ask']; $title = lang($L['know_new_title'], array($post['title'])); $question = $post['title']; $itemid = $do->itemid; $content = ob_template('ask', 'mail'); send_message($touser, $title, $content); } $js = ''; if (isset($post['sync_sina']) && $post['sync_sina']) { $js .= sync_weibo('sina', $moduleid, $do->itemid); }
function delete($itemid, $all = true) { global $MOD, $L; if (is_array($itemid)) { foreach ($itemid as $v) { $this->delete($v); } } else { $this->itemid = $itemid; $r = $this->get_one(); $userid = get_user($r['username']); if ($r['thumb']) { delete_upload($r['thumb'], $userid); } $this->db->query("DELETE FROM {$this->table} WHERE itemid={$itemid}"); if ($r['username'] && $MOD['credit_del_credit']) { credit_add($r['username'], -$MOD['credit_del_credit']); credit_record($r['username'], -$MOD['credit_del_credit'], 'system', $L['honor_punish_reason'], 'ID:' . $this->itemid); } } }
$need_check = $MOD['check_answer'] == 2 ? $MG['check'] : $MOD['check_answer']; $status = get_status(3, $need_check); $db->query("INSERT INTO {$table}_answer (qid,content,username,addtime,ip,status) VALUES ('{$itemid}', '{$content}', '{$_username}', '{$DT_TIME}', '{$DT_IP}', '{$status}')"); if ($status == 3) { $db->query("UPDATE {$table} SET answer=answer+1 WHERE itemid={$itemid}"); } if ($MOD['credit_answer'] && $_username && $status == 3) { $could_credit = true; if ($MOD['credit_maxanswer'] > 0) { $r = $db->get_one("SELECT SUM(amount) AS total FROM {$DT_PRE}finance_credit WHERE username='******' AND addtime>{$DT_TIME}-86400 AND reason='" . $L['answer'] . "'"); if ($r['total'] > $MOD['credit_maxanswer']) { $could_credit = false; } } if ($could_credit) { credit_add($_username, $MOD['credit_answer']); credit_record($_username, $MOD['credit_answer'], 'system', $L['answer'], 'ID:' . $itemid . '(' . $L['know_by_mobile'] . ')'); } } if ($MOD['answer_message'] && $item['username']) { $linkurl = $MOD['linkurl'] . $item['linkurl']; $message = lang($L['answer_message'], array(dsubstr($item['title'], 20, '...'), $item['title'], nl2br($content), $linkurl)); send_message($item['username'], dsubstr($message, 60, '...'), $message); } exit($status == 3 ? 'ok' : 'check'); } $head_title = $L['know_title'] . $DT['seo_delimiter'] . $head_title; $foot = ''; include template('know_answer', 'mobile'); if (DT_CHARSET != 'UTF-8') { toutf8();
exit('1'); break; case 'getcreditsettings': API_GETCREDITSETTINGS or exit(API_RETURN_FORBIDDEN); $credits = array(1 => array('积分', '分')); echo uc_serialize($credits); break; case 'updatecredit': $credit = intval($uc_arr['amount']); if ($credit) { $type = $uc_arr['credit']; $uid = $uc_arr['uid']; $user = uc_get_user($uid, 1); $username = $user[1]; if ($username) { credit_add($username, $credit); credit_record($username, $credit, 'system', 'UC Credits', 'extcredits' . $type); exit('1'); } else { exit('0'); } } else { exit('0'); } break; case 'updatecreditsettings': exit('1'); break; case 'updateapps': exit('1'); break;
$months = $next_month + $buy_month; $year = floor($months / 12); if ($months % 12 == 0) { $to_month = 12; $to_year = $next_year + $year - 1; } else { $to_month = $months % 12; $to_year = $next_year + $year; } $totime = strtotime($to_year . '-' . $to_month . '-1'); $status = $EXT['spread_check'] ? 2 : 3; if ($currency == 'money') { money_add($_username, -$amount); money_record($_username, -$amount, $L['in_site'], 'system', $MODULE[$mid]['name'] . $L['spread_title'], $word . '(' . $L['spread_infoid'] . $buy_tid . ')'); } else { credit_add($_username, -$amount); credit_record($_username, -$amount, 'system', $MODULE[$mid]['name'] . $L['spread_title'], $word . '(ID:' . $buy_tid . ')'); } $db->query("INSERT INTO {$DT_PRE}spread (mid,tid,word,price,currency,company,username,addtime,fromtime,totime,status) VALUES ('{$mid}','{$buy_tid}','{$word}','{$buy_price}','{$currency}','{$_company}','{$_username}','{$DT_TIME}','{$next_time}','{$totime}','{$status}')"); dmsg($L['spread_msg_success'], '?status=' . $status); } else { // } } else { dheader($EXT['spread_url']); } } else { $status = isset($status) ? intval($status) : 3; in_array($status, array(2, 3)) or $status = 3; $condition = "username='******' AND status={$status}"; $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}spread WHERE {$condition}");
function check($itemid, $status = 3) { global $MOD; if (is_array($itemid)) { foreach ($itemid as $v) { $this->check($v, $status); } } else { if ($MOD['credit_answer'] && $status == 3) { $this->itemid = $itemid; $item = $this->get_one(); if ($item['username']) { credit_add($item['username'], $MOD['credit_answer']); credit_record($item['username'], $MOD['credit_answer'], 'system', lang('my->credit_record_answer_add'), 'ID:' . $itemid); } } $this->db->query("UPDATE {$this->table} SET status={$status} WHERE itemid={$itemid}"); } }
if ($r) { if ($r['status'] == 0) { $charge_orderid = $r['itemid']; $charge_money = $r['amount'] + $r['fee']; $charge_amount = $r['amount']; $editor = 'N' . $bank; if ($total_fee == $charge_money) { $db->query("UPDATE {$DT_PRE}finance_charge SET status=3,money={$charge_money},receivetime='{$DT_TIME}',editor='{$editor}' WHERE itemid={$charge_orderid}"); require DT_ROOT . '/include/module.func.php'; money_add($r['username'], $r['amount']); money_record($r['username'], $r['amount'], $PAY[$bank]['name'], 'system', '在线充值', '订单ID:' . $charge_orderid); $MOD = cache_read('module-2.php'); if ($MOD['credit_charge'] > 0) { $credit = intval($r['amount'] * $MOD['credit_charge']); if ($credit > 0) { credit_add($r['username'], $credit); credit_record($r['username'], $credit, 'system', '充值奖励', '充值' . $r['amount'] . $DT['money_unit']); } } exit('success'); } else { $note = '充值金额不匹配S:' . $charge_money . 'R:' . $total_fee; $db->query("UPDATE {$DT_PRE}finance_charge SET status=1,receivetime='{$DT_TIME}',editor='{$editor}',note='{$note}' WHERE itemid={$charge_orderid}"); //支付失败 #log_result($note); exit('fail'); } } else { if ($r['status'] == 1) { exit('fail'); } else {
$could_credit = false; } if ($could_credit) { $r = $db->get_one("SELECT itemid FROM {$DT_PRE}finance_credit WHERE note='{$DT_IP}' AND addtime>{$DT_TIME}-86400"); if ($r) { $could_credit = false; } } if ($could_credit && $MOD['credit_maxip'] > 0) { $r = $db->get_one("SELECT SUM(amount) AS total FROM {$DT_PRE}finance_credit WHERE username='******' AND addtime>{$DT_TIME}-86400 AND reason='{$reason}'"); if ($r['total'] > $MOD['credit_maxip']) { $could_credit = false; } } if ($could_credit) { credit_add($username, $MOD['credit_ip']); credit_record($username, $MOD['credit_ip'], 'system', $reason, $DT_IP); set_cookie('inviter', encrypt($username, DT_KEY . 'INVITER'), $DT_TIME + 30 * 86400); } } else { dheader(DT_PATH); } } else { dheader(DT_PATH); } $goto = isset($goto) ? trim($goto) : ''; $URI = DT_PATH; if ($goto == 'register') { $URI = $MODULE[2]['linkurl'] . $DT['file_register']; } else { if ($goto == 'homepage') {
$do->add($post); if ($FD) { fields_update($post_fields, $table, $do->itemid); } if ($CP) { property_update($post_ppt, $moduleid, $post['catid'], $do->itemid); } if ($MOD['show_html'] && $post['status'] > 2) { $do->tohtml($do->itemid); } if ($fee_add) { if ($fee_currency == 'money') { money_add($_username, -$fee_add); money_record($_username, -$fee_add, $L['in_site'], 'system', lang($L['credit_record_add'], array($MOD['name'])), 'ID:' . $do->itemid); } else { credit_add($_username, -$fee_add); credit_record($_username, -$fee_add, 'system', lang($L['credit_record_add'], array($MOD['name'])), 'ID:' . $do->itemid); } } $msg = $post['status'] == 2 ? $L['success_check'] : $L['success_add']; $js = ''; if (isset($post['sync_sina']) && $post['sync_sina']) { $js .= sync_weibo('sina', $moduleid, $do->itemid); } if (isset($post['sync_qq']) && $post['sync_qq']) { $js .= sync_weibo('qq', $moduleid, $do->itemid); } if (isset($post['sync_qzone']) && $post['sync_qzone']) { $js .= sync_weibo('qzone', $moduleid, $do->itemid); } if ($_userid) {
function check($itemid, $status = 3) { global $_username, $DT_TIME, $MOD; if (is_array($itemid)) { foreach ($itemid as $v) { $this->check($v, $status); } } else { $this->itemid = $itemid; $item = $this->get_one(); if ($MOD['credit_reply'] && $status == 3) { if ($item['username'] && $item['addtime'] >= $item['edittime']) { credit_add($item['username'], $MOD['credit_reply']); credit_record($item['username'], $MOD['credit_reply'], 'system', lang('my->credit_record_reply_add'), 'ID:' . $itemid); } } $this->db->query("UPDATE {$this->table} SET status={$status},editor='{$_username}',edittime={$DT_TIME} WHERE itemid={$itemid}"); $this->tohtml($item['tid']); } }