<?
/*
	---------------------------------------------------------------
	点歌台 V1.0.0 for discuz!5.0.0 RC1 
	---------------------------------------------------------------
	演示网站: http://piaoyun.miyahost.com/bbs/
	原版作者: 雪狼 (伊乐园中文论坛)
	最终修改: 飘云[PYG]
	官方论坛: WwW.ChiNaPYG.CoM
        修改日期: 2006.8.1
*/
require "./include/common.inc.php";
require "./songconfig.php";
$discuz_action = 244;
if(!$discuz_user) { showmessage('not_loggedin'); }
if ($songid){
	$query=$db->query("select * from cdb_xn_song where sgid='$songid'");
	$song=@$db->fetch_array($query);
	$oldsongname=$song[songname];
	$oldsongurl=$song[songurl];
	$oldcontent=$song[content];
	if (($discuz_user == $song[username]) || ($adminid==1)){
		$navaction .= '&raquo;&nbsp;<a href="song.php">论坛点歌台</a>&raquo;&nbsp;编辑点歌';
		$news.="您给$song[touser]点了一首《$song[songname]》，您现在可以编辑想要说的话，歌曲名称以及歌曲地址。<br><font color=\"#FF0000\">如果您选择的是内置歌曲，请不要更改“歌曲名称以及歌曲地址”。</font>";
		unset($query);
	}else{
		showmessage("对不起，这首歌不是您点的！","song.php");}
} else showmessage('undefined_action');

if ($editsubmit){

	$songname =  dhtmlspecialchars($songname);
	$content=dhtmlspecialchars($content);
	$query=$db->query("update cdb_xn_song set songname='$songname', songurl='$songurl ', content='$content' WHERE sgid='$songid'");
	unset($query);
	showmessage("指定的点歌成功编辑，现在返回点歌台","song.php");
}else{
	include template('club_editsong');
}

//include template('club_editsong');
?>