原帖由 oytktk 于 2005-11-20 10:55 发表
可能是你的安装时没有把FID==8改为你那个音乐版的FID值...我去你那注册了帐号但是进不了那个音乐版...
---------------------------------------------------------
音乐天堂 的网址 http://bbs.jinlunhotel.cn/forumdisplay.php?fid=89
代表
FID==89
--------------------------------------------------------------
修改过程中所有的 $fid == 8 中的 8 改为你的音乐版FID.(也就是89)
-----------------------------------------------------------------
include/newthread.php
修改如下:
- <?php
- /*
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: [DISCUZ!] Crossday Discuz! Board ::
- :: (c) 2001-2005 Comsenz Technology Ltd (www.discuz.com) ::
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: Author: Crossday (tech@discuz.com) Cnteacher (cnteacher@discuz.com) ::
- :: Version: 2.5F 2004/10/01 05:15 ::
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- */
- if(!defined('IN_DISCUZ')) {
- exit('Access Denied');
- }
- $discuz_action = 11;
- $readonly = $fid == 89 ? "readonly" : NULL;
- if(empty($forum['fid']) || $forum['type'] == 'group') {
- showmessage('forum_nonexistence');
- }
- if(!$discuz_uid && !((!$forum['postperm'] && $allowpost) || ($forum['postperm'] && strstr($forum['postperm'], "\t$groupid\t")))) {
- header('Location: logging.php?action=login&referer='.rawurlencode("$PHP_SELF?action=$action&fid=$fid&poll=$poll"));
- exit();
- } elseif(!$forum['allowpost']) {
- if(!$forum['postperm'] && !$allowpost) {
- showmessage('group_nopermission', NULL, 'HALTED');
- } elseif($forum['postperm'] && !strstr($forum['postperm'], "\t$groupid\t")) {
- showmessage('post_forum_newthread_nopermission', NULL, 'HALTED');
- }
- }
- if(!submitcheck('topicsubmit')) {
- if(is_array($_DCACHE['icons'])) {
- foreach($_DCACHE['icons'] as $id => $icon) {
- $icons .= ' <input type="radio" name="iconid" value="'.$id.'"><img src="'.SMDIR.'/'.$icon.'">';
- $icons .= !(++$key % 9) ? '<br>' : NULL;
- }
- }
-
- $multiattach = $allowpostattach && $attach_newpost ? array_fill(1,$attach_newpost,'1'):0;
- include template('post_newthread');
- } else {
- //===========板块禁言检查begin========
- if (!$ismoderator) {
- if (!postban_check($forum[fid], $discuz_user)) showmessage('你在本板块被禁言,不能发贴和编辑');
- }
- //===========板块禁言检查end==========
- if($readonly && ($mp3_name == '' || $mp3_artist == '' || $mp3_url == '' || $mp3_m_r == '')) {
- showmessage("对不起, 您没有输入音乐必选参数!");
- }
- if(!$subject || !$message) {
- showmessage('post_sm_isnull');
- }
- $date = gmdate("m-d", $timestamp + $timeoffset * 3600);
- $subject = "[".$date."] ".$subject;
- if($post_invalid = checkpost()) {
- showmessage($post_invalid);
- }
- if(checkflood()) {
- showmessage('post_flood_ctrl');
- }
- $displayorder = ($ismoderator && $toptopic) ? 1 : 0;
- $digest = ($ismoderator && $addtodigest) ? 1 : 0;
- $viewperm = $allowsetviewperm ? $viewperm : 0;
- if($poll == 'yes' && $allowpostpoll && trim($polloptions)) {
- $poll = 1;
- $pollarray = array();
- $polloptions = explode("\n", $polloptions);
- if(count($polloptions) > $maxpolloptions) {
- showmessage('post_poll_option_toomany');
- }
- foreach($polloptions as $polloption) {
- $polloption = trim($polloption);
- if($polloption) {
- $pollarray['options'][] = array($polloption, 0);
- }
- }
- $pollarray['multiple'] = $multiplepoll;
- $pollarray['voters'] = array();
- $pollopts = addslashes(serialize($pollarray));
- } else {
- $poll = 0;
- $pollopts = '';
- }
- $paid = $last_attach_type = $aid = $tmark ='';
- $post_attaches = array();
- if ($allowpostattach){
- $post_attaches = attach_upload();
- if(is_array($post_attaches) && count($post_attaches)) {
- foreach( $post_attaches as $v) {
- $db->query("INSERT INTO $table_attachments (uid, creditsrequire, filename, filetype, filesize, attachment, dateline, downloads)
- VALUES ('$discuz_uid', '$v[creditsrequire]', '$v[filename]', '$v[filetype]', '$v[filesize]', '$v[attachment]', '$timestamp','0')");
- $v['aid'] = $db->insert_id();
- $aid .= $tmark.''.$v['aid'];
- $tmark = ' ,';
- $last_attach_type = strtolower(fileext($v['filename']))."\t".$v['filetype'];
- $paid ++;
- }
- }
- }
- unset($post_attaches);
- $db->query("INSERT INTO $table_threads (fid, creditsrequire, iconid, author, authorid, subject, dateline, lastpost, lastposter, displayorder, digest, poll, mp3_type, attachment)
- VALUES ('$fid', '$viewperm', '$iconid', '$discuz_user', '$discuz_uid', '$subject', '$timestamp', '$timestamp', '$discuz_user', '$displayorder', '$digest', '$poll', '$mp3_m_r', '".attachtype($last_attach_type, 'id')."')");
- $tid = $db->insert_id();
- if($poll) {
- $db->query("INSERT INTO $table_polls (tid, pollopts)
- VALUES ('$tid', '$pollopts')");
- }
- //发贴加钱开始
- if($bankstatus>=0) {
- $postmoney = 2; //发表主题奖励的钱数,可自己修改
- updatemoney('+', $discuz_uid, $postmoney);
- }
- //发贴加钱结束
- $bbcodeoff = checkbbcodes($message, $bbcodeoff);
- $smileyoff = checksmilies($message, $smileyoff);
- $db->query("INSERT INTO $table_posts (fid, tid, aid, author, authorid, subject, dateline, message, useip, usesig, bbcodeoff, mp3_url, smileyoff, parseurloff)
- VALUES ('$fid', '$tid', '$paid', '$discuz_user', '$discuz_uid', '$subject', '$timestamp', '$message', '$onlineip', '$usesig', '$bbcodeoff', '$mp3_url', '$smileyoff', '$parseurloff')");
- $pid = $db->insert_id();
- if($aid) {
- $db->query("UPDATE $table_attachments SET tid='$tid', pid='$pid' WHERE aid in ($aid)", 'UNBUFFERED');
- }
- updatemember('+', $discuz_uid, $postcredits);
- $db->query("UPDATE $table_members SET money=money+1 where uid='$discuz_uid'");
- $db->query("UPDATE $table_forums SET lastpost='$subject\t$timestamp\t$discuz_user', threads=threads+1, posts=posts+1 WHERE fid='$fid'", 'UNBUFFERED');
- if($emailnotify && $discuz_uid) {
- $query = $db->query("SELECT tid FROM $table_subscriptions WHERE uid='$discuz_uid' AND tid='$tid'");
- if(!$db->result($query, 0)) {
- $db->query("INSERT INTO $table_subscriptions (uid, email, tid)
- VALUES ('$discuz_uid', '$email', '$tid')", 'UNBUFFERED');
- }
- }
- $db->query("UPDATE cdb_mypetdata SET mypetexp= mypetexp+60 WHERE username='$discuz_user' and mypetdead <1 and openpk<2");
- showmessage('post_newthread_succeed', "viewthread.php?tid=$tid");
- }
- ?>
复制代码
-------------------------------------
include/editpost.php
-------------------
修改如下:
- <?
- /*
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: [DISCUZ!] Crossday Discuz! Board ::
- :: (c) 2001-2005 Comsenz Technology Ltd (www.discuz.com) ::
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: Author: Crossday (tech@discuz.com) Cnteacher (cnteacher@discuz.com) ::
- :: Version: 2.5F 2004/10/01 05:15 ::
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- */
- if(!defined('IN_DISCUZ')) {
- exit('Access Denied');
- }
- $discuz_action = 13;
- $readonly = $fid == 89 ? "readonly" : NULL;
- $query = $db->query("SELECT pid FROM $table_posts WHERE tid='$tid' ORDER BY dateline LIMIT 1");
- $isfirstpost = $db->result($query, 0) == $pid ? 1 : 0;
- $query = $db->query("SELECT m.adminid, p.authorid, p.dateline, p.aid, p.dateline FROM $table_posts p LEFT JOIN $table_members m ON m.uid=p.authorid WHERE pid='$pid' AND tid='$tid' AND fid='$fid'");
- $orig = $db->fetch_array($query);
- $isorigauthor = $discuz_uid && $discuz_uid == $orig['authorid'];
- $alloweditpost = $alloweditpost && !(in_array($orig['adminid'], array(1, 2, 3)) && $adminid > $orig['adminid']) ? 1 : 0;
- if((!$ismoderator || !$alloweditpost) && !$isorigauthor) {
- showmessage('post_edit_nopermission', NULL, 'HALTED');
- }
- if(!submitcheck('editsubmit')) {
- if(is_array($_DCACHE['icons']) && $isfirstpost) {
- foreach($_DCACHE['icons'] as $id => $icon) {
- $icons .= ' <input type="radio" name="iconid" value="'.$id.'" '.($thread['iconid'] == $id ? 'checked' : NULL).'><img src="'.SMDIR.'/'.$icon.'">';
- $icons .= !(++$key % 9) ? '<br>' : NULL;
- }
- }
- $query = $db->query("SELECT * FROM $table_posts WHERE pid='$pid' AND tid='$tid' AND fid='$fid'");
- $postinfo = $db->fetch_array($query);
- if($delayeditpost && ($timestamp -$postinfo['dateline'] >$delayeditpost) && !$ismoderator ) {
- showmessage('post_edit_timeout', NULL, 'HALTED');
- }
- $usesigcheck = $postinfo['usesig'] ? 'checked="checked"' : NULL;
- $urloffcheck = $postinfo['parseurloff'] ? 'checked="checked"' : NULL;
- $smileyoffcheck = $postinfo['smileyoff'] == 1 ? 'checked="checked"' : NULL;
- $codeoffcheck = $postinfo['bbcodeoff'] == 1 ? 'checked="checked"' : NULL;
- if($alloweditpoll && $thread['poll']) {
- $query = $db->query("SELECT pollopts FROM $table_polls WHERE tid='$tid'");
- $polloptions = unserialize($db->result($query, 0));
- for($i = 0; $i < count($polloptions['options']); $i++) {
- $polloptions['options'][$i][0] = htmlspecialchars(stripslashes($polloptions['options'][$i][0]))."\n";
- }
- } else {
- $polloptions = '';
- }
- if($allowpostattach) {
- if($postinfo['aid']) {
- require_once DISCUZ_ROOT.'./include/attachment.php';
- $attachquery = $db->query("select * from $table_attachments where pid =$postinfo[pid]");
- while($attaches = $db->fetch_array($attachquery)) {
- $extension = strtolower(fileext($attaches['filename']));
- $attaches['attachicon'] = attachtype($extension."\t".$attaches['filetype']);
- $attaches['attachsize'] = sizecount($attaches['filesize']);
- $attaches['dateline'] = $attaches['dateline']?gmdate("$dateformat $timeformat", $attaches['dateline'] + $timeoffset * 3600):gmdate("$dateformat $timeformat", $orig['dateline'] + $timeoffset * 3600);
- $postinfo[attach_list][] = $attaches;
- }
- }
- }
- $postinfo['subject'] = str_replace('"', """, $postinfo['subject']);
- $postinfo['message'] = dhtmlspecialchars($postinfo['message']);
- $postinfo['message'] = preg_replace("/\n{2}\[\[i\] Last edited by .+? on .+? at .+? \[\/i\]\]$/s", '', $postinfo['message']);
- if($previewpost) {
- $postinfo['message'] = $message;
- }
-
- $multiattach = $allowpostattach && $attach_editpost ? array_fill(1,$attach_editpost,'1'):0;
- include template('post_editpost');
- } else {
- //===========板块禁言检查begin========
- if (!$ismoderator) {
- if (!postban_check($forum[fid], $discuz_user)) showmessage('你在本板块被禁言,不能发贴和编辑');
- }
- //===========板块禁言检查end==========
- if( $editmethord == 'post' && !$delete ) {
- if($post_invalid = checkpost()) {
- showmessage($post_invalid);
- }
- $viewpermadd = ($allowsetviewperm && $isfirstpost) ? "creditsrequire='$viewperm'" : NULL;
- if($isfirstpost) {
- if($subject == '' || $message == '') {
- showmessage('post_sm_isnull');
- }
- $pollopts = '';
- if($alloweditpoll && $thread['poll'] && trim($polloptions)) {
- $query = $db->query("SELECT pollopts FROM $table_polls WHERE tid='$tid'");
- $pollarray = unserialize($db->result($query, 0));
- $optsdeleted = 0;
- $pollarray['max'] = 0;
- foreach($polloptions as $key => $option) {
- if(trim($option)) {
- $pollarray['options'][$key][0] = $option;
- if($pollarray['options'][$key][1] > $pollarray['max']) {
- $pollarray['max'] = $pollarray['options'][$key][1];
-
- }
- } else {
- $optsdeleted = 1;
- $pollarray['total'] -= $pollarray['options'][$key][1];
- unset($pollarray['options'][$key]);
- }
- }
- if($optsdeleted) {
- $newoptions = array();
- foreach($pollarray['options'] as $option) {
- $newoptions[] = $option;
- }
- $pollarray['options'] = $newoptions;
- unset($newoptions);
- }
- $pollarray['multiple'] = $multiplepoll;
- $pollopts = addslashes(serialize($pollarray));
- }
- $db->query("UPDATE $table_threads SET iconid='$iconid', mp3_type='$mp3_m_r', subject='$subject' WHERE tid='$tid'", 'UNBUFFERED');
- if($pollopts) {
- $db->query("UPDATE $table_polls SET pollopts='$pollopts' WHERE tid='$tid'", 'UNBUFFERED');
- }
- } else {
- if($subject == '' && $message == '') {
- showmessage('post_sm_isnull');
- }
- }
- if($editedby && ($timestamp - $orig['dateline']) > 60 && $adminid != 1){
- $editdate = gmdate($_DCACHE['settings']['dateformat'], $timestamp + $timeoffset * 3600);
- $edittime = gmdate($_DCACHE['settings']['timeformat'], $timestamp + $timeoffset * 3600);
- $message .= "\n\n[[i] Last edited by $discuz_user on $editdate at $edittime [/i]]";
- }
- $bbcodeoff = checkbbcodes($message, $bbcodeoff);
- $smileyoff = checksmilies($message, $smileyoff);
-
- $db->query("UPDATE $table_posts SET message='$message', usesig='$usesig', mp3_url='$mp3_url', bbcodeoff='$bbcodeoff', parseurloff='$parseurloff', smileyoff='$smileyoff', subject='$subject' WHERE pid='$pid'");
- if($viewpermadd) {
- $db->query("UPDATE $table_threads SET $viewpermadd WHERE tid='$tid'", 'UNBUFFERED');
- }
- $modaction = 'editpost';
- }elseif ($editmethord == 'attach') {
- $new_aids = $post_attaches =array();
- $del_aids ='0';
- if ($orig['aid']){
- $attachquery = $db->query("select * from $table_attachments where pid ='$pid'");
- while($att = $db->fetch_array($attachquery)) {
- $saveaid = 1;
- if(is_array($deleteaids) && count($deleteaids)){
- if (in_array($att[aid],$deleteaids)){
- $del_aids .=','.$att[aid]; @unlink(DISCUZ_ROOT.'./'.$attachdir.'/'.$att['attachment']);
- $saveaid = 0;
- }
- }
- if ($saveaid) {
- if ($allowsetattachperm && $att[creditsrequire] != $origattachperm["$att[aid]"]){
- $att[creditsrequire] = $origattachperm["$att[aid]"];
- $db->query("UPDATE $table_attachments set creditsrequire='$att[creditsrequire]' WHERE aid='$att[aid]'", 'UNBUFFERED');
- }
- $new_aids[] = $t_a;
- }
- }
- if ($del_aids) {
- $db->query("DELETE FROM $table_attachments WHERE pid='$pid' and aid in($del_aids)", 'UNBUFFERED');
- }
- }
- if ($attach_max && (count($attach)+count($new_aids)) >$attach_max){
- showmessage('attachment_edit_more', "post.php?action=edit&fid=$fid&tid=$tid&pid=$pid&page=$page");
- }
- $last_attach_type = $tmark = $aid ='';
- $post_attaches = attach_upload();
- if($post_attaches && $allowpostattach) {
- foreach( $post_attaches as $v) {
- $db->query("INSERT INTO $table_attachments (uid, creditsrequire, filename, filetype, filesize, attachment, dateline, downloads)
- VALUES ('$discuz_uid', '$v[creditsrequire]', '$v[filename]', '$v[filetype]', '$v[filesize]', '$v[attachment]','$timestamp', '0')");
- $aid .= $tmark.''.$db->insert_id();
- $v['aid'] = $db->insert_id();
- $tmark = ' ,';
- $last_attach_type = strtolower(fileext($v[filename]))."\t".$v['filetype'];
- $new_aids[] = $v;
- }
- $db->query("UPDATE $table_attachments SET tid='$tid', pid='$pid' WHERE aid in ($aid)", 'UNBUFFERED');
- $db->query("UPDATE $table_threads SET attachment='".attachtype($last_attach_type, 'id')."' WHERE tid='$tid'", 'UNBUFFERED');
- }
- $aid = count($new_aids);
- $db->query("UPDATE $table_posts SET aid='$aid' WHERE pid='$pid'");
- unset($new_aids,$post_attaches);
- $modaction = 'editattach';
- } elseif( $editmethord == 'post' && $delete ) {
- if(!$allowdelpost && !$isorigauthor) {
- showmessage('post_edit_nopermission', NULL, 'HALTED');
- }
- if(!$isfirstpost) {
- updatemember('-', $orig['authorid'], $deletedcredits);
- $query = $db->query("SELECT pid, filetype, attachment FROM $table_attachments WHERE tid='$tid'");
- $attach_type = '';
- while($thread_attachment = $db->fetch_array($query)) {
- if($thread_attachment['filetype']) {
- $attach_type = fileext($thread_attachment['attachment'])."\t".$thread_attachment['filetype'];
- }
- if($thread_attachment[pid] == $pid) {
- @unlink(DISCUZ_ROOT.'./'.$attachdir.'/'.$thread_attachment['attachment']);
- }
- }
- $db->query("UPDATE $table_threads SET attachment='".attachtype($attach_type, 'id')."' WHERE tid='$tid'", 'UNBUFFERED');
- $db->query("DELETE FROM $table_attachments WHERE pid='$pid'", 'UNBUFFERED');
- $db->query("DELETE FROM $table_posts WHERE pid='$pid'");
- updateforumcount($fid);
- updatethreadcount($tid);
- $modaction = 'delposts';
- } else {
- if(!$allowdelpost && $isorigauthor && $thread['replies'] >= 1) {
- showmessage('post_edit_nopermission', NULL, 'HALTED');
- }
- $uids = $comma = '';
- $query = $db->query("SELECT authorid FROM $table_posts WHERE tid='$tid'");
- while($post = $db->fetch_array($query)) {
- $uids .= "$comma$post[authorid]";
- $comma = ',';
- }
- updatemember('-', $uids, $deletedcredits);
- $db->query("DELETE FROM $table_threads WHERE tid='$tid' OR closed='$tid'", 'UNBUFFERED');
- $query = $db->query("SELECT attachment FROM $table_attachments WHERE tid='$tid'");
- while($thread_attachment = $db->fetch_array($query)) {
- @unlink(DISCUZ_ROOT.'./'.$attachdir.'/'.$thread_attachment['attachment']);
- }
- $db->query("DELETE FROM $table_attachments WHERE tid='$tid'", 'UNBUFFERED');
- $db->query("DELETE FROM $table_posts WHERE tid='$tid'");
- updateforumcount($fid);
- $modaction = 'delete';
- }
- }
- if(!$isorigauthor) {
- @$fp = fopen(DISCUZ_ROOT.'./forumdata/modslog.php', 'a');
- @flock($fp, 2);
- @fwrite($fp, "$timestamp\t$discuz_user\t$groupid\t$onlineip\t$forum[fid]\t$forum[name]\t$thread[tid]\t$thread[subject]\t$modaction\n");
- @fclose($fp);
- }
- if($delete && $isfirstpost) {
- showmessage('post_edit_delete_succeed', "forumdisplay.php?fid=$fid");
- }elseif($editmethord == 'attach') {
- showmessage('attachment_edit_succeed', "post.php?action=edit&fid=$fid&tid=$tid&pid=$pid&page=$page");
- } else {
- showmessage('post_edit_succeed', "viewthread.php?tid=$tid&page=$page#pid$pid");
- }
- }
- ?>
复制代码
[ 本帖最后由 jinlun721 于 2005-11-20 12:03 编辑 ] |