PEAK XOOPS - Display catagories in different colors in englishin japanese

Display catagories in different colors

  • You cannot open a new topic into this forum
  • Guests cannot post into this forum
Previous post - Next post | Parent - No child | Posted on 2005/4/18 16:33
spipes  企霹始   Posts: 1
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...

Votes:1 Average:0.00
Previous post - Next post | Parent - Children.1 | Posted on 2005/3/16 10:49
ivan8r  企霹始   Posts: 1
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.
Votes:0 Average:0.00
Previous post - Next post | Parent - No child | Posted on 2005/3/13 7:21
Salsero  企霹始   Posts: 9
And how to do it for a week view?
Votes:0 Average:0.00
Previous post - Next post | Parent - Children.1 .2 | Posted on 2004/12/9 17:54
GIJOE  黎扦烦菱   Posts: 4110
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}
Votes:0 Average:0.00
Previous post - Next post | Parent - Children.1 | Posted on 2004/12/7 20:31
ryanj  企霹始   Posts: 1
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
Votes:0 Average:0.00
Previous post - Next post | Parent - No child | Posted on 2004/6/21 17:31
GIJOE  黎扦烦菱   Posts: 4110
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.
Votes:0 Average:0.00
Previous post - Next post | Parent - Children.1 .2 | Posted on 2004/6/17 9:22
lanetterm  企霹始   Posts: 1
Is is there a way to have events in the monthly calendar to display in different colors according to the catagory they are assigned?
Votes:0 Average:0.00

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!