[外掛] Allow multiple spaces in posts 文章內輸入空格不用全形

Officially Approved MODs
由 phpBB Group 官方發展小組認證的 MOD!

版主: 版主管理群

版面規則
請注意!只有發表在 [2.0.x] MOD Database Releases 的外掛,才算是官方認證的外掛。
主題已鎖定
頭像
kkt
竹貓忠實會員
竹貓忠實會員
文章: 630
註冊時間: 2005-06-15 01:37
來自: H.K.
聯繫:

[外掛] Allow multiple spaces in posts 文章內輸入空格不用全形

文章 kkt » 2006-07-07 18:07

功能描述: 這支外掛允許你在文章中輸入空格鍵, 而不需轉換為全形輸入又再切換的麻煩.

測試狀況: 裝有文章氣泡的, 會在 pm 使用引言時, 會顯示了html 的  

==================================

代碼: 選擇全部

############################################################## 
## MOD Title: Allow multiple spaces in posts 
## MOD Author: chris_blessing < webguy@330i.net > (Chris Blessing) http://forums.330i.net 
## MOD Description: As the title states, it simply allows users to use multiple spaces 
##				    in their posts by inserting the &nbsp; entity as necessary. 
## MOD Version: 1.0.0 
## 
## Installation Level: Easy
## Installation Time: 1 Minute
## Files To Edit: includes/functions_post.php
## 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 is a global add-on, no ACP control provided (yet).
############################################################## 
## MOD History: 
## 
##   2004-04-17 - Version 1.0.0
##      - first edition, no ACP yet 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

# 
#-----[ OPEN ]------------------------------------------ 
# 

includes/functions_post.php

# 
#-----[ FIND ]------------------------------------------ 
# 

		$message = bbencode_first_pass($message, $bbcode_uid);
	}

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

	// MOD allow multiple spaces BEGIN
	$message = replace_double_spaces($message);
	// MOD allow multiple spaces END
	
# 
#-----[ FIND ]------------------------------------------ 
# 

?>

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 

	// MOD allow multiple spaces BEGIN
	function replace_double_spaces($message)
	{
		// setup find/replace vars
		$nbsp_match = '/  /';
		$nbsp_replace = ' &nbsp;';
		
		// replace all instances of double-spaces with a single space + &nbsp;
		$message = preg_replace($nbsp_match, $nbsp_replace, $message);
	
		return $message;
	}
	// MOD allow multiple spaces END

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM 



.
舊站台經已結朿了, 學生們可到遊戲站玩玩 Flash Game (不必註冊) 免費 Flash Game
在此學到很多架站知識, 永遠多謝:
心靈捕手老師, ~倉木麻衣~, 依夢兒 及 神川小羽各位大大相助

主題已鎖定

回到「官方認證外掛」