Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[经验] [原创] 谁发给我的ST 音乐盒插件商业版升级包 解密版来取~~

[复制链接]
szrq 发表于 2009-9-2 11:06:12 | 显示全部楼层 |阅读模式
本帖最后由 szrq 于 2009-9-2 16:23 编辑

[原创] 谁发给我要解密的ST音乐盒插件升级包 速来取解密代码~~

@Id: function_music.php
  1. <?php
  2. include (S_ROOT.'./phprpc_client.php');
  3. $client = new PHPRPC_Client('http://2699991.com.s18.4bo.cn/function_music_server.php');
  4. if(!defined('IN_UCHOME')) {
  5. exit('Access Denied');
  6. }
  7. $httplist = array(
  8. '1'=>"localhost",
  9. '2'=>"www.jjcute.com",
  10. '3'=>"jjcute.com",
  11. '4'=>"www.yqwb.net",
  12. '5'=>"yqwb.net",
  13. '6'=>"www.xbeifang.cn",
  14. '7'=>"xbeifang.cn",
  15. '8'=>"www.pin.sg",
  16. '9'=>"pin.sg",
  17. '10'=>"www.5xcd.com",
  18. '11'=>"5xcd.com",
  19. '12'=>"www.cncd.us",
  20. '13'=>"cncd.us",
  21. '14'=>"www.yaajee.com",
  22. '15'=>"yaajee.com",
  23. '16'=>"www.ohpop.cn",
  24. '17'=>"ohpop.cn",
  25. '18'=>"www.qyeah.net",
  26. '19'=>"qyeah.net",
  27. '20'=>"musicmx.cn",
  28. '21'=>"www.musicmx.cn",
  29. '22'=>"cqwan.com",
  30. '23'=>"www.cqwan.com",
  31. '24'=>"www.orangelr.com",
  32. '25'=>"orangelr.com",
  33. '26'=>"uch.yydm.com",
  34. '27'=>"yydm.com",
  35. '28'=>"www.paosc.com",
  36. '29'=>"paosc.com",
  37. '30'=>"www.naoxin.net",
  38. '31'=>"naoxin.net",
  39. '32'=>"maoming.cc",
  40. '33'=>"www.maoming.cc",
  41. '34'=>"home.zjjy.com",
  42. '35'=>"zjjy.com",
  43. '36'=>"www.xkboy.com",
  44. '37'=>"xkboy.com",
  45. '38'=>"www.v125.cn",
  46. '39'=>"v125.cn",
  47. '40'=>"home.kptk.cn",
  48. '41'=>"kptk.cn",
  49. '42'=>"www.0451kaixin.com",
  50. '43'=>"0451kaixin.com",
  51. '44'=>"www.wzqing.com",
  52. '45'=>"wzqing.com",
  53. '46'=>"www.ee23.cn",
  54. '47'=>"ee23.cn",
  55. '48'=>"www.halibeibei.com",
  56. '49'=>"halibeibei.com",
  57. '50'=>"www.yood.cn",
  58. '51'=>"yood.cn",
  59. '52'=>"www.mzhan.com",
  60. '53'=>"mzhan.com",
  61. '54'=>"www.hnjita.cn",
  62. '55'=>"hnjita.cn",
  63. '56'=>"www.hezequan.com",
  64. '57'=>"hezequan.com",
  65. '58'=>"www.w8zs.com",
  66. '59'=>"w8zs.com",
  67. );
  68. function PMA_getenv($var_name) {
  69. if (isset($_SERVER[$var_name])) {
  70. return $_SERVER[$var_name];
  71. }elseif (isset($_ENV[$var_name])) {
  72. return $_ENV[$var_name];
  73. }elseif (getenv($var_name)) {
  74. return getenv($var_name);
  75. }elseif (function_exists('apache_getenv') &&apache_getenv($var_name,true)) {
  76. return apache_getenv($var_name,true);
  77. }
  78. return '';
  79. }
  80. if (empty($HTTP_HOST)) {
  81. if (PMA_getenv('HTTP_HOST')) {
  82. $HTTP_HOST = PMA_getenv('HTTP_HOST');
  83. }else {
  84. $HTTP_HOST ='';
  85. }
  86. }
  87. if(!in_array(htmlspecialchars($HTTP_HOST),$httplist)){
  88. header ("location:http://www.jjcute.com");
  89. }
  90. function getuserhost(){
  91. global $client;
  92. $client->getuserhost();
  93. return $client->getOutput();
  94. }
  95. function integralop($integral,$uid) {
  96. global $_SGLOBAL,$_SC;
  97. if($_SC['music_integralset']=="1") {
  98. $_SGLOBAL['db']->query('UPDATE '.tname('space').' SET credit=credit+'.intval($integral).' WHERE uid='.$uid);
  99. }
  100. }
  101. function updatemyset($do=1,$type=1,$strvalue,$userid){
  102. global $_SGLOBAL,$_SC,$client;
  103. $datasqlstr = array();
  104. if($do==1){
  105. $datasqlstr['userid'] = $userid;
  106. $query = $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],2));
  107. return $_SGLOBAL['db']->fetch_array($query);
  108. }else{
  109. if($type==1){
  110. $datasqlstr['strvalue'] = $strvalue;
  111. $datasqlstr['userid'] = $userid;
  112. $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],1));
  113. }
  114. }
  115. }
  116. function checkboxis($ary,$str){
  117. $ary = split(",",$ary);
  118. if(in_array($str,$ary)) return ' checked="checked"';
  119. }
  120. function getarysvalue($chartstr,$stringv,$indexvalue){
  121. $resultary = split($chartstr,$stringv);
  122. return $resultary[$indexvalue];
  123. }
  124. function mycongener($str,$spaceuid,$arycount=5){
  125. global $_SGLOBAL,$_SC,$client;
  126. $datasqlstr = array();
  127. $resultlist = array();
  128. $datasqlstr['spaceuid'] = $spaceuid;
  129. $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],3);
  130. $query = $_SGLOBAL['db']->query($querysqlstring);
  131. while ($value = $_SGLOBAL['db']->fetch_array($query)) {
  132. realname_set($value['uid'],$value['username'],$value['name'],$value['namestatus']);
  133. similar_text(str_replace("@@@",",",$str),$value['musictaste'],$ptemp);
  134. $value['musictastep'] = $ptemp;
  135. $resultlist[] = $value;
  136. }
  137. foreach ($resultlist as $key =>$value) {
  138. $musictastep[$key] = $value['musictastep'];
  139. }
  140. array_multisort($musictastep,SORT_DESC,$resultlist);
  141. $resultlist = array_slice($resultlist,0,$arycount);
  142. return $resultlist;
  143. }
  144. function getdatetoarray($table,$file,$wheresql){
  145. global $_SGLOBAL;
  146. $temparray = array();
  147. $ttemp = array();
  148. $query = $_SGLOBAL['db']->query("SELECT ".$file." FROM ".tname($table)." WHERE 1=1 ".$wheresql);
  149. while ($value = $_SGLOBAL['db']->fetch_array($query)) {
  150. $ttemp = split(",",$value[$file]);
  151. $temparray = array_merge($temparray,$ttemp);
  152. }
  153. $temparray = array_merge($temparray,array("流行歌曲","舞曲","翻唱","怀旧","最新单曲","hip-hop","RandB","RAP","轻音乐","电影原声","动漫原声","HOUSE","迷幻","电子","爵士","古典乐","交响乐","朋克","民谣","金属","摇滚","乡村","歌特","其他"));
  154. $temparray=array_remove_empty($temparray);
  155. $temparray=getalinkint($temparray,2);
  156. return array_count_values($temparray);
  157. }
  158. function array_remove_empty($arr)
  159. {
  160. foreach ($arr as $key =>$value){
  161. if($value==""){
  162. unset($arr[$key]);
  163. }
  164. }
  165. return $arr;
  166. }
  167. function getalinkint($namesrt,$type=-1){
  168. $arr1 = array();
  169. $arr1[25] = array("","流行歌曲","舞曲","翻唱","怀旧","最新单曲","hip-hop","RandB","RAP","轻音乐","电影原声","动漫原声","HOUSE","迷幻","电子","爵士","古典乐","交响乐","朋克","民谣","金属","摇滚","乡村","歌特","其他");
  170. if($type==-1){
  171. for($i=1;$i<25;$i++){
  172. if($arr1[25][$i]==$namesrt) return $i;
  173. }
  174. }else{
  175. foreach ($namesrt as $key =>$value){
  176. $isin = 0;
  177. for($i=1;$i<25;$i++){
  178. if($value==$arr1[25][$i]) $isin=1;
  179. }
  180. if($isin!=1) unset($namesrt[$key]);
  181. }
  182. return $namesrt;
  183. }
  184. }
  185. function writeselectlist($type,$value)
  186. {
  187. $tempstr ="";
  188. for($i=0;$i<=20;$i++){
  189. $temp = "";
  190. $temp = $type.$i;
  191. if($temp==$value){
  192. $tempstr.= '<option value="'.$temp.'" selected="selected">'.$temp.'</option>';
  193. }else{
  194. $tempstr.= '<option value="'.$temp.'">'.$temp.'</option>';
  195. }
  196. }
  197. return $tempstr;
  198. }
  199. function getallpinglun($start,$perpage) {
  200. global $_SGLOBAL,$_SC,$client;
  201. $datasqlstr = array();
  202. $datasqlstr['start'] = $start;
  203. $datasqlstr['perpage'] = $perpage;
  204. $allpinglunlist = array();
  205. $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],4);
  206. $query = $_SGLOBAL['db']->query($querysqlstring);
  207. while ($value = $_SGLOBAL['db']->fetch_array($query)) {
  208. realname_set($value['uid'],$value['username'],$value['name'],$value['namestatus']);
  209. $allpinglunlist[] = $value;
  210. }
  211. return $allpinglunlist;
  212. }
  213. function getallpinglun_count() {
  214. global $_SGLOBAL,$_SC,$client;
  215. $listcount = 0;
  216. $allpinglunlist_c = array();
  217. $query = $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],5));
  218. $allpinglunlist_c = $_SGLOBAL['db']->fetch_array($query);
  219. return $allpinglunlist_c['c'];
  220. }
  221. function getlistofuserspace($user){
  222. global $_SGLOBAL,$_SC,$client;
  223. $userlist = array();
  224. $datasqlstr = array();
  225. $datasqlstr['user'] = $user;
  226. $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],6);
  227. $query = $_SGLOBAL['db']->query($querysqlstring);
  228. while ($value = $_SGLOBAL['db']->fetch_array($query)) {
  229. realname_set($value['uid'],$value['username'],$value['name'],$value['namestatus']);
  230. $userlist[] = $value;
  231. }
  232. return $userlist;
  233. }
  234. function server_getdiskurl($diskurl,$songid=-1){
  235. global $_SGLOBAL,$client;
  236. $configfile = S_ROOT.'./musicboxdate.txt';
  237. $tempdatesrr = sreadfile($configfile);
  238. $tempdatearray = array();
  239. $tempdatearray = explode("wwwjjcutecom111",$client->getdiskurl($diskurl,$songid,$tempdatesrr,$_SGLOBAL['timestamp']));
  240. if(strpos($tempdatearray[1],"wwwjjcutecom222")){
  241. $temparrayaaa = explode("wwwjjcutecom222",$tempdatearray[1]);
  242. if(!empty($temparrayaaa[1])) updatetable('musicbox',array('songurl'=>$temparrayaaa[1]),array('songid'=>$songid));
  243. if($temparrayaaa[0]!="0"){
  244. $fp111 = fopen($configfile,'w');
  245. fwrite($fp111,trim($temparrayaaa[0]));
  246. fclose($fp111);
  247. }
  248. }else{
  249. if($tempdatearray[1]!="0"){
  250. $fp111 = fopen($configfile,'w');
  251. fwrite($fp111,trim($tempdatearray[1]));
  252. fclose($fp111);
  253. }
  254. }
  255. return $tempdatearray[0];
  256. }
  257. function getsinglemusic($songid,$update=1) {
  258. global $_SGLOBAL,$_SC,$client;
  259. $datasqlstr = array();
  260. $datasqlstr['songid'] = $songid;
  261. $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],7);
  262. $query = $_SGLOBAL['db']->query($querysqlstring);
  263. $musicinfo = $_SGLOBAL['db']->fetch_array($query);
  264. if($musicinfo['upload']=="2"){$musicinfo['songurl'] = server_getdiskurl($musicinfo['songurl'],$musicinfo['songid']);}
  265. if($musicinfo['photourl']==""&&$musicinfo['singerid']==""){
  266. $setarr1 = array(
  267. 'area'=>"3",
  268. 'singername'=>$musicinfo['singer'],
  269. 'photourl'=>"images/singernophoto.jpg",
  270. );
  271. $newsongerid = inserttable('musicbox_singer',$setarr1,1);
  272. $musicinfo['photourl'] = "images/singernophoto.jpg";
  273. $musicinfo['singerid'] = $newsongerid;
  274. }
  275. if(!empty($musicinfo) &&$update==1){updatetable('musicbox',array('playtotal'=>$musicinfo['playtotal']+1,'commendtotal'=>$_SGLOBAL['timestamp']),array('songid'=>$songid));}
  276. return $musicinfo;
  277. }
  278. function editsingerphotofun($singerid,$photourl) {
  279. global $_SGLOBAL;
  280. updatetable('musicbox_singer',array('photourl'=>$photourl),array('singerid'=>$singerid));
  281. showmessage('do_success');
  282. }
  283. function getallsinger($keyword,$start,$perpage){
  284. global $_SGLOBAL,$_SC,$client;
  285. $datasqlstr = array();
  286. $allsingerlist = array();
  287. $resultcount = 0;
  288. if(!empty($keyword)){
  289. $wheresql = " AND singername like '%".$keyword."%'";
  290. }else{
  291. $wheresql = "";
  292. }
  293. $limitstr = " LIMIT ".$start.",".$perpage;
  294. $datasqlstr['wheresql'] = $wheresql;
  295. $datasqlstr['limitstr'] = $limitstr;
  296. $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],8);
  297. $query = $_SGLOBAL['db']->query($querysqlstring);
  298. while ($value = $_SGLOBAL['db']->fetch_array($query)) {$allsingerlist[] = $value;$resultcount++;}
  299. if($resultcount!=0) $allsingerlist[0]['returncount'] = $resultcount;
  300. return $allsingerlist;
  301. }
  302. function insertsinger($singername){
  303. global $_SGLOBAL,$_SC,$client;
  304. $datasqlstr = array();
  305. $datasqlstr['singername'] = $singername;
  306. $query = $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],9));
  307. $tempdataa = $_SGLOBAL['db']->fetch_array($query);
  308. if(empty($tempdataa)){
  309. $setarr1 = array(
  310. 'area'=>"3",
  311. 'singername'=>$singername,
  312. 'photourl'=>"images/singernophoto.jpg",
  313. );
  314. inserttable('musicbox_singer',$setarr1,0);
  315. }
  316. }
  317. function getfriendsmusiclist($userlist) {
  318. global $_SGLOBAL,$_SC,$_SN,$_SCONFIG,$client;
  319. $datasqlstr = array();
  320. $thisuserid = "-1";
  321. $thisalbumid = "-1";
  322. $musiclist = array();
  323. $datasqlstr['userlist'] = $userlist;
  324. if(!empty($datasqlstr['userlist'])){
  325. $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],10);
  326. $query = $_SGLOBAL['db']->query($querysqlstring);
  327. while ($value = $_SGLOBAL['db']->fetch_array($query)) {$musiclist[] = $value;}
  328. $musiclist = $client->server_getmyfriendsmusiclist(1,$musiclist);
  329. }
  330. return $musiclist;
  331. }
  332. function musichandle($type=-1,$setarr=-1,$id=-1,$spaceuid=-1,$arraylist=-1) {
  333. global $_SGLOBAL,$_SC,$client;
  334. $datasqlstr = array();
  335. switch ($type) {
  336. case 0:
  337. if($spaceuid==0){
  338. $datatemparr = array();
  339. $datatemparr = getsinglemusic($id,0);
  340. $_SGLOBAL['db']->query('UPDATE '.tname('space').' SET attachsize='.intval(intval($arraylist)-intval(filesize(S_ROOT.$datatemparr['songurl']))).' WHERE uid='.$datatemparr['userid']);
  341. unlink(str_replace("space.php","",realpath("space.php")).str_replace("./","",$datatemparr['songurl']));
  342. }
  343. $datasqlstr['id'] = $id;
  344. $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],11));
  345. $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],12));
  346. $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],13));
  347. $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],14));
  348. showmessage('deletemusic_success');
  349. break;
  350. case 1:
  351. $datasqlstr['id'] = $id;
  352. $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],15));
  353. $defaultid = getalbumdefaultid($spaceuid);
  354. updatetable('musicbox',array('albumid'=>$defaultid),array('albumid'=>$id));
  355. showmessage('deletemusicalbum_success');
  356. break;
  357. case 2:
  358. $datasqlstr['id'] = $id;
  359. $query = $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],16));
  360. $datatemparr = $_SGLOBAL['db']->fetch_array($query);
  361. if(!empty($setarr)){
  362. include_once(S_ROOT.'./source/function_cp.php');
  363. $note = cplang('music_toshare',array($datatemparr['userid'],$id,$datatemparr['songname']));
  364. $ckarray = $setarr;
  365. $cksize = count($ckarray);
  366. for($i=0;$i<$cksize;$i++){
  367. notification_add($ckarray[$i],'wall',$note);
  368. }
  369. }
  370. showmessage('do_success');
  371. break;
  372. case 3:
  373. inserttable('musicbox_mybox',$setarr,0);
  374. showmessage('do_success');
  375. break;
  376. case 4:
  377. inserttable('musicbox_pingfen',$setarr,0);
  378. include_once(S_ROOT.'./source/function_cp.php');
  379. $note = cplang('music_topingfen',array($arraylist['songuserid'],$arraylist['songid'],$arraylist['pingfensongname'],$arraylist['pingfen']));
  380. notification_add($arraylist['songuserid'],'wall',$note);
  381. showmessage('musicpingfen_success');
  382. break;
  383. case 5:
  384. inserttable('musicbox_pinglun',$setarr,0);
  385. include_once(S_ROOT.'./source/function_cp.php');
  386. $note = cplang('music_topinglun',array($arraylist['songuserid'],$arraylist['songid'],$arraylist['pinglunsongname']));
  387. notification_add($arraylist['songuserid'],'wall',$note);
  388. showmessage('musicpinglun_success');
  389. break;
  390. case 6:
  391. updatetable('musicbox',$setarr,array('songid'=>$id));
  392. include_once(S_ROOT.'./source/function_cp.php');
  393. $note = cplang('music_collection',array($arraylist['userid'],$arraylist['songid'],$arraylist['songname']));
  394. notification_add($arraylist['userid'],'wall',$note);
  395. showmessage('do_success');
  396. break;
  397. case 7:
  398. updatetable('musicbox',$setarr,array('songid'=>$id));
  399. showmessage('musicsetbg_success');
  400. break;
  401. case 8:
  402. $datasqlstr['id'] = $id;
  403. $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],17));
  404. showmessage('do_success');
  405. break;
  406. case 9:
  407. $datasqlstr['id'] = $id;
  408. $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],18));
  409. $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],19));
  410. $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],20));
  411. $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],21));
  412. showmessage('do_success','space.php?do=musicbox&mview=admin&control=music');
  413. break;
  414. case 10:
  415. $datasqlstr['id'] = $id;
  416. $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],22));
  417. showmessage('do_success','space.php?do=musicbox&mview=admin&control=pinglun');
  418. break;
  419. case 11:
  420. $datasqlstr['id'] = $id;
  421. $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],23));
  422. updatetable('musicbox',array('albumid'=>'0'),"albumid in (".$id.")");
  423. showmessage('do_success','space.php?do=musicbox&mview=admin&control=album');
  424. break;
  425. default:
  426. break;
  427. }
  428. return true;
  429. }
  430. function usergetallmusiclist($listorder,$listlanguage,$listkeywork,$start,$perpage){
  431. global $_SGLOBAL,$_SC,$client;
  432. $datasqlstr = array();
  433. $musiclistarr = array();
  434. $limitstr = " LIMIT ".$start.",".$perpage;
  435. $datasqlstr['listlanguage'] = $listlanguage;
  436. $datasqlstr['listkeywork'] = $listkeywork;
  437. $datasqlstr['listorder'] = $listorder;
  438. $datasqlstr['limitstr'] = $limitstr;
  439. $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],24);
  440. $query = $_SGLOBAL['db']->query($querysqlstring);
  441. while ($value = $_SGLOBAL['db']->fetch_array($query)) {$musiclistarr[] = $value;}
  442. $musiclistarr = $client->server_getmusiclist(1,$musiclistarr);
  443. return $musiclistarr;
  444. }
  445. 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="") {
  446. global $_SGLOBAL,$_SC,$_SN,$_SCONFIG,$client;
  447. $musiclistarr = array();
  448. $datasqlstr = array();
  449. $resultcount = 0;
  450. $playtotalcount = 0;
  451. if($songname!=""){
  452. $datasqlstr['songnamestr'] = " AND main.songname like '%".$songname."%'";}
  453. if($userid!=-1){
  454. $datasqlstr['useridstr'] = " AND main.userid=".$userid;
  455. $datasqlstr['orderbylasttime'] = "main.songid DESC,";
  456. }
  457. if($albumid!=-1){
  458. $datasqlstr['albumidstr'] = " AND main.albumid=".$albumid;}
  459. if($songid!=-1){
  460. $datasqlstr['songidstr'] = " AND main.songid=".$songid;}
  461. if($songidlist!=""){
  462. $datasqlstr['songidliststr'] = " AND main.songid in(".$songidlist.")";
  463. $datasqlstr['songidliststrorder'] = "substring_index('".$songidlist."',main.songid,1),";
  464. }
  465. if($label!=-1){
  466. $datasqlstr['labelstr'] = " AND main.label like '%".$label."%'";}
  467. if($singer!=-1){
  468. $datasqlstr['singerstr'] = " AND main.singer like '%".$singer."%'";}
  469. if($lang!=-1){
  470. $datasqlstr['langstr'] = " AND main.lang=".$lang;}
  471. if($collectionuser!=-1){
  472. $datasqlstr['collectionuserstr'] = " AND main.collectionuser like '%,".$collectionuser.",%'";}
  473. if($orderbyid!=-1){
  474. $datasqlstr['orderbyidstr'] = " main.songid DESC,";}
  475. if($start!=-1 ||$perpage!=-1){
  476. $datasqlstr['limitstr'] = " LIMIT ".$start.",".$perpage;}
  477. if($lastplay!=-1){
  478. $datasqlstr['lastplaystr'] = " AND (".$_SGLOBAL['timestamp']."-`commendtotal`)/3600<0.5";
  479. $datasqlstr['lastplaystrorder'] = "commendtotal DESC,";
  480. }
  481. $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],0);
  482. $query = $_SGLOBAL['db']->query($querysqlstring);
  483. if($songname==""&$alllist==-1){
  484. while ($value = $_SGLOBAL['db']->fetch_array($query)) {$musiclistarr[] = $value;}
  485. $musiclistarr = $client->server_getmusiclist(1,$musiclistarr);
  486. return $musiclistarr;
  487. }elseif($songname!=""&$alllist==2){
  488. while ($value = $_SGLOBAL['db']->fetch_array($query)) {$musiclistarr[] = $value;}
  489. $musiclistarr = $client->server_getmusiclist(1,$musiclistarr);
  490. return $musiclistarr;
  491. }else{
  492. while ($value = $_SGLOBAL['db']->fetch_array($query)) {$musiclistarr[] = $value;}
  493. return $client->server_getajaxsearchstrlist($musiclistarr);
  494. }
  495. }
  496. function getmusicguestnotes($type=-1,$id=-1,$id0s=-1,$start=-1,$perpage=-1) {
  497. global $_SGLOBAL,$_SC,$client;
  498. $datasqlstr = array();
  499. $resultlist = array();
  500. $resultcount = 0;
  501. switch ($type) {
  502. case 0:
  503. $datasqlstr['id'] = $id;
  504. $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],25);
  505. $query = $_SGLOBAL['db']->query($querysqlstring);
  506. while ($value = $_SGLOBAL['db']->fetch_array($query)) {
  507. realname_set($value['puserid'],$value['username'],$value['name'],$value['namestatus']);
  508. $resultlist[] = $value;
  509. }
  510. break;
  511. case 1:
  512. $datasqlstr['id'] = $id;
  513. $datasqlstr['start'] = $start;
  514. $datasqlstr['perpage'] = $perpage;
  515. $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],26);
  516. $query = $_SGLOBAL['db']->query($querysqlstring);
  517. while ($value = $_SGLOBAL['db']->fetch_array($query)) {
  518. realname_set($value['puserid'],$value['username'],$value['name'],$value['namestatus']);
  519. $resultlist[] = $value;
  520. $resultcount++;
  521. }
  522. if($resultcount!=0) $resultlist[0]['returncount'] = $resultcount;
  523. break;
  524. case 2:
  525. $datasqlstr['id'] = $id;
  526. $datasqlstr['id0s'] = $id0s;
  527. $query = $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],27));
  528. $resultlist = $_SGLOBAL['db']->fetch_array($query);
  529. break;
  530. case 3:
  531. $datasqlstr['id'] = $id;
  532. $datasqlstr['id0s'] = $id0s;
  533. $query = $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],28));
  534. $resultlist = $_SGLOBAL['db']->fetch_array($query);
  535. break;
  536. default:
  537. break;
  538. }
  539. return $resultlist;
  540. }
  541. function getalbumdefaultid($userid) {
  542. global $_SGLOBAL,$_SC,$client;
  543. $datasqlstr = array();
  544. $datasqlstr['userid'] = $userid;
  545. $defaultid = array();
  546. $query = $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],29));
  547. $defaultid = $_SGLOBAL['db']->fetch_array($query);
  548. return $defaultid['albumid'];
  549. }
  550. function getalbuminfo($albumid) {
  551. global $_SGLOBAL,$_SC,$client;
  552. $datasqlstr = array();
  553. $datasqlstr['albumid'] = $albumid;
  554. $thealbum = array();
  555. $query = $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],30));
  556. $thealbum = $_SGLOBAL['db']->fetch_array($query);
  557. return $thealbum;
  558. }
  559. function getmusicalbumcount($userid,$greatalbum=-1) {
  560. global $_SGLOBAL,$_SC,$client;
  561. $datasqlstr = array();
  562. $datasqlstr['userid'] = $userid;
  563. if($greatalbum==-1){
  564. $albumcount = array();
  565. $query = $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],31));
  566. $albumcount = $_SGLOBAL['db']->fetch_array($query);
  567. if(empty($albumcount)){
  568. return 0;
  569. }else{
  570. return 1;
  571. }
  572. }else{
  573. $setarr1 = array(
  574. 'userid'=>$userid,
  575. 'albumname'=>$_SGLOBAL['supe_username']."的专辑",
  576. 'albumfengmian'=>"images/album.gif",
  577. 'defaultalbumid'=>1,
  578. 'dataline'=>$_SGLOBAL['timestamp'],
  579. );
  580. inserttable('musicbox_album',$setarr1,0);
  581. }
  582. }
  583. function getmusicalbum($userid=-1,$albumid=-1,$type=0,$albumnoid=-1,$cisnotnull=-1) {
  584. global $_SGLOBAL,$_SC,$client;
  585. $datasqlstr = array();
  586. $musicalbumlistarr = array();
  587. if($userid!=-1){
  588. $useridstr = " AND main.userid=".$userid;}
  589. if($albumid!=-1){
  590. $albumidstr = " AND main.albumid=".$albumid;}
  591. if($albumnoid!=-1){
  592. $albumnoidstr = " AND main.albumid<>".$albumnoid;}
  593. if($cisnotnull!=-1){
  594. $cisnotnullstr = " AND m.mcount<>0";}
  595. $datasqlstr['useridstr'] = $useridstr;
  596. $datasqlstr['albumidstr'] = $albumidstr;
  597. $datasqlstr['albumnoidstr'] = $albumnoidstr;
  598. $datasqlstr['cisnotnullstr'] = $cisnotnullstr;
  599. $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],32);
  600. $query = $_SGLOBAL['db']->query($querysqlstring);
  601. if($type==0){
  602. $musicalbumlistarr = $_SGLOBAL['db']->fetch_array($query);
  603. }else{
  604. while ($value = $_SGLOBAL['db']->fetch_array($query)) {
  605. realname_set($value['uid'],$value['username'],$value['name'],$value['namestatus']);
  606. $value['albumname'] = getstr($value['albumname'],12,-1,-1,-1);
  607. $musicalbumlistarr[] = $value;
  608. }
  609. }
  610. return $musicalbumlistarr;
  611. }
  612. function pagecommender($commender){
  613. global $_SGLOBAL,$_SC,$client;
  614. $datasqlstr = array();
  615. $datasqlstr['commender'] = $commender;
  616. $query = $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],33));
  617. return $_SGLOBAL['db']->fetch_array($query);
  618. }
  619. function musicpeople($type=-1,$id=-1,$limit=-1) {
  620. global $_SGLOBAL,$_SC,$client;
  621. $datasqlstr = array();
  622. $musicpeoplelist = array();
  623. if($type==1) {
  624. $datalimit = $limit==-1?3:$limit;
  625. $datasqlstr['datalimit'] = $datalimit;
  626. $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],34);
  627. $query = $_SGLOBAL['db']->query($querysqlstring);
  628. while ($value = $_SGLOBAL['db']->fetch_array($query)) {
  629. realname_set($value['uid'],$value['username'],$value['name'],$value['namestatus']);
  630. $musicpeoplelist[] = $value;
  631. }
  632. }
  633. if($type==2) {
  634. $datalimit = $limit==-1?0:$limit;
  635. $collectionusertemp = array();
  636. $collectionuserstr = "";
  637. $datasqlstr['id'] = $id;
  638. $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],35);
  639. $query = $_SGLOBAL['db']->query($querysqlstring);
  640. while ($value = $_SGLOBAL['db']->fetch_array($query)) {
  641. $collectionuserstr.=$value['collectionuser'];
  642. }
  643. if(!empty($collectionuserstr) &&$collectionuserstr!=","){
  644. $collectionusertemp=explode(",",$collectionuserstr);
  645. $collectionusertemp=array_unique($collectionusertemp);
  646. $collectionusertemp=array_filter($collectionusertemp);
  647. $collectionusertemp = array_slice($collectionusertemp,0,$datalimit);
  648. $collectionuserstr=implode(",",$collectionusertemp);
  649. $datasqlstr['collectionuserstr'] = $collectionuserstr;
  650. $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],36);
  651. $query = $_SGLOBAL['db']->query($querysqlstring);
  652. while ($value = $_SGLOBAL['db']->fetch_array($query)) {
  653. realname_set($value['uid'],$value['username'],$value['name'],$value['namestatus']);
  654. $musicpeoplelist[] = $value;
  655. }
  656. }
  657. }
  658. if($type==3) {
  659. $datalimit = $limit==-1?5:$limit;
  660. $datasqlstr['datalimit'] = $datalimit;
  661. $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],37);
  662. $query = $_SGLOBAL['db']->query($querysqlstring);
  663. while ($value = $_SGLOBAL['db']->fetch_array($query)) {
  664. realname_set($value['uid'],$value['username'],$value['name'],$value['namestatus']);
  665. $value['albumname'] = getstr($value['albumname'],12,-1,-1,-1);
  666. $musicpeoplelist[] = $value;
  667. }
  668. }
  669. return $musicpeoplelist;
  670. }
  671. function getmybox($songlist) {
  672. global $_SGLOBAL,$_SC,$client;
  673. $datasqlstr = array();
  674. $playmusiclist = array();
  675. $datasqlstr['songlist'] = $songlist;
  676. $datasqlstr['supe_uid'] = $_SGLOBAL['supe_uid'];
  677. if($songlist != "myboxlist"){
  678. $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],38);
  679. $query = $_SGLOBAL['db']->query($querysqlstring);
  680. }else{
  681. $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],39);
  682. $query = $_SGLOBAL['db']->query($querysqlstring);
  683. }
  684. while ($value = $_SGLOBAL['db']->fetch_array($query)) {
  685. realname_set($value['uid'],$value['username'],$value['name'],$value['namestatus']);
  686. if($value['upload']=="2"){
  687. $value['songurl']= server_getdiskurl($value['songurl'],$value['songid']);
  688. }
  689. $playmusiclist[] = $value;
  690. }
  691. return $playmusiclist;
  692. }
  693. function setmusicbg($id,$type=-1) {
  694. global $_SGLOBAL,$_SC,$client;
  695. $datasqlstr = array();
  696. $datasqlstr['id'] = $id;
  697. $setarr = array(
  698. 'page'=>'0',
  699. );
  700. $setarr1 = array(
  701. 'page'=>'1',
  702. );
  703. if($type==2){
  704. $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],40));
  705. }else{
  706. updatetable('musicbox_mybox',$setarr,array('boxuserid'=>$_SGLOBAL['supe_uid']));
  707. if($type==-1){
  708. updatetable('musicbox_mybox',$setarr1,array('id'=>$id));
  709. }
  710. }
  711. }
  712. function ordermusic($llist) {
  713. global $_SGLOBAL;
  714. for($i = 0;$i <count($llist)-1;$i++){
  715. updatetable('musicbox_mybox',array('boxorder'=>$i),array('id'=>$llist[$i]));
  716. }
  717. }
  718. function getmusicbg($uid) {
  719. global $_SGLOBAL,$_SC,$client;
  720. $datasqlstr = array();
  721. $firstsong = array();
  722. $bgmusiclist = array();
  723. $datasqlstr['uid'] = $uid;
  724. $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],41);
  725. $query = $_SGLOBAL['db']->query($querysqlstring);
  726. while ($value = $_SGLOBAL['db']->fetch_array($query)) {
  727. if($value['upload']=="2"){
  728. $value['songurl']=server_getdiskurl($value['songurl'],$value['songid']);
  729. }
  730. $firstsong[] = $value;
  731. }
  732. if(!empty($firstsong)){
  733. $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],42);
  734. $query1 = $_SGLOBAL['db']->query($querysqlstring);
  735. while ($value = $_SGLOBAL['db']->fetch_array($query1)) {
  736. if($value['upload']=="2"){
  737. $value['songurl']=server_getdiskurl($value['songurl'],$value['songid']);
  738. }
  739. $bgmusiclist[] = $value;
  740. }
  741. $resultarray = array_merge($firstsong,$bgmusiclist);
  742. return $resultarray;
  743. }
  744. }
  745. function insertnewmusic($setarr,$filesize,$spacesize) {
  746. global $_SGLOBAL,$_SC,$client;
  747. $datasqlstr = array();
  748. $newsongid = inserttable('musicbox',$setarr,1);
  749. if(intval($filesize)!=0){
  750. $datasqlstr['filesize'] = $filesize;
  751. $datasqlstr['spacesize'] = $spacesize;
  752. $datasqlstr['supe_uid'] = $_SGLOBAL['supe_uid'];
  753. $_SGLOBAL['db']->query($client->server_getsqlstring($datasqlstr,$_SC['tablepre'],43));
  754. }
  755. include_once('./source/function_cp.php');
  756. $icon = 'musicbox';
  757. $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>';
  758. feed_add($icon,$title_template);
  759. showmessage('m_commend_success',"space.php?uid=".$_SGLOBAL['supe_uid']."&do=musicbox&mview=mpage&mid=".$newsongid);
  760. }
  761. function inserttodisk($setarr) {
  762. global $_SGLOBAL;
  763. inserttable('musicbox_disk',$setarr,0);
  764. }
  765. function getmydiskfilelist($userid) {
  766. global $_SGLOBAL,$_SC,$client;
  767. $datasqlstr = array();
  768. $mydiskfilelist = array();
  769. $datasqlstr['userid'] = $userid;
  770. $querysqlstring = $client->server_getsqlstring($datasqlstr,$_SC['tablepre'],44);
  771. $query = $_SGLOBAL['db']->query($querysqlstring);
  772. while ($value = $_SGLOBAL['db']->fetch_array($query)) {
  773. $mydiskfilelist[] = $value;
  774. }
  775. return $mydiskfilelist;
  776. }
  777. function updatemusic($setarr,$id) {
  778. updatetable('musicbox',$setarr,array('songid'=>$id));
  779. showmessage('m_commendedit_success',"space.php?uid=".$_SGLOBAL['supe_uid']."&do=musicbox&mview=mpage&mid=".$id);
  780. }
  781. function insertnewalbum($setarr1,$spaceuid) {
  782. $newalbumid = inserttable('musicbox_album',$setarr1,1);
  783. include_once('./source/function_cp.php');
  784. $icon = 'musicbox';
  785. $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>';
  786. feed_add($icon,$title_template);
  787. showmessage('m_newmymusicalbum_success');
  788. }
  789. function updatealbum($setarr1,$albumid) {
  790. updatetable('musicbox_album',$setarr1,array('albumid'=>$albumid));
  791. showmessage('do_success');
  792. }
  793. function getmusiclabellist($llist) {
  794. $labellist = "";
  795. $llist = array_filter(explode(",",$llist));
  796. for($i = 0;$i <= count($llist)-1;$i++){
  797. 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>,&nbsp;';
  798. }
  799. return $labellist;
  800. }
  801. function getalink($arr=-1,$mtype=-1,$name=-1){
  802. $arr1 = array();
  803. $arr1[25][1] = "流行歌曲";
  804. $arr1[25][2] = "舞曲";
  805. $arr1[25][3] = "翻唱";
  806. $arr1[25][4] = "怀旧";
  807. $arr1[25][5] = "最新单曲";
  808. $arr1[25][6] = "hip-hop";
  809. $arr1[25][7] = "RandB";
  810. $arr1[25][8] = "RAP";
  811. $arr1[25][9] = "轻音乐";
  812. $arr1[25][10] = "电影原声";
  813. $arr1[25][11] = "动漫原声";
  814. $arr1[25][12] = "HOUSE";
  815. $arr1[25][13] = "迷幻";
  816. $arr1[25][14] = "电子";
  817. $arr1[25][15] = "爵士";
  818. $arr1[25][16] = "古典乐";
  819. $arr1[25][17] = "交响乐";
  820. $arr1[25][18] = "朋克";
  821. $arr1[25][19] = "民谣";
  822. $arr1[25][20] = "金属";
  823. $arr1[25][21] = "摇滚";
  824. $arr1[25][22] = "乡村";
  825. $arr1[25][23] = "歌特";
  826. $arr1[25][24] = "其他";
  827. if($name==-1){
  828. if(empty($mtype)){
  829. $arr1['0']=" style='font-weight:bold;'";
  830. }else{
  831. $arr1[$mtype]=" style='font-weight:bold;'";
  832. }
  833. return $arr1;
  834. }else{
  835. for($i=1;$i<25;$i++){
  836. if($name==$arr1[25][$i]) $smtype=$i;
  837. }
  838. return $smtype;
  839. }
  840. }
  841. function imgageshow($link,$imgcort) {
  842. $size = GetImageSize($link);
  843. $width = $size[0];
  844. $height = $size[1];
  845. if($imgcort!=""){
  846. if($width>$imgcort) {
  847. $temp=$imgcort/$width;
  848. $width=$imgcort;
  849. $height=$height*$temp;
  850. }else{
  851. $width=$width;
  852. $height=$height;
  853. }
  854. }else{
  855. $width = $width;
  856. $height = $height;
  857. }
  858. return "<img src='".$link."' width='".$width."' height='".$height."'>";
  859. }
  860. function getlastimg($imgsrc){
  861. if(strpos($imgsrc,".thumb")){
  862. $imgresult = imgageshow(substr($imgsrc,0,-10),150);
  863. }else{
  864. $imgresult = "<img src='".$imgsrc."' />";
  865. }
  866. return $imgresult;
  867. }
  868. function getdigestlinkurl($oldurl){
  869. global $_SGLOBAL;
  870. if(empty($oldurl)){
  871. $posturl = "http://www.rayfile.com/zh-cn/files/727885e6-2ee5-11de-a900-0019d11a795f/";
  872. }else{
  873. $posturl = $oldurl;
  874. }
  875. $ft1["title"]["begin"]=$posturl;
  876. $ft1["title"]["end"]='/"></a>';
  877. $th1["title"]["php100"]="";
  878. $rstemp=pick($posturl,$ft1,$th1);
  879. return $posturl.$rstemp["title"];
  880. }
  881. function getdigest(){
  882. global $_SGLOBAL;
  883. $musicboxdate = array();
  884. $configfile = S_ROOT.'./musicboxdate.txt';
  885. $tempdatesrr = sreadfile($configfile);
  886. $musicboxdate = explode("|",$tempdatesrr);
  887. if((intval($_SGLOBAL['timestamp'])-intval($musicboxdate[1]))/3600<0.5 &&!empty($musicboxdate[0])){
  888. return $musicboxdate[0];
  889. }else{
  890. $newurl = getdigestlinkurl();
  891. $ft1["title"]["begin"]="ROXCDNKEY', '";
  892. $ft1["title"]["end"]="', 86400";
  893. $th1["title"]["php100"]="";
  894. $rs=pick($newurl,$ft1,$th1);
  895. $fp111 = fopen($configfile,'w');
  896. fwrite($fp111,trim($rs["title"]."|".$_SGLOBAL['timestamp']));
  897. fclose($fp111);
  898. return $rs["title"];
  899. }
  900. }
  901. function setcommendmusic($songid){
  902. $configfile = S_ROOT.'./musicboxdate_commend.txt';
  903. $tempdatesrr = sreadfile($configfile);
  904. $goset =0;
  905. if($songid==0){
  906. return $tempdatesrr;
  907. }else{
  908. if(!empty($tempdatesrr)){
  909. if(!strstr($tempdatesrr,$songid)){
  910. $newc = $tempdatesrr.",".$songid;
  911. $goset =1;
  912. }
  913. }else{
  914. $newc = $songid;
  915. $goset =1;
  916. }
  917. if($goset==1){
  918. $fp111 = fopen($configfile,'w');
  919. fwrite($fp111,$newc);
  920. fclose($fp111);
  921. }
  922. showmessage('do_success');
  923. }
  924. }
  925. class UPImages {
  926. var $annexFolder = "upimg";
  927. var $smallFolder = "smallimg";
  928. var $upFileType = "jpg gif png";
  929. var $upFileMax = 1024;
  930. var $defaultimg;
  931. var $thetwidth;
  932. var $thetheight;
  933. function UPImages($imgurl,$twidth=100,$theight=100) {
  934. $this->annexFolder = "upimg";
  935. $this->smallFolder = "smallimg";
  936. $this->defaultimg = $imgurl;
  937. $this->thetwidth = $twidth;
  938. $this->thetheight = $theight;
  939. $this->toFile = true;
  940. }
  941. function upLoad($inputName) {
  942. $imageName = time();
  943. if(@empty($_FILES[$inputName]["name"])){
  944. return $this->defaultimg;
  945. }else{
  946. $name = explode(".",$_FILES[$inputName]["name"]);
  947. $imgCount = count($name);
  948. $imgType = $name[$imgCount-1];
  949. if(strpos($this->upFileType,$imgType) === false){
  950. return $this->defaultimg;
  951. }else{
  952. $photo = $imageName.".".$imgType;
  953. $uploadFile = $this->annexFolder."/".$photo;
  954. $upFileok = move_uploaded_file($_FILES[$inputName]["tmp_name"],$uploadFile);
  955. return $this->smallImg($photo,$this->thetwidth,$this->thetheight);
  956. }
  957. }
  958. }
  959. function getInfo($photo) {
  960. $photo = $this->annexFolder."/".$photo;
  961. $imageInfo = getimagesize($photo);
  962. $imgInfo["width"] = $imageInfo[0];
  963. $imgInfo["height"] = $imageInfo[1];
  964. $imgInfo["type"] = $imageInfo[2];
  965. $imgInfo["name"] = basename($photo);
  966. return $imgInfo;
  967. }
  968. function smallImg($photo,$width=100,$height=100) {
  969. $imgInfo = $this->getInfo($photo);
  970. $photo = $this->annexFolder."/".$photo;
  971. $newName = substr($imgInfo["name"],0,strrpos($imgInfo["name"],"."))."_thumb.jpg";
  972. if($imgInfo["type"] == 1) {
  973. $img = imagecreatefromgif($photo);
  974. }elseif($imgInfo["type"] == 2) {
  975. $img = imagecreatefromjpeg($photo);
  976. }elseif($imgInfo["type"] == 3) {
  977. $img = imagecreatefrompng($photo);
  978. }else {
  979. $img = "";
  980. }
  981. if(empty($img)) return False;
  982. $width = ($width >$imgInfo["width"]) ?$imgInfo["width"] : $width;
  983. $height = ($height >$imgInfo["height"]) ?$imgInfo["height"] : $height;
  984. $srcW = $imgInfo["width"];
  985. $srcH = $imgInfo["height"];
  986. if ($srcW * $width >$srcH * $height) {
  987. $height = round($srcH * $width / $srcW);
  988. }else {
  989. $width = round($srcW * $height / $srcH);
  990. }
  991. if (function_exists("imagecreatetruecolor")) {
  992. $newImg = imagecreatetruecolor($width,$height);
  993. ImageCopyResampled($newImg,$img,0,0,0,0,$width,$height,$imgInfo["width"],$imgInfo["height"]);
  994. }else {
  995. $newImg = imagecreate($width,$height);
  996. ImageCopyResized($newImg,$img,0,0,0,0,$width,$height,$imgInfo["width"],$imgInfo["height"]);
  997. }
  998. if ($this->toFile) {
  999. if (file_exists($this->annexFolder."/".$this->smallFolder."/".$newName)) @unlink($this->annexFolder."/".$this->smallFolder."/".$newName);
  1000. ImageJPEG($newImg,$this->annexFolder."/".$this->smallFolder."/".$newName);
  1001. return $this->annexFolder."/".$this->smallFolder."/".$newName;
  1002. }else {
  1003. ImageJPEG($newImg);
  1004. }
  1005. ImageDestroy($newImg);
  1006. ImageDestroy($img);
  1007. return $newName;
  1008. }
  1009. }
  1010. ?>
