Recent Forum Posts on Homepage

Having a problem with the Forum, Wiki, Jira or other aspect of tech.lds.org? This is the place.
User avatar
greenwoodkl
Member
Posts: 242
Joined: Sun Jan 21, 2007 1:59 am
Location: Orem, Utah, United States
Contact:

Recent Forum Posts on Homepage

Postby greenwoodkl » Tue Feb 06, 2007 9:36 pm

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: 2088
Joined: Wed Sep 06, 2006 7:51 am
Location: Kaysville, UT, USA
Contact:

Postby WelchTC » Wed Feb 07, 2007 7:19 am

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: 2088
Joined: Wed Sep 06, 2006 7:51 am
Location: Kaysville, UT, USA
Contact:

Postby WelchTC » Fri Feb 09, 2007 10:45 am

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 [quote] 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.
  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".
  2. If there was a newline in the quoted text, this code would not find / replace.
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: 242
Joined: Sun Jan 21, 2007 1:59 am
Location: Orem, Utah, United States
Contact:

Postby greenwoodkl » Sun Feb 11, 2007 6:20 pm

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: 2088
Joined: Wed Sep 06, 2006 7:51 am
Location: Kaysville, UT, USA
Contact:

Postby WelchTC » Mon Feb 12, 2007 7:25 am

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: 242
Joined: Sun Jan 21, 2007 1:59 am
Location: Orem, Utah, United States
Contact:

Postby greenwoodkl » Mon Feb 12, 2007 7:31 am

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


Return to “Help with tech.lds.org”

Who is online

Users browsing this forum: No registered users and 1 guest