Recent Forum Posts on Homepage
- greenwoodkl
- Member
- Posts: 288
- Joined: Sun Jan 21, 2007 1:59 am
- Location: Orem, Utah, Utah, United States
- Contact:
Recent Forum Posts on Homepage
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.
- WelchTC
- Senior Member
- Posts: 2085
- Joined: Wed Sep 06, 2006 8:51 am
- Location: Kaysville, UT, USA
- Contact:
I'll look at the parsing code to see what I can do. Thanks for the idea.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.
Tom
- WelchTC
- Senior Member
- Posts: 2085
- Joined: Wed Sep 06, 2006 8:51 am
- Location: Kaysville, UT, USA
- Contact:
I think that this is fixed now. For those interested here was the problem. There was indeed code that was trying to strip thetomw wrote:I'll look at the parsing code to see what I can do. Thanks for the idea.
Tom
tags out. The code was as follows:Code: Select all
$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
- greenwoodkl
- Member
- Posts: 288
- Joined: Sun Jan 21, 2007 1:59 am
- Location: Orem, Utah, Utah, United States
- Contact:
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?
- WelchTC
- Senior Member
- Posts: 2085
- Joined: Wed Sep 06, 2006 8:51 am
- Location: Kaysville, UT, USA
- Contact:
- greenwoodkl
- Member
- Posts: 288
- Joined: Sun Jan 21, 2007 1:59 am
- Location: Orem, Utah, Utah, United States
- Contact: