Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[原创]可以在后台设置的背景音乐(各版块独立)

[复制链接]
lhj8000 发表于 2005-9-17 22:21:16 | 显示全部楼层
Discuz! info: MySQL Query Error

User: lhj800
Time: 2005-9-18 6:22am
Script: /admincp.php

SQL: UPDATE cdb_forums SET type='forum', status='1', bgmusic='1',bgmusicurl='',bgmusicloop='-1',
fup='4', name='超女星闻八卦', icon='',
description='', styleid='0', allowhtml='0', allowbbcode='1',
allowimgcode='1', allowsmilies='1', postcredits='-1',postmoney='-1', replymoney='-1', deletedmoney='-1'
replycredits='-1', password='', viewperm='',
postperm='', replyperm='', getattachperm='' WHERE fid='5'
Error: You have an error in your SQL syntax near 'replycredits='-1', password='', viewperm='',
postperm='', replyperm='', geta' at line 5
Errno.: 1064

Similar error report has beed dispatched to administrator before.


请教一下 这样一段代码是怎么回事呀!!
回复

使用道具 举报

 楼主| lu5266 发表于 2005-9-17 22:55:59 | 显示全部楼层
原帖由 lhj8000 于 2005-9-17 22:21 发表


请教一下 这样一段代码是怎么回事呀!!


好象是

  1. deletedmoney='-1'
复制代码


后面少了一个
  1. ,
复制代码


回复

使用道具 举报

lhj8000 发表于 2005-9-18 10:59:41 | 显示全部楼层
汗!可不可以再指点一下 这个字段出现在哪个文件呀!!找不到了!晕死!!
我安装了楼主的这个插件 安装没有提示问题
但只要设置为开启 背景音乐  后台就提示以上那段错误代码!!
找不到这个字段呀  不知道怎么改  楼主 帮帮忙了!!太想用这个插件了!!
不然只好重新来过了!!

[ 本帖最后由 lhj8000 于 2005-9-18 11:15 编辑 ]
回复

使用道具 举报

清风细雨 发表于 2005-9-18 12:23:52 | 显示全部楼层
我装上去后``没办法听到歌``后台也都有设置好``
回复

使用道具 举报

 楼主| lu5266 发表于 2005-9-18 14:55:16 | 显示全部楼层
原帖由 lhj8000 于 2005-9-18 10:59 发表
汗!可不可以再指点一下 这个字段出现在哪个文件呀!!找不到了!晕死!!
我安装了楼主的这个插件 安装没有提示问题
但只要设置为开启 背景音乐  后台就提示以上那段错误代码!!
找不到这个字段呀  不知道怎 ...



admin/forums.php

这个文件啊


不行的话

贴出来
回复

使用道具 举报

 楼主| lu5266 发表于 2005-9-18 14:55:44 | 显示全部楼层
原帖由 清风细雨 于 2005-9-18 12:23 发表
我装上去后``没办法听到歌``后台也都有设置好``



后台截图
回复

使用道具 举报

