原帖由 cosmos_wing 于 2005-8-16 00:52 发表
成功安装了,谢谢分享!
不过是否可以让用户编辑帖子,回复帖子时也能显示选择话题呢?
1:在include/newreply.php
查找:
在 include/editpost.php
查找:
分别在后面加上:
- //======发贴样本+话题类型==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 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.value="'.$Sample_content[$i].'"; break;';
- $sample_str.='default: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_newreply.htm
查找:
- <input type="text" name="subject" size="45" value="$subject" tabindex="3">
复制代码
前面加:
- <!--{if $row['sample_subject']}-->$subject_str<!--{/if}-->
复制代码
3:在模板post_editpost.htm
查找:
- <input type="text" name="subject" size="45" value="$postinfo[subject]" tabindex="3">
复制代码
前面加:
- <!--{if $row['sample_subject']}-->$subject_str<!--{/if}-->
复制代码 |