Home · Links · Contact Us
Home arrow Forums
Home
Features
FAQ
Screen Shots
Modules
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 
Upcoming events w/ alternating row colors

 
Post new topic   Reply to topic     Forum Index -> Web site integration
View previous topic :: View next topic  
Author Message
hordak1223



Joined: 06 Mar 2008
Posts: 4

PostPosted: Mon Jul 21, 2008 10:22 pm    Post subject: Upcoming events w/ alternating row colors Reply with quote

Hey,
Does anyone know how to incorporate two PHP objects? I've got a php object the adds the calendar events:


<?php

// get event list for THIS week starting RIGHT NOW regardless
// of what the calendar date is set to

$events = $cal->get_event_list("week");

// step through each day

for($i = 0; $i < 7; $i++)
{

// if we don't have any events today skip this day

if(count($events[$i]) < 1) continue;

// step through each event

foreach($events[$i] as $e)
{

$e = $cal->get_event($e['id'], $e['instance']);

echo("<div id='CellConGrey'>");
echo("<div id='date'><span class='bottomText'><strong>\n");
echo($cal->format_date("F j", $e->start));
echo("</strong></span></div>\n");

echo("<div id='desc'><span class='bottomText'><strong>". $e->title ."</strong></span></div>");

echo("<br clear='left' />");
echo("</div>");
}

}

?>


And a PHP Block that sets up alternating rows:

<?php

// just some random data in an array
$data = array('. $e->title .','is','just','an','example','to','show','the','alternating','row','colors');
$events = $cal->get_event_list("week");

// the two colors to switch between
$rowcolor1 = '#F0F0F2';
$rowcolor2 = '#FFFFFF';
// the background colors on mouseover
$hovercolor1 = '#BAD4EB';
$hovercolor2 = '#DCE9F4';

echo '
<table style="caption-side:top; border-collapse:collapse" width="100%">';

for ($n = 0; $n < count($events); $n++)
{
// this is where the magic happens
if($n % 2 == 1)
{
// add more things to swop with each cycle
$style = $rowcolor1;
$hoverstyle = $hovercolor1;
}else{
$style = $rowcolor2;
$hoverstyle = $hovercolor2;
}

echo '
<tr id="row'.$n.'" style="background:'.$style.';" onmouseover="this.style.background=\''.$hoverstyle.'\'" onmouseout="this.style.background=\''.$style.'\'">
<td>'.$data[$n].'</td>
</tr>';

}

echo '
</table>';

?>


You can find my example at http://www.centralstate.edu/index-test.php
Back to top
View user's profile Send private message
hordak1223



Joined: 06 Mar 2008
Posts: 4

PostPosted: Wed Jul 23, 2008 3:33 pm    Post subject: Can I list a set number of events Reply with quote

Okay, I worked out a system that's close enough to what I need in regards to the events showing up (a lot of tinkering)

http://www.centralstate.edu/index-test.php, The alternating rows don't quite work well, but oh well... deadlines.

Anyway, Another topic:

I followed the advanced integration tutorial to create a customized calendar view (Works great). Can I actually list a set number of events instead of "this weeks" event or "this Months" events?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Web site integration 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.