Banner
Home Forum
Qivva Forum
Welcome, Guest
Please Login or Register.    Lost Password?
Feature request: Each category its own Color
(0 viewing) 
Go to bottom Favoured: 1
TOPIC: Feature request: Each category its own Color
#848
euskaleskola
Fresh Boarder
Posts: 1
graphgraph
User Offline
Re:Feature request: Each category its own Color 10 Years, 10 Months ago Karma: 0
I was wondering just about the same thing, but I think that there'll be another option that would also be great:

Beside categories color there'll be great to have the option of colorizing differently the calendar days for registered users. Is to say, public can see a calendar with some days marked in blue and regsitered can also see some other days marked in green...

I'm waiting for this feature!
 
Logged Logged
  The administrator has disabled public write access.
#1211
baldeschi
Fresh Boarder
Posts: 1
graphgraph
User Offline
Re:Feature request: Each category its own Color 10 Years, 7 Months ago Karma: 0
Hello,
I'm waiting for this feature!

Thank you
Matteo
 
Logged Logged
  The administrator has disabled public write access.
#1287
kolly_yosh
Fresh Boarder
Posts: 8
graphgraph
User Offline
Re:Feature request: Each category its own Color 10 Years, 6 Months ago Karma: 0
I like this extension very much!
It would be great if you could include this feature in next release.
 
Logged Logged
  The administrator has disabled public write access.
#1295
safflower
Fresh Boarder
Posts: 3
graphgraph
User Offline
Re:Feature request: Each category its own Color 10 Years, 6 Months ago Karma: 0
The only problem with this would be, what if there were two events on one day - which color would get priority? I guess the first listed.

It would definitely be nice to be able to do this. The next step would then have the admin settings customize what color is for what, but at least for now if they were different colors...
 
Logged Logged
  The administrator has disabled public write access.
#1780
CheshireCat
Senior Boarder
Posts: 61
graphgraph
User Offline Click here to see the profile of this user
Re:Feature request: Each category its own Color 9 Years, 9 Months ago Karma: 1
I have the code for this (using 0.93). Attached is my early candidate which I'm tweaking the css so it'll change a bit as it grows on me.

How does it work ?.
In the module parameters you now have 5 new parameter settings,

-Multi-event style mode
-Multi-event style mode for today
-Limit value
-Category map
-Default map weight

The multi-event mode options are,

0 = default
1 = use event count
2 = use highest mapped category
3 = use list of mapped categories

The limit value is only needed for option 1.
The category map and the default map are used for options 2 and 3. How the category maps works is that you list your categories and the "weight" you want to allocate to them as a csv list e.g. 1=1,2=2,3=2,4=3
and set the default map weight to some sensible value which is the default weight for any unmapped categories e.g. 1.

By default ALL events have a category id (in the code this is $event->catsid).

For option 1 I simply use the PHP count() on the day for the events to get a number of events e.g. 1,2 or 3 or whatever. I added that option because it was the easiest ! and I was thinking some people might like using this like a "heatmap" of events (more events = darker colours).

For option 2 and 3 I take the $event->catsid and see if I can find it in the map parameter. If I do then I use the mapped value e.g. using my example above where 3=2,4=3 then a cat id of 3 would result in a mapped value of 2 and if I find no mapped value then I use the default.

With option 2 I just remember the HIGHEST mapped (or default) value.

With option 3 I create a list of mapped (or default) values filtered to be unique and sorted in ascending numerical order (using array_unique() and sort()).

For all results I simply append what I created using underscores as a delimiter to the css class e.g. mod_eventlistcalq_caldaylink_1_2_3 obviously is a day that has three unique categories of event on it and I'm using option 3.
Note that "today" has its own setting too.

For all of this to work you obviously need to get that CSS right. I have added my play CSS file as a starter and in the code if you use any of the options then it uses that file (with the ..._multi.css filename).

I'll be testing my own CSS but it would be nice to have a reference CSS that most people like. I suggest just baseing it around 3 colours e.g. existing light blue CCE0FF plus E0FFCC for light green and FFCCE0 for light pink. It'll take a bit of playing around to get something shiny.

Enjoy. Lincoln.
File Attachment:
File Name: mod_eventlistcal15q.zip
File Size: 16939
 
Logged Logged
  The administrator has disabled public write access.
#1782
CheshireCat
Senior Boarder
Posts: 61
graphgraph
User Offline Click here to see the profile of this user
Re:Feature request: Each category its own Color 9 Years, 9 Months ago Karma: 1
I have just tweaked this a bit more - the css style created is now ....link_c_1 or ...link_n_1 rather than just ...link_1 etc. The reason is that semantically using colours for counts is rather different than using colours for categories and so you could end up with a clash of intentions in the css file. For example if you wanted to setup the css to have a decrease in colour luminosity (i.e. its a deeper of the same colour) for an increasing count but a different colour hue (i.e. a different colour) for the different categories so where the count was the same number as the category map then it would be apples and oranges. I'll post an updated version later tonight.
 
Logged Logged
  The administrator has disabled public write access.
Go to top
Drug Amoxil Online (Amoxicillin) is used to treat many different types of infections caused by bacteria, such as ear infections, bladder infections, pneumonia, gonorrhea, and E. coli or salmonella infection. Sleeping pills: l-tryptophan, Phenergan, Unisom, Sominex - currently the most popular are the following hypnotic drugs. Click to see full text here:
Italian online pharmacy. Cialis, Viagra and other generic drugs. The best price and free shipping.
Sponsored by: sominex online shop.