Home · Links · Contact Us
Home arrow Forums
Home
Features
FAQ
Screen Shots
Modules
Themes
Demos
Documentation
Forums
Contact Us
Download
Purchase
Quotes

" ... I want to tell you that your thyme product is functional and valuable beyond words. I cannot imagine why any portal would be without it. It is the cornerstone of our new project ..."

" ... Thanks for such a complete project, its making my job much easier. ..."

" ... I have now deployed 4 different calendars and our users love them ... "

" ... Easy to install and use and a great look/design. ..."

" ... This has to be the easiest to use program I think I've had to deal with at all this year. ..."


  FAQFAQ    SearchSearch  RegisterRegister   Log inLog in 
Any Logic as to Display of All Day Events?

 
Post new topic   Reply to topic     Forum Index -> Hacking Thyme
View previous topic :: View next topic  
Author Message
bksnbriefs



Joined: 11 Dec 2007
Posts: 3

PostPosted: Tue Dec 11, 2007 7:28 pm    Post subject: Any Logic as to Display of All Day Events? Reply with quote

Hi all ... I'm still evaluating the software, but wanted to know if there is any logic in the way all day events are ordered/displayed

If I enter

Wang
Adachi
Yu
Evans
Vu
Wargo
Zollman
Amabelie
Gray

as 9 seperate all day events in the order listed,

I get 9 all day events displayed in this order .. from top to bottom:
Zollman
Amabelie
Gray
Wargo
Vu
Adachi
Yu
Evans
Wang

This makes no sense and it is driving me crazy ... lots of people will share this calendar and the lack of any logic to find the data, will make it difficult to implement.

Any suggestions?

Thanks.

Tyler


[/img]
Back to top
View user's profile Send private message
esoft_ian



Joined: 12 Sep 2005
Posts: 5275

PostPosted: Tue Dec 11, 2007 7:38 pm    Post subject: Reply with quote

Hi,

There is logic behind the sorting. The events are sorted by category. If they have the same or no categories associated with them, then they are sorted by the order that they are pulled from the db.

Would you like to customize this sorting?
Back to top
View user's profile Send private message Visit poster's website
peiqinglong



Joined: 12 Dec 2007
Posts: 18

PostPosted: Tue Dec 11, 2007 9:39 pm    Post subject: Reply with quote

We were hoping that it would sort by title or at the very least by order they were inputted. Is it just a random query of the database and then the results are displayed?
Back to top
View user's profile Send private message
bksnbriefs



Joined: 11 Dec 2007
Posts: 3

PostPosted: Tue Dec 11, 2007 10:03 pm    Post subject: Reply with quote

this is what I mean ... is there any logic as to how thyme pulls this stuff out of the database?

there seems to be no order as to how all day events are displayed.


Back to top
View user's profile Send private message
esoft_ian



Joined: 12 Sep 2005
Posts: 5275

PostPosted: Wed Dec 12, 2007 12:27 am    Post subject: Reply with quote

Yes. They are sorted by category if they have the same start time. If you would like them to be sorted by title, do this:

*) Create a file in Thyme's customize/ folder called event_sort.php with the following contents:

Code:
<?php

function custom_event_sort($a,$b) {

   if($a['allday'] && $b['allday'])
      return strnatcasecmp($a['title'], $b['title']);

   if($b['allday'] > 0) return 1;
   if($a['allday'] > 0) return -1;


   if($a['next'] == $b['next']) {
      return strnatcasecmp($a['title'], $b['title']);
   }

   return ($a['next'] < $b['next']) ? -1 : 1;
}



Last edited by esoft_ian on Wed Dec 12, 2007 12:30 am; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
esoft_ian



Joined: 12 Sep 2005
Posts: 5275

PostPosted: Wed Dec 12, 2007 12:28 am    Post subject: Reply with quote

Ooops. Change that &lt; at the top to a less-than symbol. <
Back to top
View user's profile Send private message Visit poster's website
bksnbriefs



Joined: 11 Dec 2007
Posts: 3

PostPosted: Wed Dec 12, 2007 12:50 am    Post subject: Reply with quote

yes, but what happens when (as in the example above) they have the SAME category and the SAME time (an all day event) ... in what order do these all day events get pulled out from the dB and displayed? It seem like even if they have the same category and the same time, there is no logic as to how they are getting pulled out from the dB and displayed in the calendar. I wish it was alphabetical. This would make the most sense.

am I missing something?

thanks in advance for your help.

Tyler
Back to top
View user's profile Send private message
esoft_ian



Joined: 12 Sep 2005
Posts: 5275

PostPosted: Wed Dec 12, 2007 1:00 am    Post subject: Reply with quote

I must be misunderstanding the question.

1) Events are pulled from the db in no specific order. There is no 'order' statement. All sorting is done by PHP.

2) Events are sorted by time

3) If they occur at the same time, they are then sorted by category.

4) If they have the same time and category, no further sorting is done.

I'm not sure what you're asking. You seem to be making the statement that there is no logic as to how they are being pulled from the db. They are being pulled from the DB by PHP. If you mean order, then yes, you are correct. Ordering is done through PHP rather than by the database. Making the database sort by title just to have PHP turn around and sort it by time would be inefficient. The snippet above will sort it by title after time though. Do you have a question on how to implement it? I apologize if I am misunderstanding the question.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Hacking Thyme All times are GMT
Page 1 of 1

 
Jump to:  
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
© 2005 eXtrovert software unless otherwise noted. All rights reserved.
Portions © 2004 Ben Brown. All rights reserved.
Trademarks are property of their respective owners.