I have tried following at least a dozen examples from the internet and can’t get anything to come close to working. I have created a table from data pulled from a database, and have used html to format the rest of the table as best I could. The main portion of the table is generated from a database and can vary based on the number of events stored so simple html row tags can’t be used. It is data that has been entered into our Thyme calendar. The basic php portion of the file was written by someone else that understands php much better than I. I have been able to modify it for my use and thanks to some help from him and here, it works perfectly. I would like to finish the formatting with alternating color rows.
The current table looks like this http://nsrca.us/contest-results/2009/d1.html, and I am trying to match the formatting of this. http://nsrca.us/calendartop/calendar.html
I have tried several java scripts and php codes but I can’t seem to apply them specifically to my file. (instructions aren’t basic enough for me )
Below is the file that I am working on. There are a lot of lines commented out that were used to test ideas etc.
If anyone can point me in the right direction I would appreciate it.
[php]<?php
//defined( ‘_JEXEC’ ) or die( ‘Restricted access from Kcal; Buff’ );
//echo ‘
?>
K-Factor Calendar <?php ############################################################ # base path of files, with trailing slash #define("_CAL_BASE_PATH_", "/home/nsrca.org/public_html/thyme-1.3-ioncube/"); define("_CAL_BASE_PATH_", "/var/www/web109/web/thyme-1.3-ioncube/"); define("_CAL_BASE_URL_", "http://nsrca.us/thyme-1.3-ioncube/"); # base url for calendar, with trailing slash include_once(_CAL_BASE_PATH_ . "include/classes/class.calendar.php"); ############################################################ function order ($a, $b) # sort alphabetically by date and district { $retval = strnatcmp($a['district'], $b['district']); if(!$retval) return strnatcmp($a['date'], $b['date']); return $retval; } $nbsp = ' '; $cal = new calendar(); $cal->set("calendar", 2); $cal->set("event_types", "0"); # trying to get events to link to their details $cal->set("event_links", 1); $cal->set("event_view_url", "view.php?eid=%eid&inst=%inst"); # events yet to come in current year #$week = $cal->get_event_list($cal->year."-12-31", _ex_localtime()); # all events for current year #$week= $cal->get_event_list("year", _ex_localtime()); # suggestion from Thymenews events for specific year $week= $cal->get_event_list("year", 2009); $ect = count($week); $yr=$cal->year; # Buff was here. #echo "Event list day count is: ".$ect.''; #echo "The current year is ".$yr.'
'; # Buff was here. $contest = array(array()); ?> h2 { color: #EBEBEB; } .Arial {font-family: Arial, Helvetica, sans-serif; font-size: large; color: #CCCCCC; font-weight: bold; }
District 1 2009 Contests | <?php #echo "<valignDistrict 1 ".$cal->year." Contests"; #echo "
Date
State
City
Contest Name
Results
"; continue; } else { #if ($pos === false) { # echo "A comma and/or the city is missing in the address (Location: City, St, Zip Field) of the ".$ev->cal_title."; ".$ev->title." contest, dated: " # .($cal->format_date("n/j/y",$ev->starttime)).". CD ".$ev->org_name.". Please correct the Thyme Calendar data for this event.
"; # continue; #} else { $spos = $clen + 2; $slen = 2; $st = substr($ev->addr_ci, $spos, $slen); $ci = substr($ev->addr_ci, $cpos, $clen); $dis = substr($ev->cal_title, 1, 2); $savtitle = $ev->title; $j = $j+1; # $contest[$j] = array('state'=>$st, 'district'=>$dis, 'date'=>($cal->format_date("n/j/y",$ev->starttime)), 'city'=>$ci, 'name'=>$ev->title); #$contest[$j] = array('date'=>($cal->format_date("n/j/y",$ev->starttime)), 'state'=>$st, 'city'=>$ci, 'name'=>$ev->title, 'url'=>$ev->url); $contest[$j] = array('date'=>($cal->format_date("n/j/y",$ev->starttime)), 'state'=>$st, 'city'=>$ci, 'name'=>$ev->title, 'results'=>$ev->results); } } } usort ( $contest, 'order' ); $savtitle = null; $savdis = $contest[0]['district']; $j = $j+1; for($i = 0; $i < $j; $i++) { if ($savtitle == $contest[$i]['name']) continue; if ($savdis != $contest[$i]['district']) echo "
".$nbsp."
".$nbsp."
".$nbsp."
".$nbsp."
".$nbsp."
".$nbsp."
".$contest[$i]['']."
".$contest[$i]['date']."
".$contest[$i]['state']."
".$contest[$i]['district']."
".$contest[$i]['city']."
".$contest[$i]['name']."
".$contest[$i]['url']."
".$contest[$i]['']."
<?php //echo "End K-Factor Calendar"; //echo "
Out of the office; gone to visit the grandkids. Will return Sunday evening, 4/20/2008
Buff Miller"; ?> [/php]