因为有人要用
所以加上
强制用话题类型 (在安装了一楼原来的基础上的)
1:修改 include/newthread.php
查找:
- include template('post_newthread');
复制代码
在前面加上: (覆盖掉你原来的)
- //======发贴样本+话题类型==By www.5466.ik8.com=======================
- $sample_sql="SELECT sample_sub,sample_subject,sample_title,sample_content FROM $table_forums WHERE fid='$fid' ";
- $sample_query=$db->query($sample_sql);
- $row=$db->fetch_array($sample_query);
- if( $row[sample_subject]){
- $sample_subject=$row[sample_subject];
- $Sample_subject=explode(',',$sample_subject);
- $subject_len=count($Sample_subject);
-
- $subject_str='<script language=javascript> function find_subject(subject_type){ if(document.input.subject.value.indexOf(subject_type)!=-1) return true;else return false; } function limit_subject(){ ';
- $subject_str.='if(find_subject("'.$Sample_subject[0].'" )) return true;';
- for($i=1;$i<$subject_len;$i++)
- $subject_str.=' else if(find_subject("'.$Sample_subject[$i].'") ) return true;';
- $subject_str.= 'else {alert("呵呵,请选择话题类型哦,谢谢!"); return false;}';
- $subject_str.='}</SCRIPT>';
- $subject_str.='<script language=javascript>function chk_subject(){document.input.subject.focus();document.input.subject.value=document.input.check_subject.value+document.input.subject.value;}</script>';
- $subject_str.='<select name=check_subject onchange="javascript:chk_subject();" ><option value="" selected>请选择话题</option>';
- for($i=0;$i<$subject_len;$i++)
- $subject_str.='<OPTION value="'.$Sample_subject[$i].'">'.$Sample_subject[$i].'</OPTION>';
- $subject_str.='</select>';
- }
-
- if($sample_sub=$row[sample_sub]){
- $sample_title=$row[sample_title];
- $sample_content=$row[sample_content];
- $Sample_title=explode(',',$sample_title);
- $Sample_content=explode(',',$sample_content);
- $sample_str='<script language=javascript>function check_sample(){document.input.message.focus();sam_va=document.input.chk_sample.value; sam_va=eval(sam_va); switch(sam_va){';
- for($i=0;$i<$sample_sub;$i++)
- $sample_str.='case '.$i.':document.input.message.focus();window.clipboardData.setData(\'text\',\''.$Sample_content[$i].'\');document.execCommand(\'Paste\'); break;';
- $sample_str.='default:document.input.message.value=document.input.message.value;break;}}</script>';
- $sample_str.='<select name=chk_sample onchange="javascript:check_sample();" ><option value="" selected>请选择样本</option>';
- for($i=0;$i<$sample_sub;$i++)
- $sample_str.='<OPTION value='.$i.'>'.$Sample_title[$i].'</OPTION>';
- $sample_str.='</select>';
-
- }
- //============发贴样本+话题类型===================lu5266================
复制代码
2:在post_newthread.htm
查找:
- var disablepostctrl = $disablepostctrl;
复制代码
后面加上:
- var subject_limit=0;
- {if $row['sample_subject']}subject_limit=1;{/if}
复制代码
查找: (看到一样的就可以了)
- alert("{lang post_subject_and_message_isnull}");
- return false;
- }
复制代码
在后面加上:
- if(subject_limit) if(!limit_subject()) return false;
复制代码
=======================================================
上面的是常规新贴,快速发贴的同样是这样,只是修改的是forumdisplay.php和forumdisplay.htm
=======================================================
ok了
够了吧
不是连编辑帖子和回复帖子也强制吧
哈哈
要的话
可以在写
说一声
就可以了
[ 本帖最后由 lu5266 于 2005-8-31 16:05 编辑 ] |