⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 song_admin.php

📁 PHP论坛中进行自助点歌的插件
💻 PHP
📖 第 1 页 / 共 2 页
字号:
	if ($step==2)
	{
		///$songer=trim($songer);
		$addgeming=trim($addgeming);
		if ($songer=="" || $addgeming=="")
		{
			echo " 歌曲或者歌名为空!返回填写!";
			if (strrpos($songer,"|")!==false || strrpos($addgeming,"|")!==false)
			{
				echo "歌曲或者歌名含不可接受字符“|”,请修改!";
			}
?>
			</td> </tr></table>
			<TABLE cellSpacing=1 cellPadding=5 width=<?=$tablewidth?> border=0 align=center>
			<TR>
			<TD class=head height=27></TD></TR></table>
<?
			require_once("footer.php");
			exit;
		}
		if (!eregi("\.mid$",$songer) && !eregi("\.mp3$",$songer) && !eregi("\.avi$",$songer) && !eregi("\.asf$",$songer) && !eregi("\.wmv$",$songer) && !eregi("\.wma$",$songer) && !eregi("\.ra$",$songer) && !eregi("\.rm$",$songer) && !eregi("\.ram$",$songer) && !eregi("\.swf$",$songer))
		{
			echo '<center><br><br>状态:发生错误,指定歌曲必须为 MID、MP3、AVI、ASF、WMV、WMA、RA、RM、RAM、SWF 格式!<ul><br><br><li><a href="javascript:history.back(1)">返回前页</a></li></ul></center>';
?>
			</td> </tr></table>
			<TABLE cellSpacing=1 cellPadding=5 width=<?=$tablewidth?> border=0 align=center>
			<TR>
			<TD class=head height=27></TD></TR></table>
<?
			footer();
		}
		$px_newpost="<?die;?>|$songer|$addgeming|$timestamp|\n";
		writeover("data/songdata/songdata.php",$px_newpost,"ab+");
		echo "添加歌曲成功!<br><br>按<a href=song_admin.php?job=add>这里继续添加</a><br><br>";
		echo "按<a href=song_admin.php>这里返回总台</a>";
	}
	else
	{				
?>
		<FORM METHOD=POST ACTION="song_admin.php?job=add&step=2">
		请填写完整的歌曲路径,如:pnm://202.103.101.25/zhj1/08.rm <br>
		格式可以是:MID、MP3、AVI、ASF、WMV、WMA、RA、RM、RAM、SWF</br>
		歌曲路径:<INPUT TYPE="text" NAME="songer" size=50><br>
		歌曲名字:<INPUT TYPE="text" NAME="addgeming" size=20><br>
		<INPUT TYPE="submit" value="提交歌曲"><br><br>
		如果要删除歌曲,请到<a href=song_admin.php?job=list>歌曲列表</a>
		</FORM>
<?php
	}
?>			  
	</td></tr></table>
	<TABLE cellSpacing=1 cellPadding=5 width=<?=$tablewidth?> border=0 align=center><TR>
	<TD class=head height=27></TD></TR></table>