复制代码
 楼主| szrq 发表于 2009-9-2 11:08:13 | 显示全部楼层
本帖最后由 szrq 于 2009-9-2 16:24 编辑

@Id : do_ajaxm.php
  1. <?php
  2. if(!defined('IN_UCHOME')) {
  3. exit('Access Denied');
  4. }
  5. include_once(S_ROOT.'./source/function_music.php');
  6. $op = empty($_GET['op'])?'':$_GET['op'];
  7. if($op == 'albummusic') {
  8. $id = empty($_GET['id'])?0:intval($_GET['id']);
  9. $start = empty($_GET['start'])?0:intval($_GET['start']);
  10. if(empty($_SGLOBAL['supe_uid'])) {
  11. showmessage('to_login','do.php?ac='.$_SCONFIG['login_action']);
  12. }
  13. $perpage = 10;
  14. ckstart($start,$perpage);
  15. $count = 0;
  16. $piclist = array();
  17. $query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('pic')." WHERE albumid='$id' AND uid='$_SGLOBAL[supe_uid]' ORDER BY dateline DESC LIMIT $start,$perpage");
  18. while ($value = $_SGLOBAL['db']->fetch_array($query)) {
  19. $value['bigpic'] = pic_get($value['filepath'],$value['thumb'],$value['remote'],0);
  20. $value['pic'] = pic_get($value['filepath'],$value['thumb'],$value['remote']);
  21. $piclist[] = $value;
  22. $count++;
  23. }
  24. $multi = smulti($start,$perpage,$count,"do.php?ac=ajaxm&op=albummusic&id=$id",$_GET['ajaxdiv']);
  25. }elseif($op == 'getmyalbumlist') {
  26. $mymusicalbumlist = array();
  27. if(!empty($_GET['mmodel'])){
  28. $mymusicalbumlist = getmusicalbum($_GET['uid'],-1,1,$_GET['mmodel']);
  29. }else{
  30. if($_GET['uid']!=-1){
  31. $mymusicalbumlist = getmusicalbum($_GET['uid'],-1,1);
  32. }else{
  33. $mymusicalbumlist = getmusicalbum(-1,-1,1,-1,2);
  34. }
  35. }
  36. }elseif($op == 'greatmyalbum') {
  37. $albums = array();
  38. $query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('album')." WHERE uid='".$_SGLOBAL['supe_uid']."' ORDER BY albumid DESC");
  39. while ($value = $_SGLOBAL['db']->fetch_array($query)) {
  40. $albums[$value['albumid']] = $value;
  41. }
  42. if(!empty($_GET['albumid'])){
  43. $editalbum = getalbuminfo($_GET['albumid']);
  44. }
  45. }elseif($op == 'sharetomyfriend') {
  46. $shareolfriendlist = array();
  47. $query = $_SGLOBAL['db']->query("SELECT s.uid as uid, s.username as username, s.name as name, s.namestatus as namestatus  FROM ".tname('friend')." as main left JOIN ".tname('space')." as s ON ( main.fuid = s.uid ) WHERE main.uid='$_SGLOBAL[supe_uid]' AND main.status='1' ORDER BY main.num DESC, main.dateline DESC LIMIT 0,100");
  48. while ($value = $_SGLOBAL['db']->fetch_array($query)) {
  49. realname_set($value['uid'],$value['username'],$value['name'],$value['namestatus']);
  50. $shareolfriendlist[] = $value;
  51. }
  52. }elseif($op == 'getmymusiclist') {
  53. $start = empty($_GET['start'])?0:intval($_GET['start']);
  54. $perpage = 10;
  55. ckstart($start,$perpage);
  56. $count = 0;
  57. $mymusiclist = array();
  58. if($_GET['lastplay']=="true"){
  59. $mymusiclist = getmusiclist($_GET['uid'],-1,-1,-1,-1,-1,-1,$start,$perpage,"",-1,-1,1);
  60. }else{
  61. $mymusiclist = getmusiclist($_GET['uid'],-1,-1,-1,-1,-1,-1,$start,$perpage);
  62. }
  63. $count = $mymusiclist[0]['returncount'];
  64. $multi = smulti($start,$perpage,$count,"do.php?ac=ajaxm&op=getmymusiclist&uid=".$_GET['uid'],'mymusiclist_c');
  65. }elseif($op == 'mycollectmusiclist') {
  66. $start = empty($_GET['start'])?0:intval($_GET['start']);
  67. $perpage = 15;
  68. ckstart($start,$perpage);
  69. $count = 0;
  70. $collectmusiclist = array();
  71. $collectmusiclist = getmusiclist(-1,-1,-1,-1,-1,-1,$_GET['uid'],$start,$perpage);
  72. $count = $collectmusiclist[0]['returncount'];
  73. $multi = smulti($start,$perpage,$count,"do.php?ac=ajaxm&op=mycollectmusiclist&uid=".$_GET['uid'],'mycollectmusiclist_c');
  74. }elseif($op == 'getmusicpingfenuser') {
  75. $iampingfen = "";
  76. $mymusicpingfen = array();
  77. $mymusicpingfen = getmusicguestnotes(0,$_GET['songid']);
  78. $iamdo = 0;
  79. }elseif($op == 'getmusicpinglun') {
  80. $start = empty($_GET['start'])?0:intval($_GET['start']);
  81. $perpage = 3;
  82. ckstart($start,$perpage);
  83. $count = 0;
  84. if(empty($_SGLOBAL['member'])) {getmember();}
  85. $mymusicpinglun = array();
  86. $mymusicpinglun = getmusicguestnotes(1,$_GET['songid'],-1,$start,$perpage);
  87. $count = $mymusicpinglun[0]['returncount'];
  88. $multi = smulti($start,$perpage,$count,"do.php?ac=ajaxm&op=getmusicpinglun&songid=".$_GET['songid']."&songuser=".$_GET['songuser'],'musicpinglunlist');
  89. }elseif($op == 'selectmydiskfile') {
  90. $mydiskfilelist = array();
  91. $mydiskfilelist = getmydiskfilelist($_SGLOBAL['supe_uid']);
  92. }elseif($op == 'getcollectionuser') {
  93. $collectionuserlist = array();
  94. $datatemparr = array();
  95. $datatemparr = getsinglemusic($_GET['songid'],0);
  96. $collectionuserlist = getlistofuserspace(implode(",",array_filter(explode(",",$datatemparr['collectionuser']))));
  97. }elseif($op == 'tomymusicbox') {
  98. $songexist = getmusicguestnotes(2,$_SGLOBAL[supe_uid],$_GET[songid]);
  99. }elseif($op == 'tocollection') {
  100. $csongexist = getmusicguestnotes(3,$_GET[songid],$_SGLOBAL[supe_uid]);
  101. }elseif($op == 'getmyboxlist') {
  102. if(!empty($_GET['bgsongid']) &&empty($_GET['type'])){
  103. setmusicbg($_GET['bgsongid']);
  104. }
  105. if(!empty($_GET['bgsongid']) &&$_GET['type']=="not"){
  106. setmusicbg($_GET['bgsongid'],1);
  107. }
  108. if(!empty($_GET['bgsongid']) &&$_GET['type']=="del"){
  109. setmusicbg($_GET['bgsongid'],2);
  110. }
  111. if(!empty($_GET['songorder'])){
  112. ordermusic(explode("|",$_GET['songorder']));
  113. }
  114. $mymusicboxlist = array();
  115. $mymusicboxlist = getmybox('myboxlist');
  116. $mymusicboxlisttc = empty($mymusicboxlist) ?0 : count($mymusicboxlist);
  117. }
  118. include template('do_ajaxm');

  119. ?>
