Ciao a tutti,
vi chiedo un piccolo aiuto
ho montato un calendario sulla mia homepage, ma avrei necessità di cambiare la visualizzazione della pagina di default, ovvero non vedere tutti i giorni del mese in corso, ma far vedere esclusivamente i giorni che hanno un evento.
Incollo il codice in questione:
<%
set rsEventsDay = Server.CreateObject("ADODB.Recordset")
rsEventsDay.ActiveConnection = MM_conncalendar_STRING
rsEventsDay.Source = "SELECT * FROM EVENTS WHERE EVE_APPROVED = 1 ORDER BY EVE_DATED"
rsEventsDay.CursorType = 0
rsEventsDay.CursorLocation = 2
rsEventsDay.LockType = 3
rsEventsDay.Open()
rsEventsDay_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
rsEventsDay_numRows = rsEventsDay_numRows + Repeat1__numRows
%>
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>
function DoTrimProperly(str, nNamedFormat, properly, pointed, points)
dim strRet
strRet = Server.HTMLEncode(str)
strRet = replace(strRet, vbcrlf,"")
strRet = replace(strRet, vbtab,"")
If (LEN(strRet) > nNamedFormat) Then
strRet = LEFT(strRet, nNamedFormat)
If (properly = 1) Then
Dim TempArray
TempArray = split(strRet, " ")
Dim n
strRet = ""
for n = 0 to Ubound(TempArray) - 1
strRet = strRet & " " & TempArray(n)
next
End If
If (pointed = 1) Then
strRet = strRet & points
End If
End If
DoTrimProperly = strRet
End Function
</SCRIPT>
<%
If Request("iDate") <> "" Then
iDate = DateValue(Request("iDate"))
Else
iDate = date
End if
CurrentMonth = Month(iDate)
CurrentMonthName = MonthName(CurrentMonth)
CurrentYear = Year(iDate)
FirstDayDate = DateSerial(CurrentYear, CurrentMonth, 1)
FirstDay = WeekDay(FirstDayDate, 0)
CurrentDay = FirstDayDate
%>
<link href="assets/calendar.css" rel="stylesheet" type="text/css">
<div class = "links">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td align="left" valign="top"><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#666666">
<tr>
<td class="bgMonthListing" align="center" valign="middle" colspan="7">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr align="center" valign="middle">
<td align = "left" class="bgMonthListing">« "><%= UCASE(Left(MonthName(Month(DateAdd("m", -1, CurrentDay))),3)) %></td>
<td class="bgMonthListing"><%= UCASE(CurrentMonthName & " " & CurrentYear) %></td>
<td align = "right" class="bgMonthListing">"><%= UCASE(Left(MonthName(Month(DateAdd("m", 1, CurrentDay))),3)) %> »</td>
</tr>
</table></td>
</tr>
<tr>
<% For DayLoop = 1 to 7 %>
<td width="100" align="center" valign="middle" class="bgDayListing"><%= WeekDayName(Dayloop, True, 0)%></td>
<% Next%>
</tr>
<tr align="center" valign="middle">
<%
If FirstDay <> 1 Then
i = FirstDay - 1
Do While i > 0
%>
<TD height="120" align="right" valign="top" class="bgGrey"><%=Day(CurrentDay - i)%></td>
<%
i = i - 1
Loop
%>
<%
End if
DayCounter = FirstDay
CorrectMonth = True
Do While CorrectMonth = True
If CurrentDay = iDate Then %>
<TD height="120" align="right" valign="top" class="bgCurrentDay">
<% Else %>
<TD height="120" align="right" valign="top" bgcolor="#FFFFFF" class="text">
<% End if %> <%=Day(CurrentDay)%>
<% rsEventsDay.Filter = "EVE_DATED = #" & CurrentDay & "#" %>
<% If not rsEventsDay.EOF Or not rsEventsDay.BOF Then %> <%
While ((Repeat1__numRows <> 0) AND (NOT rsEventsDay.EOF))
%>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td align="left" valign="middle" class="text"> - <a href="detail.asp?iEve=<%= (rsEventsDay.Fields.Item("EVE_ID").Value)%>&iType= <%= (rsEventsDay.Fields.Item("EVE_TYPE").Value)%>">
<% =(DoTrimProperly((rsEventsDay.Fields.Item("EVE_NAM E").Value), 20, 0, 1, "...")) %>
</a> </td>
</tr>
</table>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsEventsDay.MoveNext()
Wend
%> <% End If %> </TD>
<%
DayCounter = DayCounter + 1
If DayCounter > 7 then
DayCounter = 1 %>
</TR>
<tr align="center" valign="middle">
<%
End if
CurrentDay = DateAdd("d", 1, CurrentDay)
If Month(CurrentDay) <> CurrentMonth then
CorrectMonth = False
End if
Loop
%>
<%
If DayCounter <> 1 Then
i = 0
Do While i < 8 - DayCounter
%>
<TD height="120" align="right" valign="top" class="bgGrey"><%= i + 1 %></TD>
<%
i = i + 1
Loop
End if
%>
</TR>
</table></td>
</tr>
<tr>
<td align="center" valign="middle" class="text">Calendar
| Submit An Event | <a href="http://#>Powered
By #</a></td>
</tr>
</table>
</div>
Vi ringrazio per l'aiuto
eli



Rispondi quotando