Witam!
Mam problem bo chce przerobić event calentar panel tak aby pod kalendarzem wyświetlaly mi sie wydarzenia z tego i przyszłego miesiąca aby to wygladalo mniej więcej tak:
______________
| kalendarz |
| kwiecien |
| 1 2 3 4 5 6 7 | <-----to jest schematyczny kalendarz :)
| 8 9 10 11 12 |
|_____________|
Wydarzenia w tym miesiącu:
12.04 urodziny tego
13.04 wojna itp
wydarzenia w przyszlym miesiacu:
25.05 cos tam
29.05 bleble
proszę o pomoc bo szukałem na forum może nie skutecznie..
poniżej zamieszczam kod event_calendar_panel.php
<?php
/*---------------------------------------------------
| Event Calendar Infusion v1.00
| © Giuseppe Nichelini (nick56) 2004
| http://www.nichelini.it
|
---------------------------------------------------*/
if (!defined("IN_FUSION")) { header("Location:../../index.php"); exit; }
echo "<link rel='stylesheet' href='".INFUSIONS."event_calendar_panel/css/styles.css' type='text/css'>";
if (file_exists(INFUSIONS."event_calendar_panel/locale/".$settings['locale'].".php")) {
// Load the locale file matching the current site locale setting.
include INFUSIONS."event_calendar_panel/locale/".$settings['locale'].".php";
} else {
// Load the infusion's default locale file.
include INFUSIONS."event_calendar_panel/locale/English.php";
}
openside($locale['Cal100']);
if (isnum($dd)&& isnum($mm) && isnum($yy)) {
if ((substr($dd,0,1) <> "0") AND ($dd < 10)) { $dd = "0".$dd; }
$data = $yy."/".$mm."/".$dd;
$timestamp = mktime(0,0,0,intval($mm),intval($dd),intval($yy));
}
else {
$data = date("Y/m/d",time());
$datatmp = explode("/",$data);
$timestamp = mktime(0,0,0,intval($datatmp[1]),intval($datatmp[2]),intval($datatmp[0]));
$dd = $datatmp[2];
$mm = $datatmp[1];
$yy = $datatmp[0];
}
ModCalendar($dd, $mm, $yy);
@closeside();
function ModCalendar($dd, $mm, $yy)
{
global $lo_tmois,$lo_tjours,$tdaysBR,$db_prefix;
$tmois = $lo_tmois;
$tjours = $lo_tjours;
$today = getdate();
$month = $mm;
$year = $yy;
$monthday = 1;
$prevyear = ($month==1) ? $year-1 : $year;
$prevmonth = ($month==1) ? 12 : $month-1;
$nextyear = ($month==12) ? $year+1 : $year;
$nextmonth = ($month==12) ? 1 : $month+1;
$firstday = getdate(mktime(0, 0, 0, $month, $monthday, $year));
$lastday = date("t", mktime(0, 0, 0, $month, $monthday, $year));
$dbqueryCal = "SELECT DAYOFMONTH(event_data) FROM ".$db_prefix."events WHERE YEAR(event_data)='$year' AND MONTH(event_data)='$month' AND event_deleted='NO'";
$qCal = mysql_query($dbqueryCal) OR die($dbqueryCal);
$entries = array();
for ($i=0;$i<mysql_num_rows($qCal);$i++) {
list($entry_date) = mysql_fetch_row($qCal);
$entries[] = $entry_date;
}
echo "<table width='100%' cellpadding='0' cellspacing='0' class='tableBorders'>\n";
echo "<tr><td align=\"center\" height=20 valign=\"middle\" width=\"20\">\n";
echo "<a href=\"".FUSION_SELF."?dd=$dd&mm=$prevmonth&yy=$prevyear\"><img src=".INFUSIONS."event_calendar_panel/images/left.gif border='0'></a>";
echo "</td>\n";
echo "<td height=20 width=\"100\" align=\"center\" valign=\"middle\" colspan='5'><b>".$tmois[$month-1]." ".$year."</b></td>\n";
echo "<td align=\"center\" height=20 valign=\"middle\" width=\"20\">\n";
echo "<a href=\"".FUSION_SELF."?dd=$dd&mm=$nextmonth&yy=$nextyear\"><img src=".INFUSIONS."event_calendar_panel/images/right.gif border='0'></a>";
echo "</td></tr>\n";
echo "<tr><td align=\"center\" valign=\"middle\" width=\"20\"><b>".$tdaysBR[1]."</b></td>
<td height=20 align=\"center\" valign=\"middle\" width=\"20\"><b>".$tdaysBR[2]."</b></td>
<td height=20 align=\"center\" valign=\"middle\" width=\"20\"><b>".$tdaysBR[3]."</b></td>
<td height=20 align=\"center\" valign=\"middle\" width=\"20\"><b>".$tdaysBR[4]."</b></td>
<td height=20 align=\"center\" valign=\"middle\" width=\"20\"><b>".$tdaysBR[5]."</b></td>
<td height=20 align=\"center\" valign=\"middle\" width=\"20\"><b>".$tdaysBR[6]."</b></td>
<td height=20 align=\"center\" valign=\"middle\" width=\"20\"><b>".$tdaysBR[0]."</b></td></tr>\n";
while ($monthday <= $lastday)
{
echo "<tr height=\"14\">\n";
for ($i=0;$i<7;$i++)
{
$Cal_class = "tdday";
$fday = $firstday['wday'] == 0 ? 6 : $firstday['wday'] - 1;
if (($i >= $fday && $monthday <= 7) ||
($monthday <= $lastday && $monthday > (7-$fday)))
{
if ($monthday == $today["mday"])
{
if ($month == $today["mon"])
{
if ($monthday == $dd) { $Cal_class = "tddaysel"; }
else { $Cal_class = "tdoggi"; }
}
elseif ($i == 5 || $i == 6)
{
if ($monthday == $dd) { $Cal_class = "tddaysel"; }
else { $Cal_class = "tdweekend"; }
}
elseif ($monthday == $dd) { $Cal_class = "tddaysel"; }
else
{
if ($monthday == $dd) { $Cal_class = "tddaysel"; }
else { $Cal_class = "tdday"; }
}
}
elseif ($i == 5 || $i == 6)
{
if ($monthday == $dd) { $Cal_class = "tddaysel"; }
else { $Cal_class = "tdweekend"; }
}
elseif ($monthday == $dd) { $Cal_class = "tddaysel"; }
else { $Cal_class = "tdday"; }
$dayway = INFUSIONS."event_calendar_panel/event_calendar.php?yy=".$year."&mm=".$month."&dd=".$monthday;
$eventway = INFUSIONS."event_calendar_panel/event_calendar.php?yy=".$year."&mm=".$month."&dd=".$monthday;
if (in_array($monthday, $entries))
{echo "<td height=20 align=\"center\" valign=\"middle\" width=\"20\" class=\"".$Cal_class."\"><b><a href=\"".$eventway."\" style=\"color: green;\">".$monthday."</a></b></td>\n"; }
else { echo "<td height=20 align=\"center\" valign=\"middle\" width=\"20\" class=\"".$Cal_class."\"><b><a href=\"".$dayway."\">".$monthday."</a></b></td>\n"; }
$monthday++;
$Cal_class = "tdday";
}
else { echo "<td height=20 valign=\"middle\" width=\"20\" class=\"".$Cal_class."\"> </td>\n"; }
}
echo "</tr>\n";
$Cal_class = "tdday";
}
echo "</table>\n";
}
?>
Wylaczaj emotki wstawiajac kod! Przenioslem/Pieka
Edytowane przez Maliniak dnia 26.04.2006 15:25:16
|