When you edit a link, whatever the summary is, it's replaced by the full text

Register an Account
Pligg Chat Room
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-27-2008, 10:57 AM
New Pligger
 
Join Date: Jul 2008
Posts: 19
If you try to edit a link, it doesn't matter if you write your own summary... the summary text is always replaced with the first 150 (or whatever) characters of the full text, even if you write the summary again.

I was taking a look at editlink.php and I think I found the bug (and the solution).

This was the original code:

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 = 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);
   }
}
and I believe it needs to be like this:

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 = strip_tags(trim($_POST['summarytext']), 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);
   }
}

Am I right?
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 06:58 PM
How to show category keywords as text on the site? gnalkit Questions and Comments 4 11-26-2008 05:17 AM
Better Submit and Edit Link pages AnAlienHolakres3 Questions and Comments 3 07-24-2008 08:44 AM
[SOLVED] Allow edit of summary LeoNel Questions and Comments 5 02-06-2008 12:56 PM
Summary Text After Link Edit Andreiii Questions and Comments 1 09-16-2007 02:40 AM


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