<?php if (!defined('iBUAA')) { exit('Access Denied'); } //idtype到含有magiccolor字段的表映射 $mapping = array('blogid' => 'blogfield', 'tid' => 'thread'); if (!isset($mapping[$idtype])) { showmessage('magicuse_bad_object'); } magic_check_idtype($id, $idtype); //彩色灯 if (submitcheck("usesubmit")) { //颜色代号 $tablename = $mapping[$idtype]; $_POST['color'] = intval($_POST['color']); updatetable($tablename, array('magiccolor' => $_POST['color']), array($idtype => $id, 'uid' => $_SGLOBAL['supe_uid'])); //feed也加上颜色 $query = $_SGLOBAL['db']->query('SELECT * FROM ' . tname('feed') . " WHERE id='{$id}' AND idtype='{$idtype}' AND uid='{$_SGLOBAL['supe_uid']}'"); $feed = $_SGLOBAL['db']->fetch_array($query); if ($feed) { $feed['body_data'] = unserialize($feed['body_data']); $feed['body_data'] = is_array($feed['body_data']) ? $feed['body_data'] : array(); $feed['body_data']['magic_color'] = $_POST['color']; $feed['body_data'] = serialize($feed['body_data']); updatetable('feed', array('body_data' => $feed['body_data']), array('feedid' => $feed['feedid'])); } magic_use($mid, array('id' => $id, 'idtype' => $idtype), true); showmessage('magicuse_success', $_POST['refer'], 0); }
[UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: function_image.php 7350 2008-05-12 09:36:04Z liguode $ */ if (!defined('IN_UCHOME')) { exit('Access Denied'); } //红包卡 //上个红包的剩余积分 $leftcredit = 0; $query = $_SGLOBAL['db']->query('SELECT * FROM ' . tname('magicuselog') . " WHERE uid='{$_SGLOBAL['supe_uid']}' AND mid='{$mid}'"); $value = $_SGLOBAL['db']->fetch_array($query); if ($value && $value['data']) { $data = unserialize($value['data']); $leftcredit = intval($data['left']); } //每份最大数 $magic['custom']['maxchunk'] = $magic['custom']['maxchunk'] ? intval($magic['custom']['maxchunk']) : 20; if (submitcheck("usesubmit")) { $_POST['credit'] = intval($_POST['credit']); $_POST['chunk'] = intval($_POST['chunk']); if ($_POST['chunk'] < 1 || $_POST['chunk'] > $_POST['credit'] || $_POST['chunk'] > $magic['custom']['maxchunk']) { showmessage('magicuse_bad_chunk_given'); } if ($_POST['credit'] < 1 || $_POST['credit'] > $space['credit']) { showmessage("magicuse_bad_credit_given"); } $_SGLOBAL['db']->query('UPDATE ' . tname('space') . " SET credit = credit - {$_POST['credit']} + {$leftcredit} WHERE uid = '{$_SGLOBAL['supe_uid']}'"); $data = array('credit' => $_POST['credit'], 'chunk' => $_POST['chunk'], 'left' => $_POST['credit']); magic_use($mid, array('data' => serialize($data)), true); showmessage("magicuse_success", $_POST['refer']); }
<?php if (!defined('iBUAA')) { exit('Access Denied'); } //ºÃÓÑÔöÈÝ¿¨ if (submitcheck("usesubmit")) { $rate = $magic['custom']['addsize'] ? intval($magic['custom']['addsize']) : 10; $addsize = 1048576 * $rate; $_SGLOBAL['db']->query('UPDATE ' . tname('space') . " SET addsize = addsize + {$addsize} WHERE uid='{$_SGLOBAL['supe_uid']}'"); magic_use($mid, array(), true); showmessage('magicuse_success', $_POST['refer'], 0); }
<?php /* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: function_image.php 7350 2008-05-12 09:36:04Z liguode $ */ if (!defined('IN_UCHOME')) { exit('Access Denied'); } //³¬¼¶Ã÷ÐÇ if (submitcheck("usesubmit")) { $_POST['star'] = intval($_POST['star']); $expire = $_SGLOBAL['timestamp'] + ($magic['custom']['effectivetime'] ? $magic['custom']['effectivetime'] : 604800); updatetable("spacefield", array('magicstar' => $_POST['star'], 'magicexpire' => $expire), array('uid' => $_SGLOBAL['supe_uid'])); magic_use($mid, array('expire' => $expire), true); showmessage('magicuse_success', $_POST['refer'], 0); }
} elseif ($_POST['visitway'] == 'comment') { //留言 $message = getstr($_POST['visitmsg'], 255, 1, 1, 1); $ip = getonlineip(); $note_inserts = array(); foreach ($fids as $fid) { $inserts[] = "('{$fid}', '{$fid}', 'uid', '{$_SGLOBAL['supe_uid']}', '{$_SGLOBAL['supe_username']}','{$ip}', '{$_SGLOBAL['timestamp']}', '{$message}')"; $note = cplang("magic_note_wall", array("space.php?uid={$fid}&do=wall")); $note_inserts[] = "('{$fid}', 'comment', '1', '{$_SGLOBAL['supe_uid']}', '{$_SGLOBAL['supe_username']}', '{$note}', '{$_SGLOBAL['timestamp']}')"; } $_SGLOBAL['db']->query('INSERT INTO ' . tname('comment') . "(uid, id, idtype, authorid, author, ip, dateline, message) VALUES " . implode(",", $inserts)); $_SGLOBAL['db']->query('INSERT INTO ' . tname('notification') . "(uid, type, new, authorid, author, note, dateline) VALUES " . implode(",", $note_inserts)); $_SGLOBAL['db']->query('UPDATE ' . tname('space') . " SET notenum = notenum + 1 WHERE uid IN (" . simplode($fids) . ")"); } else { //访问空间 foreach ($fids as $fid) { $inserts[] = "('{$fid}', '{$_SGLOBAL['supe_uid']}', '{$_SGLOBAL['supe_username']}', '{$_SGLOBAL['timestamp']}')"; } $_SGLOBAL['db']->query('REPLACE INTO ' . tname('visitor') . "(uid, vuid, vusername, dateline) VALUES " . implode(",", $inserts)); } magic_use($mid, array(), 1); //显示 $users = array(); $query = $_SGLOBAL['db']->query('SELECT * FROM ' . tname('member') . " WHERE uid IN (" . simplode($fids) . ")"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { $users[$value['uid']] = $value; realname_set($value['uid'], $value['username']); } realname_get(); $op = 'show'; }
$from = 'uploadimage'; } $_SCONFIG['allowwatermark'] = 0; //禁止添加水印 $uploadfiles = stream_save($GLOBALS['HTTP_RAW_POST_DATA'], $_SERVER['HTTP_ALBUMID'], 'jpg', '', '', 0, $from); } $uploadResponse = true; $picid = $proid = $albumid = 0; if ($uploadfiles && is_array($uploadfiles)) { $status = "success"; $albumid = $uploadfiles['albumid']; $picid = $uploadfiles['picid']; if ($op == "doodle") { $fileurl = pic_get($uploadfiles['filepath'], $uploadfiles['thumb'], $uploadfiles['remote'], 0); include_once S_ROOT . './source/function_magic.php'; magic_use('doodle', array(), 1); } } else { switch ($uploadfiles) { case -1: $uploadfiles = cplang('inadequate_capacity_space'); break; case -2: $uploadfiles = cplang('only_allows_upload_file_types'); break; case -4: $uploadfiles = cplang('ftp_upload_file_size'); break; case -8: $uploadfiles = cplang('has_not_more_doodle'); break;