Recent Forum Posts on Homepage

6 postsstarted by greenwoodkl 2,969 viewsoriginal topic

#1
Is there anyway to edit the code that parses or pastes the recent forum posts onto the homepage to ignore quoted text? There have been several recent postings where all I see on the homepage is a section of a previous post because it is the first thing in the new post as a quote.
Senior Member
#2
kgthunder wrote:Is there anyway to edit the code that parses or pastes the recent forum posts onto the homepage to ignore quoted text? There have been several recent postings where all I see on the homepage is a section of a previous post because it is the first thing in the new post as a quote.
I'll look at the parsing code to see what I can do. Thanks for the idea.

Tom
Senior Member
#3
tomw wrote:I'll look at the parsing code to see what I can do. Thanks for the idea.

Tom
I think that this is fixed now. For those interested here was the problem. There was indeed code that was trying to strip the
tags out. The code was as follows:

Code:

$c_text=preg_replace("[\[quote="(.*?)\"](.*?)\[\/QUOTE\]]", "", $bthread->pagetext)]This code was looking for any text between QUOTE tags and replacing it with "".  This code had 2 problems.[list=1]
[*]It was case sensitive.  Most of the quotes (when you use the quote button to respond to a thread) insert a lower case "quote".
[*]If there was a newline in the quoted text, this code would not find / replace.[/list]I changed the code to the following:
[code]
$c_text=preg_replace("/\[quote="(.*?)QUOTE\"]/is", "", $bthread->pagetext)]This is a simpler regular expression that also tells the evaluator to ignore case and newlines.  Let me know if you guys see any anomalies with this code.

Tom
#4
Tom, thanks for the fix. I don't know regex that well, but I did find what I think is either a minor glitch or another bug with this feature. I see two entries that are identical in the "Recent" section. Does the app post the same thread up whenever it is edited after the original post? Could it just edit the original entry for the "Recent" section or remove the original and put the edited post at the most recent?
Senior Member
#5
If someone edits a post, it may show it twice. Not much I can easily do about that. If it becomes a big problem, I'll look into it more.

Tom
#6
No worries. Thanks for all you do, this is a high-stress job moderating the forums I imagine. ;)