CMS MADE SIMPLE FORGE

Guestbook

 

[#5128] Guestbook broken nl2pnbr()

avatar
Created By: Rolf (rolf1)
Date Submitted: Sun Jul 04 14:45:44 -0400 2010

Assigned To: Gab.Matias (Gaby)
Version: Guestbook-1.1.12
CMSMS Version: None
Severity: Critical
Resolution: Fixed
State: Closed
Summary:
Guestbook broken nl2pnbr()
Detailed Description:
After upgrading to cmsms 1.8  I get at the Guestbook page:
Fatal error: Call to undefined function nl2pnbr() in
/public/sites/www.----site.com/modules/Guestbook/action.get-entrylist.php  on
line 46

grtz. Rolf


History

Comments
avatar
Date: 2010-07-04 15:00
Posted By: Rolf (rolf1)

Okay a coincidence. Probably I notice this just now, because of the upgrading.
Think the problem is a serverchange my host did last week.
Soo the problem is still there, but another cause...
      
avatar
Date: 2010-07-04 15:07
Posted By: Rolf (rolf1)

Humm, no coincidence perhaps...
http://forum.cmsmadesimple.org/index.php/topic,45373.new.html

      
avatar
Date: 2010-07-04 15:40
Posted By: Rolf (rolf1)

Okay solved it for now by quoting out the line 46 in action.get-entrylist.php
//$entry['message'] = nl2pnbr($entry['message']);

and changing in the template:
{$entry.message}

into

<p>{$entry.message|nl2br}</p>


      
avatar
Date: 2010-07-04 21:10
Posted By: Gab.Matias (Gaby)

The original function has been commented ...
It is on 519 line.
//Taken from http://www.webmasterworld.com/forum88/164.htm
/*
function nl2pnbr( $text )
{
	// Use \n for newline on all systems
	$text = preg_replace("/(\r\n|\n|\r)/", "\n", $text);

	// Only allow two newlines in a row.
	$text = preg_replace("/\n\n+/", "\n\n", $text);

	// Put <p>..</p> around paragraphs
	$text = preg_replace('/\n?(.+?)(\n\n|\z)/s', "<p>$1</p>", $text);

	// Convert newlines not preceded by </p> to a <br /> tag
	$text = preg_replace('|(?<!</p>)\s*\n|', "<br />", $text);

	return $text;
}*/

You can remove /* and */ and the guestbook will work as before.

Feel free to leave us another comment if you know the name of the successor
function.
      
avatar
Date: 2010-07-05 21:23
Posted By: Gab.Matias (Gaby)

Fixed in SVN
      
avatar
Date: 2010-07-29 16:47
Posted By: Rolf (rolf1)

Hi Gaby,

I noticed your work just now in the #CMS IRC. Thanks for this!
Just to let you know I did some beta testing earlier. 
The result are in this topic.
http://forum.cmsmadesimple.org/index.php/topic,35444.msg199114.html#msg199114

Regards, Rolf


      
avatar
Date: 2010-07-30 07:53
Posted By: Gab.Matias (Gaby)

Hi Rolf,
This is my first contribution in a project and I am pleased that my work is
considered! (I have only 16 year old, so i'm sorry for my english which is not
as well that it should be)

I didn't see your post earlier so I used to found by my self all bug and
features that could be good. My next commit would replace the old smarty
paginate by a dynamic and more efficient one (That I think ^^).

Feel free to send me feedback or whatever you want about this.

Regards,
Gaby
      
avatar
Date: 2010-09-17 07:16
Posted By: Arjan de Wit (bob_basli)

Hi Gaby,
Experiencing the same problem and don't want to use the rc4 of 1.3
Whisch svn should I use to get this fixed?
      
avatar
Date: 2010-09-17 08:57
Posted By: Gab.Matias (Gaby)

Read my other anwer. If you want aswell to use stable release, then edit as I
described the files...
      
Updates

Updated: 2011-02-05 07:59
state: Open => Closed

Updated: 2010-08-01 19:52
resolution_id: 5 => 7

Updated: 2010-07-29 16:47
assigned_to_id: 100 => 12119

Updated: 2010-07-04 15:40
summary: Guestbook broken => Guestbook broken nl2pnbr()

Updated: 2010-07-04 15:00
summary: Guestbook broken after upgrade cms 1.8 => Guestbook broken
resolution_id: => 5