Easy PHP Calendar - We really take care of your dates!


Go Back   Easy PHP Calendar > General Discussion > Customizations (Themes / Templates)

Customizations (Themes / Templates) Help with customizing the themes and templates. Post your own custom themes for others to enjoy.

Closed Thread
 
Thread Tools Search this Thread Display Modes

Alternate row colours in list mode
Old 03-27-2007, 05:38 AM   #1
caitlinn
Calendar User
 
caitlinn is offline
Join Date: Mar 2007
Location: United Kingdom
Posts: 3
Default Alternate row colours in list mode

I've had a look around to see if anyone's done this, but haven't found anything.

Is there a way to alternate row colours in list mode? I might even be able to throw something together in PHP if there is already a variable available which contains the total number of events in list mode (have it currently set to pull the full month via 'default' settings).

Thanks in advance.
 

Old 03-27-2007, 06:30 AM   #2
ve9gra
Support Team
 
ve9gra's Avatar
 
ve9gra is offline
Join Date: Jun 2003
Location: New Brunswick, Canada
Posts: 4,965
Default

That's something I've never tried.. and I'm not entirely sure that it is even possible... The list mode is generated using a template and the part that calls the template is in the encrypted code. So there's no way to tell, from the template file, which row you're on.

I'll keep this one on my plate and see if there's anything I can come up with.
__________________
-- Gervais
EPC Tutorials... We're here to help!
Offering custom integration services. Contact me here.
* Not affiliated with EasyPHPCalendar or NashTech Inc.
 

Old 03-27-2007, 10:26 AM   #3
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,878
Default

This is on the "wish list" and it should be something added in a future release (can't say when).

It may be possible to do this now, but you'd probably need to use JavaScript (something I can't help with).
__________________
-- Brian

Questions?

Instructions: Version 6 - Version 7 | FAQ | Errors FAQ | Paths FAQ | Forums | Support
| Web Site Hosting
 

Old 03-27-2007, 03:47 PM   #4
ve9gra
Support Team
 
ve9gra's Avatar
 
ve9gra is offline
Join Date: Jun 2003
Location: New Brunswick, Canada
Posts: 4,965
Default

I just got a flash.. I might be able to work something out..

__________________
-- Gervais
EPC Tutorials... We're here to help!
Offering custom integration services. Contact me here.
* Not affiliated with EasyPHPCalendar or NashTech Inc.
 

Old 03-27-2007, 06:23 PM   #5
caitlinn
Calendar User
 
caitlinn is offline
Join Date: Mar 2007
Location: United Kingdom
Posts: 3
Default

Was able to pull it off with Javascript. Would be very interested if you are eventually able to do it with PHP.

Last edited by caitlinn; 03-27-2007 at 06:33 PM.
 

Old 03-27-2007, 09:25 PM   #6
ve9gra
Support Team
 
ve9gra's Avatar
 
ve9gra is offline
Join Date: Jun 2003
Location: New Brunswick, Canada
Posts: 4,965
Default

Gotta love output buffering..

If you've managed to do it in JavaScript (I don't think I can handle that) I'm sure you'll be able to understand this quite easily.

1- In the template that you're using, find the section that is delimited by
Code:
<!--body-->
and add this additional delimiter
Code:
=-+-=
just before the second one.

2- In that same template, replace the color from the table by this marker
Code:
%color%
3- Where you'd normally have the code for the list to be shown (just after $LIST=1; ) surround the require with the output buffering code, like so:
PHP Code:
ob_start();
require(
"calendar.php");
$my_list ob_get_clean(); 
4- Right after this, paste the juicy bits
PHP Code:
$color1="#FFFDF2";
$color2="#FFFFFF";
$epc_split explode("=-+-=",$my_list);
for (
$x=0$x count($epc_split); $x++) {
    if(
$x 2) {
        
$epc_split[$x] = str_replace("%color%"$color2$epc_split[$x]);
    } else {

        
$epc_split[$x] = str_replace("%color%"$color1$epc_split[$x]);
    }
}
$my_list implode(""$epc_split);
echo 
$my_list
Oh... don't forget to change $color1 and $color2 to your choice of color
__________________
-- Gervais
EPC Tutorials... We're here to help!
Offering custom integration services. Contact me here.
* Not affiliated with EasyPHPCalendar or NashTech Inc.
 

Old 03-28-2007, 05:05 AM   #7
caitlinn
Calendar User
 
caitlinn is offline
Join Date: Mar 2007
Location: United Kingdom
Posts: 3
Default

Very nice, Ve9gra! Well done for figuring it out in PHP.

The Javascript solution was pretty easy. A quick Google and I had my solution.


Code:
function applyColors(){
    tbl =document.getElementById("myTable");
    for (j=0;j<tbl.rows.length;j++)
        if(j%2==0) tbl.rows[j].style.background= "yellow";
}
window.onload=applyColors;
Source: http://www.ekcsoft.com/coding/js.php?page=alternate
 

Old 03-28-2007, 09:49 AM   #8
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,878
Default

Going to make this thread "Sticky".
__________________
-- Brian

Questions?

Instructions: Version 6 - Version 7 | FAQ | Errors FAQ | Paths FAQ | Forums | Support
| Web Site Hosting
 
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi and List Mode Devante Customizations (Themes / Templates) 2 08-16-2006 08:27 PM
list mode, popups, and multiple events dedawgg Customizations (Themes / Templates) 1 07-17-2006 07:41 PM
Any way to make list mode function as "headlines" JamesC Customizations (Themes / Templates) 11 10-08-2005 04:03 PM



All times are GMT -4. The time now is 12:34 AM.


vBulletin skins developed by: eXtremepixels
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright 2009 NashTech, Inc.

| Home | Register | Today's Posts | Search | New Posts |