Kalender Sonstiges 0.2 1 1072630196 1072630196 1 Kalender-Modul <?php /** * Kalender 2003 by STam * build by STam 29.07.2003 for A3 * Version 0.1-dev Alpha * --------------------------------------------------------------- * INPUT **/ // Add Functions if (!function_exists('DediMod_TreeLevelLight')) { function DediMod_TreeLevelLight() { global $db, $client, $lang, $dedi_db, $con_lang, $catlist, $catlist_level, $tlo_tree; $sql = "SELECT A.name, B.idcat, B.parent, B.sortindex FROM $dedi_db[cat_lang] AS A, $dedi_db[cat] AS B WHERE A.idcat=B.idcat AND B.idclient='$client' ORDER BY B.parent, B.sortindex"; $db->query($sql); while ($db->next_record()){ $ordner[$db->f('idcat')] = $db->f('name'); $tlo_tree[$db->f('parent')][$db->f('sortindex')] = $db->f('idcat'); } $sql = "SELECT D.idcatside, D.idcat, D.sortindex, D.is_start, F.title FROM $dedi_db[cat_side] AS D, $dedi_db[side] AS E, $dedi_db[side_lang] AS F WHERE D.idside=E.idside AND E.idside=F.idside AND E.idclient='$client' AND F.idlang='$lang' ORDER BY D.idcatside"; $db->query($sql); while ($db->next_record()){ $seiten[$db->f('idcat')][$db->f('idcatside')]['name'] = $db->f('title'); $seiten[$db->f('idcat')][$db->f('idcatside')]['idcatside'] = $db->f('idcatside'); $seiten[$db->f('idcat')][$db->f('idcatside')]['is_start'] = $db->f('is_start'); if($db->f('is_start') == 1){ $seiten['start'][$db->f('idcat')] = $db->f('idcatside'); } if(!is_array($seiten['sortarray'][$db->f('idcat')])){$seiten['sortarray'][$db->f('idcat')] = array(); } array_push($seiten['sortarray'][$db->f('idcat')],$db->f('sortindex')); } $baum = array(); tree_level_order('0', 'catlist'); foreach($catlist as $a){ $temp['id'] = $seiten['start'][$a]; $temp['name'] = $ordner[$a]; $temp['level'] = $catlist_level[$a]; array_push($baum, $temp); if(is_array($seiten[$a])){ array_multisort($seiten['sortarray'][$a] , SORT_ASC , $seiten[$a] , SORT_ASC); foreach(array_keys($seiten[$a]) as $b){ if($seiten['start'][$a] != $b){ $temp['id'] = $seiten[$a][$b]['idcatside']; $temp['name'] = $seiten[$a][$b]['name']; $temp['level'] = $catlist_level[$a] + 1; array_push($baum, $temp); } } } } return $baum; } } // Anfang MipForms Config // Hidden Version $mip_form['1']['cat'] = 'hidden'; $mip_form['1']['cms_var'] = 'MOD_VAR[1]'; $mip_form['1']['cms_val'] = $dedi_mod['info']['version']; $mip_form['1']['tab'] = '1'; // CSS //Schriftart Link Navi $mip_form['11']['desc'] = $mod_lang['gen_font'].": Navigation Links {font2}"; $mip_form['11']['cat'] = 'app_css'; $mip_form['11']['output_cat'] = 'option'; $mip_form['11']['cms_var'] = 'MOD_VAR[11]'; $mip_form['11']['cms_val'] = $dedi_mod['value']['11']; $mip_form['11']['cms_val_default'] = 'calendar_link_navi'; //Schriftart Links $mip_form['12']['desc'] = $mod_lang['gen_font'].": Links {font1}"; $mip_form['12']['cat'] = 'app_css'; $mip_form['12']['output_cat'] = 'option'; $mip_form['12']['cms_var'] = 'MOD_VAR[12]'; $mip_form['12']['cms_val'] = $dedi_mod['value']['12']; $mip_form['12']['cms_val_default'] = 'calendar_link'; //Schriftart Links Active $mip_form['13']['desc'] = $mod_lang['gen_font'].": Link Today{font3}"; $mip_form['13']['cat'] = 'app_css'; $mip_form['13']['output_cat'] = 'option'; $mip_form['13']['cms_var'] = 'MOD_VAR[13]'; $mip_form['13']['cms_val'] = $dedi_mod['value']['13']; $mip_form['13']['cms_val_default'] = 'calendar_link_active'; //Schriftart Num $mip_form['2']['desc'] = $mod_lang['gen_font'].": Zahlen {font4}"; $mip_form['2']['cat'] = 'app_css'; $mip_form['2']['output_cat'] = 'option'; $mip_form['2']['cms_var'] = 'MOD_VAR[2]'; $mip_form['2']['cms_val'] = $dedi_mod['value']['2']; $mip_form['2']['cms_val_default'] = 'calendar_number'; //Schriftart Navigation $mip_form['3']['desc'] = $mod_lang['gen_font'].": Navigation {font5}"; $mip_form['3']['cat'] = 'app_css'; $mip_form['3']['output_cat'] = 'option'; $mip_form['3']['cms_var'] = 'MOD_VAR[3]'; $mip_form['3']['cms_val'] = $dedi_mod['value']['3']; $mip_form['3']['cms_val_default'] = 'calendar_navi'; // Colors //BGCell Color $mip_form['4']['cat'] = 'txt'; $mip_form['4']['desc'] = 'Background-Color: Zellen <small>[Format: (HEX) #123456]</small>'; $mip_form['4']['cms_var'] = 'MOD_VAR[4]'; $mip_form['4']['cms_val'] = $dedi_mod['value']['4']; $mip_form['4']['cms_val_default'] = '#6699CC'; $mip_form['4']['tab'] = '0'; //BGCell Today Color $mip_form['5']['cat'] = 'txt'; $mip_form['5']['desc'] = 'Background-Color: aktueller Tag <small>[Format: (HEX) #123456]</small>'; $mip_form['5']['cms_var'] = 'MOD_VAR[5]'; $mip_form['5']['cms_val'] = $dedi_mod['value']['5']; $mip_form['5']['cms_val_default'] = '#66ff66'; $mip_form['5']['tab'] = '0'; //All Text Color $mip_form['6']['cat'] = 'txt'; $mip_form['6']['desc'] = 'Text-Color: Zahlen/Text <small>[Format: (HEX) #123456]</small>'; $mip_form['6']['cms_var'] = 'MOD_VAR[6]'; $mip_form['6']['cms_val'] = $dedi_mod['value']['6']; $mip_form['6']['cms_val_default'] = '#000000'; $mip_form['6']['tab'] = '0'; // Format //Cal Width $mip_form['7']['cat'] = 'txt'; $mip_form['7']['desc'] = 'Calendar-Width: Kalender Breite <small>[Format: (int) XX % / XX Pixel]</small>'; $mip_form['7']['cms_var'] = 'MOD_VAR[7]'; $mip_form['7']['cms_val'] = $dedi_mod['value']['7']; $mip_form['7']['cms_val_default'] = '150'; $mip_form['7']['tab'] = '0'; //CalBorder Width $mip_form['8']['cat'] = 'txt'; $mip_form['8']['desc'] = 'Border-Width: Randbreite <small>[Format: (int) XX Pixel]</small>'; $mip_form['8']['cms_var'] = 'MOD_VAR[8]'; $mip_form['8']['cms_val'] = $dedi_mod['value']['8']; $mip_form['8']['cms_val_default'] = '0'; $mip_form['8']['tab'] = '0'; // Navigation //Navigation aktiviert/ deaktiviert $mip_form['14']['cat'] = 'option'; $mip_form['14']['type'] = ''; $mip_form['14']['desc'] = 'Einstellungen Navigation:'; $mip_form['14']['cms_var'] = 'MOD_VAR[14]'; $mip_form['14']['cms_val'] = $dedi_mod['value']['14']; $mip_form['14']['option_desc']['0'] = 'Navigation aktiviert'; $mip_form['14']['option_val']['0'] = '1'; $mip_form['14']['option_desc']['1'] = 'Navigation deaktiviert'; $mip_form['14']['option_val']['1'] = '0'; $mip_form['14']['tab'] = '0'; //Navigation template vorwärts $mip_form['15']['cat'] = 'txtarea'; $mip_form['15']['type'] = 'long'; $mip_form['15']['rows'] = '1'; $mip_form['15']['desc'] = 'Button vorwärts:<br><small><u>Mögliche Templatevariable:</u>&nbsp;{url},{font1},{font2},{font3},{font4},{font5}</small>'; $mip_form['15']['cms_var'] = 'MOD_VAR[15]'; $mip_form['15']['cms_val'] = $dedi_mod['value']['15']; $mip_form['15']['cms_val_default'] = ' <a href ="{url}" class=\"{font2}\">&gt;&gt;</a> '; $mip_form['15']['tab'] = '0'; //Navigation template rückwärts $mip_form['16']['cat'] = 'txtarea'; $mip_form['16']['type'] = 'long'; $mip_form['16']['rows'] = '1'; $mip_form['16']['desc'] = 'Button rückwärts:<br><small><u>Mögliche Templatevariable:</u>&nbsp;{url},{font1},{font2},{font3},{font4},{font5}</small>'; $mip_form['16']['cms_var'] = 'MOD_VAR[16]'; $mip_form['16']['cms_val'] = $dedi_mod['value']['16']; $mip_form['16']['cms_val_default'] = ' <a href ="{url}" class=\"{font2}\">&lt;&lt;</a> '; $mip_form['16']['tab'] = '0'; //Verbindungs template Navigation $mip_form['17']['cat'] = 'txtarea'; $mip_form['17']['type'] = 'long'; $mip_form['17']['rows'] = '1'; $mip_form['17']['desc'] = 'Verbindungs-Template:<br><small><u>Mögliche Templatevariablen:</u>&nbsp;{back}, {forw},<br> {Month}=Januar, {month}=Jan, {Nmonth}=1, {Year}=2003, {year}=03'; $mip_form['17']['cms_var'] = 'MOD_VAR[17]'; $mip_form['17']['cms_val'] = $dedi_mod['value']['17']; $mip_form['17']['cms_val_default'] = "<NOBR>{back}<b>{month}&nbsp;&nbsp;{Year}</b>{forw}</NOBR>"; $mip_form['17']['tab'] = '0'; // Nutzung/Funktion //Kalender Funktion $mip_form['18']['cat'] = 'option'; $mip_form['18']['type'] = ''; $mip_form['18']['desc'] = 'Funktion des Kalenders:'; $mip_form['18']['cms_var'] = 'MOD_VAR[18]'; $mip_form['18']['cms_val'] = $dedi_mod['value']['18']; $mip_form['18']['option_desc']['0'] = 'als Archivauswahl'; $mip_form['18']['option_val']['0'] = 'archiv'; $mip_form['18']['option_desc']['1'] = 'frei Definiert'; $mip_form['18']['option_val']['1'] = 'free'; /* $mip_form['18']['option_desc']['2'] = 'als Eventanzeige'; $mip_form['18']['option_val']['2'] = 'event'; $mip_form['18']['option_desc']['3'] = 'als Kalender'; $mip_form['18']['option_val']['3'] = 'cal'; $mip_form['18']['option_desc']['4'] = 'Personalisiert'; $mip_form['18']['option_val']['4'] = 'pers'; */ $mip_form['18']['cms_val_default'] = '0'; //Ever Link $mip_form['22']['cat'] = 'option'; $mip_form['22']['type'] = ''; $mip_form['22']['desc'] = 'Einstellungen Links:'; $mip_form['22']['cms_var'] = 'MOD_VAR[2]'; $mip_form['22']['cms_val'] = $dedi_mod['value']['2']; $mip_form['22']['option_desc']['0'] = 'Links immer zeigen'; $mip_form['22']['option_val']['0'] = '1'; $mip_form['22']['option_desc']['1'] = 'nur aktive Links zeigen'; $mip_form['22']['option_val']['1'] = '0'; $mip_form['2']['tab'] = '0'; //Search for Idcat $mip_form['19']['desc'] = 'Archivauswahl:<br><small>Geben Sie die Kategorie/Ordner an, welche durchsucht werden sollen.<br>...nur bei Archivauswahl nötig!</small>'; $mip_form['19']['cat'] = 'app_cat'; $mip_form['19']['output_cat'] = 'option'; $mip_form['19']['cms_var'] = "MOD_VAR[19]"; $mip_form['19']['cms_val'] = $dedi_mod['value']['19']; $mip_form['19']['size'] = '5'; $mip_form['19']['cms_val_default'] = 'this'; //Search for Idcatside Key $mip_form['20']['cat'] = 'option'; $mip_form['20']['type'] = ''; $mip_form['20']['desc'] = 'Einstellungen Siteauswahl:<br><small>Geben Sie den Key an nachdem gesucht werden soll.<br>...nur bei Archivauswahl nötig!</small>'; $mip_form['20']['cms_var'] = 'MOD_VAR[20]'; $mip_form['20']['cms_val'] = $dedi_mod['value']['20']; $mip_form['20']['option_desc']['0'] = 'Site-Name'; $mip_form['20']['option_val']['0'] = 'name'; $mip_form['20']['option_desc']['1'] = 'Site-Keys'; $mip_form['20']['option_val']['1'] = 'meta_keywords'; $mip_form['20']['option_desc']['2'] = 'Site-Description'; $mip_form['20']['option_val']['2'] = 'meta_description'; $mip_form['20']['tab'] = '0'; //Seite einbinden/weiterleiten $mip_form['21']['cat'] = 'option'; $mip_form['21']['type'] = ''; $mip_form['21']['desc'] = 'Einstellungen Content-Syndication:'; $mip_form['21']['cms_var'] = 'MOD_VAR[21]'; $mip_form['21']['cms_val'] = $dedi_mod['value']['21']; $mip_form['21']['option_desc']['1'] = 'Content einbinden'; $mip_form['21']['option_val']['1'] = '0'; $mip_form['21']['option_desc']['0'] = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;>>>&nbsp;weiterleiten&nbsp;<<<'; $mip_form['21']['option_val']['0'] = '0'; $myi = 2; foreach(DediMod_TreeLevelLight() as $a) { $mip_form['21']['option_val'][$myi] = $a['id']; $mip_form['21']['option_desc'][$myi] = (str_repeat('&nbsp;&nbsp;',$a['level'])).$a['name']; $myi++; } $mip_form['21']['cms_val_default'] = '0'; $mip_form['21']['flag'] = 'class_only'; //CalLink Out $mip_form['9']['cat'] = 'txtarea'; $mip_form['9']['desc'] = 'Kalender Linkformat: <i>frei definiert</i> <small><u>Mögliche Templatevariable:</u>&nbsp;&DediMod_Input=Schnittstelle<br> {timestamp}=12345678901234, {Month}=Januar, {month}=Jan, {Nmonth}=1, {Year}=2003, {year}=03 </small>'; $mip_form['9']['type'] = 'long'; $mip_form['9']['rows'] = '1'; $mip_form['9']['cms_var'] = 'MOD_VAR[9]'; $mip_form['9']['cms_val'] = $dedi_mod['value']['9']; $mip_form['9']['cms_val_default'] = '&DediMod_Input={timestamp}'; $mip_form['9']['tab'] = '0'; //CalLink In $mip_form['10']['cat'] = 'txtarea'; $mip_form['10']['desc'] = 'Kalender Inputvar: Eingangsvariable <small>[Variable die das Anzeigedatum ändert! Format: (string) name]</small>'; $mip_form['10']['type'] = 'long'; $mip_form['10']['rows'] = '1'; $mip_form['10']['cms_var'] = 'MOD_VAR[10]'; $mip_form['10']['cms_val'] = $dedi_mod['value']['10']; $mip_form['10']['cms_val_default'] = 'cal_pos'; $mip_form['10']['tab'] = '0'; // Ende MipForms Config // Display MipForms mip_formsp($mip_form['1']); // Hidden Version echo '<b>Einstellungen CSS:</b><p>'; mip_formsp($mip_form['12']); // mip_formsp($mip_form['11']); // mip_formsp($mip_form['13']); // mip_formsp($mip_form['2']); // mip_formsp($mip_form['3']); // echo "<hr>"; echo '<b>Einstellungen Layout:</b><p>'; mip_formsp($mip_form['4']); // mip_formsp($mip_form['5']); // mip_formsp($mip_form['6']); // mip_formsp($mip_form['7']); // mip_formsp($mip_form['8']); // echo '<hr>'; echo '<b>Datumsnavigation:</b><p>'; mip_formsp($mip_form['14']); // echo '<br>'; mip_formsp($mip_form['15']); // echo '<br>'; mip_formsp($mip_form['16']); // echo '<br>'; mip_formsp($mip_form['17']); // echo '<hr>'; echo '<b>Kalender:</b><br>'; mip_formsp($mip_form['18']); // mip_formsp($mip_form['22']); // echo "<br>"; echo '---&nbsp;Archiv&nbsp;-----------------------------------------------------'; mip_formsp($mip_form['19']); // echo "<br>"; mip_formsp($mip_form['20']); // echo "<br>"; echo '---&nbsp;Output&nbsp;-----------------------------------------------------'; mip_formsp($mip_form['21']); // echo "<br>"; echo '---&nbsp;free&nbsp;Definition&nbsp;---------------------------------------'; mip_formsp($mip_form['9']); // echo "<br>"; echo '---&nbsp;Input&nbsp;------------------------------------------------------'; mip_formsp($mip_form['10']); // // make clean unset($mip_form, $myi, $a); ?> <DEDIPHP> /** * Kalender 2003 by STam * build by STam 29.07.2003 for A3 * Version 0.1-dev Alpha * --------------------------------------------------------------- * OUTPUT **/ // Add Classes if (!class_exists('DediMod_BaseCalendar')) { class DediMod_BaseCalendar { /** * This Script was originaly written by William J Sanders * reprogramed by STam 2003, added some funky Stuff & Functions * basicly formed 2 use with DeDi A3 **/ // ClassVars var $calLinkto = "?test=1"; var $calBorder = "0"; var $calWidth = "150"; var $calBGCellColor = "#6699CC"; var $calBGCellToday = "#66ff66"; var $calTextColor = "#000000"; var $calLinkMode = 'template'; // values: template/auto=values in LinkMatrixArray var $calLinkTemplate = '&DediMod_Input={timestamp}'; // {timestamp}=12345678901234, {Month}=Januar, {month}=Jan, {Nmonth}=1, {Year}=2003, {year}=03 var $calActiveLink = 0; // enable checking for LinkMatrix var $calLinkMatrix = array(); // LinkMatrixArray ['date'] = true; is active zB: array('12032003' => array( 'active' => 1, 'link' => 'index.php?bla=test')); var $calNaviactive = 1; var $calBaseUrl ='kalender.php?'; var $calNaviForw = ' <a href ="{url}" class=\"{font2}\">&gt;&gt;</a> '; var $calNaviBack = ' <a href ="{url}" class=\"{font2}\">&lt;&lt;</a> '; var $calNavigation = '{back}<b>{Month}&nbsp;&nbsp;{Year}</b>{forw}'; var $calCss_link = 'calendar_link'; var $calCss_link_navi = 'calendar_link_navi'; var $calCss_link_active = 'calendar_link_active'; var $calCss_number = 'calendar_number'; var $calCss_navi = 'calendar_navi'; var $calCss_td = 'calendar_td'; var $calCss_tr = 'calendar_tr'; var $calCss_table = 'calendar_table'; var $calInput_Var = 'cal_pos'; var $calMes = array( "01" => "Januar", "02" => "Februar", "03" => "März", "04" => "April", "05" => "Mai", "06" => "Juni", "07" => "Juli", "08" => "August", "09" => "September", "10" => "Oktober", "11" => "November", "12" => "Dezember"); // Class Construktor function DediMod_BaseCalendar() { } // Class Methods function set($var, $val = '') { $this->$var = $val; return $this->$var; } function MonthShort($month) { // Assign shortnames 2 German switch ($month) { case "Oct": return "Okt"; break; case "Dec": return "Dez"; break; case "Mar": return "Mär"; break; case "May": return "Mai"; break; case "Jun": return "Jun"; break; case "Jul": return "Jul"; break; default: return $month; } } function MonthFull($num_month) { return $this->calMes[$num_month]; } function cacheMonth($shift = 0) { $kalender = $this->displayMonth($shift); return $kalender; } function getByDate($in_time = 0) { if ($in_time == 0) $in_time = time(); $shift = $this->diffDate($in_time, time()); return $this->cacheMonth($shift); } function getMonth($m = '1', $y = '2003') { list($month, $year) = $this->adjustDate((int)$m, (int)$y); $in_date = mktime(0, 0, 0, $month, 1, $year); $shift = $this->diffDate($in_date, mktime(0, 0, 0, date("m"), 1, date("Y"))); return $this->cacheMonth("$shift"); } function diffDate($in_dateLow, $in_dateHigh) { // change $in_if Low > High if ($in_dateLow > $in_dateHigh) { $tmp = $in_dateLow; $in_dateLow = $in_dateHigh; $in_dateHigh = $tmp; $pre = '+'; } else $pre = '-'; $dateLow = $in_dateLow; $str_dateHigh = strftime('%Y%m', $in_dateHigh); $str_dateLow = strftime('%Y%m', $dateLow); $periodDiff = 0; while ($str_dateLow < $str_dateHigh) { $periodDiff++; $dateLow = strtotime('+1 month', $dateLow); $str_dateLow = strftime('%Y%m', $dateLow); } return $periodDiff != 0 ? $pre.$periodDiff : $periodDiff; } function adjustDate($month, $year) // Adjust Month <= 12 >= 1 and change Year { $a = array(); $a[0] = $month; $a[1] = $year; while ($a[0] > 12) { $a[0] -= 12; $a[1]++; } while ($a[0] <= 0) { $a[0] += 12; $a[1]--; } return $a; } function displayMonth($shift = 0) { if ($this->calLinkMode == 'auto') $this->calActiveLink == '1'; // Assign timestamps to dates $today_ts = mktime(0, 0, 0, date("n"), date("d"), date("Y")); // non relative date $firstday_month_ts = mktime(0, 0, 0, date("n") + $shift, 1, date("Y")); // first day of the month $lastday_month_ts = mktime(0, 0, 0, date("n") + $shift + 1, 0, date("Y")); // last day of the month // Assign numbers and text to the month, year and day $numYear = date("Y", $firstday_month_ts); $numYears = date("y", $firstday_month_ts); $numMonth = date("m", $firstday_month_ts); $textMonth = $this->MonthShort(date("M", $firstday_month_ts)); $daysInMonth = date("t", $firstday_month_ts); // raplace day 0 for day 7, week starts on monday $dayMonth_start = date("w", $firstday_month_ts); if ($dayMonth_start == 0) { $dayMonth_start = 7; } if ($this->calNaviactive == 1) { $forw = str_replace('{url}', $this->calBaseUrl . '&' . $this->calInput_Var . '=' . ($numMonth+1) . '-' . $numYear, $this->calNaviForw); $back = str_replace('{url}', $this->calBaseUrl . '&' . $this->calInput_Var . '=' . ($numMonth-1) . '-' . $numYear, $this->calNaviBack); } $dayMonth_end = date("w", $lastday_month_ts); if ($dayMonth_end == 0) { $dayMonth_end = 7; } // formating output as a table $o = "<center><table border=" . ($this->calBorder) . " cellspacing=1 cellpadding=1 width=" . ($this->calWidth) . "\" class=\"" . $this->calCss_table . "\">\n"; $o .= "<caption><center><span class=\"{font5}\">{navigation}</span></center></caption>\n"; $o = str_replace('{navigation}', $this->calNavigation, $o); $o = str_replace('{forw}', $forw, $o); $o = str_replace('{back}', $back, $o); $o .= "<tr bgcolor=" . ($this->calBGCellColor) . " class=\"" . $this->calCss_tr . "\">\n"; // Day headers, starting from Monday $o .= "<td class=\"" . $this->calCss_td . "\">Mo</td><td class=\"" . $this->calCss_td . "\">Di</td><td class=\"" . $this->calCss_td . "\">Mi</td><td class=\"" . $this->calCss_td . "\">Do</td><td class=\"" . $this->calCss_td . "\">Fr</td><td class=\"" . $this->calCss_td . "\">Sa</td><td class=\"" . $this->calCss_td . "\">So</td></tr>\n"; $o .= "<tr class=\"" . $this->calCss_tr . "\">\n"; for ($k = 1; $k < $dayMonth_start; $k++) { $o .= "<td class=\"" . $this->calCss_td . "\">&nbsp;</td>\n"; } for ($i = 1; $i <= $daysInMonth; $i++) { // Assigns a timestamp to day i $day_i_ts = mktime(0, 0, 0, date("n", $firstday_month_ts), $i, date("Y", $firstday_month_ts)); $day_i = date("w", $day_i_ts); // Placing Sunday as last day of the week if ($day_i == 0) { $day_i = 7; } // Target link $d2_i = date("d", $day_i_ts); if ($this->calLinkMode == 'template') { $link_i = "<a class=\"{active}\" href=\"" . $this->calLinkto . $this->calLinkTemplate; } elseif ($this->calLinkMode == 'auto') { $link_i = "<a class=\"{active}\" href=\"" . ($this->calLinkMatrix["$i"]['link']); } $link_i .= "\">" . ($i) . "</a>"; // Plancing day i on calendar if ($shift == 0 && $today_ts == $day_i_ts && $this->calLinkMatrix["$i"]['active'] == $this->calActiveLink) { $o .= "<td bgcolor=" . ($this->calBGCellToday) . " class=\"" . $this->calCss_td . "\"><strong><center>" . $link_i . "</center></strong></td>\n"; $o = str_replace('{active}', $this->calCss_link_active, $o); } elseif ($shift == 0 && $today_ts == $day_i_ts && $this->calLinkMatrix["$i"]['active'] != $this->calActiveLink) { $o .= "<td bgcolor=" . ($this->calBGCellToday) . " class=\"" . $this->calCss_td . "\"><strong><center>" . $i . "</center></strong></td>\n"; $o = str_replace('{active}', $this->calCss_link_active, $o); } elseif ($this->calLinkMatrix["$i"]['active'] == $this->calActiveLink) { $o .= "<td bgcolor=" . ($this->calBGCellColor) . " class=\"" . $this->calCss_td . "\"><center>" . $link_i . "</center></td>\n"; $o = str_replace('{active}', $this->calCss_link, $o); } else { $o .= "<td bgcolor=" . ($this->calBGCellColor) . " class=\"" . $this->calCss_td . "\"><center><span class=\"" . $this->calCss_number . "\">" . $i . "</span></center></td>\n"; } if ($day_i == 7 && $i < $daysInMonth) { $o .= "</tr><tr class=\"" . $this->calCss_tr . "\">\n"; } else if ($day_i == 7 && $i == $daysInMonth) { $o .= "</tr>\n"; } else if ($i == $daysInMonth) { for ($h = $dayMonth_end; $h < 7; $h++) { $o .= "<td class=\"" . $this->calCss_td . "\">&nbsp;</td>\n"; } $o .= "</tr>\n"; } $o = str_replace('{timestamp}', mktime(0,0,0,$numMonth,$d2_i,$numYear), $o); } $o .= "</table></center>\n"; $o = str_replace('{month}', $textMonth, $o); $o = str_replace('{Nmonth}', $numMonth, $o); $o = str_replace('{Month}', $this->MonthFull($numMonth), $o); $o = str_replace('{Year}', $numYear, $o); $o = str_replace('{year}', $numYears, $o); $o = str_replace('{font1}', $this->calCss_link, $o); $o = str_replace('{font2}', $this->calCss_link_navi, $o); $o = str_replace('{font3}', $this->calCss_link_active, $o); $o = str_replace('{font4}', $this->calCss_number, $o); $o = str_replace('{font5}', $this->calCss_navi, $o); return $o; } }// End Class } $newCal = new DediMod_BaseCalendar(); // --------------------------------------------------------------- // CONFIG GENERAL // --------------------------------------------------------------- // Calendar Version $cal['cal_version'] = "MOD_VALUE[1]"; // Calendar Design $cal['Border'] = "MOD_VALUE[8]"; $newCal->set('calBorder', $cal['Border']); $cal['Width'] = "MOD_VALUE[7]"; $newCal->set('calWidth', $cal['Width']); $cal['BGCellColor'] = "MOD_VALUE[4]"; $newCal->set('calBGCellColor', $cal['BGCellColor']); $cal['BGCellToday'] = "MOD_VALUE[5]"; $newCal->set('calBGCellToday', $cal['BGCellToday']); $cal['TextColor'] = "MOD_VALUE[6]"; $newCal->set('calTextColor', $cal['TextColor']); // Calendar Link Template $cal['LinkTemplate'] = "MOD_VALUE[9]"; // Calendar Navi $cal['Naviactive'] = "MOD_VALUE[14]"; $newCal->set('calNaviactive', $cal['Naviactive']); $cal['NaviForw'] = $cal['Naviactive'] == '1' ? "MOD_VALUE[15]" : ''; $newCal->set('calNaviForw', $cal['NaviForw']); $cal['NaviBack'] = $cal['Naviactive'] == '1' ? "MOD_VALUE[16]" : ''; $newCal->set('calNaviBack', $cal['NaviBack']); $cal['Navigation'] = $cal['Naviactive'] == '1' ? "MOD_VALUE[17]" : ''; $newCal->set('calNavigation', $cal['Navigation']); // Calendar intenal styles $cal['Css_link'] = "MOD_VALUE[12]"; $newCal->set('calCss_link', $cal['Css_link']); $cal['Css_link_navi'] = "MOD_VALUE[11]"; $newCal->set('calCss_link_navi', $cal['Css_link_navi']); $cal['Css_link_active'] = "MOD_VALUE[13]"; $newCal->set('calCss_link_active', $cal['Css_link_active']); $cal['Css_number'] = "MOD_VALUE[2]"; $newCal->set('calCss_number', $cal['Css_number']); $cal['Css_navi'] = "MOD_VALUE[3]"; $newCal->set('calCss_navi', $cal['Css_navi']); // Calendar external Styles $cal['Css_td'] = 'calendar_td'; $newCal->set('calCss_td', $cal['Css_td']); $cal['Css_tr'] = 'calendar_tr'; $newCal->set('calCss_tr', $cal['Css_tr']); $cal['Css_table'] = 'calendar_table'; $newCal->set('calCss_table', $cal['Css_table']); // Calendar BaseUrl $cal['BaseUrl'] = $con_side[$idcatside]['link'];#$cfg_client['htmlpath'] . $cfg_client['contentfile']; $newCal->set('calBaseUrl', $cal['BaseUrl']); // Calendar InputVar $cal['Input_Var'] = ${"MOD_VALUE[10]"}; $newCal->set('calInput_Val', "MOD_VALUE[10]"); // Calendar Modus $cal['modus'] = "MOD_VALUE[18]"; // Calendar Archiv $cal['archiv'] = "MOD_VALUE[19]"; // Calendar Archiv Key $cal['archiv_key'] = "MOD_VALUE[21]"; // Calendar Link Ever $cal['archiv'] = "MOD_VALUE[22]"; // Calendar Forward Site $cal['forward_site'] = "MOD_VALUE[21]"; $cal['Linkto'] = $cal['forward_site'] > '0' ? "?idcatside=" . $cal['forward_site'] : $con_side[$idcatside]['link']; $newCal->set('calLinkto', $cal['Linkto']); // Calendar some Misc $cal['LinkMode'] = 'template'; // values: template/auto=values in LinkMatrixArray $cal['ActiveLink'] = $cal['archiv'] == '1' ? 0 : 1; // enable checking for LinkMatrix $cal['LinkMatrix'] = array(); // LinkMatrixArray ['day'] = true; is active zB: array('1' => array( 'active' => 1, 'link' => 'index.php?bla=test')); switch ($cal['modus']) { case 'archiv': foreach($con_side as $_side) { if ($_side['idcat'] == $cal['archiv']) $_side_list[$_side['idside']] = $_side; } break; case 'free': $cal['set_Template'] = true; break; case 'event': break; case 'cal': break; case 'pers': $cal['LinkMode'] = 'auto'; $cal['ActiveLink'] = 1; $cal['LinkMatrix'] = array(); break; default: break; } if ($cal['set_Template']) $newCal->set('calLinkTemplate', $cal['LinkTemplate']); /** Test *echo $kalender = $newCal->cacheMonth(0); *echo $kalender = $newCal->getMonth('08','2003'); *echo $kalender = $newCal->getByDate(); **/ if ($cal['Input_Var'] != '') { list($month, $year) = explode('-', $cal['Input_Var']); echo $newCal->getMonth($month,$year); } else echo $newCal->cacheMonth(); unset($cal, $newCal, $month, $year, $_side, $_side_list); </DEDIPHP>