Witam!
Jestem w trakcie modyfikacji skryptu Event Calendar Panel i chcę tak zrobić aby po najechaniu myszką na datę w którym jest jakies wydarzenie sie ono wyświetlało sie ono w okienku przy myszce. TAk jak na załączonym obrazku.
Problem jest w tym że nie umiem napisać polecenia aby odwołać się odpowiednio do mysql'a aby wyświetlił tytuł wydarzenia.
Poniżej zamieszczam kod źródłowy przerobionego już event calendar panelu:
<?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;\" onmouseover=\"gpe('text:<b>InO: </b> ".$data['event_titre'].";')\">".$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";
}
?>
a to co zmieniłem znajduje się tutaj:
echo "<td height=20 align=\"center\" valign=\"middle\" width=\"20\" class=\"".$Cal_class."\"><b><a href=\"".$eventway."\" style=\"color: green;\" onmouseover=\"gpe('text:<b>InO: </b> ".$data['event_titre'].";')\">".$monthday."</a></b></td>\n"; }
Proszę o pomoc przy tej modyfikacji. |