Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> Raven's RavenNuke(tm) v2.02.02 Distro
Author Message
hl3395
New Member
New Member



Joined: Apr 18, 2006
Posts: 3

PostPosted: Sat Jul 29, 2006 2:11 pm Reply with quote

Hi I'm having a problem with my comments not ordering according to tid or date. It doesn't seem to happen until there's over 10 comments.

Here's a post example: http://wow.linuncensored.com/modules.php?name=News&file=article&sid=484

You'll notice that a comment on July 15 is above the comments on the July 11.

I'm using 7.6 v2.02.02 and the comments.php file has not been touched in any way.

Thanks in advance, hopefully it's something really simple.
 
View user's profile Send private message
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Sat Jul 29, 2006 2:30 pm Reply with quote

Ok, I have looked at your site and the code and I am wondering if these users are in different timezones? It is picking up the topics that are directly tied to the parent story and then for each topic, it will cycle through the "child comments" until done with the topic and then move on to the next.

The query for pulling the list of topics (highest level comments) is sorting in descending order of date (system time) and then the dates are being displayed given your timezone.

This may be giving it the "illusion" of being off in time sequence.

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
hl3395







PostPosted: Tue Aug 01, 2006 3:52 am Reply with quote

This doesn't explain how a July 15 post is above the July 11 post.
As for the post date, they are all MST in the database. So shouldn't matter where the posts are from, if it's being sorted by that, should it?

I guess I'll fiddle with the order by condition and see if it even changes the posting order.
 
montego







PostPosted: Tue Aug 01, 2006 5:53 am Reply with quote

Yeah, something about that has been bugging me ever since I wrote it. There is a function which is formatting the date and IF it is formatting the date based on the poster's locale, the behaviour I described would be correct, however, I have not had time to really dig into that function.
 
hl3395







PostPosted: Wed Aug 23, 2006 12:38 pm Reply with quote

ok I did some fiddling and found out what was causing this.

Quote:

if ($order==1) $q .= " ORDER BY date DESC";
if ($order==2) $q .= " ORDER BY score DESC";


What seemed to be happening to me is the $order value seems to be set to 0 if there's no predefined value, which cause the ordering to be whatever the default order the database is in.

Before this

if ($order==1) $q .= " ORDER BY date DESC";

I added

if (!$order==1 || !$order==2) $q .= " ORDER BY date DESC";

It's not pretty but it works. I tried setting all the $order=0 to $order=1, but that didn't seem to changed anything.
 
montego







PostPosted: Wed Aug 23, 2006 9:44 pm Reply with quote

Not sure the "other effects" of using the "OR". Maybe this would be better:

if (empty($order) || $order='') $q .= " ORDER BY date DESC";

Regards
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> Raven's RavenNuke(tm) v2.02.02 Distro

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©