Recent Forum Posts on Homepage

Having a problem with the Forum? Or feedback about the forum? This is the place.
Post Reply
User avatar
greenwoodkl
Member
Posts: 288
Joined: Sun Jan 21, 2007 1:59 am
Location: Orem, Utah, Utah, United States
Contact:

Recent Forum Posts on Homepage

#1

Post by greenwoodkl »

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.
User avatar
WelchTC
Senior Member
Posts: 2085
Joined: Wed Sep 06, 2006 8:51 am
Location: Kaysville, UT, USA
Contact:

#2

Post by WelchTC »

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
User avatar
WelchTC
Senior Member
Posts: 2085
Joined: Wed Sep 06, 2006 8:51 am
Location: Kaysville, UT, USA
Contact:

#3

Post by WelchTC »

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: 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
User avatar
greenwoodkl
Member
Posts: 288
Joined: Sun Jan 21, 2007 1:59 am
Location: Orem, Utah, Utah, United States
Contact:

#4

Post by greenwoodkl »

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?
User avatar
WelchTC
Senior Member
Posts: 2085
Joined: Wed Sep 06, 2006 8:51 am
Location: Kaysville, UT, USA
Contact:

#5

Post by WelchTC »

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
User avatar
greenwoodkl
Member
Posts: 288
Joined: Sun Jan 21, 2007 1:59 am
Location: Orem, Utah, Utah, United States
Contact:

#6

Post by greenwoodkl »

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

Return to “Help with this forum”