Go Back   Pligg CMS Forum > Pligg Development > Bug Report

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-15-2007, 09:45 PM
Casual Pligger
Pligg Version: 9.7
Pligg Template: yget based
 
Join Date: Aug 2007
Posts: 50
Thanks: 5
Thanked 0 Times in 0 Posts
Summary Text After Link Edit

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, 02:40 AM
New Pligger
Pligg Version: 9.8.2
Pligg Template: yget
 
Join Date: Aug 2007
Posts: 18
Thanks: 7
Thanked 1 Time in 1 Post
Solved, check this out

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
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
When you edit a link, whatever the summary is, it's replaced by the full text VictorML Bug Report 0 07-27-2008 10:57 AM
Better Submit and Edit Link pages AnAlienHolakres3 Modification Tutorials 3 07-24-2008 08:44 AM
[SOLVED] Allow edit of summary LeoNel Bug Report 5 02-06-2008 12:56 PM
edit story and outgoing link returns blank page crusty General Help 0 08-23-2007 02:30 PM
NEW: "Read More" link after story summary kbeeveer46 Modification Tutorials 9 12-01-2006 04:55 PM


Search Engine Friendly URLs by vBSEO 3.2.0