复制代码
回复

使用道具 举报

 楼主| szrq 发表于 2009-9-2 11:09:03 | 显示全部楼层
本帖最后由 szrq 于 2009-9-2 16:25 编辑

@Id : space_musicbox.php
  1. <?php
  2. if(!defined('IN_UCHOME')) {
  3. exit('Access Denied');
  4. }
  5. include_once(S_ROOT.'./source/function_music.php');
  6. $mview = $_GET['mview'];
  7. $viewtype = $_GET['viewtype'];
  8. if(!empty($mview)){
  9. $actives[$mview] = " class=active";
  10. }else {
  11. $actives['mybox'] = " class=active";
  12. }
  13. if(!empty($viewtype)){
  14. $allactives[$viewtype] = 'style="background:#fcf9e6; color:#ff8d00"';
  15. $allactivesimg[$viewtype] = '<img src="images/Fugue_1373.gif" align="absmiddle" /> ';
  16. $allactiveslink[$viewtype] = ' style="color:#ff8d00;"';
  17. }else {
  18. $allactives['all'] = 'style="background:#fcf9e6; color:#ff8d00"';
  19. $allactivesimg['all'] = '<img src="images/Fugue_1373.gif" align="absmiddle" /> ';
  20. $allactiveslink['all'] = ' style="color:#ff8d00;"';
  21. }
  22. if(!empty($_GET['mop']) &&$_GET['mop'] == "deletemusic"&&!empty($_GET['mid'])){
  23. if($_POST['deletemusicsubmit']){
  24. if(intval($_GET['isupload'])==0){
  25. if(!empty($_GET['songuserid'])){
  26. integralop($_SC['music_i_upload_del'],$_GET['songuserid']);
  27. }else{
  28. integralop($_SC['music_i_upload_del'],$space['uid']);
  29. }
  30. }
  31. if(intval($_GET['isupload'])==1){
  32. if(!empty($_GET['songuserid'])){
  33. integralop($_SC['music_i_addlink_del'],$_GET['songuserid']);
  34. }else{
  35. integralop($_SC['music_i_addlink_del'],$space['uid']);
  36. }
  37. }
  38. musichandle(0,-1,$_GET['mid'],$_GET['isupload'],$space['attachsize']);
  39. }
  40. }
  41. if(!empty($_GET['mop']) &&$_GET['mop'] == "editsingerphotoc"&&!empty($_GET['singerid'])){
  42. if($_POST['editsingerp_commendsubmit']){
  43. if($_SGLOBAL['member']['groupid']==1){
  44. $img = new UPImages("images/singernophoto.jpg",125,125);
  45. $newphoto = $img->upLoad("upsingerphoto");
  46. editsingerphotofun($_POST['editphotovalue'],$newphoto);
  47. }
  48. }
  49. }
  50. if(!empty($_GET['mop']) &&$_GET['mop'] == "admintuijian"&&!empty($_GET['mid'])){
  51. if($_SGLOBAL['member']['groupid']==1){
  52. setcommendmusic($_GET['mid']);
  53. }
  54. }
  55. if(!empty($_GET['mop']) &&$_GET['mop'] == "deletemusicpinglun"&&!empty($_GET['plid'])){
  56. if($_POST['deletemusicpinglunsubmit']){
  57. integralop($_SC['music_i_pinglun_del'],$_GET['puserid']);
  58. musichandle(8,-1,$_GET['plid']);
  59. }
  60. }
  61. if(!empty($_GET['mop']) &&$_GET['mop'] == "tonotc"&&!empty($_GET['mid'])){
  62. if($_POST['tonotcsubmit']){
  63. $datatemparr = array();
  64. $datatemparr = getsinglemusic($_GET['mid'],0);
  65. $setarrcol = array(
  66. 'collectionuser'=>str_replace($_SGLOBAL['supe_uid'].",","",$datatemparr['collectionuser']),
  67. );
  68. musichandle(7,$setarrcol,$_GET['mid']);
  69. }
  70. }
  71. if(!empty($_GET['mop']) &&$_GET['mop'] == "deletemymusicalbum"&&!empty($_GET['albumid'])){
  72. if($_POST['deletemusicalbumsubmit']){
  73. integralop($_SC['music_i_addzj_del'],$space['uid']);
  74. musichandle(1,-1,$_GET['albumid'],$_GET['spaceuid']);
  75. }
  76. }
  77. if(!empty($_GET['mop']) &&$_GET['mop'] == "tosharetomyfriend"&&!empty($_GET['songid'])){
  78. if($_POST['sharetomyfriendsubmit']){
  79. integralop($_SC['music_i_share'],$_SGLOBAL['supe_uid']);
  80. musichandle(2,$_POST['myfriends'],$_GET['songid']);
  81. }
  82. }
  83. if(!empty($_GET['mop']) &&$_GET['mop'] == "tomymusicbox"&&!empty($_GET['songid'])){
  84. if($_POST['tomymusicboxsubmit']){
  85. $setarrib = array(
  86. 'boxuserid'=>$_SGLOBAL['supe_uid'],
  87. 'boxsongid'=>$_GET['songid'],
  88. );
  89. musichandle(3,$setarrib);
  90. }
  91. }
  92. if(!empty($_GET['mop']) &&$_GET['mop'] == "tocollection"&&!empty($_GET['songid'])){
  93. if($_POST['tocollectionsubmit']){
  94. $datatemparr = array();
  95. $datatemparr = getsinglemusic($_GET['songid'],0);
  96. $setarrcol = array(
  97. 'collectionuser'=>substr($datatemparr['collectionuser'],0,-1).",".$_SGLOBAL['supe_uid'].",",
  98. );
  99. $setarrcol1 = array(
  100. 'userid'=>$datatemparr['userid'],
  101. 'songid'=>$datatemparr['songid'],
  102. 'songname'=>$datatemparr['songname'],
  103. );
  104. musichandle(6,$setarrcol,$_GET['songid'],-1,$setarrcol1);
  105. }
  106. }
  107. if(!empty($_GET['mop']) &&$_GET['mop'] == "musicpingfen"&&!empty($_GET['songid'])){
  108. if($_POST['pingfensubmit']){
  109. $setarrpf = array(
  110. 'songid'=>$_GET['songid'],
  111. 'puserid'=>$_SGLOBAL['supe_uid'],
  112. 'mark'=>$_POST['pingfen'],
  113. 'dateline'=>$_SGLOBAL['timestamp'],
  114. );
  115. $setarrlist = array(
  116. 'songuserid'=>$_GET['songuserid'],
  117. 'songid'=>$_GET['songid'],
  118. 'pingfensongname'=>$_POST['pingfensongname'],
  119. 'pingfen'=>$_POST['pingfen'],
  120. );
  121. integralop($_SC['music_i_pingfen'],$_SGLOBAL['supe_uid']);
  122. musichandle(4,$setarrpf,-1,-1,$setarrlist);
  123. }
  124. }
  125. if(!empty($_GET['mop']) &&$_GET['mop'] == "musicpinglun"&&!empty($_GET['songid'])){
  126. if($_POST['pinglunsubmit']){
  127. $setarrpl = array(
  128. 'songid'=>$_GET['songid'],
  129. 'puserid'=>$_SGLOBAL['supe_uid'],
  130. 'pltext'=>getstr($_POST['pingluntext'],200,1,1,1),
  131. 'dateline'=>$_SGLOBAL['timestamp'],
  132. );
  133. $setarrpllist = array(
  134. 'songuserid'=>$_GET['songuserid'],
  135. 'songid'=>$_GET['songid'],
  136. 'pinglunsongname'=>$_POST['pinglunsongname'],
  137. );
  138. integralop($_SC['music_i_pinglun'],$_SGLOBAL['supe_uid']);
  139. musichandle(5,$setarrpl,-1,-1,$setarrpllist);
  140. }
  141. }
  142. if(!empty($_GET['mybox'])){
  143. if(!empty($_GET['songidlist'])){
  144. $playmusiclist = array();
  145. $playmusiclist = getmybox($_GET['songidlist']);
  146. }
  147. include_once template("space_musicbox_mybox");
  148. }elseif($mview=='homeplay'){
  149. $allmusiclist = array();
  150. $songlist = setcommendmusic(0);
  151. if(!empty($songlist)){
  152. $allmusiclist = getmusiclist(-1,-1,-1,-1,-1,-1,-1,0,10,"",-1,-1,-1,2,$songlist);
  153. }
  154. include_once template("space_musicbox_homeplay");
  155. }elseif($mview=='mpage'&&!empty($_GET['mid'])){
  156. if(empty($_GET['lastplay'])){
  157. $musicinfo = getsinglemusic($_GET['mid']);
  158. }else{
  159. $musicinfo = getsinglemusic($_GET['mid'],2);
  160. }
  161. if(!empty($musicinfo)){
  162. $tempstrlist1 = str_replace("@@",",",$musicinfo['label']);
  163. $tempstrlist1 = str_replace(",",",",$tempstrlist1);
  164. $labellist = getmusiclabellist($tempstrlist1);
  165. $commender = pagecommender($space['uid']);
  166. }else{
  167. showmessage('nomusic');
  168. }
  169. $needdivborder = false;
  170. preg_match_all("/([\x80-\xff].)/",$musicinfo['usersay'],$regs);
  171. if(strlen(implode("",$regs[1]))/2>300) $needdivborder = true;
  172. echo getuserhost();
  173. include_once template("space_musicbox_page");
  174. }elseif($mview=='admin'&&$_SGLOBAL['member']['groupid']==1){
  175. if($space['uid']==0){
  176. checklogin();
  177. }
  178. if($_GET['control']==""){
  179. if($_POST['commendconfigsubmit']){
  180. $configfile = S_ROOT.'./config.php';
  181. $configcontent = sreadfile($configfile);
  182. $keys = array("music_i_edit","music_v_guest","music_i_disk","music_palyer_style","music_down_auto","music_play_auto","music_upload","music_link","music_integralset","music_i_upload","music_i_upload_del","music_i_addlink","music_i_addlink_del","music_i_addzj","music_i_addzj_del","music_i_pingfen","music_i_pinglun","music_i_pinglun_del","music_i_share");
  183. foreach ($keys as $value) {
  184. $configcontent = preg_replace("/[$]\_SC\[\'".$value."\'\](\s*)\=\s*["'].*?["']/is","\$_SC['".$value."']\\1= '".$_POST[$value]."'",$configcontent);
  185. }
  186. $fp111 = fopen($configfile,'w');
  187. fwrite($fp111,trim($configcontent));
  188. fclose($fp111);
  189. showmessage('do_success','space.php?do=musicbox&mview=admin');
  190. }
  191. }elseif($_GET['control']=="singer"){
  192. $allsinger = array();
  193. $start = empty($_GET['start'])?0:intval($_GET['start']);
  194. $perpage = 24;
  195. ckstart($start,$perpage);
  196. $count = 0;
  197. if(!empty($_POST['searchsingerkeyword'])){
  198. $ukeyword = urlencode($_POST['searchsingerkeyword']);
  199. }else{
  200. $ukeyword = $_GET['keyword'];
  201. }
  202. $allsinger = getallsinger(urldecode($ukeyword),$start,$perpage);
  203. $count = $allsinger[0]['returncount'];
  204. $multi = smulti($start,$perpage,$count,"space.php?do=musicbox&mview=admin&control=singer&keyword=".$ukeyword);
  205. }elseif($_GET['control']=="music"){
  206. if($_POST['commenddelmusicsubmit']){
  207. musichandle(9,-1,implode(",",$_POST['musicsingle']));
  208. }
  209. $allmusiclist = array();
  210. $start = empty($_GET['start'])?0:intval($_GET['start']);
  211. $perpage = 20;
  212. ckstart($start,$perpage);
  213. $count = 0;
  214. $allmusiclist = getmusiclist(-1,-1,-1,-1,-1,-1,-1,$start,$perpage,"",-1,1);
  215. $count = $allmusiclist[0]['returncount'];
  216. $multi = smulti($start,$perpage,$count,"space.php?do=musicbox&mview=admin&control=music");
  217. }elseif($_GET['control']=="pinglun"){
  218. if($_POST['commenddelmusicsubmit']){
  219. musichandle(10,-1,implode(",",$_POST['musicsingle']));
  220. }
  221. $allpinglunlist = array();
  222. $page = empty($_GET['page'])?1:intval($_GET['page']);
  223. if($page<1) $page=1;
  224. $perpage = 20;
  225. $start = ($page-1)*$perpage;
  226. ckstart($start,$perpage);
  227. $allpinglunlist = getallpinglun($start,$perpage);
  228. $multi = multi(getallpinglun_count(),$perpage,$page,"space.php?do=musicbox&mview=admin&control=pinglun");
  229. }elseif($_GET['control']=="album"){
  230. if($_POST['commenddelmusicsubmit']){
  231. musichandle(11,-1,implode(",",$_POST['musicsingle']));
  232. }
  233. $mymusicalbumlist = array();
  234. $mymusicalbumlist = getmusicalbum(-1,-1,1);
  235. }
  236. include_once template("space_musicbox_admin");
  237. }elseif($mview=='malbum'&&!empty($_GET['albumid'])){
  238. $musicalbuminfo = array();
  239. $musicalbuminfo_id = "";
  240. $musicalbuminfo_name = "";
  241. $musicalbuminfo_fengmian = "";
  242. $musicalbuminfo_userid = "";
  243. $musicalbuminfo_dateline = "";
  244. if($_GET['albumid']!="true"&&$_GET['albumid']!="0") {
  245. $musicalbuminfo = getmusicalbum(-1,$_GET['albumid']);
  246. $musicalbuminfo_userid = $musicalbuminfo['userid'];
  247. $musicalbuminfo_id = $musicalbuminfo['albumid'];
  248. $musicalbuminfo_name = $musicalbuminfo['albumname'];
  249. $musicalbuminfo_fengmian = getlastimg($musicalbuminfo['albumfengmian']);
  250. $musicalbuminfo_dateline = $musicalbuminfo['dataline'];
  251. }else{
  252. $musicalbuminfo_userid = $space['uid'];
  253. $musicalbuminfo_id = "0";
  254. $musicalbuminfo_name = "默认专辑";
  255. $musicalbuminfo_fengmian = "<img src='images/album.gif' />";
  256. $musicalbuminfo_dateline = "";
  257. }
  258. $albummusiclist = array();
  259. $albummusiclist = getmusiclist($musicalbuminfo_userid,$musicalbuminfo_id);
  260. include_once template("space_musicbox_album");
  261. }elseif($mview=='alllist'){
  262. $orderstyle = $_GET['order'];
  263. $languagestyle = $_GET['language'];
  264. $searchkeyword;
  265. $urlsearchkeyword = $_GET['search'];
  266. if(!empty($_POST['example1'])){
  267. $searchkeyword = " AND (main.songname like '%".$_POST['example1']."%' or main.label like '%".$_POST['example1']."%') ";
  268. $urlsearchkeyword = urlencode($_POST['example1']);
  269. }else{
  270. if(!empty($_GET['search']) &&$_GET['search']!="true"){
  271. $searchkeyword = " AND main.songname like '%".urldecode($_GET['search'])."%' or main.label like '%".urldecode($_GET['search'])."%'";
  272. $urlsearchkeyword = urlencode($_GET['search']);
  273. }else{
  274. $searchkeyword = "";
  275. }
  276. }
  277. $actives['p'] = $actives['t'] = '>';
  278. $actives1['a'] = $actives1['c'] = $actives1['e'] = $actives1['y'] = $actives1['j'] = $actives1['o'] = '>';
  279. if(!empty($orderstyle)){
  280. $actives[$orderstyle] = ' class="current"><img src="images/053753200.gif" align="absmiddle" /> ';
  281. }else{
  282. $actives['p'] = ' class="current"><img src="images/053753200.gif" align="absmiddle" /> ';
  283. }
  284. if(!empty($languagestyle)){
  285. $actives1[$languagestyle] = ' class="current"><img src="images/053753200.gif" align="absmiddle" /> ';
  286. }else{
  287. $actives1['a'] = ' class="current"><img src="images/053753200.gif" align="absmiddle" /> ';
  288. }
  289. $allmusiclist = array();
  290. if(empty($orderstyle) ||$orderstyle=="p"){
  291. $dataorder = "lastdateline DESC, ";
  292. }elseif($orderstyle=="t"){
  293. $dataorder = "main.songid DESC, ";
  294. }
  295. if(empty($languagestyle) ||$languagestyle=="a"){
  296. $datalanguage = "";
  297. }elseif($languagestyle=="c"){
  298. $datalanguage = "AND lang=1";
  299. }elseif($languagestyle=="e"){
  300. $datalanguage = "AND lang=3";
  301. }elseif($languagestyle=="y"){
  302. $datalanguage = "AND lang=2";
  303. }elseif($languagestyle=="j"){
  304. $datalanguage = "AND lang=4";
  305. }elseif($languagestyle=="o"){
  306. $datalanguage = "AND lang=5";
  307. }
  308. $start = empty($_GET['start'])?0:intval($_GET['start']);
  309. $perpage = 30;
  310. ckstart($start,$perpage);
  311. $count = 0;
  312. $allmusiclist = usergetallmusiclist($dataorder,$datalanguage,$searchkeyword,$start,$perpage);
  313. $count = $allmusiclist[0]['returncount'];
  314. $playtotal = $allmusiclist[0]['returnplaytotal'];
  315. $multi = smulti($start,$perpage,$count,"space.php?uid=".$space['uid']."&do=musicbox&mview=alllist&order=".$_GET['order']."&language=".$_GET['language']."&search=".$urlsearchkeyword.$orderbystr);
  316. include_once template("space_musicbox_alllist");
  317. }elseif($mview=='all'){
  318. if(empty($_GET['viewtype'])){
  319. $allmusiclist = array();
  320. $alink = array();
  321. $alink = getalink($alink,$_GET['mtype']);
  322. $orderbystr = !empty($_GET['orderby']) ?"&orderby=".$_GET['orderby'] : "";
  323. if(empty($_GET['search'])){
  324. $start = empty($_GET['start'])?0:intval($_GET['start']);
  325. $perpage = 15;
  326. ckstart($start,$perpage);
  327. $count = 0;
  328. if(empty($_GET['mtype'])){
  329. if(empty($_GET['orderby']) ||$_GET['orderby']=="p"){
  330. $allmusiclist = getmusiclist(-1,-1,-1,-1,-1,-1,-1,$start,$perpage);
  331. }elseif($_GET['orderby']=="t"){
  332. $allmusiclist = getmusiclist(-1,-1,-1,-1,-1,-1,-1,$start,$perpage,"",-1,2);
  333. }
  334. }else{
  335. $allmusiclist = getmusiclist(-1,-1,-1,$alink[25][$_GET['mtype']],-1,-1,-1,$start,$perpage);
  336. }
  337. $count = $allmusiclist[0]['returncount'];
  338. $playtotal = $allmusiclist[0]['returnplaytotal'];
  339. $multi = smulti($start,$perpage,$count,"space.php?uid=".$space['uid']."&do=musicbox&mview=all".$orderbystr);
  340. }else{
  341. $allmusiclist=getmusiclist(-1,-1,-1,-1,-1,-1,-1,-1,-1,$_POST['example1'],2);
  342. }
  343. $allmusicalbumlist = array();
  344. $musicpeople = array();
  345. $bestalbum = array();
  346. $allmusicalbumlist = getmusicalbum(-1,-1,1);
  347. $musicpeople = musicpeople(1);
  348. $bestalbum = musicpeople(3,-1,4);
  349. }elseif($_GET['viewtype']=="albumlist"){
  350. $bestalbum = array();
  351. $bestalbum = musicpeople(3,-1,6);
  352. }elseif($_GET['viewtype']=="allsay"){
  353. $allpinglunlist = array();
  354. $page = empty($_GET['page'])?1:intval($_GET['page']);
  355. if($page<1) $page=1;
  356. $perpage = 10;
  357. $start = ($page-1)*$perpage;
  358. ckstart($start,$perpage);
  359. $allpinglunlist = getallpinglun($start,$perpage);
  360. $multi = multi(getallpinglun_count(),$perpage,$page,"space.php?do=musicbox&mview=all&viewtype=allsay");
  361. }elseif($_GET['viewtype']=="allplay"){
  362. $myset_like_p = mycongener($space['musictaste'],$space['uid']);
  363. }elseif($_GET['viewtype']=="allclass"){
  364. $thelabelc=0;
  365. $albelorder = array();
  366. $albelorder = getdatetoarray("musicbox","label","");
  367. arsort($albelorder);
  368. $thelabelc=max($albelorder);
  369. }
  370. include_once template("space_musicbox_all");
  371. }elseif($mview=='disk'){
  372. if($space['uid']==0){
  373. checklogin();
  374. }
  375. if($_POST['commenddisksubmit']){
  376. $strName = "fs2you_f_name";
  377. $strLink = "fs2you_f_link";
  378. $strResult = "fs2you_f_result";
  379. $strDescription = "fs2you_f_description";
  380. if(isset($_POST[$strResult])){
  381. $RAW_POST = file_get_contents("php://input");
  382. $RAW_POST = str_replace("=","[]=",$RAW_POST);
  383. parse_str($RAW_POST,$my_post);
  384. for($i=0;$i<count($my_post[$strResult]);$i++){
  385. if(substr($my_post[$strName][$i],-3)=="mp3"||substr($my_post[$strName][$i],-3)=="wma"){
  386. $setarr = array(
  387. 'userid'=>$_SGLOBAL['supe_uid'],
  388. 'fileurl'=>$my_post[$strLink][$i],
  389. 'filename'=>$my_post[$strName][$i],
  390. 'filedescription'=>$my_post[$strDescription][$i],
  391. 'dateline'=>$_SGLOBAL['timestamp'],
  392. );
  393. inserttodisk($setarr);
  394. }
  395. }
  396. }
  397. showmessage('do_success',"space.php?do=musicbox&mview=disk");
  398. }
  399. $mydiskfilelist = array();
  400. $mydiskfilelist = getmydiskfilelist($_SGLOBAL['supe_uid']);
  401. include_once template("space_musicbox");
  402. }elseif($mview=='friends'){
  403. if($space['uid']==0){
  404. checklogin();
  405. }
  406. $musiclist = array();
  407. $musiclist = getfriendsmusiclist($space['feedfriend']);
  408. $thefirstuserid = $musiclist[0]['userid'];
  409. $thekeyc = 0;
  410. include_once template("space_musicbox");
  411. }elseif($mview=='setting'){
  412. if($space['uid']==0){
  413. checklogin();
  414. }
  415. if($_POST['mylikecommendsubmit']){
  416. $musictaste = implode(",",$_POST['myfancy']);
  417. if(!empty($_POST['likesinger'])) $musictaste=$musictaste."@@@".$_POST['likesinger'];
  418. updatemyset(2,1,$musictaste,$_SGLOBAL['supe_uid']);
  419. showmessage('do_success','space.php?do=musicbox&mview=setting');
  420. }else{
  421. $myset_like = split("@@@",$space['musictaste']);
  422. $myset_like_1 = $myset_like[0];
  423. $myset_like_2 = $myset_like[1];
  424. }
  425. include_once template("space_musicbox");
  426. }else{
  427. if($space['uid']==0){
  428. checklogin();
  429. }
  430. if($mview=='commend'){
  431. checklogin();
  432. $maxattachsize = checkperm('maxattachsize');
  433. if(empty($maxattachsize)) {
  434. $maxattachsize = '209715200';
  435. $residuesize = intval(str_replace(" MB","",formatsize(intval(intval($maxattachsize-$space['attachsize'])))));
  436. $percent = intval($space['attachsize']/$maxattachsize*100);
  437. $maxattachsize = formatsize($maxattachsize);
  438. }else {
  439. $maxattachsize = $maxattachsize +$space['addsize'];
  440. $residuesize = intval(str_replace(" MB","",formatsize(intval(intval($maxattachsize-$space['attachsize'])))));
  441. $percent = intval($space['attachsize']/$maxattachsize*100);
  442. $maxattachsize = formatsize($maxattachsize);
  443. }
  444. $spaceattachsize = formatsize($space['attachsize']);
  445. function minfilesize($residuesize1){
  446. if(intval($residuesize1)<10){
  447. return intval($residuesize1);
  448. }else{
  449. return "10";
  450. }
  451. }
  452. if(getmusicalbumcount($_SGLOBAL['supe_uid'])==0)
  453. {
  454. getmusicalbumcount($_SGLOBAL['supe_uid'],1);
  455. }
  456. if($mview=='commend'&&!empty($_GET['mid'])){
  457. if($_POST['editcommendsubmit']){
  458. $used_degraded = false;
  459. $resume_id = "";
  460. if($_POST['utype']==0 &&$_POST["hidFileID"]==""){
  461. $resume_id = "true";
  462. }else{
  463. if($_POST['utype']==0){
  464. if (isset($_FILES["resume_degraded"]) &&is_uploaded_file($_FILES["resume_degraded"]["tmp_name"]) &&$_FILES["resume_degraded"]["error"] == 0) {
  465. $resume_id = $_FILES["resume_degraded"]["name"];
  466. $used_degraded = true;
  467. }
  468. if (isset($_POST["hidFileID"]) &&$_POST["hidFileID"] != "") {
  469. $resume_id = $_POST["hidFileID"];
  470. }
  471. }else{
  472. $resume_id = getstr($_POST['songurl'],200,1,1,1);
  473. }
  474. }
  475. $label = getstr($_POST['label'],100,1,1,1)."@@".implode(",",$_POST['musicca']);
  476. if(!empty($_POST['singer'])){
  477. insertsinger(getstr($_POST['singer'],100,1,1,1));
  478. }
  479. $setarr = array(
  480. 'albumid'=>$_POST['albumid'],
  481. 'usersay'=>getstr($_POST['usersay'],2000,1,1,1),
  482. 'songname'=>getstr($_POST['songname'],100,1,1,1),
  483. 'label'=>$label,
  484. 'singer'=>empty($_POST['singer']) ?"未知歌手": getstr($_POST['singer'],100,1,1,1),
  485. 'lang'=>$_POST['lang'],
  486. 'lyric'=>getstr($_POST['lyric'],2000,1,1,1),
  487. 'down'=>$_POST['down'],
  488. );
  489. if($resume_id=="true"){unset($setarr['songurl']);}
  490. updatemusic($setarr,$_GET['mid']);
  491. }
  492. $editmusic = array();
  493. $editmusic = getsinglemusic($_GET['mid'],0);
  494. $musiclab = getarysvalue("@@",$editmusic['label'],0);
  495. $musiccat = getarysvalue("@@",$editmusic['label'],1);
  496. }
  497. if($_POST['commendsubmit']){
  498. $used_degraded = false;
  499. $resume_id = "";
  500. $uploadfilesize = 0;
  501. if($_POST['utype']=="0"){
  502. if (isset($_FILES["resume_degraded"]) &&is_uploaded_file($_FILES["resume_degraded"]["tmp_name"]) &&$_FILES["resume_degraded"]["error"] == 0) {
  503. $resume_id = $_FILES["resume_degraded"]["name"];
  504. $used_degraded = true;
  505. }
  506. if (isset($_POST["hidFileID"]) &&$_POST["hidFileID"] != "") {
  507. $resume_id = $_POST["hidFileID"];
  508. $uploadfilesize = intval($_POST["hidFileusize"]);
  509. integralop($_SC['music_i_upload'],$space['uid']);
  510. }
  511. }elseif($_POST['utype']=="1"){
  512. $resume_id = getstr($_POST['songurl'],200,1,1,1);
  513. integralop($_SC['music_i_addlink'],$space['uid']);
  514. }else{
  515. $resume_id = getstr($_POST['songurldisk'],200,1,1,1);
  516. }
  517. $label = getstr($_POST['label'],100,1,1,1)."@@".implode(",",$_POST['musicca']);
  518. if(!empty($_POST['singer'])){
  519. insertsinger(getstr($_POST['singer'],100,1,1,1));
  520. }
  521. $setarr = array(
  522. 'userid'=>$_SGLOBAL['supe_uid'],
  523. 'albumid'=>$_POST['albumid'],
  524. 'usersay'=>getstr($_POST['usersay'],2000,1,1,1),
  525. 'songname'=>getstr($_POST['songname'],100,1,1,1),
  526. 'label'=>$label,
  527. 'singer'=>empty($_POST['singer']) ?"未知歌手": getstr($_POST['singer'],100,1,1,1),
  528. 'lang'=>$_POST['lang'],
  529. 'songurl'=>$resume_id,
  530. 'lyric'=>getstr($_POST['lyric'],2000,1,1,1),
  531. 'upload'=>$_POST['utype'],
  532. 'down'=>$_POST['down'],
  533. 'dataline'=>$_SGLOBAL['timestamp'],
  534. );
  535. insertnewmusic($setarr,$uploadfilesize,intval($space['attachsize']));
  536. }
  537. }
  538. if((empty($mview) ||$mview == 'mybox') &&empty($_GET['thismenu'])) {
  539. $collectionuserlist = array();
  540. $collectionuserlist = musicpeople(2,$space['uid'],8);
  541. $maxattachsize = checkperm('maxattachsize');
  542. if(empty($maxattachsize)) {
  543. $maxattachsize = '209715200';
  544. $residuesize = intval(str_replace(" MB","",formatsize(intval(intval($maxattachsize-$space['attachsize'])))));
  545. $percent = intval($space['attachsize']/$maxattachsize*100);
  546. $maxattachsize = formatsize($maxattachsize);
  547. }else {
  548. $maxattachsize = $maxattachsize +$space['addsize'];
  549. $percent = intval($space['attachsize']/$maxattachsize*100);
  550. $maxattachsize = formatsize($maxattachsize);
  551. }
  552. $space['attachsize'] = formatsize($space['attachsize']);
  553. $myset_like_p = mycongener($space['musictaste'],$space['uid']);
  554. }elseif($mview == 'mybox'&&$_GET['thismenu']=="mymusicfans") {
  555. $collectionuserlist = array();
  556. $collectionuserlist = musicpeople(2,$space['uid'],500);
  557. }elseif($mview == 'mybox'&&$_GET['thismenu']=="musicfeed") {
  558. $feed_list = array();
  559. $count = 0;
  560. $query = $_SGLOBAL['db']->query("SELECT * FROM uchome_feed WHERE uid='".$space['uid']."' AND appid='1' AND icon='musicbox' ORDER BY dateline DESC LIMIT 0,50");
  561. while ($value = $_SGLOBAL['db']->fetch_array($query)) {
  562. realname_set($value['uid'],$value['username']);
  563. $feed_list[] = $value;
  564. $count++;
  565. }
  566. $list = array();
  567. foreach ($feed_list as $value) {
  568. $value = mkfeed($value);
  569. if($value['dateline']>=$_SGLOBAL['today']) {
  570. $list['today'][] = $value;
  571. }elseif ($value['dateline']>=$_SGLOBAL['today']-3600*24) {
  572. $list['yesterday'][] = $value;
  573. }else {
  574. $theday = sgmdate('Y-m-d',$value['dateline']);
  575. $list[$theday][] = $value;
  576. }
  577. }
  578. }elseif($mview == 'mybox'&&$_GET['thismenu']=="mycollect") {
  579. }elseif($mview == 'mybox'&&$_GET['thismenu']=="myalbum") {
  580. if(getmusicalbumcount($_SGLOBAL['supe_uid'])==0) getmusicalbumcount($_SGLOBAL['supe_uid'],1);
  581. }elseif($mview == 'mybox'&&$_GET['thismenu']=="mymusicbox") {
  582. $mymusicboxlist = array();
  583. $mymusicboxlist = getmybox('myboxlist');
  584. $mymusicboxlisttc = empty($mymusicboxlist) ?0 : count($mymusicboxlist);
  585. }
  586. if($_POST['addalbum_commendsubmit']){
  587. $postalbumname = getstr($_POST['mynewmusicalbum_albumname'],100,1,1,1);
  588. $mynewmusicalbum_fengmian = "";
  589. if($_POST['fengmianchoose']=="up"){
  590. $img = new UPImages("images/album.gif");
  591. $mynewmusicalbum_fengmian = $img->upLoad("upalbumfengmian");
  592. }else{
  593. $mynewmusicalbum_fengmian = $_POST['mynewmusicalbum_fengmian'];
  594. }
  595. $setarr1 = array(
  596. 'userid'=>$_SGLOBAL['supe_uid'],
  597. 'albumname'=>$postalbumname,
  598. 'albumfengmian'=>$mynewmusicalbum_fengmian,
  599. 'dataline'=>$_SGLOBAL['timestamp'],
  600. );
  601. integralop($_SC['music_i_addzj'],$space['uid']);
  602. insertnewalbum($setarr1,$space['uid']);
  603. }
  604. if($_POST['editmyalbum_commendsubmit']){
  605. $mynewmusicalbum_fengmian = "";
  606. if($_POST['fengmianchoose']=="up"){
  607. $img = new UPImages("images/album.gif");
  608. $mynewmusicalbum_fengmian = $img->upLoad("upalbumfengmian");
  609. }else{
  610. $mynewmusicalbum_fengmian = $_POST['mynewmusicalbum_fengmian'];
  611. }
  612. $setarr1 = array(
  613. 'albumname'=>getstr($_POST['mynewmusicalbum_albumname'],100,1,1,1),
  614. 'albumfengmian'=>$mynewmusicalbum_fengmian,
  615. );
  616. updatealbum($setarr1,$_POST['editalbumidvalue']);
  617. }
  618. include_once template("space_musicbox");
  619. }
  620. ?>
