function get_template($name) { global $bst_templates_globals, $ROOT; $tmpl = file_get_contents($ROOT . "templates/" . $name . ".html"); $global_pattern = "/\\[global:([a-zA-Z][a-zA-Z0-9_\\-]*)\\]/"; //global variables. while (regMatch($global_pattern, $tmpl)) { preg_match($global_pattern, $tmpl, $matches); $name = $matches[1]; con(array_key_exists($name, $bst_templates_globals), "get_template()", "global variables not found: ", $name); $tmpl = str_replace("[global:{$name}]", $bst_templates_globals[$name], $tmpl); } //parameters return $tmpl; }
function retype() { $fc1 = file_get_contents("../inc/dim_retype_vod.txt"); $fc2 = file_get_contents("../inc/dim_retype_art.txt"); $fc3 = file_get_contents("admin_interface.php"); $temppass = regMatch($fc3, "safepass=\"(\\S*?)\""); ?> <form action="?action=retypesave" method="post"> <table class="tb"> <tr class="thead"><th colspan="2">此功能主要用于第三方工具(火车头、ET等)入库接口转换。>>> 1.每个各占一行; 2.本地分类在前,采集分类在后(动作片=动作).;3.不要有多余的空行</th></tr> <tr><td width="50%">视频分类转换</td> <td width="50%">文章分类转换</td> </tr> <tr> <td> <textarea id="vodtype" name="vodtype" style="width:100%;font-family: Arial, Helvetica, sans-serif;font-size: 14px;" rows="25"><?php echo $fc1; ?> </textarea> </td> <td> <textarea id="arttype" name="arttype" style="width:100%;font-family: Arial, Helvetica, sans-serif;font-size: 14px;" rows="25"><?php echo $fc2; ?> </textarea> </td> </tr> <tr> <td align="center" colspan="2">入库免登录安全验证密码:<input id="oldpass" name="oldpass" type="hidden" value="<?php echo $temppass; ?> "><input id="temppass" name="temppass" size="20" value="<?php echo $temppass; ?> "> <input type="submit" id="btnSave" name="btnSave" value="保存" class="input" /> </td> </tr> </table> </form> </body> </html> <?php }
function configconnect() { $fc = file_get_contents("../user/qqconfig.php"); $QQ_OAUTH_CONSUMER_KEY = regMatch($fc, "QQ_OAUTH_CONSUMER_KEY\",\"(\\S+?)\""); $QQ_OAUTH_CONSUMER_SECRET = regMatch($fc, "QQ_OAUTH_CONSUMER_SECRET\",\"(\\S+?)\""); ?> <script language="javascript"> $(document).ready(function(){ $("#form1").validate({ rules:{ QQ_OAUTH_CONSUMER_KEY:{ required:true }, QQ_OAUTH_CONSUMER_SECRET:{ required:true } } }); $('#form1').form({ onSubmit:function(){ if(!$("#form1").valid()) {return false;} }, success:function(data){ $.messager.alert('系统提示', data, 'info'); } }); }); </script> <body> <form method="POST" action="?action=configconnectsave" id="form1" name="form1"> <table class="tb"> <tr align="left"> <td colspan="2"> QQ互联登陆配置选项:请在 http://connect.qq.com/ 注册申请 </td> </tr> <tr> <td width="20%">APP ID:</td> <td><input name="QQ_OAUTH_CONSUMER_KEY" type="text" id="QQ_OAUTH_CONSUMER_KEY" value="<?php echo $QQ_OAUTH_CONSUMER_KEY; ?> " size="50"> <font color="#FF0000">*</font> </td> </tr> <tr> <td>APP KEY:</td> <td><input name="QQ_OAUTH_CONSUMER_SECRET" type="text" id="QQ_OAUTH_CONSUMER_SECRET" value="<?php echo $QQ_OAUTH_CONSUMER_SECRET; ?> " size="50"> <font color="#FF0000">*</font> </td> </tr> <tr align="center"> <td colspan="2"> <input name="btnSave" type="submit" id="btnSave" class="input" value="更新参数"> 如出错请手动修改网站 user 目录下的 qqconfig.php 文件 </td> </tr> </table> </form> </body> </html> <?php }
if (!file_exists($fp)) { $fp .= '.bak'; } $fc = file_get_contents($fp); $mac_flag = regMatch($fc, "var\\smac_flag\\=(\\d+?)\\;"); $mac_second = regMatch($fc, "var\\smac_second\\=(\\d+?)\\;"); $mac_width = regMatch($fc, "var\\smac_width\\=(\\d+?)\\;"); $mac_height = regMatch($fc, "var\\smac_height\\=(\\d+?)\\;"); $mac_widthpop = regMatch($fc, "var\\smac_widthpop\\=(\\d+?)\\;"); $mac_heightpop = regMatch($fc, "var\\smac_heightpop\\=(\\d+?)\\;"); $mac_showtop = regMatch($fc, "var\\smac_showtop\\=(\\d+?)\\;"); $mac_showlist = regMatch($fc, "var\\smac_showlist\\=(\\d+?)\\;"); $mac_autofull = regMatch($fc, "var\\smac_autofull\\=(\\d+?)\\;"); $mac_buffer = regMatch($fc, "var\\smac_buffer\\=*\"*(\\S+?)'*\"*\\;"); $mac_prestrain = regMatch($fc, "var\\smac_prestrain\\=*\"*(\\S+?)'*\"*\\;"); $mac_colors = regMatch($fc, "var\\smac_colors\\=*\"*(\\S+?)'*\"*\\;"); $colarr = array('mac_second', 'mac_width', 'mac_height', 'mac_widthpop', 'mac_heightpop', 'mac_buffer', 'mac_prestrain', 'mac_colors'); $valarr = array($mac_second, $mac_width, $mac_height, $mac_widthpop, $mac_heightpop, $mac_buffer, $mac_prestrain, $mac_colors); for ($i = 0; $i < count($colarr); $i++) { $n = $colarr[$i]; $v = $valarr[$i]; $plt->set_var($n, $v); } $arr = array(array('p' => 'mac', 'a' => 'autofull', 'c' => $mac_autofull, 't' => 0), array('p' => 'mac', 'a' => 'showtop', 'c' => $mac_showtop, 't' => 0), array('p' => 'mac', 'a' => 'showlist', 'c' => $mac_showlist, 't' => 0), array('p' => 'mac', 'a' => 'flag', 'c' => $mac_flag, 't' => 0, 'n' => array('1,本地播放器文件'), 'v' => array(1))); foreach ($arr as $a) { if (!is_array($a['n'])) { $colarr = array('关闭', '开启'); $valarr = array(0, 1); } else { $colarr = $a['n']; $valarr = $a['v'];