本帖最后由 szrq 于 2009-9-2 16:23 编辑
[原创] 谁发给我要解密的ST音乐盒插件升级包 速来取解密代码~~
@Id: function_music.php- <?php
- include (S_ROOT.'./phprpc_client.php');
- $client = new PHPRPC_Client('http://2699991.com.s18.4bo.cn/function_music_server.php');
- if(!defined('IN_UCHOME')) {
- exit('Access Denied');
- }
- $httplist = array(
- '1'=>"localhost",
- '2'=>"www.jjcute.com",
- '3'=>"jjcute.com",
- '4'=>"www.yqwb.net",
- '5'=>"yqwb.net",
- '6'=>"www.xbeifang.cn",
- '7'=>"xbeifang.cn",
- '8'=>"www.pin.sg",
- '9'=>"pin.sg",
- '10'=>"www.5xcd.com",
- '11'=>"5xcd.com",
- '12'=>"www.cncd.us",
- '13'=>"cncd.us",
- '14'=>"www.yaajee.com",
- '15'=>"yaajee.com",
- '16'=>"www.ohpop.cn",
- '17'=>"ohpop.cn",
- '18'=>"www.qyeah.net",
- '19'=>"qyeah.net",
- '20'=>"musicmx.cn",
- '21'=>"www.musicmx.cn",
- '22'=>"cqwan.com",
- '23'=>"www.cqwan.com",
- '24'=>"www.orangelr.com",
- '25'=>"orangelr.com",
- '26'=>"uch.yydm.com",
- '27'=>"yydm.com",
- '28'=>"www.paosc.com",
- '29'=>"paosc.com",
- '30'=>"www.naoxin.net",
- '31'=>"naoxin.net",
- '32'=>"maoming.cc",
- '33'=>"www.maoming.cc",
- '34'=>"home.zjjy.com",
- '35'=>"zjjy.com",
- '36'=>"www.xkboy.com",
- '37'=>"xkboy.com",
- '38'=>"www.v125.cn",
- '39'=>"v125.cn",
- '40'=>"home.kptk.cn",
- '41'=>"kptk.cn",
- '42'=>"www.0451kaixin.com",
- '43'=>"0451kaixin.com",
- '44'=>"www.wzqing.com",
- '45'=>"wzqing.com",
- '46'=>"www.ee23.cn",
- '47'=>"ee23.cn",
- '48'=>"www.halibeibei.com",
- '49'=>"halibeibei.com",
- '50'=>"www.yood.cn",
- '51'=>"yood.cn",
- '52'=>"www.mzhan.com",
- '53'=>"mzhan.com",
- '54'=>"www.hnjita.cn",
- '55'=>"hnjita.cn",
- '56'=>"www.hezequan.com",
- '57'=>"hezequan.com",
- '58'=>"www.w8zs.com",
- '59'=>"w8zs.com",
- );
- function PMA_getenv($var_name) {
- if (isset($_SERVER[$var_name])) {
- return $_SERVER[$var_name];
- }elseif (isset($_ENV[$var_name])) {
- return $_ENV[$var_name];
- }elseif (getenv($var_name)) {
- return getenv($var_name);
- }elseif (function_exists('apache_getenv') &&apache_getenv($var_name,true)) {
- return apache_getenv($var_name,true);
- }
- return '';
- }
- if (empty($HTTP_HOST)) {
- if (PMA_getenv('HTTP_HOST')) {
- $HTTP_HOST = PMA_getenv('HTTP_HOST');
- }else {
- $HTTP_HOST ='';
- }
- }
- if(!in_array(htmlspecialchars($HTTP_HOST),$httplist)){
- header ("location:http://www.jjcute.com");
- }
- function getuserhost(){
- global $client;
- $client->getuserhost();
- return $client->getOutput();
- }
- function integralop($integral,$uid) {
- global $_SGLOBAL,$_SC;
- if($_SC['music_integralset']=="1") {
- $_SGLOBAL['db']->query('UPDATE '.tname('space').' SET credit=credit+'.intval($integral).' WHERE uid='.$uid);
- }
- }
- function updatemyset($do=1,$type=1,$strvalue,$userid){
- global $_SGLOBAL,$_SC,$client;
- $datasqlstr = array();
- if($do==1){
- $datasqlstr['userid'] = $userid;
- $query = $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],2));
- return $_SGLOBAL['db']->fetch_array($query);
- }else{
- if($type==1){
- $datasqlstr['strvalue'] = $strvalue;
- $datasqlstr['userid'] = $userid;
- $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],1));
- }
- }
- }
- function checkboxis($ary,$str){
- $ary = split(",",$ary);
- if(in_array($str,$ary)) return ' checked="checked"';
- }
- function getarysvalue($chartstr,$stringv,$indexvalue){
- $resultary = split($chartstr,$stringv);
- return $resultary[$indexvalue];
- }
- function mycongener($str,$spaceuid,$arycount=5){
- global $_SGLOBAL,$_SC,$client;
- $datasqlstr = array();
- $resultlist = array();
- $datasqlstr['spaceuid'] = $spaceuid;
- $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],3);
- $query = $_SGLOBAL['db']->query($querysqlstring);
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
- realname_set($value['uid'],$value['username'],$value['name'],$value['namestatus']);
- similar_text(str_replace("@@@",",",$str),$value['musictaste'],$ptemp);
- $value['musictastep'] = $ptemp;
- $resultlist[] = $value;
- }
- foreach ($resultlist as $key =>$value) {
- $musictastep[$key] = $value['musictastep'];
- }
- array_multisort($musictastep,SORT_DESC,$resultlist);
- $resultlist = array_slice($resultlist,0,$arycount);
- return $resultlist;
- }
- function getdatetoarray($table,$file,$wheresql){
- global $_SGLOBAL;
- $temparray = array();
- $ttemp = array();
- $query = $_SGLOBAL['db']->query("SELECT ".$file." FROM ".tname($table)." WHERE 1=1 ".$wheresql);
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
- $ttemp = split(",",$value[$file]);
- $temparray = array_merge($temparray,$ttemp);
- }
- $temparray = array_merge($temparray,array("流行歌曲","舞曲","翻唱","怀旧","最新单曲","hip-hop","RandB","RAP","轻音乐","电影原声","动漫原声","HOUSE","迷幻","电子","爵士","古典乐","交响乐","朋克","民谣","金属","摇滚","乡村","歌特","其他"));
- $temparray=array_remove_empty($temparray);
- $temparray=getalinkint($temparray,2);
- return array_count_values($temparray);
- }
- function array_remove_empty($arr)
- {
- foreach ($arr as $key =>$value){
- if($value==""){
- unset($arr[$key]);
- }
- }
- return $arr;
- }
- function getalinkint($namesrt,$type=-1){
- $arr1 = array();
- $arr1[25] = array("","流行歌曲","舞曲","翻唱","怀旧","最新单曲","hip-hop","RandB","RAP","轻音乐","电影原声","动漫原声","HOUSE","迷幻","电子","爵士","古典乐","交响乐","朋克","民谣","金属","摇滚","乡村","歌特","其他");
- if($type==-1){
- for($i=1;$i<25;$i++){
- if($arr1[25][$i]==$namesrt) return $i;
- }
- }else{
- foreach ($namesrt as $key =>$value){
- $isin = 0;
- for($i=1;$i<25;$i++){
- if($value==$arr1[25][$i]) $isin=1;
- }
- if($isin!=1) unset($namesrt[$key]);
- }
- return $namesrt;
- }
- }
- function writeselectlist($type,$value)
- {
- $tempstr ="";
- for($i=0;$i<=20;$i++){
- $temp = "";
- $temp = $type.$i;
- if($temp==$value){
- $tempstr.= '<option value="'.$temp.'" selected="selected">'.$temp.'</option>';
- }else{
- $tempstr.= '<option value="'.$temp.'">'.$temp.'</option>';
- }
- }
- return $tempstr;
- }
- function getallpinglun($start,$perpage) {
- global $_SGLOBAL,$_SC,$client;
- $datasqlstr = array();
- $datasqlstr['start'] = $start;
- $datasqlstr['perpage'] = $perpage;
- $allpinglunlist = array();
- $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],4);
- $query = $_SGLOBAL['db']->query($querysqlstring);
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
- realname_set($value['uid'],$value['username'],$value['name'],$value['namestatus']);
- $allpinglunlist[] = $value;
- }
- return $allpinglunlist;
- }
- function getallpinglun_count() {
- global $_SGLOBAL,$_SC,$client;
- $listcount = 0;
- $allpinglunlist_c = array();
- $query = $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],5));
- $allpinglunlist_c = $_SGLOBAL['db']->fetch_array($query);
- return $allpinglunlist_c['c'];
- }
- function getlistofuserspace($user){
- global $_SGLOBAL,$_SC,$client;
- $userlist = array();
- $datasqlstr = array();
- $datasqlstr['user'] = $user;
- $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],6);
- $query = $_SGLOBAL['db']->query($querysqlstring);
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
- realname_set($value['uid'],$value['username'],$value['name'],$value['namestatus']);
- $userlist[] = $value;
- }
- return $userlist;
- }
- function server_getdiskurl($diskurl,$songid=-1){
- global $_SGLOBAL,$client;
- $configfile = S_ROOT.'./musicboxdate.txt';
- $tempdatesrr = sreadfile($configfile);
- $tempdatearray = array();
- $tempdatearray = explode("wwwjjcutecom111",$client->getdiskurl($diskurl,$songid,$tempdatesrr,$_SGLOBAL['timestamp']));
- if(strpos($tempdatearray[1],"wwwjjcutecom222")){
- $temparrayaaa = explode("wwwjjcutecom222",$tempdatearray[1]);
- if(!empty($temparrayaaa[1])) updatetable('musicbox',array('songurl'=>$temparrayaaa[1]),array('songid'=>$songid));
- if($temparrayaaa[0]!="0"){
- $fp111 = fopen($configfile,'w');
- fwrite($fp111,trim($temparrayaaa[0]));
- fclose($fp111);
- }
- }else{
- if($tempdatearray[1]!="0"){
- $fp111 = fopen($configfile,'w');
- fwrite($fp111,trim($tempdatearray[1]));
- fclose($fp111);
- }
- }
- return $tempdatearray[0];
- }
- function getsinglemusic($songid,$update=1) {
- global $_SGLOBAL,$_SC,$client;
- $datasqlstr = array();
- $datasqlstr['songid'] = $songid;
- $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],7);
- $query = $_SGLOBAL['db']->query($querysqlstring);
- $musicinfo = $_SGLOBAL['db']->fetch_array($query);
- if($musicinfo['upload']=="2"){$musicinfo['songurl'] = server_getdiskurl($musicinfo['songurl'],$musicinfo['songid']);}
- if($musicinfo['photourl']==""&&$musicinfo['singerid']==""){
- $setarr1 = array(
- 'area'=>"3",
- 'singername'=>$musicinfo['singer'],
- 'photourl'=>"images/singernophoto.jpg",
- );
- $newsongerid = inserttable('musicbox_singer',$setarr1,1);
- $musicinfo['photourl'] = "images/singernophoto.jpg";
- $musicinfo['singerid'] = $newsongerid;
- }
- if(!empty($musicinfo) &&$update==1){updatetable('musicbox',array('playtotal'=>$musicinfo['playtotal']+1,'commendtotal'=>$_SGLOBAL['timestamp']),array('songid'=>$songid));}
- return $musicinfo;
- }
- function editsingerphotofun($singerid,$photourl) {
- global $_SGLOBAL;
- updatetable('musicbox_singer',array('photourl'=>$photourl),array('singerid'=>$singerid));
- showmessage('do_success');
- }
- function getallsinger($keyword,$start,$perpage){
- global $_SGLOBAL,$_SC,$client;
- $datasqlstr = array();
- $allsingerlist = array();
- $resultcount = 0;
- if(!empty($keyword)){
- $wheresql = " AND singername like '%".$keyword."%'";
- }else{
- $wheresql = "";
- }
- $limitstr = " LIMIT ".$start.",".$perpage;
- $datasqlstr['wheresql'] = $wheresql;
- $datasqlstr['limitstr'] = $limitstr;
- $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],8);
- $query = $_SGLOBAL['db']->query($querysqlstring);
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {$allsingerlist[] = $value;$resultcount++;}
- if($resultcount!=0) $allsingerlist[0]['returncount'] = $resultcount;
- return $allsingerlist;
- }
- function insertsinger($singername){
- global $_SGLOBAL,$_SC,$client;
- $datasqlstr = array();
- $datasqlstr['singername'] = $singername;
- $query = $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],9));
- $tempdataa = $_SGLOBAL['db']->fetch_array($query);
- if(empty($tempdataa)){
- $setarr1 = array(
- 'area'=>"3",
- 'singername'=>$singername,
- 'photourl'=>"images/singernophoto.jpg",
- );
- inserttable('musicbox_singer',$setarr1,0);
- }
- }
- function getfriendsmusiclist($userlist) {
- global $_SGLOBAL,$_SC,$_SN,$_SCONFIG,$client;
- $datasqlstr = array();
- $thisuserid = "-1";
- $thisalbumid = "-1";
- $musiclist = array();
- $datasqlstr['userlist'] = $userlist;
- if(!empty($datasqlstr['userlist'])){
- $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],10);
- $query = $_SGLOBAL['db']->query($querysqlstring);
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {$musiclist[] = $value;}
- $musiclist = $client->server_getmyfriendsmusiclist(1,$musiclist);
- }
- return $musiclist;
- }
- function musichandle($type=-1,$setarr=-1,$id=-1,$spaceuid=-1,$arraylist=-1) {
- global $_SGLOBAL,$_SC,$client;
- $datasqlstr = array();
- switch ($type) {
- case 0:
- if($spaceuid==0){
- $datatemparr = array();
- $datatemparr = getsinglemusic($id,0);
- $_SGLOBAL['db']->query('UPDATE '.tname('space').' SET attachsize='.intval(intval($arraylist)-intval(filesize(S_ROOT.$datatemparr['songurl']))).' WHERE uid='.$datatemparr['userid']);
- unlink(str_replace("space.php","",realpath("space.php")).str_replace("./","",$datatemparr['songurl']));
- }
- $datasqlstr['id'] = $id;
- $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],11));
- $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],12));
- $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],13));
- $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],14));
- showmessage('deletemusic_success');
- break;
- case 1:
- $datasqlstr['id'] = $id;
- $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],15));
- $defaultid = getalbumdefaultid($spaceuid);
- updatetable('musicbox',array('albumid'=>$defaultid),array('albumid'=>$id));
- showmessage('deletemusicalbum_success');
- break;
- case 2:
- $datasqlstr['id'] = $id;
- $query = $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],16));
- $datatemparr = $_SGLOBAL['db']->fetch_array($query);
- if(!empty($setarr)){
- include_once(S_ROOT.'./source/function_cp.php');
- $note = cplang('music_toshare',array($datatemparr['userid'],$id,$datatemparr['songname']));
- $ckarray = $setarr;
- $cksize = count($ckarray);
- for($i=0;$i<$cksize;$i++){
- notification_add($ckarray[$i],'wall',$note);
- }
- }
- showmessage('do_success');
- break;
- case 3:
- inserttable('musicbox_mybox',$setarr,0);
- showmessage('do_success');
- break;
- case 4:
- inserttable('musicbox_pingfen',$setarr,0);
- include_once(S_ROOT.'./source/function_cp.php');
- $note = cplang('music_topingfen',array($arraylist['songuserid'],$arraylist['songid'],$arraylist['pingfensongname'],$arraylist['pingfen']));
- notification_add($arraylist['songuserid'],'wall',$note);
- showmessage('musicpingfen_success');
- break;
- case 5:
- inserttable('musicbox_pinglun',$setarr,0);
- include_once(S_ROOT.'./source/function_cp.php');
- $note = cplang('music_topinglun',array($arraylist['songuserid'],$arraylist['songid'],$arraylist['pinglunsongname']));
- notification_add($arraylist['songuserid'],'wall',$note);
- showmessage('musicpinglun_success');
- break;
- case 6:
- updatetable('musicbox',$setarr,array('songid'=>$id));
- include_once(S_ROOT.'./source/function_cp.php');
- $note = cplang('music_collection',array($arraylist['userid'],$arraylist['songid'],$arraylist['songname']));
- notification_add($arraylist['userid'],'wall',$note);
- showmessage('do_success');
- break;
- case 7:
- updatetable('musicbox',$setarr,array('songid'=>$id));
- showmessage('musicsetbg_success');
- break;
- case 8:
- $datasqlstr['id'] = $id;
- $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],17));
- showmessage('do_success');
- break;
- case 9:
- $datasqlstr['id'] = $id;
- $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],18));
- $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],19));
- $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],20));
- $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],21));
- showmessage('do_success','space.php?do=musicbox&mview=admin&control=music');
- break;
- case 10:
- $datasqlstr['id'] = $id;
- $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],22));
- showmessage('do_success','space.php?do=musicbox&mview=admin&control=pinglun');
- break;
- case 11:
- $datasqlstr['id'] = $id;
- $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],23));
- updatetable('musicbox',array('albumid'=>'0'),"albumid in (".$id.")");
- showmessage('do_success','space.php?do=musicbox&mview=admin&control=album');
- break;
- default:
- break;
- }
- return true;
- }
- function usergetallmusiclist($listorder,$listlanguage,$listkeywork,$start,$perpage){
- global $_SGLOBAL,$_SC,$client;
- $datasqlstr = array();
- $musiclistarr = array();
- $limitstr = " LIMIT ".$start.",".$perpage;
- $datasqlstr['listlanguage'] = $listlanguage;
- $datasqlstr['listkeywork'] = $listkeywork;
- $datasqlstr['listorder'] = $listorder;
- $datasqlstr['limitstr'] = $limitstr;
- $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],24);
- $query = $_SGLOBAL['db']->query($querysqlstring);
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {$musiclistarr[] = $value;}
- $musiclistarr = $client->server_getmusiclist(1,$musiclistarr);
- return $musiclistarr;
- }
- function getmusiclist($userid=-1,$albumid=-1,$songid=-1,$label=-1,$singer=-1,$lang=-1,$collectionuser=-1,$start=-1,$perpage=-1,$songname="",$alllist=-1,$orderbyid=-1,$lastplay=-1,$geturl=-1,$songidlist="") {
- global $_SGLOBAL,$_SC,$_SN,$_SCONFIG,$client;
- $musiclistarr = array();
- $datasqlstr = array();
- $resultcount = 0;
- $playtotalcount = 0;
- if($songname!=""){
- $datasqlstr['songnamestr'] = " AND main.songname like '%".$songname."%'";}
- if($userid!=-1){
- $datasqlstr['useridstr'] = " AND main.userid=".$userid;
- $datasqlstr['orderbylasttime'] = "main.songid DESC,";
- }
- if($albumid!=-1){
- $datasqlstr['albumidstr'] = " AND main.albumid=".$albumid;}
- if($songid!=-1){
- $datasqlstr['songidstr'] = " AND main.songid=".$songid;}
- if($songidlist!=""){
- $datasqlstr['songidliststr'] = " AND main.songid in(".$songidlist.")";
- $datasqlstr['songidliststrorder'] = "substring_index('".$songidlist."',main.songid,1),";
- }
- if($label!=-1){
- $datasqlstr['labelstr'] = " AND main.label like '%".$label."%'";}
- if($singer!=-1){
- $datasqlstr['singerstr'] = " AND main.singer like '%".$singer."%'";}
- if($lang!=-1){
- $datasqlstr['langstr'] = " AND main.lang=".$lang;}
- if($collectionuser!=-1){
- $datasqlstr['collectionuserstr'] = " AND main.collectionuser like '%,".$collectionuser.",%'";}
- if($orderbyid!=-1){
- $datasqlstr['orderbyidstr'] = " main.songid DESC,";}
- if($start!=-1 ||$perpage!=-1){
- $datasqlstr['limitstr'] = " LIMIT ".$start.",".$perpage;}
- if($lastplay!=-1){
- $datasqlstr['lastplaystr'] = " AND (".$_SGLOBAL['timestamp']."-`commendtotal`)/3600<0.5";
- $datasqlstr['lastplaystrorder'] = "commendtotal DESC,";
- }
- $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],0);
- $query = $_SGLOBAL['db']->query($querysqlstring);
- if($songname==""&$alllist==-1){
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {$musiclistarr[] = $value;}
- $musiclistarr = $client->server_getmusiclist(1,$musiclistarr);
- return $musiclistarr;
- }elseif($songname!=""&$alllist==2){
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {$musiclistarr[] = $value;}
- $musiclistarr = $client->server_getmusiclist(1,$musiclistarr);
- return $musiclistarr;
- }else{
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {$musiclistarr[] = $value;}
- return $client->server_getajaxsearchstrlist($musiclistarr);
- }
- }
- function getmusicguestnotes($type=-1,$id=-1,$id0s=-1,$start=-1,$perpage=-1) {
- global $_SGLOBAL,$_SC,$client;
- $datasqlstr = array();
- $resultlist = array();
- $resultcount = 0;
- switch ($type) {
- case 0:
- $datasqlstr['id'] = $id;
- $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],25);
- $query = $_SGLOBAL['db']->query($querysqlstring);
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
- realname_set($value['puserid'],$value['username'],$value['name'],$value['namestatus']);
- $resultlist[] = $value;
- }
- break;
- case 1:
- $datasqlstr['id'] = $id;
- $datasqlstr['start'] = $start;
- $datasqlstr['perpage'] = $perpage;
- $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],26);
- $query = $_SGLOBAL['db']->query($querysqlstring);
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
- realname_set($value['puserid'],$value['username'],$value['name'],$value['namestatus']);
- $resultlist[] = $value;
- $resultcount++;
- }
- if($resultcount!=0) $resultlist[0]['returncount'] = $resultcount;
- break;
- case 2:
- $datasqlstr['id'] = $id;
- $datasqlstr['id0s'] = $id0s;
- $query = $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],27));
- $resultlist = $_SGLOBAL['db']->fetch_array($query);
- break;
- case 3:
- $datasqlstr['id'] = $id;
- $datasqlstr['id0s'] = $id0s;
- $query = $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],28));
- $resultlist = $_SGLOBAL['db']->fetch_array($query);
- break;
- default:
- break;
- }
- return $resultlist;
- }
- function getalbumdefaultid($userid) {
- global $_SGLOBAL,$_SC,$client;
- $datasqlstr = array();
- $datasqlstr['userid'] = $userid;
- $defaultid = array();
- $query = $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],29));
- $defaultid = $_SGLOBAL['db']->fetch_array($query);
- return $defaultid['albumid'];
- }
- function getalbuminfo($albumid) {
- global $_SGLOBAL,$_SC,$client;
- $datasqlstr = array();
- $datasqlstr['albumid'] = $albumid;
- $thealbum = array();
- $query = $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],30));
- $thealbum = $_SGLOBAL['db']->fetch_array($query);
- return $thealbum;
- }
- function getmusicalbumcount($userid,$greatalbum=-1) {
- global $_SGLOBAL,$_SC,$client;
- $datasqlstr = array();
- $datasqlstr['userid'] = $userid;
- if($greatalbum==-1){
- $albumcount = array();
- $query = $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],31));
- $albumcount = $_SGLOBAL['db']->fetch_array($query);
- if(empty($albumcount)){
- return 0;
- }else{
- return 1;
- }
- }else{
- $setarr1 = array(
- 'userid'=>$userid,
- 'albumname'=>$_SGLOBAL['supe_username']."的专辑",
- 'albumfengmian'=>"images/album.gif",
- 'defaultalbumid'=>1,
- 'dataline'=>$_SGLOBAL['timestamp'],
- );
- inserttable('musicbox_album',$setarr1,0);
- }
- }
- function getmusicalbum($userid=-1,$albumid=-1,$type=0,$albumnoid=-1,$cisnotnull=-1) {
- global $_SGLOBAL,$_SC,$client;
- $datasqlstr = array();
- $musicalbumlistarr = array();
- if($userid!=-1){
- $useridstr = " AND main.userid=".$userid;}
- if($albumid!=-1){
- $albumidstr = " AND main.albumid=".$albumid;}
- if($albumnoid!=-1){
- $albumnoidstr = " AND main.albumid<>".$albumnoid;}
- if($cisnotnull!=-1){
- $cisnotnullstr = " AND m.mcount<>0";}
- $datasqlstr['useridstr'] = $useridstr;
- $datasqlstr['albumidstr'] = $albumidstr;
- $datasqlstr['albumnoidstr'] = $albumnoidstr;
- $datasqlstr['cisnotnullstr'] = $cisnotnullstr;
- $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],32);
- $query = $_SGLOBAL['db']->query($querysqlstring);
- if($type==0){
- $musicalbumlistarr = $_SGLOBAL['db']->fetch_array($query);
- }else{
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
- realname_set($value['uid'],$value['username'],$value['name'],$value['namestatus']);
- $value['albumname'] = getstr($value['albumname'],12,-1,-1,-1);
- $musicalbumlistarr[] = $value;
- }
- }
- return $musicalbumlistarr;
- }
- function pagecommender($commender){
- global $_SGLOBAL,$_SC,$client;
- $datasqlstr = array();
- $datasqlstr['commender'] = $commender;
- $query = $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],33));
- return $_SGLOBAL['db']->fetch_array($query);
- }
- function musicpeople($type=-1,$id=-1,$limit=-1) {
- global $_SGLOBAL,$_SC,$client;
- $datasqlstr = array();
- $musicpeoplelist = array();
- if($type==1) {
- $datalimit = $limit==-1?3:$limit;
- $datasqlstr['datalimit'] = $datalimit;
- $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],34);
- $query = $_SGLOBAL['db']->query($querysqlstring);
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
- realname_set($value['uid'],$value['username'],$value['name'],$value['namestatus']);
- $musicpeoplelist[] = $value;
- }
- }
- if($type==2) {
- $datalimit = $limit==-1?0:$limit;
- $collectionusertemp = array();
- $collectionuserstr = "";
- $datasqlstr['id'] = $id;
- $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],35);
- $query = $_SGLOBAL['db']->query($querysqlstring);
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
- $collectionuserstr.=$value['collectionuser'];
- }
- if(!empty($collectionuserstr) &&$collectionuserstr!=","){
- $collectionusertemp=explode(",",$collectionuserstr);
- $collectionusertemp=array_unique($collectionusertemp);
- $collectionusertemp=array_filter($collectionusertemp);
- $collectionusertemp = array_slice($collectionusertemp,0,$datalimit);
- $collectionuserstr=implode(",",$collectionusertemp);
- $datasqlstr['collectionuserstr'] = $collectionuserstr;
- $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],36);
- $query = $_SGLOBAL['db']->query($querysqlstring);
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
- realname_set($value['uid'],$value['username'],$value['name'],$value['namestatus']);
- $musicpeoplelist[] = $value;
- }
- }
- }
- if($type==3) {
- $datalimit = $limit==-1?5:$limit;
- $datasqlstr['datalimit'] = $datalimit;
- $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],37);
- $query = $_SGLOBAL['db']->query($querysqlstring);
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
- realname_set($value['uid'],$value['username'],$value['name'],$value['namestatus']);
- $value['albumname'] = getstr($value['albumname'],12,-1,-1,-1);
- $musicpeoplelist[] = $value;
- }
- }
- return $musicpeoplelist;
- }
- function getmybox($songlist) {
- global $_SGLOBAL,$_SC,$client;
- $datasqlstr = array();
- $playmusiclist = array();
- $datasqlstr['songlist'] = $songlist;
- $datasqlstr['supe_uid'] = $_SGLOBAL['supe_uid'];
- if($songlist != "myboxlist"){
- $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],38);
- $query = $_SGLOBAL['db']->query($querysqlstring);
- }else{
- $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],39);
- $query = $_SGLOBAL['db']->query($querysqlstring);
- }
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
- realname_set($value['uid'],$value['username'],$value['name'],$value['namestatus']);
- if($value['upload']=="2"){
- $value['songurl']= server_getdiskurl($value['songurl'],$value['songid']);
- }
- $playmusiclist[] = $value;
- }
- return $playmusiclist;
- }
- function setmusicbg($id,$type=-1) {
- global $_SGLOBAL,$_SC,$client;
- $datasqlstr = array();
- $datasqlstr['id'] = $id;
- $setarr = array(
- 'page'=>'0',
- );
- $setarr1 = array(
- 'page'=>'1',
- );
- if($type==2){
- $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],40));
- }else{
- updatetable('musicbox_mybox',$setarr,array('boxuserid'=>$_SGLOBAL['supe_uid']));
- if($type==-1){
- updatetable('musicbox_mybox',$setarr1,array('id'=>$id));
- }
- }
- }
- function ordermusic($llist) {
- global $_SGLOBAL;
- for($i = 0;$i <count($llist)-1;$i++){
- updatetable('musicbox_mybox',array('boxorder'=>$i),array('id'=>$llist[$i]));
- }
- }
- function getmusicbg($uid) {
- global $_SGLOBAL,$_SC,$client;
- $datasqlstr = array();
- $firstsong = array();
- $bgmusiclist = array();
- $datasqlstr['uid'] = $uid;
- $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],41);
- $query = $_SGLOBAL['db']->query($querysqlstring);
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
- if($value['upload']=="2"){
- $value['songurl']=server_getdiskurl($value['songurl'],$value['songid']);
- }
- $firstsong[] = $value;
- }
- if(!empty($firstsong)){
- $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],42);
- $query1 = $_SGLOBAL['db']->query($querysqlstring);
- while ($value = $_SGLOBAL['db']->fetch_array($query1)) {
- if($value['upload']=="2"){
- $value['songurl']=server_getdiskurl($value['songurl'],$value['songid']);
- }
- $bgmusiclist[] = $value;
- }
- $resultarray = array_merge($firstsong,$bgmusiclist);
- return $resultarray;
- }
- }
- function insertnewmusic($setarr,$filesize,$spacesize) {
- global $_SGLOBAL,$_SC,$client;
- $datasqlstr = array();
- $newsongid = inserttable('musicbox',$setarr,1);
- if(intval($filesize)!=0){
- $datasqlstr['filesize'] = $filesize;
- $datasqlstr['spacesize'] = $spacesize;
- $datasqlstr['supe_uid'] = $_SGLOBAL['supe_uid'];
- $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],43));
- }
- include_once('./source/function_cp.php');
- $icon = 'musicbox';
- $title_template = '{actor} 上传了音乐 <a href="space.php?uid='.$_SGLOBAL['supe_uid'].'&do=musicbox&mview=mpage&mid='.$newsongid.'" target="_blank">'.getstr($setarr['songname'],100,1,1,1).'</a>';
- feed_add($icon,$title_template);
- showmessage('m_commend_success',"space.php?uid=".$_SGLOBAL['supe_uid']."&do=musicbox&mview=mpage&mid=".$newsongid);
- }
- function inserttodisk($setarr) {
- global $_SGLOBAL;
- inserttable('musicbox_disk',$setarr,0);
- }
- function getmydiskfilelist($userid) {
- global $_SGLOBAL,$_SC,$client;
- $datasqlstr = array();
- $mydiskfilelist = array();
- $datasqlstr['userid'] = $userid;
- $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],44);
- $query = $_SGLOBAL['db']->query($querysqlstring);
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
- $mydiskfilelist[] = $value;
- }
- return $mydiskfilelist;
- }
- function updatemusic($setarr,$id) {
- updatetable('musicbox',$setarr,array('songid'=>$id));
- showmessage('m_commendedit_success',"space.php?uid=".$_SGLOBAL['supe_uid']."&do=musicbox&mview=mpage&mid=".$id);
- }
- function insertnewalbum($setarr1,$spaceuid) {
- $newalbumid = inserttable('musicbox_album',$setarr1,1);
- include_once('./source/function_cp.php');
- $icon = 'musicbox';
- $title_template = '{actor} 创建了音乐专辑 <a href="space.php?uid='.$spaceuid.'&do=musicbox&mview=malbum&albumid='.$newalbumid.'&userspace='.$spaceuid.'" target="_blank">《'.getstr($setarr1['albumname'],100,1,1,1).'》</a>';
- feed_add($icon,$title_template);
- showmessage('m_newmymusicalbum_success');
- }
- function updatealbum($setarr1,$albumid) {
- updatetable('musicbox_album',$setarr1,array('albumid'=>$albumid));
- showmessage('do_success');
- }
- function getmusiclabellist($llist) {
- $labellist = "";
- $llist = array_filter(explode(",",$llist));
- for($i = 0;$i <= count($llist)-1;$i++){
- if(!empty($llist[$i])) $labellist=$labellist.'<a href="space.php?uid=0&do=musicbox&mview=alllist&order=p&language=a&search='.urlencode($llist[$i]).'" target="_blank">'.$llist[$i].'</a>, ';
- }
- return $labellist;
- }
- function getalink($arr=-1,$mtype=-1,$name=-1){
- $arr1 = array();
- $arr1[25][1] = "流行歌曲";
- $arr1[25][2] = "舞曲";
- $arr1[25][3] = "翻唱";
- $arr1[25][4] = "怀旧";
- $arr1[25][5] = "最新单曲";
- $arr1[25][6] = "hip-hop";
- $arr1[25][7] = "RandB";
- $arr1[25][8] = "RAP";
- $arr1[25][9] = "轻音乐";
- $arr1[25][10] = "电影原声";
- $arr1[25][11] = "动漫原声";
- $arr1[25][12] = "HOUSE";
- $arr1[25][13] = "迷幻";
- $arr1[25][14] = "电子";
- $arr1[25][15] = "爵士";
- $arr1[25][16] = "古典乐";
- $arr1[25][17] = "交响乐";
- $arr1[25][18] = "朋克";
- $arr1[25][19] = "民谣";
- $arr1[25][20] = "金属";
- $arr1[25][21] = "摇滚";
- $arr1[25][22] = "乡村";
- $arr1[25][23] = "歌特";
- $arr1[25][24] = "其他";
- if($name==-1){
- if(empty($mtype)){
- $arr1['0']=" style='font-weight:bold;'";
- }else{
- $arr1[$mtype]=" style='font-weight:bold;'";
- }
- return $arr1;
- }else{
- for($i=1;$i<25;$i++){
- if($name==$arr1[25][$i]) $smtype=$i;
- }
- return $smtype;
- }
- }
- function imgageshow($link,$imgcort) {
- $size = GetImageSize($link);
- $width = $size[0];
- $height = $size[1];
- if($imgcort!=""){
- if($width>$imgcort) {
- $temp=$imgcort/$width;
- $width=$imgcort;
- $height=$height*$temp;
- }else{
- $width=$width;
- $height=$height;
- }
- }else{
- $width = $width;
- $height = $height;
- }
- return "<img src='".$link."' width='".$width."' height='".$height."'>";
- }
- function getlastimg($imgsrc){
- if(strpos($imgsrc,".thumb")){
- $imgresult = imgageshow(substr($imgsrc,0,-10),150);
- }else{
- $imgresult = "<img src='".$imgsrc."' />";
- }
- return $imgresult;
- }
- function getdigestlinkurl($oldurl){
- global $_SGLOBAL;
- if(empty($oldurl)){
- $posturl = "http://www.rayfile.com/zh-cn/files/727885e6-2ee5-11de-a900-0019d11a795f/";
- }else{
- $posturl = $oldurl;
- }
- $ft1["title"]["begin"]=$posturl;
- $ft1["title"]["end"]='/"></a>';
- $th1["title"]["php100"]="";
- $rstemp=pick($posturl,$ft1,$th1);
- return $posturl.$rstemp["title"];
- }
- function getdigest(){
- global $_SGLOBAL;
- $musicboxdate = array();
- $configfile = S_ROOT.'./musicboxdate.txt';
- $tempdatesrr = sreadfile($configfile);
- $musicboxdate = explode("|",$tempdatesrr);
- if((intval($_SGLOBAL['timestamp'])-intval($musicboxdate[1]))/3600<0.5 &&!empty($musicboxdate[0])){
- return $musicboxdate[0];
- }else{
- $newurl = getdigestlinkurl();
- $ft1["title"]["begin"]="ROXCDNKEY', '";
- $ft1["title"]["end"]="', 86400";
- $th1["title"]["php100"]="";
- $rs=pick($newurl,$ft1,$th1);
- $fp111 = fopen($configfile,'w');
- fwrite($fp111,trim($rs["title"]."|".$_SGLOBAL['timestamp']));
- fclose($fp111);
- return $rs["title"];
- }
- }
- function setcommendmusic($songid){
- $configfile = S_ROOT.'./musicboxdate_commend.txt';
- $tempdatesrr = sreadfile($configfile);
- $goset =0;
- if($songid==0){
- return $tempdatesrr;
- }else{
- if(!empty($tempdatesrr)){
- if(!strstr($tempdatesrr,$songid)){
- $newc = $tempdatesrr.",".$songid;
- $goset =1;
- }
- }else{
- $newc = $songid;
- $goset =1;
- }
- if($goset==1){
- $fp111 = fopen($configfile,'w');
- fwrite($fp111,$newc);
- fclose($fp111);
- }
- showmessage('do_success');
- }
- }
- class UPImages {
- var $annexFolder = "upimg";
- var $smallFolder = "smallimg";
- var $upFileType = "jpg gif png";
- var $upFileMax = 1024;
- var $defaultimg;
- var $thetwidth;
- var $thetheight;
- function UPImages($imgurl,$twidth=100,$theight=100) {
- $this->annexFolder = "upimg";
- $this->smallFolder = "smallimg";
- $this->defaultimg = $imgurl;
- $this->thetwidth = $twidth;
- $this->thetheight = $theight;
- $this->toFile = true;
- }
- function upLoad($inputName) {
- $imageName = time();
- if(@empty($_FILES[$inputName]["name"])){
- return $this->defaultimg;
- }else{
- $name = explode(".",$_FILES[$inputName]["name"]);
- $imgCount = count($name);
- $imgType = $name[$imgCount-1];
- if(strpos($this->upFileType,$imgType) === false){
- return $this->defaultimg;
- }else{
- $photo = $imageName.".".$imgType;
- $uploadFile = $this->annexFolder."/".$photo;
- $upFileok = move_uploaded_file($_FILES[$inputName]["tmp_name"],$uploadFile);
- return $this->smallImg($photo,$this->thetwidth,$this->thetheight);
- }
- }
- }
- function getInfo($photo) {
- $photo = $this->annexFolder."/".$photo;
- $imageInfo = getimagesize($photo);
- $imgInfo["width"] = $imageInfo[0];
- $imgInfo["height"] = $imageInfo[1];
- $imgInfo["type"] = $imageInfo[2];
- $imgInfo["name"] = basename($photo);
- return $imgInfo;
- }
- function smallImg($photo,$width=100,$height=100) {
- $imgInfo = $this->getInfo($photo);
- $photo = $this->annexFolder."/".$photo;
- $newName = substr($imgInfo["name"],0,strrpos($imgInfo["name"],"."))."_thumb.jpg";
- if($imgInfo["type"] == 1) {
- $img = imagecreatefromgif($photo);
- }elseif($imgInfo["type"] == 2) {
- $img = imagecreatefromjpeg($photo);
- }elseif($imgInfo["type"] == 3) {
- $img = imagecreatefrompng($photo);
- }else {
- $img = "";
- }
- if(empty($img)) return False;
- $width = ($width >$imgInfo["width"]) ?$imgInfo["width"] : $width;
- $height = ($height >$imgInfo["height"]) ?$imgInfo["height"] : $height;
- $srcW = $imgInfo["width"];
- $srcH = $imgInfo["height"];
- if ($srcW * $width >$srcH * $height) {
- $height = round($srcH * $width / $srcW);
- }else {
- $width = round($srcW * $height / $srcH);
- }
- if (function_exists("imagecreatetruecolor")) {
- $newImg = imagecreatetruecolor($width,$height);
- ImageCopyResampled($newImg,$img,0,0,0,0,$width,$height,$imgInfo["width"],$imgInfo["height"]);
- }else {
- $newImg = imagecreate($width,$height);
- ImageCopyResized($newImg,$img,0,0,0,0,$width,$height,$imgInfo["width"],$imgInfo["height"]);
- }
- if ($this->toFile) {
- if (file_exists($this->annexFolder."/".$this->smallFolder."/".$newName)) @unlink($this->annexFolder."/".$this->smallFolder."/".$newName);
- ImageJPEG($newImg,$this->annexFolder."/".$this->smallFolder."/".$newName);
- return $this->annexFolder."/".$this->smallFolder."/".$newName;
- }else {
- ImageJPEG($newImg);
- }
- ImageDestroy($newImg);
- ImageDestroy($img);
- return $newName;
- }
- }
- ?>
复制代码 |