Summary Text After Link Edit

Register an Account
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 09-15-2007, 10:45 PM
Casual Pligger
Pligg Version: 9.7
Pligg Template: yget based
 
Join Date: Aug 2007
Posts: 84
I use Pligg 9.7.0 and Url Method 2.

When I edit story, summarytext drops linebrakes. And after saving summarytext it begin like this : "String1rnString2". What is wrong?

I checkout editlink.php. I think the problem at here:

Code:
			if($_POST['summarytext'] == ""){
				$linkres->link_summary = utf8_substr(strip_tags(trim($_POST['bodytext']), Story_Content_Tags_To_Allow), 0, StorySummary_ContentTruncate - 1);
				$linkres->link_summary = str_replace("\n", "<br />", $linkres->link_summary);				
			} else {
				$linkres->link_summary = $db->escape($_POST['summarytext']);
				$linkres->link_summary = strip_tags(trim($linkres->link_summary), Story_Content_Tags_To_Allow);
        			$linkres->link_summary = str_replace("\n", "<br />", $linkres->link_summary);
				if(strlen($linkres->link_summary) > StorySummary_ContentTruncate){
				loghack('SubmitAStory-SummaryGreaterThanLimit', 'username: ' . $_POST["username"].'|email: '.$_POST["email"], true);
				$linkres->link_summary = utf8_substr($linkres->link_summary, 0, StorySummary_ContentTruncate - 1);
				$linkres->link_summary = str_replace("\n", "<br />", $linkres->link_summary);
				}
or here:

Code:
			$linkres=new Link;

			$edit = false;

			$link_id = $_GET['id'];
			$linkres->id=$link_id;
			$linkres->read();
			$link_title = $linkres->title;
			$link_content = str_replace("<br />", "\n", $linkres->content);
			$link_category=$linkres->category;
			$link_summary = str_replace("<br />", "\n", $linkres->link_summary);
Please help me
Reply With Quote
  #2 (permalink)  
Old 09-16-2007, 03:40 AM
New Pligger
Pligg Version: 9.8.2
Pligg Template: yget
 
Join Date: Aug 2007
Posts: 18
Hi there, this is solved by Darek in this post (Bad handling of multi-line summary editlink.php). It solved the problem absolutely perfect!

http://forums.pligg.com/core-develop...tlink-php.html

/Niko


Quote:
Originally Posted by Andreiii View Post
I use Pligg 9.7.0 and Url Method 2.

When I edit story, summarytext drops linebrakes. And after saving summarytext it begin like this : "String1rnString2". What is wrong?

I checkout editlink.php. I think the problem at here:

Code:
			if($_POST['summarytext'] == ""){
				$linkres->link_summary = utf8_substr(strip_tags(trim($_POST['bodytext']), Story_Content_Tags_To_Allow), 0, StorySummary_ContentTruncate - 1);
				$linkres->link_summary = str_replace("\n", "<br />", $linkres->link_summary);				
			} else {
				$linkres->link_summary = $db->escape($_POST['summarytext']);
				$linkres->link_summary = strip_tags(trim($linkres->link_summary), Story_Content_Tags_To_Allow);
        			$linkres->link_summary = str_replace("\n", "<br />", $linkres->link_summary);
				if(strlen($linkres->link_summary) > StorySummary_ContentTruncate){
				loghack('SubmitAStory-SummaryGreaterThanLimit', 'username: ' . $_POST["username"].'|email: '.$_POST["email"], true);
				$linkres->link_summary = utf8_substr($linkres->link_summary, 0, StorySummary_ContentTruncate - 1);
				$linkres->link_summary = str_replace("\n", "<br />", $linkres->link_summary);
				}
or here:

Code:
			$linkres=new Link;

			$edit = false;

			$link_id = $_GET['id'];
			$linkres->id=$link_id;
			$linkres->read();
			$link_title = $linkres->title;
			$link_content = str_replace("<br />", "\n", $linkres->content);
			$link_category=$linkres->category;
			$link_summary = str_replace("<br />", "\n", $linkres->link_summary);
Please help me
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Edit link bug cucat Questions and Comments 2 01-21-2009 07:58 PM
How to show category keywords as text on the site? gnalkit Questions and Comments 4 11-26-2008 06:17 AM
When you edit a link, whatever the summary is, it's replaced by the full text VictorML Questions and Comments 0 07-27-2008 11:57 AM
Better Submit and Edit Link pages AnAlienHolakres3 Questions and Comments 3 07-24-2008 09:44 AM
[SOLVED] Allow edit of summary LeoNel Questions and Comments 5 02-06-2008 01:56 PM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development