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 
Primary Category when multiple categories selected
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic     Forum Index -> Hacking Thyme
View previous topic :: View next topic  
Author Message
HexAngel



Joined: 22 Feb 2006
Posts: 90

PostPosted: Sun Mar 05, 2006 2:37 am    Post subject: Primary Category when multiple categories selected Reply with quote

Hi all,

Currently, when the calendar is set to display event colours by category, and multiple categories are selected for an event, then the event is displayed with the default event colours defined for the current theme.

A mouthful.

Perhaps this is slated for 1.3, but the conflict could be alleviated if one of the multiple categories could be identified as "primary" and the colour for this category used in the display.

btw: is there a date planned for releasing 1.3?

Cheers,

p.
Back to top
View user's profile Send private message Visit poster's website
esoft_ian



Joined: 12 Sep 2005
Posts: 5275

PostPosted: Sun Mar 05, 2006 5:54 am    Post subject: Reply with quote

Hi HexAngel,

1.3 will display all the icons configured for each category it is in but I'm not sure that I want to do the primary category thing. I was thinking that one could configure colors for events that have multiple categories. What do you think? The constraint on 1.x is that I do not want to add any more database fields. Primary category would require another field. This would complicate the installation and we'd have to deal with upgrade sql scripts.. blah blah blah...

I'd give 1.3 another 4 weeks or so.
Back to top
View user's profile Send private message Visit poster's website
HexAngel



Joined: 22 Feb 2006
Posts: 90

PostPosted: Sun Mar 05, 2006 4:10 pm    Post subject: Reply with quote

Hey Ian,

That would work, essentially performing the same function. It would work best if Thyme provided the colour schemes of the selected categories to choose from. I take it that events already have display colour fields?

p.
Back to top
View user's profile Send private message Visit poster's website
esoft_ian



Joined: 12 Sep 2005
Posts: 5275

PostPosted: Sun Mar 05, 2006 7:40 pm    Post subject: Reply with quote

Events do not have display color fields. They get all their color info either from the theme or category (or owner, or calendar) etc..
Back to top
View user's profile Send private message Visit poster's website
HexAngel



Joined: 22 Feb 2006
Posts: 90

PostPosted: Sun Mar 05, 2006 8:03 pm    Post subject: Reply with quote

Ah, I misunderstood.

You mean that events with multiple categories would all have the same colour, correct?

For my purposes, not so good -- and I imagine for some others as well.

As you know, I'm integrating Thyme with a CafePress.com application and using it to display t-shirts, buttons, stickers, etc., appropriate for particular events. For displaying events I'll use icons to denote availability of buttons, stickers, etc., and hoped to allow colour to display the event category (eg: birthdays, historical events, holidays...)

I can see that this implementation will be somewhat unusual. Perhaps a hack?

p.

_________________
Home: eJournal
Thyme: Critical Events
Shop: Critical Graphics; Travel Photographs;
Back to top
View user's profile Send private message Visit poster's website
esoft_ian



Joined: 12 Sep 2005
Posts: 5275

PostPosted: Sun Mar 05, 2006 8:09 pm    Post subject: Reply with quote

Right, that's what I meant. They would all have the same color.

For 1.x, if you want "primary category", it would have to be a hack. I could tell you what to add where to make this happen if you'd like.
Back to top
View user's profile Send private message Visit poster's website
HexAngel



Joined: 22 Feb 2006
Posts: 90

PostPosted: Mon Mar 06, 2006 5:25 am    Post subject: Reply with quote

Yes, please. I've already added one field to the db...I'm up for another!

Thanks,

p.

_________________
Home: eJournal
Thyme: Critical Events
Shop: Critical Graphics; Travel Photographs;
Back to top
View user's profile Send private message Visit poster's website
esoft_ian



Joined: 12 Sep 2005
Posts: 5275

PostPosted: Wed Mar 08, 2006 3:18 am    Post subject: Reply with quote

Ok, add a bigint unsigned field (the same type as etype) to Thyme's events table called pcat.

In include/templates/event_edit_tpl.php add

Code:
$_cal_tmpl->section_row("Primary category:", $_cal_form->select('pcat', $_cal_etypes));


This will allow people to select a primary category.

In include/classes/class.event_minimal.php, find:

Code:

      $this->type_css_class = "cal_event_type_". $this->type ."_". $this->calendar;


Change that to:
Code:

      $this->type_css_class = "cal_event_type_". ($this->pcat ? $this->pcat : $this->type) ."_". $this->calendar;


Let me know which encoded version of Thyme you are using and I'll have to send you the file that will get pcat into event_minimal.

Don't hesitate to ask if you have any questions.
Back to top
View user's profile Send private message Visit poster's website
HexAngel