<?
	footer();
}
if ($job=="del")
{
	require("header.php");
	if(!$step)
	{
		$msg_info="<a href=song_admin.php?job=del&step=2&songid=$songid>确认删除</a>";
		include PrintEot('showmsg');
	}
	else
	{
		$songlist=openfile("data/songdata/songdata.php");
		$num=count($songlist);
		$songid=trim($songid);
		for ($r=0;$r<$num;$r++)
		{
			$songin=explode("|",$songlist[$r]);
			if (trim($songin[3])==$songid)
			{
				unset($songlist[$r]);
			}
		}
		$songlist=implode("",$songlist);
		writeover("data/songdata/songdata.php",$songlist);
		refreshto("song_admin.php?job=list","执行成功");
	}
	exit;
}
if ($job=="list")
{
	require("header.php");
	echo $msg_guide;
?>
	<script>
	function popwin2(id,path)
	{	
		window.open("song_admin.php?job=test&songurl="+id,"","height=350,width=395,resizable=no,scrollbars=no,status=no,toolbar=no,menubar=no,location=no");
	}
	</script>
	<TABLE cellSpacing=1 cellPadding=5 width=<?=$tablewidth?> border=0 align=center>
	<TR>
	<TD class=head height=27><B>-=> 
	</B><FONT class=headurl>欢迎您,<?=$windid?>,一天的工作又开始咯,加油哦!</FONT></TD></TR></table>
	<table width=<?=$tablewidth?> border=0 cellspacing=1 cellpadding=5 bgcolor=F0F0F0 align=center>
	<tr bgcolor=FFFFFF><td>
	现有歌曲列表:<br>
	<table width=100% border=0 cellspacing=1 cellpadding=5>
<?
	$songlist=openfile("data/songdata/songdata.php");
	for ($i=0; $i<count($songlist); $i++) 
	{
		$detail=explode("|", trim($songlist[$i]));
		$no=$i+1;
		$color=$article_color1;
		if ($no%2==0) $color=$article_color2;
		echo "<tr bgcolor=$color><td> $no 歌名:$detail[2]  </td><td> 网址:$detail[1] </td><td width=*><a href=javascript:popwin2(\"$detail[1]&songid={$detail[3]}\",410)>试听</a>==<a href=song_admin.php?job=del&songid={$detail[3]}>删除</a></td></tr>";
	}
?>
	</table>
	</td></tr></table>
	<TABLE cellSpacing=1 cellPadding=5 width=<?=$tablewidth?> border=0 align=center>
	<TR>
	<TD class=head height=27></TD></TR></table>
<?
	footer();
}
if ($job=="manage")
{
	require("header.php");
	echo $msg_guide;
?>
	<TABLE cellSpacing=1 cellPadding=5 width=<?=$tablewidth?> border=0 align=center>
    <TR>
	<TD class=head height=27><B>-=> 
	</B><FONT class=headurl>欢迎您,<?=$windid?>,一天的工作又开始咯,加油哦!</FONT></TD></TR></table>
	<table width=<?=$tablewidth?> border=0 cellspacing=1 cellpadding=5 bgcolor=F0F0F0 align=center>
	<tr bgcolor=FFFFFF><td>
	点歌信息列表:[红色的为当天的点歌]<br>
	<table width=100% border=0 cellspacing=1 cellpadding=5>
<?
	$ar=getdate(time());
	$songlist=openfile("data/songdata/song.php");
	if($songlist[0]=="")unset($songlist[0]);
	for ($i=0; $i<count($songlist); $i++)
	{
		$detail=explode("|", trim($songlist[$i]));
		$no=$i+1;
		$color=$article_color1;
		if ($no%2==0) $color=$article_color2;
			$today=getdate($detail[3]);
		if ($ar["mday"]==$today["mday"])
		{
			$no="<font color=red>$no</font>";
		}
		echo "<tr bgcolor=$color><td> $no <font color=#9FA4B0>点歌人</font>:$detail[1]  </td><td> <font color=#9FA4B0>听歌人:</font>$detail[2] </td><td><font color=#9FA4B0>歌名:</font>$detail[5] </td><td width=200><font color=#9FA4B0>想说的话:</font>$detail[6] </td><td width=25><a href=song_admin.php?job=deldg&songid={$detail[3]}><font color=#9FA4B0>删除</font></a></td></tr>";
	}
?>
	</table>
	</td></tr></table>
	<TABLE cellSpacing=1 cellPadding=5 width=<?=$tablewidth?> border=0 align=center>
	<TR>
	<TD class=head height=27></TD></TR></table>
<?
	footer();
}
if ($job=="deldg")
{
	if(!$step)
	{
		require("header.php");
		$msg_info="<a href=song_admin.php?job=deldg&step=2&songid=$songid>确认删除这条信息</a>";
		include PrintEot('showmsg');
	}
	else
	{
		$songlist=openfile("data/songdata/song.php");
		$num=count($songlist);
		$songid=trim($songid);
		for ($r=0;$r<$num;$r++)
		{
			$songin=explode("|",$songlist[$r]);
			if (trim($songin[3])==$songid)
			{
				unset($songlist[$r]);
			}
		}
		$songlist=implode("",$songlist);
		writeover("data/songdata/song.php",$songlist);
		$songarray=openfile("data/songdata/song.php");
		$count=count($songarray);
		$t_date=date("Ymd",$timestamp);
		$flag=0;
		for($i=0;$i<$count;$i++){
			$detail=explode("|", trim($songarray[$i]));
			$dates=date("Ymd",$detail[3]);
			$dates2=$dates+7;
			if($t_date<= $dates2) {
				$flag=1;
				$timeds=date("Y-m-j g:i A",$detail[3]);
				$songdetail.="<a href=javascript:popwin2('$detail[3]',410)><font color=blue>$detail[1]</font>点了一首<font color=green>《$detail[5]》</font>送给<font color=RED>$detail[2]</font>听,并想对 $detail[2] 说: <font color=RED>$detail[6]</font></a>($timeds)<br>";
			}else {
				if($flag!=1) $songdetail="近几天内没有点歌信息!";
				break;
			}
		}
		writeover("data/songdata/songcache.htm",$songdetail);
		refreshto("song_admin.php?job=manage","删除歌曲执行成功");
	}
	exit;
}
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -