Code:<?php
### !!!! don't change this 3 lines !!!! #########################################
$thisfile=basename(__file__);
if (eregi($thisfile, $_SERVER["PHP_SELF"])) die ("You can't access this file directly...");
global $bgcolor1,$bgcolor2,$bgcolor3,$bgcolor4,$bgcolor5,$textcolor1,$textcolor2, $dbi;
#################################################################################
$mxblockcache = FALSE;
###### Einstellungen fuer den Block ###################################################
// CHANGE THIS IF YOU CHANGE THE CALENDAR-MODULES FOLDER NAME
if (!defined("CAL_MODULE_NAME")) define("CAL_MODULE_NAME","Kalender");
#########################################################################################
// verschiedene Einstellungen
$sort = "asc"; # Sortierung der Liste: asc =aufsteigend / desc =absteigend
$scrolling = 0; # Eintraege scrollen
$scrolldirection = "up" ; # Richtung des Scrollens: up / down
$scrollheight = 170 ; # Hoehe des scrollenden Bereichs
$scrolldelay = 1 ; # Scrollgeschwindigkeit
$scrollamount = 1 ; # Scrollgeschwindigkeit
$listcount = 50 ; # count of entries in the List-Block
$listEnddate = 0 ; # display the ending Date in List-View: 0=nein / 1=ja
$listStarttime = 0 ; # display the starting Time in List-View: 0=nein / 1=ja
$listEndtime = 0 ; # display the ending Time in List-View: 0=nein / 1=ja
$showNewlink = 1 ; # Link Event vorschlagen anzeigen: 0=nein / 1=ja
$showLegend = 0 ; # Farblegende anzeigen: 0=nein / 1=ja
######### Definition der Farben und Rahmen ###############################################################
$listbgcolor1 = $bgcolor1; # Hintergrund erste Zeile ( "" fuer Transparent )
$listtxtcolor1 = $textcolor1; # Text erste Zeile
$listbgcolor2 = $bgcolor2; # Hintergrund naechste Zeile
$listtxtcolor2 = $textcolor2; # Text naechste Zeile
$listbordercolor = $bgcolor3; # Rahmenfarbe um Liste
$scrollbgcolor = $bgcolor1; # Hintergrundfarbe des Marquee-Tags (Zwischenraum Scrollinhalte)
$listtableborder = 0; # html Rahmen um Liste
$listtablecellspacing = 1; # abstand zwischen Events (auch Rahmenbreite)
$listtablecellpadding = 2; # this will make the Events lines larger or smaller depending on value
###### Ende der Einstellungen, ab hier nichts veraendern !! ###############################################
$conftest = @include("modules/".CAL_MODULE_NAME."/config/config.php");
if (!$conftest){
$content = "<b>Error!</b><br>You must change the constant '\"CAL_MODULE_NAME\"' in file: <br>".__file__."";
return;
}
get_lang(CAL_MODULE_NAME);
if (!defined("CAL_MODULE_PATH")) define("CAL_MODULE_PATH","modules/".CAL_MODULE_NAME."/");
if (!defined("CAL_TABLE_EVENTS")) @include_once(CAL_MODULE_PATH."includes/functions.php");
$showNewlink = (calIsPostAllowed() && $showNewlink) ? 1 : 0;
if (!calDetectGoodBrowser ()) {$scrolling=0;}
$whereoption= " categorie in(".calGetSqlEventpoints().") AND activ=1";
$d = (int)Date("d");
$m = Date("n");
$y = (int)Date("Y");
$tomorrow = date("Y-n-d", mktime(0, 0, 0, date("m") , date("d")+7, date("Y")));
$qrydate = "$y-$m-$d";
$qry="SELECT count(eid) FROM ".CAL_TABLE_EVENTS."
WHERE (startDate>= '$qrydate' and startDate<= '$tomorrow')
and ($whereoption) ";
$result = sql_query($qry, $dbi);
list($icount) = sql_fetch_row($result, $dbi);
if ($icount>$listcount) $icount=$listcount;
$i = 0;
$a = 0;
if ($icount) {
setlocale (LC_TIME, _CALLOCALE);
$imgprops= "align=\"middle\" hspace=\"1\" vspace=\"2\" width=\"9\" height=\"9\" border=\"0\" alt=\"\"";
$content.="<table cellspacing=\"$listtablecellspacing\" cellpadding=\"$listtablecellpadding\" style=\"background-color: $listbordercolor; border: ${listtableborder}px solid $listbordercolor;\" border=\"$listtableborder\" width=\"100%\">";
$qry="SELECT eid, title, hometext, posteddate, topic, informant, year(startDate), month(startDate), dayofmonth(startDate), hour(startTime), minute(startTime), year(endDate), month(endDate), dayofmonth(endDate), hour(endTime), minute(endTime), alldayevent, categorie FROM ".CAL_TABLE_EVENTS."
WHERE (startDate>= '$qrydate' or endDate>= '$qrydate')
and ($whereoption)
order by startDate $sort, endDate $sort
limit 0,$icount";
$result=sql_query($qry, $dbi);
do {
$compare = date("d.m.y", mktime(0, 0, 0, date("m") , date("d")+$a, date("y")));
$pisi = date("d", mktime(0, 0, 0, date("m") , date("d")+$a, date("Y")));
$content.="<tr style=\"background-color: $bgcolornew;\">
<td valign=\"top\" width=\"15%\">$pisi</td>\n<td width=\"85 %\">";
while(list($eid, $title, $hometext, $posteddate, $topic, $informant, $y1, $m1, $d1, $h1, $mi1, $y2, $m2, $d2, $h2, $mi2, $alldayevent, $categorie) = sql_fetch_row($result, $dbi)) {
$title = htmlspecialchars(strip_tags(stripslashes($title)), ENT_QUOTES);
$fontstyle = ($listStarttime) ? "tiny" : "content";
$dateStart = strftime(_CALSHORTDATEFORMAT, @mktime(0, 0, 0, $m1, $d1, $y1));
if ($listStarttime && !$alldayevent) {
$dateStart.= " ".strftime(_CALTIMEFORMAT, @mktime($h1, $mi1, 0, $m1, $d1, $y1));
}
if ($dateStart == $compare) {
$dateEnd = ($listEnddate) ? strftime(_CALSHORTDATEFORMAT, @mktime(0, 0, 0, $m2, $d2, $y2)) : "";
if ($listEndtime && !$alldayevent) {
$dateEnd.= " ".strftime(_CALTIMEFORMAT, @mktime($h2, $mi2, 0, $m2, $d2, $y2));
}
$bgcolornew = ($i==0) ? $listbgcolor1 : $listbgcolor2;
$txtcolornew = ($i==0) ? $listtxtcolor1 : $listtxtcolor2;
$i = ($i==0) ? 1 : 0;
$alttext = ($hometext && !$scrolling) ? substr(htmlentities(strip_tags(stripslashes($hometext))),0,70).'...' : "";}
if ($dateStart == $compare) {
$content.="<img src=\"".calGetBarImage("ball",$categorie)."\" $imgprops><span style=\"color: $txtcolornew;\" class=\"tiny\">
<a href=\"".CAL_MODULE_LINK."&op=view&eid=$eid\" style=\"text-decoration: none;\">$title</a></span><br>\n"; }
}
$content.="</td>\n</tr>\n";
$a = $a+1;
}
while ($a < 7);
$content.= "</table>";
setlocale (LC_TIME, $GLOBALS["locale"]);
}
else {
$content.= "<span class=\"tiny\">"._CAL0EVENTSBLOCK."<br></span>\n";
}
$bgcolornew = ($i==1) ? $listbgcolor2 : $listbgcolor1;
if ($showNewlink) {
$content.="<hr size=\"1\" style=\"color: $listbgcolor2;\" width=\"100%\" noshade>";
$content.="<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><a href=\"".CAL_MODULE_LINK."&file=submit\"><img src=\"".CAL_IMAGE_PATH."sign.gif\" alt=\""._CALSUBMITEVENT."\" width=\"16\" height=\"16\" border=\"0\" align=\"middle\" hspace=\"0\" vspace=\"1\"></a></td><td valign=\"middle\"><span class=\"tiny\"> <a href=\"".CAL_MODULE_LINK."&file=submit\">"._CALSUBMITEVENT."</a></span></td></tr></table>";
}
if ($showLegend) {
$imgprops= "align=\"middle\" hspace=\"6\" vspace=\"3\" width=\"9\" height=\"9\" border=\"0\" alt=\"\"";
$content.="<hr size=\"1\" style=\"color: $listbgcolor2;\" width=\"100%\" noshade>\n";
$content.=calBuildColorLegendSideBlocks();
}
$content .= "\n<!-- $thisfile output end -->\n<!-- KalenderMx © by shiba-design.de -->\n";
$content = ereg_replace("\t","",$content);
/// Der Blocktitel wird über die Sprachdatei des Kalenders gesteuert,
/// soll statt dessen die Einstellung des Adminmenüs verwendet werden,
/// einfach die folgenden Zeilen löschen oder auskommentieren
$blockfiletitle = _CALLISTDESCRIPTION3;
?>
|