[問題]快速回文限制最少字數方法(已解決)

phpBB 2 MOD Support
無論是官方或非官方認證之外掛,安裝與使用問題討論。
(發表文章請按照公告格式發表,違者砍文)

版主: 版主管理群

夜楓
星球公民
星球公民
文章: 131
註冊時間: 2003-05-16 21:19

[問題]快速回文限制最少字數方法(已解決)

文章 夜楓 »

我想要找..回文或者是快速回文
有字數限制...就是說...最少要發幾個字以上~才可以
防止小白用的

我只找到\r
這個只能用在發表文章..不能用在回文

i-Flood Limit 1.0.0 [發文最少字數限制]

http://phpbb-tw.net/phpbb/viewtopic.php?t=29443
最後由 夜楓 於 2004-12-22 18:50 編輯,總共編輯了 3 次。
●架設主機作業系統:Windows XP SP2
●快速架站程式:appserv2.4.4a
●您的上網方式:Hinet 12M/1M
●phpBB2 版本:phpBB 2.0.20
No3
星球普通子民
星球普通子民
文章: 4
註冊時間: 2004-10-17 18:34

文章 No3 »

[2.0.7] Message too short
在phpbb 2.0.10中通过,在PM中也有效。

代碼: 選擇全部

############################################################## 
## MOD Title: Message too short
## MOD Author: Xpert < xpert@phpbbguru.net > (N/A) http://www.phpbbguru.net 
## MOD Description: 	Allows you to require a minimum 
##                 	amount of characters in a post & pm. 
## MOD Version: 	1.1.0 [phpBB 2.0.x]
## 
## Installation Level: 	Easy 
## Installation Time: 	5 Minutes 
## Files To Edit (4): 	posting.php
##			privmsg.php 
##			language/lang_english/lang_main.php
##			templates/subSilver/posting_body.tpl
## Included Files: (n/a)
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/
############################################################## 
## Author Notes: 
##
##	This mod is a simple way to avoid your forum users 
#	from comments as "Yes", "*****SPAM*****" and other flood actions.	
## 
############################################################## 
## MOD History: 
##
##   2004-07-03 - Version 1.1.0 
##      - Undefined 'L_MESSAGE_TOO_SHORT' when posting pm fixed.
##	  Thanks to R@ < meos@mail.ru > for report.
## 
##   2004-05-23 - Version 1.0.0 
##      - Initial Release 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

# 
#-----[ OPEN ]------------------------------------------ 
# 
posting.php 

# 
#-----[ FIND ]------------------------------------------ 
# 
	'L_EMPTY_MESSAGE' => $lang['Empty_message'],

#
#-----[ AFTER, ADD ]------------------------------------------
#
	'L_MESSAGE_TOO_SHORT' => $lang['Message_too_short'],

# 
#-----[ OPEN ]------------------------------------------ 
# 
privmsg.php 

# 
#-----[ FIND ]------------------------------------------ 
# 
	'L_EMPTY_MESSAGE' => $lang['Empty_message'],

#
#-----[ AFTER, ADD ]------------------------------------------
#
	'L_MESSAGE_TOO_SHORT' => $lang['Message_too_short'],

#  
#-----[ OPEN ]------------------------------------------ 
# 
language/lang_english/lang_main.php
# 
#-----[ FIND ]------------------------------------------ 
# 
//
// That's all, Folks!

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
// Message too short
$lang['Message_too_short'] = 'Message too short';

# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/subSilver/posting_body.tpl

# 
#-----[ FIND ]------------------------------------------ 
# 
	if (document.post.message.value.length < 2) {
		formErrors = "{L_EMPTY_MESSAGE}";
	}
  
# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 
	// Here you can change 5 to the minimum amount
	// of characters in a post you want.
	if (document.post.message.value.length < 5) {
		formErrors = "{L_MESSAGE_TOO_SHORT}";
	}
# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM 
No3
星球普通子民
星球普通子民
文章: 4
註冊時間: 2004-10-17 18:34

文章 No3 »

