function cksearchcredit($ac) { global $space, $gets; //搜索积分 $paycredit = creditrule('pay', 'search'); $mcredit = empty($space['credit']) ? 0 : intval($space['credit']); if ($mcredit < $paycredit) { showmessage('integral_inadequate', '', 1, array($mcredit, $paycredit)); } if ($paycredit) { //不是二次提交 if (!isset($_GET['confirm'])) { $nexturl = "network.php?ac={$ac}"; foreach ($gets as $gkey => $gvalue) { if ($gvalue) { $nexturl .= '&' . $gkey . '=' . rawurlencode(stripslashes($gvalue)); } } $nexturl .= "&searchmode=1&confirm"; showmessage('points_deducted_yes_or_no', '', 1, array($paycredit, $nexturl, $ac)); } } }
preg_match("/(admincp|do|cp)\\.php\\?ac\\=([a-z]+)/i", $refer, $ms); if ($ms) { if ($ms[1] != 'cp' || $ms[2] != 'sendmail') { $refer = ''; } } if (empty($refer)) { $refer = 'space.php?do=home'; } //好友邀请 $uid = empty($_GET['uid']) ? 0 : intval($_GET['uid']); $code = empty($_GET['code']) ? '' : $_GET['code']; $app = empty($_GET['app']) ? '' : intval($_GET['app']); $invite = empty($_GET['invite']) ? '' : $_GET['invite']; $invitearr = array(); if ($uid && $code && !creditrule('pay', 'invite')) { $m_space = getspace($uid); if ($code == space_key($m_space, $app)) { //验证通过 $invitearr['uid'] = $uid; $invitearr['username'] = $m_space['username']; } $url_plus = "uid={$uid}&app={$app}&code={$code}"; } elseif ($uid && $invite) { include_once S_ROOT . './source/function_cp.php'; $invitearr = invite_get($uid, $invite); $url_plus = "uid={$uid}&invite={$invite}"; } //没有登录表单 $_SGLOBAL['nologinform'] = 1; if (submitcheck('loginsubmit')) {
} //判断是否有权限 if (!checkperm('allowblog')) { showmessage('no_privilege'); } //检查是否支持 if (!function_exists('fsockopen')) { showmessage('support_function_has_not_yet_opened fsockopen'); } $userfile = S_ROOT . "./data/temp/{$_SGLOBAL['supe_uid']}.data"; $results = array(); if (file_exists($userfile)) { $result = sreadfile($userfile); $results = empty($result) ? '' : unserialize($result); } $paycredit = creditrule('pay', 'xmlrpc'); $siteurl = getsiteurl(); if (submitcheck('importsubmit')) { //检查积分 if ($space['credit'] < $paycredit) { showmessage('integral_inadequate', '', 1, array($space['credit'], $paycredit)); } //站点URL $_POST['url'] = trim($_POST['url']); if (empty($_POST['url']) || !($urls = parse_url($_POST['url']))) { showmessage('url_is_not_correct'); } //构建串 $xmldata = '<?xml version="1.0" encoding="utf-8"?>'; $xmldata .= '<methodCall><methodName>metaWeblog.getRecentPosts</methodName>'; $xmldata .= '<params>';
<?php /* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: cp_domain.php 9257 2008-10-29 07:11:13Z liguode $ */ if (!defined('IN_UCHOME')) { exit('Access Denied'); } //二级域名 $domainlength = checkperm('domainlength'); if ($_SCONFIG['allowdomain'] && $_SCONFIG['domainroot'] && $domainlength) { $dcredit = creditrule('pay', 'domain'); } else { showmessage('no_privilege'); } if (submitcheck('domainsubmit')) { $setarr = array(); //二级域名 $_POST['domain'] = strtolower(trim($_POST['domain'])); if ($_POST['domain'] != $space['domain']) { //积分 if ($space['domain'] && $dcredit) { if ($space['credit'] >= $dcredit) { $setarr['credit'] = $space['credit'] - $dcredit; } else { showmessage('integral_inadequate', '', 1, array($space['credit'], $dcredit)); } } if (empty($domainlength) || empty($_POST['domain'])) { $setarr['domain'] = '';
function invite_update($inviteid, $uid, $username, $m_uid, $m_username, $appid = 0) { global $_SGLOBAL, $_SN; if ($uid && $uid != $m_uid) { $friendstatus = getfriendstatus($uid, $m_uid); if ($friendstatus < 1) { friend_update($uid, $username, $m_uid, $m_username, 'invite'); //查找邀请记录 $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('invite') . " WHERE uid='{$m_uid}' AND fuid='{$uid}'"); if ($oldinvite = $_SGLOBAL['db']->fetch_array($query)) { //已经邀请过 return false; } //奖励积分 $getcredit = creditrule('get', 'invite'); $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET credit=credit+{$getcredit} WHERE uid='{$m_uid}'"); //feed $_SGLOBAL['supe_uid'] = $m_uid; $_SGLOBAL['supe_username'] = $m_username; //实名 realname_set($uid, $username); realname_get(); $title_template = cplang('feed_invite'); $tite_data = array('username' => '<a href="space.php?uid=' . $uid . '">' . stripslashes($_SN[$uid]) . '</a>'); feed_add('friend', $title_template, $tite_data); //通知 $_SGLOBAL['supe_uid'] = $uid; $_SGLOBAL['supe_username'] = $username; notification_add($m_uid, 'friend', cplang('note_invite')); //更新邀请 $setarr = array('fuid' => $uid, 'fusername' => $username, 'appid' => $appid); if ($inviteid) { updatetable('invite', $setarr, array('id' => $inviteid)); } else { $setarr['uid'] = $m_uid; inserttable('invite', $setarr, 0, true); //插入邀请记录 } } } }
<?php /* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: cp_profile.php 9732 2008-11-14 01:51:43Z liguode $ */ if (!defined('IN_UCHOME')) { exit('Access Denied'); } //积分 $rncredit = creditrule('pay', 'realname'); if (submitcheck('profilesubmit')) { if (!@(include_once S_ROOT . './data/data_profilefield.php')) { include_once S_ROOT . './source/function_cache.php'; profilefield_cache(); } $profilefields = empty($_SGLOBAL['profilefield']) ? array() : $_SGLOBAL['profilefield']; //提交检查 $setarr = array('qq' => getstr($_POST['qq'], 20, 1, 1), 'msn' => getstr($_POST['msn'], 80, 1, 1), 'birthyear' => intval($_POST['birthyear']), 'birthmonth' => intval($_POST['birthmonth']), 'birthday' => intval($_POST['birthday']), 'blood' => getstr($_POST['blood'], 5, 1, 1), 'marry' => intval($_POST['marry']), 'birthprovince' => getstr($_POST['birthprovince'], 20, 1, 1), 'birthcity' => getstr($_POST['birthcity'], 20, 1, 1), 'resideprovince' => getstr($_POST['resideprovince'], 20, 1, 1), 'residecity' => getstr($_POST['residecity'], 20, 1, 1)); //性别 $_POST['sex'] = intval($_POST['sex']); if ($_POST['sex'] && empty($space['sex'])) { $setarr['sex'] = $_POST['sex']; } foreach ($profilefields as $field => $value) { if ($value['formtype'] == 'select') { $value['maxsize'] = 255; } $setarr['field_' . $field] = getstr($_POST['field_' . $field], $value['maxsize'], 1, 1); if ($value['required'] && empty($setarr['field_' . $field])) { showmessage('field_required', '', 1, array($value['title']));
function updatespaces($spaces, $type) { global $_SGLOBAL; //空间数据 if (!($credit = creditrule('pay', $type))) { return false; //删除不扣分 } $nums = renum($spaces); foreach ($nums[0] as $num) { //积分 $newcredit = $num * $credit; $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET credit=credit-{$newcredit} WHERE uid IN (" . simplode($nums[1][$num]) . ")"); } }
<?php /* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: cp_invite.php 10977 2009-01-14 02:30:13Z zhengqingpeng $ */ if (!defined('IN_UCHOME')) { exit('Access Denied'); } $siteurl = getsiteurl(); $maxcount = 50; //最多好友邀请 $pay_invite = creditrule('pay', 'invite'); $get_invite = creditrule('get', 'invite'); $appid = empty($_GET['app']) ? 0 : intval($_GET['app']); $inviteapp = $invite_code = ''; if (empty($pay_invite) || $appid) { $pay_invite = 0; $invite_code = space_key($space, $appid); } $siteurl = getsiteurl(); $spaceurl = $siteurl . 'space.php?uid=' . $_SGLOBAL['supe_uid']; $mailvar = array("<a href=\"{$spaceurl}\"><img src=\"" . avatar($space['uid'], 'middle') . "\" border=\"0\"></a><br>" . $_SN[$space['uid']], $_SN[$space['uid']], $_SCONFIG['sitename'], '', '', $spaceurl, ''); //取出相应的应用 $appinfo = array(); if ($appid) { $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('myapp') . " WHERE appid='{$appid}'"); $appinfo = $_SGLOBAL['db']->fetch_array($query); if ($appinfo) { $inviteapp = "&app={$appid}"; $mailvar[6] = $appinfo['appname'];
function updatespacestatus($creditmode, $optype) { global $_SGLOBAL; $lastname = $optype == 'search' ? 'lastsearch' : 'lastpost'; $credit = creditrule($creditmode, $optype); if ($credit) { $creditsql = $creditmode == 'get' ? "+{$credit}" : "-{$credit}"; } else { $creditsql = ''; } $creditsql = $creditsql ? ",credit=credit{$creditsql}" : ''; $updatetimesql = $optype == 'search' ? '' : ",updatetime='{$_SGLOBAL['timestamp']}'"; //搜索不更新 //更新状态 $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET {$lastname}='{$_SGLOBAL['timestamp']}' {$updatetimesql} {$creditsql} WHERE uid='{$_SGLOBAL['supe_uid']}'"); }