[2.0.20] 50 characters in message

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

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
7
88%
Very Good
0
No votes
Good
0
No votes
Fair
0
No votes
Poor
1
13%
 
Total votes: 8

NoDeity
Registered User
Posts: 148
Joined: Thu Jul 17, 2003 9:43 am
Contact:

Post by NoDeity » Sat Jul 08, 2006 8:23 am

404 error for the demo. Temporary problem?

Underhill
Registered User
Posts: 154
Joined: Tue Sep 27, 2005 1:54 pm

Post by Underhill » Sun Jul 09, 2006 12:02 am

Hi,

"official" demo for the MOD:

http://www.underhill.de/phpbb2/?language=english

and the MOD does work for the signature also...


Reg.
Underhill
batlh ghajbe' De'wI'mey!

NoDeity
Registered User
Posts: 148
Joined: Thu Jul 17, 2003 9:43 am
Contact:

Post by NoDeity » Sun Jul 09, 2006 5:24 am

Underhill wrote: and the MOD does work for the signature also...

Hmm... I must have made a mistake in installing it, then.

NoDeity
Registered User
Posts: 148
Joined: Thu Jul 17, 2003 9:43 am
Contact:

Post by NoDeity » Tue Jul 11, 2006 6:42 pm

Would it be possible for this MOD to not split long URLs? Splitting an URL at 50 characters sort of messes things up.

For long URLs, I use Chunk Long URLs, which shortens them without wrecking them.

Underhill
Registered User
Posts: 154
Joined: Tue Sep 27, 2005 1:54 pm

Post by Underhill » Thu Jul 13, 2006 6:51 am

Hi,

use this code in combination with the Chunk Long URLs MOD:

Code: Select all

	//
	// 50 characters in message
	//
	if (preg_match("/([^[:blank:]]{50})/", $message))
	{
		$message_array = preg_split("/\n/", $message);
		for ($x = 0; $x < count($message_array); $x++)
		{
			if (!preg_match('#^(http://|https://|ftp://|www\.)#is', $message_array[$x])) // Ignore all types of URL...
			{
				$message_array[$x] = preg_replace("/([^[:blank:]]{50})/", "\\1 ", $message_array[$x]);
			}
			$message = implode("\n", $message_array);
		}
	}
Reg.
Underhill
batlh ghajbe' De'wI'mey!

NoDeity
Registered User
Posts: 148
Joined: Thu Jul 17, 2003 9:43 am
Contact:

Post by NoDeity » Thu Jul 13, 2006 7:17 am

Thanks. I'll try that. :)

NoDeity
Registered User
Posts: 148
Joined: Thu Jul 17, 2003 9:43 am
Contact:

Post by NoDeity » Thu Jul 13, 2006 8:11 am

Hi. You're going to get tired of seeing me here. ;)

I found a bug. It handles most types of URLs properly. However, it turns this line:

modification is here: http://www.phpbb.com/phpBB/viewtopic.ph ... 35#2249535

...into this:

modification is here: http://www.phpbb.com/phpBB/viewtopic.php?p=2249535 #2249535

Notice the space added before the '#'. I tried replacing the '#' with other symbols and even removing it completely (like 22495352249535) but it still put a space right there. It doesn't do it with ordinary URLs.

Underhill
Registered User
Posts: 154
Joined: Tue Sep 27, 2005 1:54 pm

Post by Underhill » Thu Jul 13, 2006 11:23 pm

Hi,

this sound like a bug in the Chunk Long URLs MOD ... :cry:

Did the error also appears without the 50Chars MOD?


Reg.
Underhill

Edit: But there is no problem in my local demo forum...

will be
modification is here: http://www.phpbb.com/phpBB/vie ... 35#2249535

Please double check editing...
batlh ghajbe' De'wI'mey!

NoDeity
Registered User
Posts: 148
Joined: Thu Jul 17, 2003 9:43 am
Contact:

Post by NoDeity » Fri Jul 14, 2006 3:21 am

I'll check my editing. The problem stopped when I took out your MOD. I will check to see whether the problem occurs when your MOD is in and Chunk Long URLs is out.

Underhill
Registered User
Posts: 154
Joined: Tue Sep 27, 2005 1:54 pm

Post by Underhill » Fri Jul 14, 2006 7:29 am

Yes - Now I can imitate this

Please try:

Code: Select all

if (!preg_match('#(http://|https://|ftp://|www\.)#is', $message_array[$x]))
instead
if (!preg_match('#^(http://|https://|ftp://|www\.)#is', $message_array[$x]))

better then?

Reg.
Underhill
batlh ghajbe' De'wI'mey!

NoDeity
Registered User
Posts: 148
Joined: Thu Jul 17, 2003 9:43 am
Contact:

Post by NoDeity » Fri Jul 14, 2006 8:06 am

Thanks again. I won't be able to try this tonight but I will try it and I'll let you know how it goes.

NoDeity
Registered User
Posts: 148
Joined: Thu Jul 17, 2003 9:43 am
Contact:

Post by NoDeity » Sat Jul 15, 2006 7:20 am

Yes, that works! I appreciate your efforts, Underhill. Good work.

Underhill
Registered User
Posts: 154
Joined: Tue Sep 27, 2005 1:54 pm

Post by Underhill » Mon Jul 17, 2006 3:19 pm

Ok,

I hold this in a "FAQ" for these MOD:
http://www.underhill.de/downloads/phpbb ... getips.txt


Thanks and Reg.
Underhill
batlh ghajbe' De'wI'mey!

NoDeity
Registered User
Posts: 148
Joined: Thu Jul 17, 2003 9:43 am
Contact:

Post by NoDeity » Tue Jul 18, 2006 9:53 am

It would be great if all MOD authors were as conscientious as you have been in this matter.

ZoliveR
Former Team Member
Posts: 11899
Joined: Sun Jul 14, 2002 7:36 pm
Location: floating in the light, never forgotten

Post by ZoliveR » Mon Jul 24, 2006 4:31 pm

Hello. I noticed also the problem with long urls
I've installed this mod and autoShortenURLs and when i tried, it cutted the url, i've tried to extend to 80 chars but is appears like this: http://testofalongurl.com/testofalongur ... /testofalo ngurl/testofalongurl.html

Is this fix you provided is working also with auto shorten url?
Many thanks, in all cases your mod is very nice 8)


Underhill wrote: Yes - Now I can imitate this

Please try:

Code: Select all

if (!preg_match('#(http://|https://|ftp://|www\.)#is', $message_array[$x]))
instead
if (!preg_match('#^(http://|https://|ftp://|www\.)#is', $message_array[$x]))

better then?

Reg.
Underhill
No more Team Chocolate Member. I decided to leave, it's my choice. Thanks to all for all these years.
I'm always near if you need news of me. But no more support is given (private notification disabled)

Post Reply

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