Preserve Post Spaces

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in the Customisations Database.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
Extensions Robot
Extensions Robot
Extensions Robot
Posts: 28206
Joined: Sat Aug 16, 2003 7:36 am

Preserve Post Spaces

Post by Extensions Robot »

Modification name: Preserve Post Spaces
Author: benjam
Modification description: Preserve the spaces as they are entered in the post.
Modification version: 2.0.0
Tested on phpBB version: 3.0.8

Download file: preserve.zip
File size: 33.73 KiB

Modification overview page: View

The phpBB Team is not responsible nor required to provide support for this modification. By installing this MOD, you acknowledge that the phpBB Support Team or phpBB Extensions Team may not be able to provide support.

-->Modification support<--
Last edited by Extensions Robot on Mon Mar 27, 2017 3:09 pm, edited 10 times in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 26138
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Preserve Post Spaces

Post by Paul »

Modification validated/released

Notes:
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development
benjam
Registered User
Posts: 2
Joined: Thu Apr 12, 2007 9:44 pm

Preserve Post Spaces

Post by benjam »

This post has been reserved for the MOD author.
simvader
Registered User
Posts: 144
Joined: Thu Sep 06, 2007 5:54 pm
Location: Netherlands
Contact:

Re: Preserve Post Spaces

Post by simvader »

nice modification! :D
dodo5000
Registered User
Posts: 50
Joined: Sun Nov 19, 2006 1:49 pm
Location: Palestine
Contact:

Re: Preserve Post Spaces

Post by dodo5000 »

could you explain it a little more please :oops:
gtraddict
Registered User
Posts: 33
Joined: Wed Feb 11, 2009 4:52 pm

Re: Preserve Post Spaces

Post by gtraddict »

This MOD works well when viewing the post, but still allows the spaces to be removed when viewing via preview post.
User avatar
polkadotcat
Registered User
Posts: 53
Joined: Thu Jun 23, 2005 11:11 pm
Contact:

Re: Preserve Post Spaces

Post by polkadotcat »

Thanks for the mod benjam :D
gtraddict wrote:This MOD works well when viewing the post, but still allows the spaces to be removed when viewing via preview post.
Hi gtraddict.. try these edits.. (works for me)

To get it to work in preview (above post box)..
Open posting.php and find the following lines of code

Code: Select all

// Preview
if (!sizeof($error) && $preview)
{
	$post_data['post_time'] = ($mode == 'edit') ? $post_data['post_time'] : $current_time;

	$preview_message = $message_parser->format_display($post_data['enable_bbcode'], $post_data['enable_urls'], $post_data['enable_smilies'], false);
On a separate line after, add the following

Code: Select all

	// Preserve spaces MOD
	$preview_message = str_replace("\t", '        ', $preview_message);
	$preview_message = str_replace('  ', ' &nbsp;', $preview_message);
	// end MOD
To get it to work in the topic review window (below post box)..
Open includes/functions_posting.php and find the following lines of code

Code: Select all

		$poster_id		= $row['user_id'];
		$post_subject	= $row['post_subject'];
		$message		= censor_text($row['post_text']);
On a separate line after, add the following

Code: Select all

	// Preserve spaces MOD
	$message = str_replace("\t", '        ', $message);
	$message = str_replace('  ', ' &nbsp;', $message);
	// end MOD
I'm just a girl in the world...
polkadotcat's wee world...
Peter77sx
Registered User
Posts: 3259
Joined: Wed Nov 09, 2005 2:51 pm

Re: Preserve Post Spaces

Post by Peter77sx »

is he talking about white spaces?



doesn't phpbb3


do that already?
User avatar
polkadotcat
Registered User
Posts: 53
Joined: Thu Jun 23, 2005 11:11 pm
Contact:

Re: Preserve Post Spaces

Post by polkadotcat »

Peter77sx wrote:is he talking about white spaces?



doesn't phpbb3


do that already?
nope it doesn't..

eg: this line of text has 10 spaces preceeding the word THIS.
in other words it should look like this
eg:_________this line of text has spaces preceeding the word THIS.
but it doesn't..
benjam's mod fixes this so we don't need to use the codebox anymore to display formatted text

codebox formatted example

Code: Select all

eg:           this line of text has 10 spaces preceeding the word THIS.
in other words it should look like this
eg:_________this line of text has spaces preceeding the word THIS.
I'm just a girl in the world...
polkadotcat's wee world...
User avatar
sixtvs
Registered User
Posts: 215
Joined: Thu Feb 14, 2008 8:39 am
Location: Virginia Beach, VA
Contact:

Re: Preserve Post Spaces

Post by sixtvs »

Awesome . . . thank you Benjam
People sleep peacefully at night only because rough men stand ready to fight for them!
marian0810
Former Team Member
Posts: 3011
Joined: Mon May 21, 2007 9:17 pm
Location: The Netherlands
Name: Marian
Contact:

Re: Preserve Post Spaces

Post by marian0810 »

Does this affect smilies? Do they still work when you put more than one space before them?
You and me, time and space. You watch us run!
User avatar
Jim Dominic
Registered User
Posts: 104
Joined: Sat Apr 02, 2005 6:38 pm

Re: Preserve Post Spaces

Post by Jim Dominic »

marian0810 wrote:Does this affect smilies? Do they still work when you put more than one space before them?
It will keep the spaces between smilies in a row, but doesn't seem to keep the spaces in front of the first smilie in the sequence. Smilies still work though.
stokerpiller
Registered User
Posts: 1934
Joined: Wed Feb 28, 2007 8:06 pm

Re: Preserve Post Spaces

Post by stokerpiller »

This mod conflicts with some bbcodes.
Especially bbcodes that uses some kind of javascript.

Any fix for this?
I am done with phpBB
Electra736
Registered User
Posts: 270
Joined: Fri Aug 11, 2006 4:25 pm

Re: Preserve Post Spaces

Post by Electra736 »

Why not place the code in message parser? It would help save some resources.
Mr.Victor
Registered User
Posts: 91
Joined: Tue Oct 23, 2007 8:17 pm

Re: Preserve Post Spaces

Post by Mr.Victor »

This doesn't seem to be working in the signatures. Any fix for this?
Locked

Return to “[3.0.x] MOD Database Releases”

cron