lhj8000 发表于 2005-9-19 08:49:31 | 显示全部楼层
麻烦楼主帮忙看一下!!
  1. <?php

  2. /*
  3. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  4. :: [DISCUZ!]  Crossday Discuz! Board                                    ::
  5. :: (c) 2001-2005 Comsenz Technology Ltd (www.discuz.com)                ::
  6. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  7. :: Author:  Crossday (tech@discuz.com) Cnteacher (cnteacher@discuz.com) ::
  8. :: Version: 2.5F   2004/10/01 05:15                                     ::
  9. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  10. */
  11. //fix:  BY pk0909
  12. /*
  13. 1 子论坛的子论坛问题
  14. 2 板块简介和名字长度问题
  15. */

  16. if(!defined('IN_ADMINCP')) {
  17.         exit('Access Denied');
  18. }

  19. cpheader();

  20. if($action == 'forumadd') {

  21.         if((!submitcheck('catsubmit') && !submitcheck('forumsubmit'))) {
  22.                 $groupselect = $forumselect = "<select name="fup">\n<option value="0" selected="selected"> - $lang[none] - </option>\n";
  23.                 $query = $db->query("SELECT fid, name, type FROM $table_forums WHERE type<>'sub' ORDER BY displayorder");
  24.                 while($fup = $db->fetch_array($query)) {
  25.                         if($fup['type'] == 'group') {
  26.                                 $groupselect .= "<option value="$fup[fid]">$fup[name]</option>\n";
  27.                         } else {
  28.                                 $forumselect .= "<option value="$fup[fid]">$fup[name]</option>\n";
  29.                         }
  30.                 }
  31.                 $groupselect .= '</select>';
  32.                 $forumselect .= '</select>';
  33.                 include CP_TPL.'forums_add.php';

  34.         } elseif(submitcheck('catsubmit')) {
  35.                 if (strlen($newcat) > 255) cpmsg('forums_forum_name_toolong');
  36.                 $db->query("INSERT INTO $table_forums (type, name, status)
  37.                         VALUES ('group', '$newcat', '1')");

  38.                 updatecache('forums');
  39.                 cpmsg('forums_new_cat_succeed', 'admincp.php?action=forumsedit');
  40.         } elseif(submitcheck('forumsubmit')) {
  41.                 if (strlen($newforum) > 255) cpmsg('forums_forum_name_toolong');
  42.                 $query = $db->query("SELECT type FROM $table_forums WHERE fid='$fup'");
  43.                 $type = $db->result($query, 0) == "forum" ? "sub" : "forum";
  44.                 $db->query("INSERT INTO $table_forums (fup, type, name, status, allowsmilies, allowbbcode, allowimgcode)
  45.                         VALUES ('$fup', '$type', '$newforum', '1', '1', '1', '1')");

  46.                 updatecache('forums');
  47.                 cpmsg('forums_new_forum_succeed', 'admincp.php?action=forumsedit');
  48.         }               

  49. } elseif($action == 'forumsedit') {

  50.         if(!submitcheck('editsubmit')) {

  51. ?>
  52. <table cellspacing="0" cellpadding="0" border="0" width="<?=TABLEWIDTH?>" align="center">
  53. <tr><td bgcolor="<?=BORDERCOLOR?>">

  54. <table border="0" cellspacing="<?=BORDERWIDTH?>" cellpadding="<?=TABLESPACE?>" width="100%">
  55. <tr class="header"><td><?=$lang['forums_edit']?></td></tr>
  56. <tr><td bgcolor="<?=ALTBG1?>"><br>
  57. <form method="post" action="admincp.php?action=forumsedit">
  58. <input type="hidden" name="formhash" value="<?=FORMHASH?>">
  59. <?

  60.                 $modsorig = $comma = '';
  61.                 $query = $db->query("SELECT fid, type, status, name, fup, displayorder, moderator FROM $table_forums ORDER BY displayorder");
  62.                 while($forum = $db->fetch_array($query)) {
  63.                         $forums[] = $forum;
  64.                         $modsorig .= $comma.$forum['moderator'];
  65.                         $comma = ',';
  66.                 }

  67.                 for($i = 0; $i < count($forums); $i++) {
  68.                         if($forums[$i]['type'] == 'group') {
  69.                                 echo '<ul>';
  70.                                 showforum($forums[$i], 1, 'group');
  71.                                 for($j = 0; $j < count($forums); $j++) {
  72.                                         if($forums[$j]['fup'] == $forums[$i]['fid'] && $forums[$j]['type'] == 'forum') {
  73.                                                 echo '<ul>';
  74.                                                 showforum($forums[$j], 2);
  75.                                                 for($k = 0; $k < count($forums); $k++) {
  76.                                                         if($forums[$k]['fup'] == $forums[$j]['fid'] && $forums[$k]['type'] == 'sub') {
  77.                                                                 echo '<ul>';
  78.                                                                 showforum($forums[$k], 3, 'sub');
  79.                                                                 echo '</ul>';
  80.                                                         }
  81.                                                 }
  82.                                                 echo '</ul>';
  83.                                         }
  84.                                 }
  85.                                 echo '</ul>';
  86.                         } elseif(!$forums[$i]['fup'] && $forums[$i]['type'] == 'forum') {
  87.                                 echo '<ul>';
  88.                                 showforum($forums[$i], 1);
  89.                                 for($j = 0; $j < count($forums); $j++) {
  90.                                         if($forums[$j]['fup'] == $forums[$i]['fid'] && $forums[$j]['type'] == 'sub') {
  91.                                                 echo '<ul>';
  92.                                                 showforum($forums[$j], 2, 'sub');
  93.                                                 echo '</ul>';
  94.                                         }
  95.                                 }
  96.                                 echo '</ul>';
  97.                         }
  98.                 }
  99.                 echo "<input type="hidden" name="modsorig" value="$modsorig"><br><center>\n".
  100.                         "<input type="submit" name="editsubmit" value="$lang[submit]"></center><br></td></tr></table></td></tr></table>\n";

  101.         } else {

  102.                 // read from groups
  103.                 $usergroups = array();
  104.                 $query = $db->query("SELECT groupid, type, creditshigher, creditslower FROM $table_usergroups");
  105.                 while($group = $db->fetch_array($query)) {
  106.                         $usergroups[$group['groupid']] = $group;
  107.                 }

  108.                 if(is_array($order)) {
  109.                         $modlist = $comma = '';
  110.                         foreach($order as $fid => $value) {
  111.                                 if($moderator[$fid]) {
  112.                                         $modlist .= $comma.$moderator[$fid];
  113.                                         $comma = ',';
  114.                                 }
  115.                                 $moderator[$fid] = str_replace(',', ', ', str_replace(' ', '', $moderator[$fid]));
  116.                                 $db->query("UPDATE $table_forums SET moderator='$moderator[$fid]', displayorder='$order[$fid]' WHERE fid='$fid'");
  117.                         }
  118.                 }

  119.                 $modsorig = "'".str_replace(',', "','", str_replace(' ', '', $modsorig))."'";
  120.                 $modlist = "'".str_replace(',', "','", str_replace(' ', '', $modlist))."'";

  121.                 $member_groups = '0';
  122.                 $query = $db->query("SELECT groupid FROM $table_usergroups WHERE type='member'");
  123.                 while ($tmp = $db->fetch_array($query)) {
  124.                         $member_groups .= ",$tmp[groupid]";
  125.                 }
  126.                 $db->query("UPDATE $table_members SET groupid='3' WHERE username IN ($modlist) AND groupid IN ($member_groups)");
  127.                 $db->query("UPDATE $table_members SET adminid='3' WHERE username IN ($modlist) AND adminid = 0");


  128.                 $query = $db->query("SELECT uid, adminid, groupid, credit FROM $table_members WHERE username IN ($modsorig) AND username NOT IN ($modlist) AND adminid NOT IN (1,2)");

  129.                 while($member = $db->fetch_array($query)) {
  130.                         if($usergroups[$member['groupid']]['type'] == 'special') {
  131.                                 $adminidnew = -1;
  132.                                 $groupidnew = $member['groupid'];
  133.                         } else {
  134.                                 $adminidnew = $member['adminid'] == 3 ? 0 : $member['adminid'];
  135.                                 foreach($usergroups as $group) {
  136.                                         if($group['type'] == 'member' && $member['credit'] >= $group['creditshigher'] && $member['credit'] < $group['creditslower']) {
  137.                                                 $groupidnew = $group['groupid'];
  138.                                                 break;
  139.                                         }
  140.                                 }
  141.                         }
  142.                         $db->query("UPDATE $table_members SET adminid='$adminidnew', groupid='$groupidnew' WHERE uid='$member[uid]'");
  143.                 }

  144.                 updatecache('forums');
  145.                 cpmsg('forums_updated_succeed', 'admincp.php?action=forumsedit');
  146.         }

  147. } elseif($action == 'forumsmerge') {

  148.         if(!submitcheck('mergesubmit') || $source == $target || !$source || !$target) {
  149.                 $forumselect = "<option value="0" selected="selected"> - $lang[none] - </option>\n";
  150.                 $query = $db->query("SELECT fid, name FROM $table_forums WHERE type<>'group' ORDER BY displayorder");
  151.                 while($forum = $db->fetch_array($query)) {
  152.                         $forumselect .= "<option value="$forum[fid]">$forum[name]</option>\n";
  153.                 }
  154.                 include CP_TPL.'forums_merge.php';
  155.         } else {

  156.                 $query = $db->query("SELECT COUNT(*) FROM $table_forums WHERE fup='$source'");
  157.                 if($db->result($query, 0)) {
  158.                         cpmsg('forums_merge_source_sub_notnull');
  159.                 }

  160.                 $db->query("UPDATE $table_threads SET fid='$target' WHERE fid='$source'");
  161.                 $db->query("UPDATE $table_posts SET fid='$target' WHERE fid='$source'");

  162.                 $query = $db->query("SELECT threads, posts FROM $table_forums WHERE fid='$source'");
  163.                 $sourceforum = $db->fetch_array($query);
  164.                 $db->query("UPDATE $table_forums SET threads=threads+$sourceforum[threads], posts=posts+$sourceforum[posts] WHERE fid='$target'");
  165.                 $db->query("DELETE FROM $table_forums WHERE fid='$source'");

  166.                 $query = $db->query("SELECT * FROM $table_access WHERE fid='$source'");
  167.                 while($access = $db->fetch_array($query)) {
  168.                         $db->query("INSERT INTO $table_access (uid, fid, allowview, allowpost, allowreply, allowgetattach)
  169.                                 VALUES ('$access[uid]', '$target', '$access[allowview]', '$access[allowpost]', '$access[allowreply]', '$access[allowgetattach]')", 'SILENT');
  170.                 }
  171.                 $db->query("DELETE FROM $table_access WHERE fid='$source'");

  172.                 updatecache('forums');
  173.                 cpmsg('forums_merge_succeed', 'admincp.php?action=forumsedit');
  174.         }

  175. } elseif($action == 'forumdetail') {

  176.         $perms = array('viewperm', 'postperm', 'replyperm', 'getattachperm');

  177.         if(!submitcheck('detailsubmit')) {

  178.                 $query = $db->query("SELECT * FROM $table_forums WHERE fid='$fid'");
  179.                 $forum = $db->fetch_array($query);
  180.                 $forum['name'] = dhtmlspecialchars($forum['name']);

  181. ?>
  182. <br><form method="post" action="admincp.php?action=forumdetail&fid=<?=$fid?>">
  183. <input type="hidden" name="formhash" value="<?=FORMHASH?>">
  184. <input type="hidden" name="type" value="<?=$forum['type']?>">
  185. <?

  186.                 if($forum['type'] == 'group') {

  187.                         showtype("$lang[forums_cat_detail] - $forum[name]", 'top');
  188.                         showsetting('forums_cat_name', 'namenew', $forum['name'], 'text');
  189.                         showtype('', 'bottom');

  190.                 } else {

  191. ?>
  192. <table cellspacing="0" cellpadding="0" border="0" width="90%" align="center">
  193. <tr><td bgcolor="<?=BORDERCOLOR?>">
  194. <table border="0" cellspacing="<?=BORDERWIDTH?>" cellpadding="<?=TABLESPACE?>" width="100%">
  195. <tr class="header"><td><?=$lang['tips']?></td></tr>
  196. <tr bgcolor="<?=ALTBG1?>"><td>
  197. <br><?=$lang['forums_edit_tips']?>
  198. </td></tr></table></td></tr></table><br><br>
  199. <?

  200.                         $fupselect = "<select name="fupnew">\n<option value="0" ".(!$forum[fup] ? "selected="selected"" : NULL)."> - $lang[none] - </option>\n";
  201.                         $query = $db->query("SELECT fid, name FROM $table_forums WHERE fid<>'$fid' AND type<>'sub' ORDER BY displayorder");
  202.                         while($fup = $db->fetch_array($query)) {
  203.                                 $selected = $fup['fid'] == $forum['fup'] ? "selected="selected"" : NULL;
  204.                                 $fupselect .= "<option value="$fup[fid]" $selected>$fup[name]</option>\n";
  205.                         }
  206.                         $fupselect .= '</select>';
  207.                         $query = $db->query("SELECT groupid, grouptitle FROM $table_usergroups");
  208.                         while($group = $db->fetch_array($query)) {
  209.                                 $groups[] = $group;
  210.                         }

  211.                         $styleselect = "<select name="styleidnew"><option value="0">$lang[default]</option>";
  212.                         $query = $db->query("SELECT styleid, name FROM $table_styles");
  213.                         while($style = $db->fetch_array($query)) {
  214.                                 $styleselect .= "<option value="$style[styleid]" ".
  215.                                         ($style['styleid'] == $forum['styleid'] ? 'selected="selected"' : NULL).
  216.                                         ">$style[name]</option>\n";
  217.                         }
  218.                         $styleselect .= '</select>';

  219.                         foreach($perms as $perm) {
  220.                                 $num = -1;
  221.                                 $$perm = "<table cellspacing="0" cellpadding="0" border="0" width="100%" align="center"><tr>";
  222.                                 foreach($groups as $group) {
  223.                                         $num++;
  224.                                         if($num && $num % 4 == 0) {
  225.                                                 $$perm .= "</tr><tr>";
  226.                                         }
  227.                                         $checked = strstr($forum[$perm], "\t$group[groupid]\t") ? 'checked' : NULL;
  228.                                         $$perm .= "<td><input type="checkbox" name="{$perm}[]" value="$group[groupid]" $checked> $group[grouptitle]</td>\n";
  229.                                 }
  230.                                 $$perm .= '</tr></table>';
  231.                         }

  232.                         $viewaccess = $postaccess = $replyaccess = $getattachaccess = '';

  233.                         $query = $db->query("SELECT m.username, a.* FROM $table_access a LEFT JOIN $table_members m USING (uid) WHERE fid='$fid'");
  234.                         while($access = $db->fetch_array($query)) {
  235.                                 $member = ", <a href="admincp.php?action=access&uid=$access[uid]" target="_blank">$access[username]</a>";
  236.                                 $viewaccess .= $access['allowview'] ? $member : NULL;
  237.                                 $postaccess .= $access['allowpost'] ? $member : NULL;
  238.                                 $replyaccess .= $access['allowreply'] ? $member : NULL;
  239.                                 $getattachaccess .= $access['allowgetattach'] ? $member : NULL;
  240.                         }
  241.                         unset($member);

  242.                         $forum['description'] = str_replace('&lt;', '<', $forum['description']);
  243.                         $forum['description'] = str_replace('&gt;', '>', $forum['description']);

  244.                         showtype("$lang[forums_detail] - $forum[name]", 'top');
  245. //====背景音乐==by  http://lulu.e-168.cn==================
  246.                         
  247. showsetting('forums_edit_bgmusic', 'bgmusic', $forum['bgmusic'], 'radio');                        
  248. showsetting('forums_edit_bgmusicurl', 'bgmusicurl', $forum['bgmusicurl'], 'text');                        
  249. showsetting('forums_edit_bgmusicloop', 'bgmusicloop', $forum['bgmusicloop'], 'text');
  250.                         
  251. //====背景音乐======by lu5266=======================

  252.                         showsetting('forums_edit_display', 'statusnew', $forum['status'], 'radio');
  253.                         showsetting('forums_edit_up', '', '', $fupselect);
  254.                         showsetting('forums_edit_style', '', '', $styleselect);
  255.                         showsetting('forums_edit_name', 'namenew', $forum['name'], 'text');
  256.                         showsetting('forums_edit_icon', 'iconnew', $forum['icon'], 'text');
  257.                         showsetting('forums_edit_description', 'descriptionnew', $forum['description'], 'textarea');

  258.                         showtype('forums_edit_func');
  259.                         showsetting('forums_edit_html', 'allowhtmlnew', $forum['allowhtml'], 'radio');
  260.                         showsetting('forums_edit_bbcode', 'allowbbcodenew', $forum['allowbbcode'], 'radio');
  261.                         showsetting('forums_edit_imgcode', 'allowimgcodenew', $forum['allowimgcode'], 'radio');
  262.                         showsetting('forums_edit_smilies', 'allowsmiliesnew', $forum['allowsmilies'], 'radio');
  263.                         showsetting('forums_edit_postcredits', 'postcreditsnew', $forum['postcredits'], 'text');
  264.                         showsetting('forums_edit_replycredits', 'replycreditsnew', $forum['replycredits'], 'text');
  265.                         showsetting('forums_edit_postmoney', 'postmoneynew', $forum['postmoney'], 'text');
  266.                     showsetting('forums_edit_replymoney', 'replymoneynew', $forum['replymoney'], 'text');
  267.                     showsetting('forums_edit_deletedmoney', 'deletedmoneynew', $forum['deletedmoney'], 'text');
  268.                         showtype('forums_edit_perm');
  269.                         showsetting('forums_edit_perm_passwd', 'passwordnew', $forum['password'], 'text', '15%');
  270.                         echo '<tr><td colspan="2" height="1" bgcolor="'.ALTBG2.'"></td></tr>';

  271.                         showsetting('forums_edit_perm_view', '', '', str_replace('cdb_groupname', 'viewperm', $viewperm), '15%');
  272.                         echo '<td width="15%" bgcolor="'.ALTBG1.'">'.$lang['forums_edit_access_mask'].'</td><td bgcolor="'.ALTBG2.'">'.substr($viewaccess, 2).'</td></tr>';
  273.                         echo '<tr><td colspan="2" height="1" bgcolor="'.ALTBG2.'"></td></tr>';

  274.                         showsetting('forums_edit_perm_post', '', '', str_replace('cdb_groupname', 'postperm', $postperm), '15%');
  275.                         echo '<td width="15%" bgcolor="'.ALTBG1.'">'.$lang['forums_edit_access_mask'].'</td><td bgcolor="'.ALTBG2.'">'.substr($postaccess, 2).'</td></tr>';
  276.                         echo '<tr><td colspan="2" height="1" bgcolor="'.ALTBG2.'"></td></tr>';

  277.                         showsetting('forums_edit_perm_reply', '', '', str_replace('cdb_groupname', 'replyperm', $replyperm), '15%');
  278.                         echo '<td width="15%" bgcolor="'.ALTBG1.'">'.$lang['forums_edit_access_mask'].'</td><td bgcolor="'.ALTBG2.'">'.substr($replyaccess, 2).'</td></tr>';
  279.                         echo '<tr><td colspan="2" height="1" bgcolor="'.ALTBG2.'"></td></tr>';

  280.                         showsetting('forums_edit_perm_download', '', '', str_replace('cdb_groupname', 'getattachperm', $getattachperm), '15%');
  281.                         echo '<td width="15%" bgcolor="'.ALTBG1.'">'.$lang['forums_edit_access_mask'].'</td><td bgcolor="'.ALTBG2.'">'.substr($getattachaccess, 2).'</td></tr>';

  282.                         showtype('', 'bottom');

  283.                 }

  284.                 echo "<br><br><center><input type="hidden" name="detailsubmit" value="$lang[submit]"><input type="submit" name="detailsubmit" value="$lang[submit]"></form>";

  285.         } else {

  286.                 if($type == 'group') {

  287.                         if($namenew) {
  288.                                 if (strlen($namenew) > 255) cpmsg('forums_forum_name_toolong');
  289.                                 $db->query("UPDATE $table_forums SET name='$namenew' WHERE fid='$fid'");
  290.                                 updatecache('forums');
  291.                                 cpmsg('forums_edit_succeed');
  292.                         } else {
  293.                                 cpmsg('forums_edit_name_invalid');
  294.                         }
  295.                        
  296.                 } else {

  297.                         foreach($perms as $perm) {
  298.                                 if(is_array($$perm)) {
  299.                                         ${$perm.'new'} = "\t";
  300.                                         foreach($$perm as $groupid) {
  301.                                                 ${$perm.'new'} .= "\t$groupid";
  302.                                         }
  303.                                         ${$perm.'new'} .= "\t\t";
  304.                                 }
  305.                         }
  306.                        
  307.                         if (strlen($namenew) > 255) cpmsg('forums_forum_name_toolong');
  308.                         if (strlen($descriptionnew) > 255) cpmsg('forums_forum_description_toolong');
  309.                         $query = $db->query("SELECT type FROM $table_forums WHERE fid='$fupnew'");
  310.                         $fuptype = $db->result($query, 0);
  311.                         $typenew = $fuptype == 'forum' ? 'sub' : 'forum';
  312.                         $db->query("UPDATE $table_forums SET type='$typenew', status='$statusnew', bgmusic='$bgmusic',bgmusicurl='$bgmusicurl',bgmusicloop='$bgmusicloop',
  313. fup='$fupnew', name='$namenew', icon='$iconnew',
  314.                                 description='$descriptionnew', styleid='$styleidnew', allowhtml='$allowhtmlnew', allowbbcode='$allowbbcodenew',
  315.                                 allowimgcode='$allowimgcodenew', allowsmilies='$allowsmiliesnew', postcredits='".intval($postcreditsnew)."',postmoney='$postmoneynew', replymoney='$replymoneynew', deletedmoney='$deletedmoneynew',
  316.                                 replycredits='".intval($replycreditsnew)."', password='$passwordnew', viewperm='$viewpermnew',
  317.                                 postperm='$postpermnew', replyperm='$replypermnew', getattachperm='$getattachpermnew' WHERE fid='$fid'");
  318.                         if($type == 'forum' && $typenew == 'sub') {
  319.                                 $db->query("UPDATE $table_forums SET fup='$fupnew' WHERE  fup='$fid' && type='sub'");
  320.                         }

  321.                         updatecache('forums');
  322.                         cpmsg('forums_edit_succeed', 'admincp.php?action=forumsedit');
  323.                 }

  324.         }

  325. } elseif($action == 'forumdelete') {

  326.         $query = $db->query("SELECT COUNT(*) FROM $table_forums WHERE fup='$fid'");
  327.         if($db->result($query, 0)) {
  328.                 cpmsg('forums_delete_sub_notnull');
  329.         }

  330.         if(!$confirmed) {
  331.                 cpmsg('forums_delete_confirm', "admincp.php?action=forumdelete&fid=$fid", 'form');
  332.         } else {
  333.                 require DISCUZ_ROOT.'./include/post.php';

  334.                 $query = $db->query("SELECT pid FROM $table_posts WHERE aid<>'0' AND fid='$fid'");
  335.                 $aid = $comma = '';
  336.                 while($post = $db->fetch_array($query)) {
  337.                         $aid .= "$comma'$post[aid]'";
  338.                         $comma = ',';
  339.                 }

  340.                 if($aid) {
  341.                         $query = $db->query("SELECT filename FROM $table_attachments WHERE aid IN ($aid)");
  342.                         while($attach = $db->fetch_array($query)) {
  343.                                 @unlink(DISCUZ_ROOT."./$attachdir/$attach[filename]");
  344.                         }
  345.                         $db->query("DELETE FROM $table_attachments WHERE aid IN ($aid)");
  346.                 }

  347.                 $db->query("DELETE FROM $table_threads WHERE fid='$fid'");
  348.                 $db->query("DELETE FROM $table_posts WHERE fid='$fid'");
  349.                 $db->query("DELETE FROM $table_forums WHERE fid='$fid'");
  350.                 $db->query("DELETE FROM $table_access WHERE fid='$fid'");

  351.                 updatecache('forums');
  352.                 cpmsg('forums_delete_succeed', 'admincp.php?action=forumsedit');
  353.         }

  354. }

  355. ?>
复制代码
回复

使用道具 举报

 楼主| lu5266 发表于 2005-9-19 13:52:11 | 显示全部楼层
原帖由 lhj8000 于 2005-9-19 08:49 发表
麻烦楼主帮忙看一下!!


/*
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [DISCUZ!]  Crossday Discuz! Board                                    : ...



试试
这个:


  1. <?php

  2. /*
  3. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  4. :: [DISCUZ!]  Crossday Discuz! Board                                    ::
  5. :: (c) 2001-2005 Comsenz Technology Ltd (www.discuz.com)                ::
  6. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  7. :: Author:  Crossday (tech@discuz.com) Cnteacher (cnteacher@discuz.com) ::
  8. :: Version: 2.5F   2004/10/01 05:15                                     ::
  9. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  10. */
  11. //fix:  BY pk0909
  12. /*
  13. 1 子论坛的子论坛问题
  14. 2 板块简介和名字长度问题
  15. */

  16. if(!defined('IN_ADMINCP')) {
  17.         exit('Access Denied');
  18. }

  19. cpheader();

  20. if($action == 'forumadd') {

  21.         if((!submitcheck('catsubmit') && !submitcheck('forumsubmit'))) {
  22.                 $groupselect = $forumselect = "<select name="fup">\n<option value="0" selected="selected"> - $lang[none] - </option>\n";
  23.                 $query = $db->query("SELECT fid, name, type FROM $table_forums WHERE type<>'sub' ORDER BY displayorder");
  24.                 while($fup = $db->fetch_array($query)) {
  25.                         if($fup['type'] == 'group') {
  26.                                 $groupselect .= "<option value="$fup[fid]">$fup[name]</option>\n";
  27.                         } else {
  28.                                 $forumselect .= "<option value="$fup[fid]">$fup[name]</option>\n";
  29.                         }
  30.                 }
  31.                 $groupselect .= '</select>';
  32.                 $forumselect .= '</select>';
  33.                 include CP_TPL.'forums_add.php';

  34.         } elseif(submitcheck('catsubmit')) {
  35.                 if (strlen($newcat) > 255) cpmsg('forums_forum_name_toolong');
  36.                 $db->query("INSERT INTO $table_forums (type, name, status)
  37.                         VALUES ('group', '$newcat', '1')");

  38.                 updatecache('forums');
  39.                 cpmsg('forums_new_cat_succeed', 'admincp.php?action=forumsedit');
  40.         } elseif(submitcheck('forumsubmit')) {
  41.                 if (strlen($newforum) > 255) cpmsg('forums_forum_name_toolong');
  42.                 $query = $db->query("SELECT type FROM $table_forums WHERE fid='$fup'");
  43.                 $type = $db->result($query, 0) == "forum" ? "sub" : "forum";
  44.                 $db->query("INSERT INTO $table_forums (fup, type, name, status, allowsmilies, allowbbcode, allowimgcode)
  45.                         VALUES ('$fup', '$type', '$newforum', '1', '1', '1', '1')");

  46.                 updatecache('forums');
  47.                 cpmsg('forums_new_forum_succeed', 'admincp.php?action=forumsedit');
  48.         }               

  49. } elseif($action == 'forumsedit') {

  50.         if(!submitcheck('editsubmit')) {

  51. ?>
  52. <table cellspacing="0" cellpadding="0" border="0" width="<?=TABLEWIDTH?>" align="center">
  53. <tr><td bgcolor="<?=BORDERCOLOR?>">

  54. <table border="0" cellspacing="<?=BORDERWIDTH?>" cellpadding="<?=TABLESPACE?>" width="100%">
  55. <tr class="header"><td><?=$lang['forums_edit']?></td></tr>
  56. <tr><td bgcolor="<?=ALTBG1?>"><br>
  57. <form method="post" action="admincp.php?action=forumsedit">
  58. <input type="hidden" name="formhash" value="<?=FORMHASH?>">
  59. <?

  60.                 $modsorig = $comma = '';
  61.                 $query = $db->query("SELECT fid, type, status, name, fup, displayorder, moderator FROM $table_forums ORDER BY displayorder");
  62.                 while($forum = $db->fetch_array($query)) {
  63.                         $forums[] = $forum;
  64.                         $modsorig .= $comma.$forum['moderator'];
  65.                         $comma = ',';
  66.                 }

  67.                 for($i = 0; $i < count($forums); $i++) {
  68.                         if($forums[$i]['type'] == 'group') {
  69.                                 echo '<ul>';
  70.                                 showforum($forums[$i], 1, 'group');
  71.                                 for($j = 0; $j < count($forums); $j++) {
  72.                                         if($forums[$j]['fup'] == $forums[$i]['fid'] && $forums[$j]['type'] == 'forum') {
  73.                                                 echo '<ul>';
  74.                                                 showforum($forums[$j], 2);
  75.                                                 for($k = 0; $k < count($forums); $k++) {
  76.                                                         if($forums[$k]['fup'] == $forums[$j]['fid'] && $forums[$k]['type'] == 'sub') {
  77.                                                                 echo '<ul>';
  78.                                                                 showforum($forums[$k], 3, 'sub');
  79.                                                                 echo '</ul>';
  80.                                                         }
  81.                                                 }
  82.                                                 echo '</ul>';
  83.                                         }
  84.                                 }
  85.                                 echo '</ul>';
  86.                         } elseif(!$forums[$i]['fup'] && $forums[$i]['type'] == 'forum') {
  87.                                 echo '<ul>';
  88.                                 showforum($forums[$i], 1);
  89.                                 for($j = 0; $j < count($forums); $j++) {
  90.                                         if($forums[$j]['fup'] == $forums[$i]['fid'] && $forums[$j]['type'] == 'sub') {
  91.                                                 echo '<ul>';
  92.                                                 showforum($forums[$j], 2, 'sub');
  93.                                                 echo '</ul>';
  94.                                         }
  95.                                 }
  96.                                 echo '</ul>';
  97.                         }
  98.                 }
  99.                 echo "<input type="hidden" name="modsorig" value="$modsorig"><br><center>\n".
  100.                         "<input type="submit" name="editsubmit" value="$lang[submit]"></center><br></td></tr></table></td></tr></table>\n";

  101.         } else {

  102.                 // read from groups
  103.                 $usergroups = array();
  104.                 $query = $db->query("SELECT groupid, type, creditshigher, creditslower FROM $table_usergroups");
  105.                 while($group = $db->fetch_array($query)) {
  106.                         $usergroups[$group['groupid']] = $group;
  107.                 }

  108.                 if(is_array($order)) {
  109.                         $modlist = $comma = '';
  110.                         foreach($order as $fid => $value) {
  111.                                 if($moderator[$fid]) {
  112.                                         $modlist .= $comma.$moderator[$fid];
  113.                                         $comma = ',';
  114.                                 }
  115.                                 $moderator[$fid] = str_replace(',', ', ', str_replace(' ', '', $moderator[$fid]));
  116.                                 $db->query("UPDATE $table_forums SET moderator='$moderator[$fid]', displayorder='$order[$fid]' WHERE fid='$fid'");
  117.                         }
  118.                 }

  119.                 $modsorig = "'".str_replace(',', "','", str_replace(' ', '', $modsorig))."'";
  120.                 $modlist = "'".str_replace(',', "','", str_replace(' ', '', $modlist))."'";

  121.                 $member_groups = '0';
  122.                 $query = $db->query("SELECT groupid FROM $table_usergroups WHERE type='member'");
  123.                 while ($tmp = $db->fetch_array($query)) {
  124.                         $member_groups .= ",$tmp[groupid]";
  125.                 }
  126.                 $db->query("UPDATE $table_members SET groupid='3' WHERE username IN ($modlist) AND groupid IN ($member_groups)");
  127.                 $db->query("UPDATE $table_members SET adminid='3' WHERE username IN ($modlist) AND adminid = 0");


  128.                 $query = $db->query("SELECT uid, adminid, groupid, credit FROM $table_members WHERE username IN ($modsorig) AND username NOT IN ($modlist) AND adminid NOT IN (1,2)");

  129.                 while($member = $db->fetch_array($query)) {
  130.                         if($usergroups[$member['groupid']]['type'] == 'special') {
  131.                                 $adminidnew = -1;
  132.                                 $groupidnew = $member['groupid'];
  133.                         } else {
  134.                                 $adminidnew = $member['adminid'] == 3 ? 0 : $member['adminid'];
  135.                                 foreach($usergroups as $group) {
  136.                                         if($group['type'] == 'member' && $member['credit'] >= $group['creditshigher'] && $member['credit'] < $group['creditslower']) {
  137.                                                 $groupidnew = $group['groupid'];
  138.                                                 break;
  139.                                         }
  140.                                 }
  141.                         }
  142.                         $db->query("UPDATE $table_members SET adminid='$adminidnew', groupid='$groupidnew' WHERE uid='$member[uid]'");
  143.                 }

  144.                 updatecache('forums');
  145.                 cpmsg('forums_updated_succeed', 'admincp.php?action=forumsedit');
  146.         }

  147. } elseif($action == 'forumsmerge') {

  148.         if(!submitcheck('mergesubmit') || $source == $target || !$source || !$target) {
  149.                 $forumselect = "<option value="0" selected="selected"> - $lang[none] - </option>\n";
  150.                 $query = $db->query("SELECT fid, name FROM $table_forums WHERE type<>'group' ORDER BY displayorder");
  151.                 while($forum = $db->fetch_array($query)) {
  152.                         $forumselect .= "<option value="$forum[fid]">$forum[name]</option>\n";
  153.                 }
  154.                 include CP_TPL.'forums_merge.php';
  155.         } else {

  156.                 $query = $db->query("SELECT COUNT(*) FROM $table_forums WHERE fup='$source'");
  157.                 if($db->result($query, 0)) {
  158.                         cpmsg('forums_merge_source_sub_notnull');
  159.                 }

  160.                 $db->query("UPDATE $table_threads SET fid='$target' WHERE fid='$source'");
  161.                 $db->query("UPDATE $table_posts SET fid='$target' WHERE fid='$source'");

  162.                 $query = $db->query("SELECT threads, posts FROM $table_forums WHERE fid='$source'");
  163.                 $sourceforum = $db->fetch_array($query);
  164.                 $db->query("UPDATE $table_forums SET threads=threads+$sourceforum[threads], posts=posts+$sourceforum[posts] WHERE fid='$target'");
  165.                 $db->query("DELETE FROM $table_forums WHERE fid='$source'");

  166.                 $query = $db->query("SELECT * FROM $table_access WHERE fid='$source'");
  167.                 while($access = $db->fetch_array($query)) {
  168.                         $db->query("INSERT INTO $table_access (uid, fid, allowview, allowpost, allowreply, allowgetattach)
  169.                                 VALUES ('$access[uid]', '$target', '$access[allowview]', '$access[allowpost]', '$access[allowreply]', '$access[allowgetattach]')", 'SILENT');
  170.                 }
  171.                 $db->query("DELETE FROM $table_access WHERE fid='$source'");

  172.                 updatecache('forums');
  173.                 cpmsg('forums_merge_succeed', 'admincp.php?action=forumsedit');
  174.         }

  175. } elseif($action == 'forumdetail') {

  176.         $perms = array('viewperm', 'postperm', 'replyperm', 'getattachperm');

  177.         if(!submitcheck('detailsubmit')) {

  178.                 $query = $db->query("SELECT * FROM $table_forums WHERE fid='$fid'");
  179.                 $forum = $db->fetch_array($query);
  180.                 $forum['name'] = dhtmlspecialchars($forum['name']);

  181. ?>
  182. <br><form method="post" action="admincp.php?action=forumdetail&fid=<?=$fid?>">
  183. <input type="hidden" name="formhash" value="<?=FORMHASH?>">
  184. <input type="hidden" name="type" value="<?=$forum['type']?>">
  185. <?

  186.                 if($forum['type'] == 'group') {

  187.                         showtype("$lang[forums_cat_detail] - $forum[name]", 'top');
  188.                         showsetting('forums_cat_name', 'namenew', $forum['name'], 'text');
  189.                         showtype('', 'bottom');

  190.                 } else {

  191. ?>
  192. <table cellspacing="0" cellpadding="0" border="0" width="90%" align="center">
  193. <tr><td bgcolor="<?=BORDERCOLOR?>">
  194. <table border="0" cellspacing="<?=BORDERWIDTH?>" cellpadding="<?=TABLESPACE?>" width="100%">
  195. <tr class="header"><td><?=$lang['tips']?></td></tr>
  196. <tr bgcolor="<?=ALTBG1?>"><td>
  197. <br><?=$lang['forums_edit_tips']?>
  198. </td></tr></table></td></tr></table><br><br>
  199. <?

  200.                         $fupselect = "<select name="fupnew">\n<option value="0" ".(!$forum[fup] ? "selected="selected"" : NULL)."> - $lang[none] - </option>\n";
  201.                         $query = $db->query("SELECT fid, name FROM $table_forums WHERE fid<>'$fid' AND type<>'sub' ORDER BY displayorder");
  202.                         while($fup = $db->fetch_array($query)) {
  203.                                 $selected = $fup['fid'] == $forum['fup'] ? "selected="selected"" : NULL;
  204.                                 $fupselect .= "<option value="$fup[fid]" $selected>$fup[name]</option>\n";
  205.                         }
  206.                         $fupselect .= '</select>';
  207.                         $query = $db->query("SELECT groupid, grouptitle FROM $table_usergroups");
  208.                         while($group = $db->fetch_array($query)) {
  209.                                 $groups[] = $group;
  210.                         }

  211.                         $styleselect = "<select name="styleidnew"><option value="0">$lang[default]</option>";
  212.                         $query = $db->query("SELECT styleid, name FROM $table_styles");
  213.                         while($style = $db->fetch_array($query)) {
  214.                                 $styleselect .= "<option value="$style[styleid]" ".
  215.                                         ($style['styleid'] == $forum['styleid'] ? 'selected="selected"' : NULL).
  216.                                         ">$style[name]</option>\n";
  217.                         }
  218.                         $styleselect .= '</select>';

  219.                         foreach($perms as $perm) {
  220.                                 $num = -1;
  221.                                 $$perm = "<table cellspacing="0" cellpadding="0" border="0" width="100%" align="center"><tr>";
  222.                                 foreach($groups as $group) {
  223.                                         $num++;
  224.                                         if($num && $num % 4 == 0) {
  225.                                                 $$perm .= "</tr><tr>";
  226.                                         }
  227.                                         $checked = strstr($forum[$perm], "\t$group[groupid]\t") ? 'checked' : NULL;
  228.                                         $$perm .= "<td><input type="checkbox" name="{$perm}[]" value="$group[groupid]" $checked> $group[grouptitle]</td>\n";
  229.                                 }
  230.                                 $$perm .= '</tr></table>';
  231.                         }

  232.                         $viewaccess = $postaccess = $replyaccess = $getattachaccess = '';

  233.                         $query = $db->query("SELECT m.username, a.* FROM $table_access a LEFT JOIN $table_members m USING (uid) WHERE fid='$fid'");
  234.                         while($access = $db->fetch_array($query)) {
  235.                                 $member = ", <a href="admincp.php?action=access&uid=$access[uid]" target="_blank">$access[username]</a>";
  236.                                 $viewaccess .= $access['allowview'] ? $member : NULL;
  237.                                 $postaccess .= $access['allowpost'] ? $member : NULL;
  238.                                 $replyaccess .= $access['allowreply'] ? $member : NULL;
  239.                                 $getattachaccess .= $access['allowgetattach'] ? $member : NULL;
  240.                         }
  241.                         unset($member);

  242.                         $forum['description'] = str_replace('&lt;', '<', $forum['description']);
  243.                         $forum['description'] = str_replace('&gt;', '>', $forum['description']);

  244.                         showtype("$lang[forums_detail] - $forum[name]", 'top');
  245.                         //====背景音乐==by  http://lulu.e-168.cn==================
  246.                         
  247.                          showsetting('forums_edit_bgmusic', 'bgmusic', $forum['bgmusic'], 'radio');                        
  248.                          showsetting('forums_edit_bgmusicurl', 'bgmusicurl', $forum['bgmusicurl'], 'text');                        
  249.                          showsetting('forums_edit_bgmusicloop', 'bgmusicloop', $forum['bgmusicloop'], 'text');
  250.                         
  251.                         //====背景音乐======by lu5266=======================

  252.                         showsetting('forums_edit_display', 'statusnew', $forum['status'], 'radio');
  253.                         showsetting('forums_edit_up', '', '', $fupselect);
  254.                         showsetting('forums_edit_style', '', '', $styleselect);
  255.                         showsetting('forums_edit_name', 'namenew', $forum['name'], 'text');
  256.                         showsetting('forums_edit_icon', 'iconnew', $forum['icon'], 'text');
  257.                         showsetting('forums_edit_description', 'descriptionnew', $forum['description'], 'textarea');

  258.                         showtype('forums_edit_func');
  259.                         showsetting('forums_edit_html', 'allowhtmlnew', $forum['allowhtml'], 'radio');
  260.                         showsetting('forums_edit_bbcode', 'allowbbcodenew', $forum['allowbbcode'], 'radio');
  261.                         showsetting('forums_edit_imgcode', 'allowimgcodenew', $forum['allowimgcode'], 'radio');
  262.                         showsetting('forums_edit_smilies', 'allowsmiliesnew', $forum['allowsmilies'], 'radio');
  263.                         showsetting('forums_edit_postcredits', 'postcreditsnew', $forum['postcredits'], 'text');
  264.                         showsetting('forums_edit_replycredits', 'replycreditsnew', $forum['replycredits'], 'text');
  265.                         showsetting('forums_edit_postmoney', 'postmoneynew', $forum['postmoney'], 'text');
  266.                     showsetting('forums_edit_replymoney', 'replymoneynew', $forum['replymoney'], 'text');
  267.                     showsetting('forums_edit_deletedmoney', 'deletedmoneynew', $forum['deletedmoney'], 'text');
  268.                         showtype('forums_edit_perm');
  269.                         showsetting('forums_edit_perm_passwd', 'passwordnew', $forum['password'], 'text', '15%');
  270.                         echo '<tr><td colspan="2" height="1" bgcolor="'.ALTBG2.'"></td></tr>';

  271.                         showsetting('forums_edit_perm_view', '', '', str_replace('cdb_groupname', 'viewperm', $viewperm), '15%');
  272.                         echo '<td width="15%" bgcolor="'.ALTBG1.'">'.$lang['forums_edit_access_mask'].'</td><td bgcolor="'.ALTBG2.'">'.substr($viewaccess, 2).'</td></tr>';
  273.                         echo '<tr><td colspan="2" height="1" bgcolor="'.ALTBG2.'"></td></tr>';

  274.                         showsetting('forums_edit_perm_post', '', '', str_replace('cdb_groupname', 'postperm', $postperm), '15%');
  275.                         echo '<td width="15%" bgcolor="'.ALTBG1.'">'.$lang['forums_edit_access_mask'].'</td><td bgcolor="'.ALTBG2.'">'.substr($postaccess, 2).'</td></tr>';
  276.                         echo '<tr><td colspan="2" height="1" bgcolor="'.ALTBG2.'"></td></tr>';

  277.                         showsetting('forums_edit_perm_reply', '', '', str_replace('cdb_groupname', 'replyperm', $replyperm), '15%');
  278.                         echo '<td width="15%" bgcolor="'.ALTBG1.'">'.$lang['forums_edit_access_mask'].'</td><td bgcolor="'.ALTBG2.'">'.substr($replyaccess, 2).'</td></tr>';
  279.                         echo '<tr><td colspan="2" height="1" bgcolor="'.ALTBG2.'"></td></tr>';

  280.                         showsetting('forums_edit_perm_download', '', '', str_replace('cdb_groupname', 'getattachperm', $getattachperm), '15%');
  281.                         echo '<td width="15%" bgcolor="'.ALTBG1.'">'.$lang['forums_edit_access_mask'].'</td><td bgcolor="'.ALTBG2.'">'.substr($getattachaccess, 2).'</td></tr>';

  282.                         showtype('', 'bottom');

  283.                 }

  284.                 echo "<br><br><center><input type="hidden" name="detailsubmit" value="$lang[submit]"><input type="submit" name="detailsubmit" value="$lang[submit]"></form>";

  285.         } else {

  286.                 if($type == 'group') {

  287.                         if($namenew) {
  288.                                 if (strlen($namenew) > 255) cpmsg('forums_forum_name_toolong');
  289.                                 $db->query("UPDATE $table_forums SET name='$namenew' WHERE fid='$fid'");
  290.                                 updatecache('forums');
  291.                                 cpmsg('forums_edit_succeed');
  292.                         } else {
  293.                                 cpmsg('forums_edit_name_invalid');
  294.                         }
  295.                         
  296.                 } else {

  297.                         foreach($perms as $perm) {
  298.                                 if(is_array($$perm)) {
  299.                                         ${$perm.'new'} = "\t";
  300.                                         foreach($$perm as $groupid) {
  301.                                                 ${$perm.'new'} .= "\t$groupid";
  302.                                         }
  303.                                         ${$perm.'new'} .= "\t\t";
  304.                                 }
  305.                         }
  306.                         
  307.                         if (strlen($namenew) > 255) cpmsg('forums_forum_name_toolong');
  308.                         if (strlen($descriptionnew) > 255) cpmsg('forums_forum_description_toolong');
  309.                         $query = $db->query("SELECT type FROM $table_forums WHERE fid='$fupnew'");
  310.                         $fuptype = $db->result($query, 0);
  311.                         $typenew = $fuptype == 'forum' ? 'sub' : 'forum';
  312.                         $db->query("UPDATE $table_forums SET type='$typenew', status='$statusnew', bgmusic='$bgmusic',bgmusicurl='$bgmusicurl',bgmusicloop='$bgmusicloop',fup='$fupnew', name='$namenew', icon='$iconnew',
  313.                                 description='$descriptionnew', styleid='$styleidnew', allowhtml='$allowhtmlnew', allowbbcode='$allowbbcodenew',
  314.                                 allowimgcode='$allowimgcodenew', allowsmilies='$allowsmiliesnew', postcredits='".intval($postcreditsnew)."',postmoney='$postmoneynew', replymoney='$replymoneynew', deletedmoney='$deletedmoneynew',
  315.                                 replycredits='".intval($replycreditsnew)."', password='$passwordnew', viewperm='$viewpermnew',
  316.                                 postperm='$postpermnew', replyperm='$replypermnew', getattachperm='$getattachpermnew' WHERE fid='$fid'");
  317.                         if($type == 'forum' && $typenew == 'sub') {
  318.                                 $db->query("UPDATE $table_forums SET fup='$fupnew' WHERE  fup='$fid' && type='sub'");
  319.                         }

  320.                         updatecache('forums');
  321.                         cpmsg('forums_edit_succeed', 'admincp.php?action=forumsedit');
  322.                 }

  323.         }

  324. } elseif($action == 'forumdelete') {

  325.         $query = $db->query("SELECT COUNT(*) FROM $table_forums WHERE fup='$fid'");
  326.         if($db->result($query, 0)) {
  327.                 cpmsg('forums_delete_sub_notnull');
  328.         }

  329.         if(!$confirmed) {
  330.                 cpmsg('forums_delete_confirm', "admincp.php?action=forumdelete&fid=$fid", 'form');
  331.         } else {
  332.                 require DISCUZ_ROOT.'./include/post.php';

  333.                 $query = $db->query("SELECT pid FROM $table_posts WHERE aid<>'0' AND fid='$fid'");
  334.                 $aid = $comma = '';
  335.                 while($post = $db->fetch_array($query)) {
  336.                         $aid .= "$comma'$post[aid]'";
  337.                         $comma = ',';
  338.                 }

  339.                 if($aid) {
  340.                         $query = $db->query("SELECT filename FROM $table_attachments WHERE aid IN ($aid)");
  341.                         while($attach = $db->fetch_array($query)) {
  342.                                 @unlink(DISCUZ_ROOT."./$attachdir/$attach[filename]");
  343.                         }
  344.                         $db->query("DELETE FROM $table_attachments WHERE aid IN ($aid)");
  345.                 }

  346.                 $db->query("DELETE FROM $table_threads WHERE fid='$fid'");
  347.                 $db->query("DELETE FROM $table_posts WHERE fid='$fid'");
  348.                 $db->query("DELETE FROM $table_forums WHERE fid='$fid'");
  349.                 $db->query("DELETE FROM $table_access WHERE fid='$fid'");

  350.                 updatecache('forums');
  351.                 cpmsg('forums_delete_succeed', 'admincp.php?action=forumsedit');
  352.         }

  353. }

  354. ?>
复制代码
回复

使用道具 举报

lhj8000 发表于 2005-9-20 11:35:20 | 显示全部楼层
首先要感谢一下楼主滴 用了楼主这个文件 哈哈原来的问题解决了!
不过又出现了新的问题 估计这个问题是和本插件有关咯,还要麻烦楼主一下了!!
再谢一下哈!

  1. Discuz! info: MySQL Query Error

  2. User: lhj800
  3. Time: 2005-9-20 7:22pm
  4. Script: /admincp.php

  5. SQL: UPDATE cdb_forums SET type='forum', status='1', bgmusic='1',bgmusicurl='http://211.64.201.201/UploadFile/youth_2005615175333.mp3',bgmusicloop='-1',fup='10', name='酷乐推荐', icon='',
  6. description='', styleid='0', allowhtml='0', allowbbcode='1',
  7. allowimgcode='1', allowsmilies='1', postcredits='-1',postmoney='-1', replymoney='-1', deletedmoney='-1',
  8. replycredits='-1', password='', viewperm='',
  9. postperm='', replyperm='', getattachperm='' WHERE fid='13'
  10. Error: Unknown column 'bgmusic' in 'field list'
  11. [color=Red]程序文件跟数据库有冲突,请使用正确的程序文件上传上去覆盖[/color]

  12. Similar error report has beed dispatched to administrator before.

复制代码

[ 本帖最后由 lhj8000 于 2005-9-20 11:39 编辑 ]
回复

使用道具 举报

 楼主| lu5266 发表于 2005-9-20 19:36:55 | 显示全部楼层
原帖由 lhj8000 于 2005-9-20 11:35 发表
首先要感谢一下楼主滴 用了楼主这个文件 哈哈原来的问题解决了!
不过又出现了新的问题 估计这个问题是和本插件有关咯,还要麻烦楼主一下了!!
再谢一下哈!
[code]
Discuz! info: MySQL Query Error

Use ...

Unknown column 'bgmusic' in 'field list'



一楼的数据库代码
你升级了没??
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-5-2 11:27 , Processed in 0.134340 second(s), 15 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表