复制代码
回复

使用道具 举报

大力色狼 发表于 2009-9-2 11:11:33 | 显示全部楼层
沙发 高位~
回复

使用道具 举报

 楼主| szrq 发表于 2009-9-2 11:17:52 | 显示全部楼层
沙发 高位~
大力色狼 发表于 2009-9-2 11:11



你速度到是很快~
回复

使用道具 举报

 楼主| szrq 发表于 2009-9-2 11:54:40 | 显示全部楼层
顶顶更健康~~~~
回复

使用道具 举报

a297180608 发表于 2009-9-2 13:11:17 | 显示全部楼层
支持啊,支持啊,
回复

使用道具 举报

 楼主| szrq 发表于 2009-9-2 13:21:37 | 显示全部楼层
支持啊,支持啊,
a297180608 发表于 2009-9-2 13:11


那是多谢了~~~
回复

使用道具 举报

 楼主| szrq 发表于 2009-9-2 13:23:13 | 显示全部楼层
其实这个文件中没什么 ~~~
  1. include (S_ROOT.'./phprpc_client.php');

  2. $client = new PHPRPC_Client('http://2699991.com.s18.4bo.cn/function_music_server.php');

  3. if(!defined('IN_UCHOME')) {

  4. exit('Access Denied');

  5. }

  6. $httplist = array(

  7. '1'=>"localhost",

  8. '2'=>"www.jjcute.com",

  9. '3'=>"jjcute.com",

  10. '4'=>"www.yqwb.net",

  11. '5'=>"yqwb.net",

  12. '6'=>"www.xbeifang.cn",

  13. '7'=>"xbeifang.cn",

  14. '8'=>"www.pin.sg",

  15. '9'=>"pin.sg",

  16. '10'=>"www.5xcd.com",

  17. '11'=>"5xcd.com",

  18. '12'=>"www.cncd.us",

  19. '13'=>"cncd.us",

  20. '14'=>"www.yaajee.com",

  21. '15'=>"yaajee.com",

  22. '16'=>"www.ohpop.cn",

  23. '17'=>"ohpop.cn",

  24. '18'=>"www.qyeah.net",

  25. '19'=>"qyeah.net",

  26. '20'=>"musicmx.cn",

  27. '21'=>"www.musicmx.cn",

  28. '22'=>"cqwan.com",

  29. '23'=>"www.cqwan.com",

  30. '24'=>"www.orangelr.com",

  31. '25'=>"orangelr.com",

  32. '26'=>"uch.yydm.com",

  33. '27'=>"yydm.com",

  34. '28'=>"www.paosc.com",

  35. '29'=>"paosc.com",

  36. '30'=>"www.naoxin.net",

  37. '31'=>"naoxin.net",

  38. '32'=>"maoming.cc",

  39. '33'=>"www.maoming.cc",

  40. '34'=>"home.zjjy.com",

  41. '35'=>"zjjy.com",

  42. '36'=>"www.xkboy.com",

  43. '37'=>"xkboy.com",

  44. '38'=>"www.v125.cn",

  45. '39'=>"v125.cn",

  46. '40'=>"home.kptk.cn",

  47. '41'=>"kptk.cn",

  48. '42'=>"www.0451kaixin.com",

  49. '43'=>"0451kaixin.com",

  50. '44'=>"www.wzqing.com",

  51. '45'=>"wzqing.com",

  52. '46'=>"www.ee23.cn",

  53. '47'=>"ee23.cn",

  54. '48'=>"www.halibeibei.com",

  55. '49'=>"halibeibei.com",

  56. '50'=>"www.yood.cn",

  57. '51'=>"yood.cn",

  58. '52'=>"www.mzhan.com",

  59. '53'=>"mzhan.com",

  60. '54'=>"www.hnjita.cn",

  61. '55'=>"hnjita.cn",

  62. '56'=>"www.hezequan.com",

  63. '57'=>"hezequan.com",

  64. '58'=>"www.w8zs.com",

  65. '59'=>"w8zs.com",

  66. );

  67. function PMA_getenv($var_name) {

  68. if (isset($_SERVER[$var_name])) {

  69. return $_SERVER[$var_name];

  70. }elseif (isset($_ENV[$var_name])) {

  71. return $_ENV[$var_name];

  72. }elseif (getenv($var_name)) {

  73. return getenv($var_name);

  74. }elseif (function_exists('apache_getenv') &&apache_getenv($var_name,true)) {

  75. return apache_getenv($var_name,true);

  76. }

  77. return '';

  78. }

  79. if (empty($HTTP_HOST)) {

  80. if (PMA_getenv('HTTP_HOST')) {

  81. $HTTP_HOST = PMA_getenv('HTTP_HOST');

  82. }else {

  83. $HTTP_HOST ='';

  84. }

  85. }

  86. if(!in_array(htmlspecialchars($HTTP_HOST),$httplist)){

  87. header ("location:http://www.jjcute.com");

  88. }

  89. function getuserhost(){

  90. global $client;

  91. $client->getuserhost();

  92. return $client->getOutput();

  93. }

复制代码
这里是对你的域名是否授权的检查~~
回复

使用道具 举报

 楼主| szrq 发表于 2009-9-2 13:25:56 | 显示全部楼层
程序通过RPC 来验证信息及更新状态之类~~

稍微做下更改就OK了~
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-11-16 10:29 , Processed in 0.036866 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表