<?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";
admincheck(6);
$version="v1.1";
include "../../../plug/myppt/conf.inc.php";
$action=SafeRequest("action", "get");
$ac=SafeRequest("ac", "get");
if($action=="config") {
	$lei_skin=SafeRequest("lei_skin", "post");
	$lei_width=SafeRequest("lei_width", "post");
	$lei_height=SafeRequest("lei_height", "post");
	$lei_num=SafeRequest("lei_num", "post");
	$strs="<?php" . "\n";
	$strs=$strs . "define(\"lei_skin\",\"" . $lei_skin . "\");\n";
	$strs=$strs . "define(\"lei_width\",\"" . $lei_width . "\");\n";
	$strs=$strs . "define(\"lei_height\",\"" . $lei_height . "\");\n";
	$strs=$strs . "define(\"lei_num\",\"" . $lei_num . "\");\n";
	$strs=$strs . "?>";
	if(!$fp=fopen('../../../plug/myppt/conf.inc.php', 'w')) {
		showmessage("出错了，文件 /plug/myppt/conf.inc.php 没有写入权限！", $_SERVER['HTTP_REFERER'], 0);
	}
	$ifile=new iFile('../../../plug/myppt/conf.inc.php', 'w');
	$ifile->WriteFile($strs, 3);
	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 style="padding: 8px;"> 
     <a href="index.php" class="btn btn_success">幻灯片设置</a> 
     <a href="myppt.php" class="btn btn-default">幻灯片列表</a> 
     <a href="myppt.php?action=add" class="btn btn-default">添加幻灯片</a> 
    </div> 
   </div> 
  </div> 
  <div class="contents"> 
   <div class="panel"> 
    <div class="panel-head">
     <strong>cctvai幻灯片设置</strong>
    </div>
<?php
$lockfile = 'install.lock';
if(file_exists($lockfile)) {
?>	
    <form action="?action=config" method="post" name="form2" >
    <table class="table3" id="dellist"> 
     <tbody>
	 <tr>
       <td width="110" align="left">版本信息</td>
       <td align="left"> <?php echo $version;?></td>
      </tr>
	 <tr>
       <td align="left">幻灯片风格</td>
       <td align="left">
	   <select name="lei_skin" id="lei_skin">
<?php
$directory='../../../plug/myppt/skin/';
$files=array();
if(is_dir($directory)) {
	if($dh=opendir($directory)) {
		while(($file=readdir($dh))!==false) {
			if($file!='.' && $file!='..' && $file!='index.php') {
if(lei_skin=="$file"){
	echo'<option value="'.$file.'" selected>'.$file.'</option>';
}else{
	echo'<option value="'.$file.'">'.$file.'</option>';
}
			}	
		}
		closedir($dh);
	}
}
?>
      <tr>
       <td align="left">幻灯片宽度</td>
       <td align="left"><input id="lei_width" name="lei_width" value="<?php echo lei_width;?>" type="text" class="input input_hd length_1"> px</td>
      </tr>
	  <tr>
       <td align="left">幻灯片高度</td>
       <td align="left"><input id="lei_height" name="lei_height" value="<?php echo lei_height;?>" type="text" class="input input_hd length_1"> px</td>
      </tr>
	  <tr>
       <td align="left">调用条数</td>
       <td align="left"><input id="lei_num" name="lei_num" value="<?php echo lei_num;?>" type="text" class="input input_hd length_1"> 条</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>
	<?php }else{?>
	<table class="table3"> 
      <tbody> 
       <tr> 
        <td width="50" align="left" class="p10">提醒</td> 
        <td align="left">请先安装幻灯片插件！<a href="install.php" class="btn">安装插件</a></td> 
       </tr>	   
      </tbody> 
     </table>
<?php }?>
   </div> 
  </div> 
  <div class="contents"> 
   <div class="panel"> 
    <div class="panel-head">
     <strong>cctvai幻灯片使用说明</strong>
    </div>
<div style="padding: 10px;line-height: 25px;">
模板调用幻灯片代码：<br /><br />
在模板的&lt;head>&lt;/head>之间引用JS<br />
&lt;script type="text/javascript" src="[cctvai:path]plug/myppt/">&lt;/script><br />
在需要显示的地方调用<br />
&lt;script type="text/javascript">myppt();&lt;/script>
<br /><br />
本插件的幻灯片调用采用了myfocus 2.0.4，如果您嫌风格太少，也可以下载myfocus的风格到/plug/skin/
<br />
/plug/skin/风格名称/<br />
----风格名称.css<br />
----风格名称.js<br /><br />
安装过程中如有问题请联系幻灯片插件作者QQ80903155
</div> 
   </div> 
  </div> 
 </body>
</html>