简体出现错误的把最长的那一段替换成以下的就解决了
- } elseif($action == 'smiliesadd') {
- if(!submitcheck('smiliesaddsubmit')) {
- $_POST[nohvsmilie] = $_POST[nohvsmilie] ? $_POST[nohvsmilie] : 1;
- $filenum = 0;
- $query=$db->query("SELECT url FROM {$tablepre}smilies");
- while($db_smilies=$db->fetch_array($query)){
- $hv_smilies[] = $db_smilies[url];
- }
- if(empty($_POST[allowexten])) $allowexten = array('gif','jpg','png');
- else $allowexten = explode(",",$allowexten);
- if(empty($_POST[smiliespath])) $smiliespath='./images/smilies';
- if ($handle=@opendir("$smiliespath")) {
- while($file = @readdir($handle)) {
- $fileinfo = pathinfo($file);
- if (in_array($fileinfo[extension],$allowexten) && !in_array($file,array('.','..'))) {
- if($_POST[nohvsmilie]=='1'){
- if(!in_array($file,$hv_smilies)){
- $filenum++;
- $showlist .= "<tr><td align="center" class="altbg1"><input name="smiliesadd[".$filenum."]" type="checkbox" ".(in_array($file,$hv_smilies)?"":"checked")."></td><td align="center" class="altbg2"><input type="text" name="smiliesdis[".$filenum."]" value="0" size="5"></td><td align="center" class="altbg2"><input type="text" name="smiliescode[".$filenum."]" value=":s".random(2).rand(10,99).random(2).":"></td><td align="center" class="altbg2"><input type="text" name="smiliesname[".$filenum."]" value=".$file."></td><td align="center" class="altbg2"><img src=".$smiliespath."/".$file."></td><td align="center" class="altbg2">".(in_array($file,$hv_smilies)?"<font color=red>存在</font>":"<font color=blue>不存在</font>")."</td></tr>";
- }
- }else{
- $filenum++;
- $showlist .= "<tr><td align="center" class="altbg1"><input name="smiliesadd[".$filenum."]" type="checkbox" ".(in_array($file,$hv_smilies)?"":"checked")."></td><td align="center" class="altbg2"><input type="text" name="smiliesdis[".$filenum."]" value="0" size="5"></td><td align="center" class="altbg2"><input type="text" name="smiliescode[".$filenum."]" value=":s".random(2).rand(10,99).random(2).":"></td><td align="center" class="altbg2"><input type="text" name="smiliesname[".$filenum."]" value=".$file."></td><td align="center" class="altbg2"><img src=".$smiliespath."/".$file."></td><td align="center" class="altbg2">".(in_array($file,$hv_smilies)?"<font color=red>存在</font>":"<font color=blue>不存在</font>")."</td></tr>";
- }
- }
- }
- closedir($handle);
- }
- ?>
- <br><table align="center" cellspacing="<?=INNERBORDERWIDTH?>" cellpadding="<?=TABLESPACE?>" width="95%" class="tableborder">
- <tr align="center" class="header"><td colspan="4">..::程序资讯::..</td></tr>
- <tr><td class="altbg1" width="25%"><b>作者:</b></td><td class="altbg2" width="25%"><a href="http://hkpz.com/">旗”</a></td><td class="altbg1" width="25%"><b>开发论坛:</b></td><td class="altbg2" width="25%"><a href="http://hkpz.com/">ΡˇΖΟΝΕ</a></td></tr>
- </table><br>
- <form method="post" action="admincp.php?action=smiliesadd">
- <table align="center" cellspacing="<?=INNERBORDERWIDTH?>" cellpadding="<?=TABLESPACE?>" width="95%" class="tableborder">
- <tr align="center" class="header"><td colspan="2">..::过滤器::..</td></tr>
- <tr><td class="altbg1"><b>表情图片路径:</b><br>只为方便管理而用,表情图片必须放在表情存放路径(预设在./images/smilies)</td><td class="altbg2"><input type="text" value="<?=$_POST[smiliespath]?"$_POST[smiliespath]":"./images/smilies"?>" name="smiliespath"></td></tr>
- <tr><td class="altbg1"><b>副档名限制:</b><br>以 <font color="red">,</font> 分隔,暂时只能判断副档名,并不是档案格式</td><td class="altbg2"><input type="text" value="<?=$_POST[allowexten]?"$_POST[allowexten]":"gif,jpg,png"?>" name="allowexten"></td></tr>
- <tr><td class="altbg1"><b>只显示数据库中 Smilies 名称不存在的资料:</b><td class="altbg2"><input type="radio" name="nohvsmilie" value="1" <?=$_POST[nohvsmilie]==1?"checked":""?>>是 <input type="radio" name="nohvsmilie" value="2" <?=$_POST[nohvsmilie]==2?"checked":""?>>否</td></tr>
- <tr><td colspan="2" align="center" class="altbg2"><input type="submit" value="提交"></td></tr>
- </table></form><br>
- <form method="post" action="admincp.php?action=smiliesadd">
- <input type="hidden" name="formhash" value="<?=FORMHASH?>">
- <table cellspacing="<?=INNERBORDERWIDTH?>" cellpadding="<?=TABLESPACE?>" width="95%" align="center" class="tableborder">
- <tr align="center" class="header"><td width="100%" colspan="6">找到文件 <?=$filenum?> 个</td></tr>
- <tr align="center" class="category"><td width="48"><input type="checkbox" class="category" name="chkall" onclick="checkall(this.form)" <?=$_POST[nohvsmilie]==1?"checked":""?>>新增</td>
- <td>显示顺序</td><td>Smilies 代码(随机生成)</td><td>Smilies 文件名</td><td>Smilies 图片</td><td>数据库中<br>Smilie名称检查</td></tr>
- <?=$showlist?>
- </table><br>
- <center><input type="submit" name="smiliesaddsubmit" value="<?=$lang['submit']?>"></center>
- </form>
- <?
- } else {
- if(is_array($smiliesadd)){
- foreach($smiliesadd as $key => $values){
- if($values) $db->query("INSERT INTO {$tablepre}smilies VALUES ('','$smiliesdis[$key]','smiley','$smiliescode[$key]','$smiliesname[$key]')");
- }
- }
- cpmsg("新增完成","admincp.php?action=smiliesadd");
- }
复制代码 |