Hi,
Using PiCal 0.74 it appears the hack has allready been implemented into the distro.
All that is needed is to modify your style.css as detailed above.
Note if your category names use multiple words you only need to add the first word into the css file.
i.e.
Category name = Lacrosse Club
css entry is
.Lacrosse {color:#FF0000}
Just make sure all your categories have a unique first word...
Is there any other file that needs to be modified in order for the stylesheet to work? I added styles to style.css which were based on my category names, but nothing changed on my site. Basically, is there a place where I can add class tags?
Quote:
/* Style sheet for piCal (you can add embed css's here) */
.Meetings {color:#FF0000}
.Holidays {color:#00FF00}
.Birthdays {color:#0000FF}
.Training {color:#000000}
.Vacation {color:#00580E}
.Projects {color:#6A00FF}
.Proposals {color:#34007E}
.URS Company Holidays {color:#89013A}
I'm using PiCal 0.7, Xoops 2.0.9.2, PHP 5.0, MySQL 4.1, IIS 5.0.
edit near line 996 of piCal.php
while( $event = mysql_fetch_object( $rs ) ) {
$long_event_ids[ $bit ] = $event->unique_id ;
$bit ++ ;
}
// (japanese comment)
$yrs = mysql_query( "SELECT start,end,summary,id,allday,admission,uid,unique_id,categories FROM $this->table WHERE ($whr_term) AND ($whr_categories) AND ($whr_class) ORDER BY start" , $this->conn ) ;
$numrows_yrs = mysql_num_rows( $yrs ) ;
edit near line 1050 of piCal.php
if( $event->admission ) {
// (japanese comment)
$event->summary = $this->text_sanitizer_for_show( $event->summary ) ;
// categories
$catname = htmlspecialchars( $this->categories[ intval( $event->categories ) ]->cat_title , ENT_QUOTES ) ;
// (japanese comment)
$summary = mb_strcut( $event->summary , 0 , 33 ) ;
if( $summary != $event->summary ) $summary .= ".." ;
$event_str_tmp = "• <a href='$get_target?smode=Monthly&action=View&event_id=$event->id&caldate=$this->caldate' style='font-size:10px;font-weight:normal;text-decoration:none;' class='$catname'>$summary</a>" ;
After this hack, you can edit your style.css like this:
.(cat_name) {color:#FF0000}
Hi lanetterm, I wonder if since your post you managed to do it.
For me it is a pre-requisite for the use of piCal on my website
hi lanetterm.
It is not so easy way because the monthly calendar doesn't use xoops template system.
Thus, you have to hack piCal.php class itself.
Is is there a way to have events in the monthly calendar to display in different colors according to the catagory they are assigned?