00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00038 $content="";
00039
00040
00041
00042
00043
00044
00045 $config["pid_list"] = trim($this->stdWrap($conf["pid_list"],$conf["pid_list."]));
00046 $config["pid_list"] = $config[pid_list] ? $config["pid_list"] : $GLOBALS["TSFE"]->id;
00047
00048 $config["recursive"] = $this->stdWrap($conf["recursive"],$conf["recursive."]);
00049
00050 $config["font"] = $this->stdWrap($conf["fontFace"],$conf["fontFace."]);
00051 $config["font"] = $config["font"] ? $config["font"] : "verdana";
00052
00053
00054 $config["displayCurrentRecord"] = $conf["displayCurrentRecord"];
00055
00056
00057 $templateCode = $this->fileResource($conf["templateFile"]);
00058
00059
00060 $categories = Array();
00061 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tt_calender_cat', '1=1'.$this->enableFields('tt_calender_cat'));
00062 while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
00063 $categories[$row['uid']] = $row['title'];
00064 }
00065
00066
00067
00068 $selectConf = Array();
00069 if ($config[recursive]) {
00070 $pid_list_arr = explode(",",$config[pid_list]);
00071 $orig_pids = $config[pid_list];
00072 $config[pid_list]="";
00073 while(list(,$val)=each($pid_list_arr)) {
00074 $config[pid_list].=$this->getTreeList($val,intval($config["recursive"]));
00075 }
00076 $config[pid_list].=$orig_pids;
00077 }
00078 $selectConf["pidInList"] = $config[pid_list];
00079 $selectConf["orderBy"] = "date,time";
00080 $selectConf["where"] = "type=0";
00081 if (intval($conf["maxAge"])) {
00082 $selectConf["where"].= " AND date>".(time()-(3600*24*intval($conf["maxAge"])));
00083 }
00084
00085
00086 $res = $this->exec_getQuery("tt_calender",$selectConf);
00087
00088
00089 $tableRows = "";
00090 $day_base = mktime (0,0,0,date("m"),date("d"),date("Y"));
00091
00092
00093 $tConf["template"] ="HTML";
00094 $tConf["template."]["value"] = $templateCode;
00095
00096 while($config["displayCurrentRecord"] || $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
00097 if ($config["displayCurrentRecord"]) {$row = $this->data;}
00098
00099 $tConf["workOnSubpart"] = "DATE_HEADER";
00100 $tConf["marks."] = Array ();
00101 $tConf["marks."]["DATE"]="HTML";
00102 $tConf["marks."]["DATE."]["value"]=date("d/m Y",$row[date]);
00103 $tConf["marks."]["HEADER"]="HTML";
00104 $tConf["marks."]["HEADER."]["value"]=$row[title];
00105 $tConf["marks."]["FONT"]="HTML";
00106 $tConf["marks."]["FONT."]["value"]=$config[font];
00107 $tableRows.=$this->TEMPLATE($tConf);
00108
00109
00110 $parts = explode(chr(10)."---".chr(10), str_replace(chr(13),"",$row[note]));
00111 while(list(,$pcon)=each($parts)) {
00112 $pcon=trim($pcon);
00113 $pcon_arr=split(chr(10),$pcon,2);
00114 $theTime = "";
00115
00116 $hP=explode(" ",$pcon_arr[0],2);
00117 if (ereg("[^0-9,.:;-]",$hP[0])) {
00118 $title = trim($pcon_arr[0]);
00119 } else {
00120 $title = trim($hP[1]);
00121 $theTime = trim($hP[0]);
00122 }
00123 if ($conf["parseFunc."]) {
00124 $title = $this->parseFunc($title,$conf["parseFunc."]);
00125 $pcon_arr[1] = $this->parseFunc($pcon_arr[1],$conf["parseFunc."]);
00126 }
00127 $theContent = "<b>".$title."</b><BR>".nl2br($pcon_arr[1]);
00128
00129
00130 $tConf["workOnSubpart"] = "DATE_CONTENT";
00131 $tConf["marks."] = Array ();
00132 $tConf["marks."]["TIME"]="HTML";
00133 $tConf["marks."]["TIME."]["value"]= $theTime;
00134 $tConf["marks."]["CONTENT"]="HTML";
00135 $tConf["marks."]["CONTENT."]["value"]=$theContent;
00136 $tConf["marks."]["FONT"]="HTML";
00137 $tConf["marks."]["FONT."]["value"]=$config[font];
00138 $tableRows.=$this->TEMPLATE($tConf);
00139
00140 }
00141
00142 $this->lastChanged($row[tstamp]);
00143
00144 if ($config["displayCurrentRecord"]) {break;}
00145 }
00146
00147 $tConf["workOnSubpart"] = "TEMPLATE_CALENDAR";
00148 $tConf["marks."] = Array ();
00149 $tConf["subparts."] = Array ();
00150 $tConf["subparts."]["TABLE_CONTENT"]="HTML";
00151 $tConf["subparts."]["TABLE_CONTENT."]["value"]= $tableRows;
00152
00153
00154 $content = $this->TEMPLATE($tConf);
00155
00156
00157 $RESTORE_OLD_DATA = 1;
00158
00159 ?>