Joined: 22 Feb 2006
Posts: 90

PostPosted: Sat Mar 11, 2006 6:22 am    Post subject: Reply with quote

Took me a while to get to it, but I've implemented the changes you suggested.

Added pcat to db.

Added code to event_edit_tpl.php

Thyme now successfully records and saves a primary category.

event_minimal is encoded so didn't touch it.

Instead, I uploaded the copy of class.event_matrix.php that you sent me in email.


Thyme does not display the colour of the event's primary category. It still displays the default category colors.

see: http://www.tshirtcalendar.com/index.php and look for Karl Marx dies, on March 14 for an example. I've set 'Anarchist' as the primary category.

Thanks,

Patrick.

_________________
Home: eJournal
Thyme: Critical Events
Shop: Critical Graphics; Travel Photographs;
Back to top
View user's profile Send private message Visit poster's website
esoft_ian



Joined: 12 Sep 2005
Posts: 5275

PostPosted: Sat Mar 11, 2006 8:11 pm    Post subject: Reply with quote

You're going to need an unencoded event_minimal.

http://www.extrosoft.com/products/thyme/updates/1.2/class.event_minimal.txt

Rename to .php, make the changes described, then upload it over your current one.
Back to top
View user's profile Send private message Visit poster's website
HexAngel



Joined: 22 Feb 2006
Posts: 90

PostPosted: Tue Mar 14, 2006 1:40 pm    Post subject: Reply with quote

Excellent!

Works great. See http://www.calendarshoppe.com for several examples.

p.

_________________
Home: eJournal
Thyme: Critical Events
Shop: Critical Graphics; Travel Photographs;
Back to top
View user's profile Send private message Visit poster's website
esoft_ian



Joined: 12 Sep 2005
Posts: 5275

PostPosted: Tue Mar 14, 2006 2:02 pm    Post subject: Reply with quote

Looks good Hex. One thing you may want to do is this:

$_cal_tmpl->section_row("","T-Shirts, Stickers, Buttons, Magnets, Posters, Coffee Mugs and More:");

$_cal_tmpl->section_row("", $content);

Rather than putting it all on the same row. Just a thought.
Back to top
View user's profile Send private message Visit poster's website
HexAngel



Joined: 22 Feb 2006
Posts: 90

PostPosted: Tue Mar 14, 2006 3:01 pm    Post subject: Reply with quote

Thanks. I've been considering that. Kinda of two minds on the issue. Does it bother you much?

On 1024X768 the caption works out fairly well as is: each category on its own line. It becomes a list rather than a sentence and perhaps not the most readable. Much smaller than 1024, though, and it gets somewhat scrunched and decidedly less readable.

Running the caption horizontally across the top does improve readability. On the other hand, it breaks the format for the page and I'm not so keen on the way it looks visually for that reason. After a user reads it the caption a couple times it becomes a design element (and search engine tag) and less an informative caption

Also, I'm planning on placing a header at the top of the section, with more text, Just waiting for the right inspiration. I think a horizontal caption will visually conflict.

Cheers,

p.

_________________
Home: eJournal
Thyme: Critical Events
Shop: Critical Graphics; Travel Photographs;
Back to top
View user's profile Send private message Visit poster's website
HexAngel



Joined: 22 Feb 2006
Posts: 90

PostPosted: Tue Mar 14, 2006 3:14 pm    Post subject: Reply with quote

Oh, one thing to watch out for if/when you implement this in 2.x

When initially editing an event the primary category defaults to the first category in the drop-list. If you save it that way, then the event is thenceforth displayed with that primary category's colour. However, listing events in that primary category will, of course, fail to list the event.

I think that's a clear explanation... Anyway, a small issue of inconvenience and an occasional "Whoops!".

Perhaps there's an easy way to initialise the list so that the default is NULL?

p.

_________________
Home: eJournal
Thyme: Critical Events
Shop: Critical Graphics; Travel Photographs;
Back to top
View user's profile Send private message Visit poster's website
HexAngel



Joined: 22 Feb 2006
Posts: 90

PostPosted: Sat Apr 15, 2006 7:21 pm    Post subject: Reply with quote

ian wrote:
You're going to need an unencoded event_minimal.

http://www.extrosoft.com/products/thyme/updates/1.2/class.event_minimal.txt

Rename to .php, make the changes described, then upload it over your current one.


Hi Ian,

I'll need this unencoded event_minimal for 1.3 -- at your convenience.

Cheers,

p.

_________________
Home: eJournal
Thyme: Critical Events
Shop: Critical Graphics; Travel Photographs;
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
Goto page 1, 2, 3  Next
Page 1 of 3

 
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.