if (document.post.message.value.length < 5
5是代表限制的最少发文字数
夜楓
星球公民
星球公民
文章: 131
註冊時間: 2003-05-16 21:19

文章 夜楓 »

回覆文章可以..

但是..快速回文..就不行了~
還是一樣沒辦法
●架設主機作業系統:Windows XP SP2
●快速架站程式:appserv2.4.4a
●您的上網方式:Hinet 12M/1M
●phpBB2 版本:phpBB 2.0.20
~倉木麻衣~
竹貓忠實會員
竹貓忠實會員
文章: 1405
註冊時間: 2004-03-21 21:00

文章 ~倉木麻衣~ »

夜楓 寫:回覆文章可以..

但是..快速回文..就不行了~
還是一樣沒辦法
那是因為快速回覆的name 跟預設的不同
假設快速回覆的form 是長這樣\r

代碼: 選擇全部

<form [color=red]name='quick_reply'[/color] action='posting.php' method='post'>
....中間略....
<input type='image' src='your templates/quick_reply.gif' border='0' alt="Quick reply to topic" [color=orange]onClick="return checkForm(this);"[/color] />
若沒有OnClick那一段的話~請自行加上
並在viewtopic_body.tpl 裡多加個名為checkForm的JavaScript來判斷quick_reply

代碼: 選擇全部

# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/subSilver/viewtopic_body.tpl 

# 
#-----[ FIND ]------------------------------------------ 
# 
  <tr>
	<td align="left" colspan="3"><span class="nav">{PAGE_NUMBER}</span></td>
  </tr>
</table>
  
# 
#-----[ AFTER ADD ]------------------------------------------ 
# 
   // Here you can change 5 to the minimum amount 
   // of characters in a post you want. 
<script language="JavaScript" type="text/javascript">
function checkForm()
{
   var formErrors;
   if (document.quick_reply.message.value.length < 5) { 
      formErrors = "{L_MESSAGE_TOO_SHORT}"; 
   }
    if (formErrors)
    {
        alert(formErrors);
        return false;
    }
    else
        return true;
}
</script>
# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM
試看看吧~
夜楓
星球公民
星球公民
文章: 131
註冊時間: 2003-05-16 21:19

文章 夜楓 »

我的快速回文..是Advanced Quick Reply 1.3.1

不行耶~
~倉木麻衣~
竹貓忠實會員
竹貓忠實會員
文章: 1405
註冊時間: 2004-03-21 21:00

文章 ~倉木麻衣~ »

夜楓 寫:我的快速回文..是Advanced Quick Reply 1.3.1

不行耶~
sorry..我忘了先問你的快速回文是那一個版本了 (ro06)
如果是Advanced Quick Reply 的話~那就簡單多了
不過我底下的作法是用Advanced Quick Reply 1.4.1版的
(?! 這個是看quick_reply.php裡寫的~但下載頁面是寫1.5 ?! (ro24) )

代碼: 選擇全部

#
#------[ OPEN ]------
#
your templates/quick_reply.tpl

#
#------[ FIND ]------
#
                if (document.post.message.value.length < 2) {
                        formErrors = '{L_EMPTY_MESSAGE}';
                }

#
#------[ REPLACE WITH ]------
#
                if (document.post.message.value.length < 5) {
                        formErrors = "{L_MESSAGE_TOO_SHORT}";
                }

#
#------[ SAVE/CLOSE ]------
#
EoM
夜楓
星球公民
星球公民
文章: 131
註冊時間: 2003-05-16 21:19

文章 夜楓 »

問題解決了~
謝謝...~倉木麻衣~
●架設主機作業系統:Windows XP SP2
●快速架站程式:appserv2.4.4a
●您的上網方式:Hinet 12M/1M
●phpBB2 版本:phpBB 2.0.20
tsairandy
星球公民
星球公民
文章: 45
註冊時間: 2002-11-08 11:54

文章 tsairandy »

使用在正常回覆OK,但是在快速回覆出問題
雖然以下連結裡附上兩種方法,但都不能用\r
http://phpbb-tw.net/phpbb/viewtopic.php ... D%AD%A8%EE

連結內的教學提到,找到快速回覆的name 並假設快速回覆的form 是長這樣\r

代碼: 選擇全部


<form name='quick_reply' action='posting.php' method='post'> 
....中間略.... 
<input type='image' src='your templates/quick_reply.gif' border='0' alt="Quick reply to topic" onClick="return checkForm(this);" />


但是我的這一段長的很像卻一點不一樣\r

代碼: 選擇全部


<!-- BEGIN quick_reply -->
	  	  </tr> 
	  </table> 
	  
	  <table width='100%' cellspacing='2' border='0' align='center'> 
	    <tr> 
	     <td valign='top' align='left'>
	       <form name='quick_reply' action='{quick_reply.U_QUICK_REPLY}' method='post'>
	       <!-- END quick_reply -->
	        <!-- BEGIN switch_username_field --> 
	        <span class='gensmall'><b>{L_USERNAME}</b></span><br /> 
	        <span class='genmed'><input type='text' class='post' tabindex='1' name='username' size='25' maxlength='25' value='' /></span><br /> 
	        <!-- END switch_username_field -->
	        <!-- BEGIN quick_reply -->
	        <textarea name="message" rows="7" cols="35" wrap="virtual" style="width:425px" class="post" onclick="{if(document.quick_reply.message.value=='{L_QUICK_REPLY_TOPIC}') document.quick_reply.message.value=''}">{L_QUICK_REPLY_TOPIC}</textarea><br /> 
	        {quick_reply.S_HIDDEN_FORM} 
	        <input type='image' src='{quick_reply.QUICK_REPLY_IMG}' border='0' alt="{quick_reply.L_QUICK_REPLY_TOPIC}" onClick="if(document.quick_reply.message.value == '{quick_reply.L_QUICK_REPLY_TOPIC}' || document.quick_reply.message.value == ''){ alert('{quick_reply.L_EMPTY_MESSAGE}'); return false;}else{ return true;}" />
	        </form>
	   </td>
   <!-- END quick_reply -->


雖然已經將
onClick="if(document.quick_reply.message.value == '{quick_reply.L_QUICK_REPLY_TOPIC}' || document.quick_reply.message.value == ''){ alert('{quick_reply.L_EMPTY_MESSAGE}'); return false;}else{ return true;}"
改成
onClick="return checkForm(this);"

但還是沒用,誰可以救救我喔!!!
蕭遙
星球公民
星球公民
文章: 120
註冊時間: 2004-09-29 05:21

文章 蕭遙 »

你是用OOHOO的quickreply?嘗試一下如下的修改方法:

代碼: 選擇全部


#打開 viewtopic.php
#
#找到:
if ( !$userdata['session_logged_in'] ) 
{ 
$template->assign_block_vars('switch_username_field', array()); 
}
#
#在後面增加:
if( $board_config['flood_limit'] != 0 )
{
	$template->assign_block_vars('switch_flood_limit', array());
}
else if( !$is_auth['auth_mod'] )
{
	$template->assign_block_vars('switch_flood_limit', array());
}
#
#找到:
#
'L_QUICK_REPLY_TOPIC' => $quick_reply_alt, 
'L_EMPTY_MESSAGE' => $lang['Empty_message'],
#
#在後面增加:
#
	'FLOOD_LIMIT_MESSAGE' => sprintf($lang['Flood_limit_message'], $board_config['flood_limit']),
	'FLOOD_LIMIT' => $board_config['flood_limit'],
#
#保存關閉
#
#
#
#打開 viewtopic_body.tpl
#
#找到:
<input type='image' src='{quick_reply.QUICK_REPLY_IMG}' border='0' alt="{quick_reply.L_QUICK_REPLY_TOPIC}" onClick="if(document.quick_reply.message.value == '{quick_reply.L_QUICK_REPLY_TOPIC}' || document.quick_reply.message.value == ''){ alert('{quick_reply.L_EMPTY_MESSAGE}'); return false;}else{ return true;}" />
#
#在行中找到:
{ alert('{quick_reply.L_EMPTY_MESSAGE}'); return false;}
#
#在行中之後加入:
<!-- END quick_reply --> 
<!-- BEGIN switch_flood_limit -->
else if(document.quick_reply.message.value.length < {FLOOD_LIMIT} ){ alert('{FLOOD_LIMIT_MESSAGE}'); return false;}
<!-- END switch_flood_limit -->
<!-- BEGIN quick_reply -->
#
#保存並關閉

頭像
suicidal
星球公民
星球公民
文章: 137
註冊時間: 2002-11-17 23:12

文章 suicidal »

我依照昌木麻伊大人的修改方法成功但是原本的注音魔人散退卻失效了...
不知道是哪裡改錯了...希望有人可以幫我看看...
我的 viewtopic_body.tpl

代碼: 選擇全部

<script language="JavaScript" type="text/javascript"> 
function checkForm() 
{ 
    formErrors = false; 
    if(document.quick_reply.message.value == '{L_QUICK_REPLY_TOPIC}' || document.quick_reply.message.value == '' ) 
    { 
        formErrors = "{L_EMPTY_MESSAGE}"; 
    } 
    for (var i = 0 ; i <  document.quick_reply.message.value.length ; i++) 
        { 
            var code = document.quick_reply.message.value.charCodeAt(i); 
            if (12549 <= code && code <= 12585) 
            { 
                formErrors = "本站不歡迎使用注音文!請重新輸入內文吧!";  
            } 
        } 
    
    if (formErrors) 
    { 
   alert(formErrors); 
   return false; 
    } 
    else 
        return true; 
}    
</script>
<table width="95%" cellspacing="2" cellpadding="2" border="0">
  <tr> 
	<td align="left" valign="middle"><span class="nav">
	  <a href="{U_INDEX}" class="nav">{L_INDEX}</a> 
	  :: <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a>
	  :: <a class="nav" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></span></td>
	 <td align="right" valign="middle"><span class="nav"><b>{PAGINATION}</b></span></td>
  </tr>
  <tr>
    <td align="left" valign="middle"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" align="middle" /></a>  <a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" border="0" alt="{L_POST_REPLY_TOPIC}" align="middle" /></a></td>
	<td align="right" valign="middle"><span class="nav">
	<a href="{U_VIEW_OLDER_TOPIC}" class="nav">{L_VIEW_PREVIOUS_TOPIC}</a> :: <a href="{U_VIEW_NEWER_TOPIC}" class="nav">{L_VIEW_NEXT_TOPIC}</a> 
	</span></td>
  </tr>
</table>

{POLL_DISPLAY} 

<!-- BEGIN postrow -->
<a name="{postrow.U_POST_ID}"></a>
<table width="95%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="3%" align="left"><img src="http://home.pchome.com.tw/online/suicidal/images/buttons.gif" width="66" height="23"></td>
    <td width="94%" align="center" background="http://home.pchome.com.tw/online/suicidal/images/buttons_bkgd.gif"><span class="cattitle">{postrow.POST_SUBJECT}</span></td>
    <td width="3%" align="right"><img src="http://home.pchome.com.tw/online/suicidal/images/buttons_right.gif" width="66" height="23"></td>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="1" width="95%" class="forumline">
<tr>
	<td class="row4" align="center" valign="middle"><table border="0" cellspacing="0" cellpadding="2" width="100%">
	<tr height="22">
		<td align="left" valign="middle" nowrap="nowrap"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="genmed">{L_POSTED}: {postrow.POST_DATE}</span></td>
		<td align="right" valign="middle" nowrap="nowrap">{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG} </td>
	</tr></table></td>
</tr>
<tr>
	<td class="row1" align="left" valign="top" width="100%"><table border="0" cellspacing="0" cellpadding="0" width="100%"><!-- main table start -->
	<tr>
		<td width="150" align="left" valign="top" rowspan="2"><table border="0" cellspacing="0" cellpadding="0" width="100%"><!-- left row table start -->
		<tr>
			<td width="100%" align="left" valign="top" background="http://home.pchome.com.tw/online/suicidal/images/post_bkgd.gif"><table border="0" cellspacing="0" cellpadding="4">
			<tr>
								<td align="left" valign="top"><table border="0" cellspacing="0" cellpadding="0">
				<tr><td nowrap="nowrap"><span class="name"><b>{postrow.POSTER_NAME}</b></span></td></tr>
				<tr><td nowrap="nowrap"><span class="postdetails">{postrow.POSTER_RANK}</span></td></tr>
				<tr><td nowrap="nowrap"><span class="postdetails">{postrow.RANK_IMAGE}{postrow.POSTER_AVATAR}</span></tr>
				<tr><td><img src="http://home.pchome.com.tw/online/suicidal/images/spacer.gif" width="120" height="5" border="0" alt="" /></td></tr>
				<tr><td><span class="postdetails">{postrow.RR_HACK}<br />
<tr><td><span class="postdetails">{postrow.POSTER_POSTS}</span></td></tr>
				<tr><td><span class="postdetails">{postrow.POSTER_FROM}<br /> 
      {postrow.POSTER_ONLINE}<br /> {postrow.POSTER_JOINED}</span></td></tr><br /></td></tr>
				</table></td>
			</tr>
			</table><br /><br /></td>
			<td width="10" background="http://home.pchome.com.tw/online/suicidal/images/post_right.gif"><img src="http://home.pchome.com.tw/online/suicidal/images/spacer.gif" width="10" height="1" border="0" /></td>
		</tr>
		<tr>
			<td height="10" background="http://home.pchome.com.tw/online/suicidal/images/post_bottom.gif"><img src="http://home.pchome.com.tw/online/suicidal/images/spacer.gif" width="1" height="10" border="0" /></td>
			<td width="10" height="10"><img src="http://home.pchome.com.tw/online/suicidal/images/post_corner.gif" width="10" height="10" border="0" /></td>
		</tr>
	<!-- left row table end --></table>
		  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td align="center"><a href="#top"><img src="http://home.pchome.com.tw/online/suicidal/images/lang_english/back_to_top.gif" width="91" height="24" vspace="4" border="0"></a></td>
            </tr>
          </table></td>
		<td class="row1" align="left" valign="top" width="100%"><table border="0" cellspacing="0" cellpadding="5" width="100%"><!-- right top row table start -->
		<tr>
			<td width="100%"><table style="table-layout:fixed"><tr><td style="word-wrap:break-word"><span class="postbody">{postrow.MESSAGE}</span></td></tr></table></td>
		</tr>
		<!-- right top row table end --></table></td>
	</tr>
	<tr>
		<td class="row1" align="left" valign="bottom" nowrap="nowrap"><table border="0" cellspacing="0" cellpadding="5" width="100%"><!-- right bottom row start -->
		<tr>
			<td width="100%"><table style="table-layout:fixed"><tr><td style="word-wrap:break-word"><span class="postbody">{postrow.SIGNATURE}</span></td></tr></table></td>
		</tr>
		<!-- right bottom row end --></table></td>
	</tr>
	</table></td>
</tr>
<tr>
	<td height="24" align="left" valign="middle" class="row4"><table border="0" cellspacing="0" cellpadding="3">
	<tr>
		<td width="135"><img src="http://home.pchome.com.tw/online/suicidal/images/spacer.gif" width="120" height="1" border="0" /></td>
		<td align="left" valign="middle" nowrap="nowrap">{postrow.PROFILE_IMG} {postrow.SEARCH_IMG2} {postrow.PM_IMG} {postrow.EMAIL_IMG} {postrow.WWW_IMG} {postrow.AIM_IMG} {postrow.YIM_IMG} {postrow.MSN_IMG}</td>
		<td align="left" valign="top" nowrap="nowrap"><script language="JavaScript" type="text/javascript"><!-- 

	if ( navigator.userAgent.toLowerCase().indexOf('mozilla') != -1 && navigator.userAgent.indexOf('5.') == -1 && navigator.userAgent.indexOf('6.') == -1 )
		document.write(' {postrow.ICQ_IMG}');
	else
		document.write('<div style="position:relative"><div style="position:absolute">{postrow.ICQ_IMG}</div><div style="position:absolute;left:4px;top:-1px">{postrow.ICQ_STATUS_IMG}</div></div>');
		  
		  //--></script><noscript>{postrow.ICQ_IMG}</noscript></td>
	    <td width="60"><img src="http://home.pchome.com.tw/online/suicidal/images/spacer.gif" width="60" height="1" border="0" /></td>
	</tr></table></td>
</tr>
</table>
<table width="95%"  border="0" cellspacing="0" cellpadding="0">
\n  <tr>
    <td height="35" align="left" valign="top" background="http://home.pchome.com.tw/online/suicidal/images/shadow_bottom.jpg"><img src="http://home.pchome.com.tw/online/suicidal/images/shadow_bttm_left_corner.jpg" width="19" height="35"></td>
    <td align="left" valign="top" background="http://home.pchome.com.tw/online/suicidal/images/shadow_bottom.jpg"><img src="http://home.pchome.com.tw/online/suicidal/images/shadow_bottom.jpg" width="19" height="35"></td>
    <td align="right" valign="top" background="http://home.pchome.com.tw/online/suicidal/images/shadow_bottom.jpg"><img src="http://home.pchome.com.tw/online/suicidal/images/shadow_bttm_right_corner.jpg" width="19" height="35"></td>
  </tr>
</table>
<!-- END postrow -->

      <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="95%" id="AutoNumber1" height="30">
        <tr>
          <td width="50%" valign="top">
          <p align="left">
			 <a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" align="middle" /></a>  <a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" border="0" alt="{L_POST_REPLY_TOPIC}" align="middle" /></a></td>
          <td width="50%" valign="top">
          <p align="right">
			<span class="nav"><b>{PAGINATION}    </b></span><span class="gensmall"><br/>
            {PAGE_NUMBER}    </span><br />
			 </td>
          </tr>
        </table>
<script language="JavaScript" type="text/javascript"> 
function checkForm() 
{ 
   var formErrors; 
   if (document.quick_reply.message.value.length < 6) { 
      formErrors = "{L_MESSAGE_TOO_SHORT}"; 
   } 
    if (formErrors) 
    { 
        alert(formErrors); 
        return false; 
    } 
    else 
        return true; 
} 
</script>

<table width="95%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="3%" align="left"><img src="http://home.pchome.com.tw/online/suicidal/images/buttons.gif" width="66" height="23"></td>
    <td width="94%" align="center" background="http://home.pchome.com.tw/online/suicidal/images/buttons_bkgd.gif"><span class="cattitle">   {TOPIC_TITLE}</span></td>
    <td width="3%" align="right"><img src="http://home.pchome.com.tw/online/suicidal/images/buttons_right.gif" width="66" height="23"></td>
  </tr>
</table>
<table class="forumline" width="95%" cellspacing="1" cellpadding="" border="0">
<tr>
	<td class="row4" align="left" height="25"> <a class="th" href="{U_INDEX}">{L_INDEX}</a> :: <a class="th" href="{U_VIEW_FORUM}">{FORUM_NAME}</a> :: <a class="th" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></th>
</tr>
<tr>
	<td class="row1" align="left" valign="top">
	<table border="0" cellspacing="0" cellpadding="5" width="100%">
	<tr>
		<td align="left" valign="top">
<!-- BEGIN quick_reply -->
<table width='100%' cellspacing='2' border='0' align='center'> 
  <tr> 
   <td valign='top' align='left'> 
     <form name='quick_reply' action='{quick_reply.U_QUICK_REPLY}' method='post'> 
     <!-- END quick_reply --> 
      <!-- BEGIN switch_username_field --> 
      <span class='gensmall'><b>{L_USERNAME}</b></span><br /> 
      <span class='genmed'><input type='text' class='post' tabindex='1' name='username' size='25' maxlength='25' value='' /></span><br /> 
      <!-- END switch_username_field --> 
      <!-- BEGIN quick_reply --> 
      <textarea name="message" rows="7" cols="35" wrap="virtual" style="width:425px" class="post" onclick="{if(document.quick_reply.message.value=='{L_QUICK_REPLY_TOPIC}') document.quick_reply.message.value=''}">{L_QUICK_REPLY_TOPIC}</textarea><br /> 
      {quick_reply.U_HIDDEN_FORM_FIELDS} 
      <input type='image' src='{quick_reply.QUICK_REPLY_IMG}' border='0' alt="{quick_reply.L_QUICK_REPLY_TOPIC}" onClick="return checkForm(this)"  
      </form> 
</td> 
   <!-- END quick_reply -->
</tr>
</table></td>
		<td align="right" valign="top">
			{JUMPBOX}<p>
			<span class="gensmall">{S_AUTH_LIST}</span> </td>
		<td align="right" valign="top">
			 </td>
	</tr>
	<tr>
		<td align="left" valign="top">
			 </td>
		<td align="right" valign="top" colspan="2">
			<span class="gensmall"> <br />
			 </span></td>
	</tr>
	</table>
	</td>
</tr>
<tr>
	<td class="row4" align="center" valign="middle" nowrap="nowrap"><table border="0" cellspacing="0" cellpadding="2" width="100%">
	<tr>
		<form method="post" action="{S_POST_DAYS_ACTION}"><td align="left" valign="middle" nowrap="nowrap">
			<span class="gensmall"> {S_TIMEZONE} </span></td></form>
		<td align="right" valign="middle" nowrap="nowrap"> </td>
	</tr>
	</table>
	</td>
</tr>
</table>
<table width="95%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="35" align="left" valign="top" background="http://home.pchome.com.tw/online/suicidal/images/shadow_bottom.jpg"><img src="http://home.pchome.com.tw/online/suicidal/images/shadow_bttm_left_corner.jpg" width="19" height="35"></td>
    <td align="left" valign="top" background="http://home.pchome.com.tw/online/suicidal/images/shadow_bottom.jpg"><img src="http://home.pchome.com.tw/online/suicidal/images/shadow_bottom.jpg" width="19" height="35"></td>
    <td align="right" valign="top" background="http://home.pchome.com.tw/online/suicidal/images/shadow_bottom.jpg"><img src="http://home.pchome.com.tw/online/suicidal/images/shadow_bttm_right_corner.jpg" width="19" height="35"></td>
  </tr>
</table>
<table border="0" cellspacing="0" cellpadding="5" width="95%">
<tr>
	<td align="left" valign="top"> </td>
	<td align="right" valign="top">{S_TOPIC_ADMIN} </td>
 
     </tr> 
</table>
遇到問題大家都會急,但是不按照發問格式也不會有人理你,所以按照發問格式,詳細描訴問題,才是解決問題的好方法,這是我在這裡學到的,跟大家共勉之!
蕭遙
星球公民
星球公民
文章: 120
註冊時間: 2004-09-29 05:21

文章 蕭遙 »

那邊是字數限制失效,這邊是魔人退散失效,難道這2個一定要犧牲一個嘛……\r

嘗試把if(document.quick_reply.message.value == '{quick_reply.L_QUICK_REPLY_TOPIC}' || document.quick_reply.message.value == '' || document.quick_reply.message.value.length < 10 )這段拿到JS外面來吧。另外你這段代碼好像有錯,兩個判定條件重復了哦。
頭像
suicidal
星球公民
星球公民
文章: 137
註冊時間: 2002-11-17 23:12

文章 suicidal »

謝謝蕭遙前輩的回覆...小弟本來安裝的是注意魔人散退快速回覆版
參考連結 http://phpbb-tw.net/phpbb/viewtopic.php?t=21670
可以正常使用...還來安裝..[2.0.7] Message too short 也成功..
到了修改快速回覆的部分...我照教學加入下面的Java Scrpit

代碼: 選擇全部

# \r
#-----[ OPEN ]------------------------------------------ 
# 
templates/subSilver/viewtopic_body.tpl 

# 
#-----[ FIND ]------------------------------------------ 
# 
  <tr> 
   <td align="left" colspan="3"><span class="nav">{PAGE_NUMBER}</span></td> 
  </tr> 
</table> 
  
# 
#-----[ AFTER ADD ]------------------------------------------ 
# 
   // Here you can change 5 to the minimum amount 
   // of characters in a post you want. 
<script language="JavaScript" type="text/javascript"> 
function checkForm() 
{ 
   var formErrors; 
   if (document.quick_reply.message.value.length < 5) { 
      formErrors = "{L_MESSAGE_TOO_SHORT}"; 
   } 
    if (formErrors) 
    { 
        alert(formErrors); 
        return false; 
    } 
    else 
        return true; 
} 
</script> 
# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM
變成可以限制回覆字數..但是ㄅㄆㄇ的判定就失效...前輩說是判斷重複...
不知道正確的應該要如何更改才可以讓限制字數跟ㄅㄆㄇ共存...
我安裝的快速回覆是\r
http://phpbb-tw.net/phpbb/viewtopic.php?t=4965
遇到問題大家都會急,但是不按照發問格式也不會有人理你,所以按照發問格式,詳細描訴問題,才是解決問題的好方法,這是我在這裡學到的,跟大家共勉之!
蕭遙
星球公民
星球公民
文章: 120
註冊時間: 2004-09-29 05:21

文章 蕭遙 »

因爲你的兩個JS函數重名了,所以造成只有一個有效,你貼的viewtopic_body.tpl裏面有這2個:

代碼: 選擇全部

<script language="JavaScript" type="text/javascript"> 
function checkForm() 
{ 
   var formErrors; 
   if (document.quick_reply.message.value.length < 6) { 
      formErrors = "{L_MESSAGE_TOO_SHORT}"; 
   } 
    if (formErrors) 
    { 
        alert(formErrors); 
        return false; 
    } 
    else 
        return true; 
} 
</script>

代碼: 選擇全部

<script language="JavaScript" type="text/javascript"> 
function checkForm() 
{ 
    formErrors = false; 
    if(document.quick_reply.message.value == '{L_QUICK_REPLY_TOPIC}' || document.quick_reply.message.value == '' ) 
    { 
        formErrors = "{L_EMPTY_MESSAGE}"; 
    } 
    for (var i = 0 ; i <  document.quick_reply.message.value.length ; i++) 
        { 
            var code = document.quick_reply.message.value.charCodeAt(i); 
            if (12549 <= code && code <= 12585) 
            { 
                formErrors = "本站不歡迎使用注音文!請重新輸入內文吧!";  
            } 
        } 
    
    if (formErrors) 
    { 
   alert(formErrors); 
   return false; 
    } 
    else 
        return true; 
}    
</script>
解決辦法,將前一個刪掉,后一個改成:

代碼: 選擇全部

<script language="JavaScript" type="text/javascript"> 
function checkForm() 
{ 
    formErrors = false; 
    if(document.quick_reply.message.value == '{L_QUICK_REPLY_TOPIC}' || document.quick_reply.message.value == '' || document.quick_reply.message.value.length < 6) 
    { 
        formErrors = "{L_MESSAGE_TOO_SHORT}"; 
    } 
    for (var i = 0 ; i <  document.quick_reply.message.value.length ; i++) 
        { 
            var code = document.quick_reply.message.value.charCodeAt(i); 
            if (12549 <= code && code <= 12585) 
            { 
                formErrors = "本站不歡迎使用注音文!請重新輸入內文吧!";  
            } 
        } 
    
    if (formErrors) 
    { 
   alert(formErrors); 
   return false; 
    } 
    else 
        return true; 
}    
</script>
即可。
夜楓
星球公民
星球公民
文章: 131
註冊時間: 2003-05-16 21:19

Re: [問題]快速回文限制最少字數方法(已解決)

文章 夜楓 »

夜楓 寫:我想要找..回文或者是快速回文
有字數限制...就是說...最少要發幾個字以上~才可以
防止小白用的

我只找到\r
這個只能用在發表文章..不能用在回文

i-Flood Limit 1.0.0 [發文最少字數限制]

http://phpbb-tw.net/phpbb/viewtopic.php?t=29443
不小心按到...砍掉-.-
主題已鎖定

回到「外掛問題討論」