<?php

/*
'**************************************************************************************************
' 程序名称: CCTVAI开源音乐管理系统
' 官方网站: http://www.cctvai.com
' 联系 Q Q: 1542367792
' QQ交流群：136687984
' 版本：(终结版)
' 备注：未经书面授权，不得向任何第三方提供本软件系统！
' 功能，模板，插件，扩展，定制请联系QQ：1542367792
'**************************************************************************************************
*/
error_reporting(0);
include '../../../include/cctvai.conn.php';
include "../../function_common.php";
include "config.php";
admincheck(6);
/*if(Smallfivesolution() == $_SERVER['SERVER_NAME']) {
} else {
    echo Smallfivesq();
    exit();
}*/

include "../../../plug/yijianmusic/conf.inc.php";
$action=SafeRequest("action", "get");
$ac=SafeRequest("ac", "get");
if($action=="config") {
	$yijianmusicopen=SafeRequest("yijianmusicopen", "post");
	$yijianmusictxt=SafeRequest("yijianmusictxt", "post");
	$yijianmusicremote=SafeRequest("yijianmusicremote", "post");
	$width=SafeRequest("width", "post");
	$height=SafeRequest("height", "post");
	$top=SafeRequest("top", "post");
	$strs="<?php" . "\n";
	$strs=$strs . "define(\"yijianmusicopen\",\"" . $yijianmusicopen . "\");\n";
	$strs=$strs . "define(\"yijianmusictxt\",\"" . $yijianmusictxt . "\");\n";
	$strs=$strs . "define(\"yijianmusicremote\",\"" . $yijianmusicremote . "\");\n";
	$strs=$strs . "define(\"width\",\"" . $width . "\");\n";
	$strs=$strs . "define(\"height\",\"" . $height . "\");\n";
	$strs=$strs . "define(\"top\",\"" . $top . "\");\n";
	$strs=$strs . "?>";
	if(!$fp=fopen('../../../plug/yijianmusic/conf.inc.php', 'w')) {
		showmessage("出错了，文件 ../../../plug/yijianmusic/conf.inc.php 没有写入权限！", $_SERVER['HTTP_REFERER'], 0);
	}
	$ifile=new iFile('../../../plug/yijianmusic/conf.inc.php', 'w');
	$ifile->WriteFile($strs, 3);
	showmessage("恭喜您，保存设置成功！", $_SERVER['HTTP_REFERER'], 0);
} elseif($action=="configurl") {
	if(!$fp=fopen('../../../plug/yijianmusic/mub.txt', 'w')) {
		showmessage('文件 ../../../plug/yijianmusic/mub.txt 读写权限设置错误，请设置为可写后再执行！', $_SERVER['HTTP_REFERER'], 0);
	} else {
		$yijianmusicurl=SafeRequest("yijianmusicurl", "post");
		$yijianmusicurl=str_replace('\\','',$yijianmusicurl);
		fwrite(fopen('../../../plug/yijianmusic/mub.txt', 'wb'), $yijianmusicurl);
		showmessage("恭喜您，保存设置成功！", $_SERVER['HTTP_REFERER'], 0);
	}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head> 
  <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> 
  <meta name="renderer" content="webkit" /> 
  <title>管理后台</title> 
  <link rel="stylesheet" href="../../css/add.css" type="text/css" media="screen" /> 
<style type="text/css">
.table2{width: 100%;max-width: 100%;border-collapse: collapse;border-spacing: 0;}
.table2 td{font-size: 12px;border-top: 1px solid #ddd;padding: 8px;vertical-align: top;}
.table2 tr:hover{text-decoration: none;background-color: #e6f2fb;}
.table2 th{border-bottom: 2px solid #ddd;vertical-align: bottom;padding: 2px;text-align: left;}
.table3{width: 100%;max-width: 100%;border-collapse: collapse;border-spacing: 0;}
.table3 tr:hover{text-decoration: none;background-color: #e6f2fb;}
.table3 td{font-size: 12px;line-height:25px;border-top: 1px solid #ddd;padding: 5px;vertical-align: top;border-right: solid 1px #ddd;}
.table3 th{border-bottom: 2px solid #ddd;vertical-align: bottom;padding: 2px;text-align: left;}
</style>
 </head> 
 <body> 
  <div class="contents"> 
   <div class="panel"> 
    <div class="panel-head">
     <strong><?php echo $plug_name?>插件设置</strong>
    </div> 
    <form action="?action=config" method="post" name="form2" >
    <table class="table3" id="dellist"> 
     <tbody>
	 <tr>
       <td width="100" align="left">版本信息</td>
       <td align="left"><?php echo $plug_version;?>　</td>
      </tr>
	 <tr>
       <td width="80" align="left">是否启用</td>
       <td align="left">
<label class="mr20"><input name="yijianmusicopen" type="radio" value="yes" <?php if(yijianmusicopen=="yes"){echo "checked";} ?>>&nbsp;启用&nbsp;</label>
<label class="mr20"><input type="radio" name="yijianmusicopen" value="no" <?php if(yijianmusicopen=="no"){echo "checked";} ?>>&nbsp;关闭&nbsp;</label>
	   </td>
      </tr>
	 <tr>
       <td width="80" align="left">远程采集方式</td>
       <td align="left">
<label class="mr20"><input name="yijianmusicremote" type="radio" value="1" <?php if(yijianmusicremote=="1"){echo "checked";} ?>>&nbsp;file_get_contents&nbsp;</label>
<label class="mr20"><input type="radio" name="yijianmusicremote" value="0" <?php if(yijianmusicremote=="0"){echo "checked";} ?>>&nbsp;cURL&nbsp;</label>
	   </td>
      </tr>
	 <tr>
       <td align="left">框架位置调整</td>
       <td align="left">
	   宽：<input id="width" name="width" value="<?php echo width;?>" type="text" class="input input_hd length_1">
	   高：<input id="height" name="height" value="<?php echo height;?>" type="text" class="input input_hd length_1">
	   顶部距离：<input id="top" name="top" value="<?php echo top;?>" type="text" class="input input_hd length_1">
	   </td>
      </tr>
      <tr>
       <td align="left">提示内容</td>
       <td align="left"><input id="yijianmusictxt" name="yijianmusictxt" value="<?php echo yijianmusictxt;?>" type="text" class="input input_hd length_6"></td>
      </tr>
      <tr>
       <td height="35" colspan="2" align="left" bgcolor="#FAFBF7" class="td_border"><button type="submit" id="adddance" class="btn btn_submit J_ajax_submit_btn" style="margin-left: 80px;">保存设置</button></td>
      </tr>
     </tbody>
    </table> 
	</form>
   </div> 
<br />
   <div class="panel"> 
    <div class="panel-head">
     <strong>URL按钮地址,一行一个。</strong>
    </div> 
    <form action="?action=configurl" method="post" name="form2" >
    <table class="table3" id="dellist"> 
     <tbody>
      <tr>
       <td width="120" align="left">按钮颜色：<br>btn btn-warning<br>btn btn-success<br>btn btn-info<br>btn btn-danger<br>btn btn-default</td>
       <td align="left"><textarea class="length_6" name="yijianmusicurl" style="height: 200px;width:500px;line-height:25px;font-size:14px;"><?php echo file_get_contents('../../../plug/yijianmusic/mub.txt')?></textarea></td>
      </tr>
      <tr>
       <td height="35" colspan="2" align="left" bgcolor="#FAFBF7" class="td_border"><button type="submit" id="adddance" class="btn btn_submit J_ajax_submit_btn" style="margin-left: 80px;">保存设置</button></td>
      </tr>
     </tbody>
    </table> 
	</form>
   </div>
  </div>  
  <div class="contents"> 
   <div class="panel"> 
    <div class="panel-head">
     <strong><?php echo $plug_name?>使用说明</strong>
    </div> 
	<div style="padding: 5px;line-height: 22px;color: #575757;">
	前台会员中心，一键添加各大音乐网站。
	</div>
   </div> 
  </div>  
 </body>
</html>