i have a text file i use for creating calendars formatted as so:
Code: Select all
event[id]
event2[id2],event3[id3]
...
eventn[idn]
--------------------
(0 based "start on" day, ie: 0 = sun)
--------------------
id=popup data for id
id2=popup data for id2
...in between the ---'s is the day the month starts on
after the ---'s are lookup tables for the specific event.
if you roll over event in the calendar, a small tooltip will appear containing the data in id
so far, i have the php parser picking apart the popup section:
Code: Select all
<?php
$popups=array();
#linebreak fix
array_shift($popup_raw);
#for each line, break into id and data
for($i=0,$l=sizeof($popup_raw); $i<$l; $i++){
$p=explode("=",$popup_raw[$i]);
echo "Raw: {$popup_raw[$i]}<br>";
$id=$p[0];
echo "Data before check: {$p[1]}<br>";
if(!$p[1] || $p[1]=""){
$p[1]="Details have yet to be announced";
echo "EMPTY AND CHANGED<br>";
} else {
echo "NOT EMPTY: {$p[1]}<br>";
}
echo "Data after check: {$p[1]}<br>";
$data=$p[1];
$popups[$id]=$data;
echo "$id : $data<hr>";
}
?>and the file has this popup section:
Code: Select all
J1=
J2=
J3=
J4=
BP=Blah blah blah
J5=Blah blah blah
GB=Blah blah blah
SC=Blah blah blahCode: Select all
Raw: J1=
Data Before Check:
EMPTY AND CHANGED
Data After Check: Details have yet to be announced
J1 : Details have yet to be announcedCode: Select all
Raw: BP= Blah blah blah
Data Before Check: Blah blah blah
NOT EMPTY:
Data After Check:
BP :please help! this is driving me insane