Author |
Topic |
|
Jóhannes
Junior Member
Iceland
139 Posts |
Posted - 13 January 2003 : 12:12:16
|
Hi
I am using the Calendar MOD in v.3.4.03
Is there a way to have categorys in the Calendar? That is:
I have 3 categorys (cars, meetings and football) and with some entries. Can I have a "drop-down" list to display one of them (category) at a time (that is: I want only to see "football" entries)?
can I change the URL from: intranet.test.is/dagatal/cal.asp?view=monthly&date=13.1.2003
to something like this: intranet.test.is/dagatal/cal.asp?FORUM_ID=1&view=monthly&date=13.1.2003
what changes do I have to make in ASP? |
Jóhannes
|
Edited by - Jóhannes on 14 January 2003 15:07:13 |
|
red1
Junior Member
355 Posts |
|
Jóhannes
Junior Member
Iceland
139 Posts |
Posted - 14 January 2003 : 05:13:26
|
I'm not very good at this SQL buisness . This is the SQL for Monthly view:
'### Get the topics from the db ###
strSql = "SELECT T.TOPIC_ID, " & _
"T.T_SUBJECT, " & _
"T.T_AUTHOR, " & _
"T.T_MESSAGE, " & _
"T.FORUM_ID, " & _
"T.T_STATUS, " & _
"T.T_EVENT_DATE, " & _
"C.CAT_MODERATION, " & _
"F.F_MODERATION " & _
"FROM " & strTablePrefix & "TOPICS T, " & _
strTablePrefix & "CATEGORY C, " & _
strTablePrefix & "FORUM F " & _
"WHERE T.T_ISEVENT=1 " & _
"AND (T.T_EVENT_DATE > '" & DateToStr(DateSerial(Year(dateHolder),Month(dateHolder),1-1)) & "') " & _
"AND (T.T_EVENT_DATE < '" & DateToStr(DateSerial(Year(dateHolder),Month(dateHolder)+1,1)) & "') " & _
"AND F.FORUM_ID = T.FORUM_ID " & _
"AND C.CAT_ID = T.CAT_ID " & _
"ORDER BY T.T_EVENT_DATE Asc"
How do I edit this ? |
Jóhannes
|
Edited by - Jóhannes on 14 January 2003 14:32:28 |
|
|
red1
Junior Member
355 Posts |
|
Jóhannes
Junior Member
Iceland
139 Posts |
Posted - 15 January 2003 : 03:40:36
|
I did that (in the SQL in monthly-view) but then I get this:
ADODB.Recordset error '800a0bb9' Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/intranet/vsk/dagatal/cal.asp, line 634
Any suggestions ? |
Jóhannes
|
|
|
red1
Junior Member
355 Posts |
Posted - 15 January 2003 : 06:46:34
|
sorry about that... use this one (this works, I tested it)
strSql = "SELECT T.TOPIC_ID, " & _
"T.T_SUBJECT, " & _
"T.T_AUTHOR, " & _
"T.T_MESSAGE, " & _
"T.FORUM_ID, " & _
"T.T_STATUS, " & _
"T.T_EVENT_DATE, " & _
"C.CAT_MODERATION, " & _
"F.F_MODERATION " & _
"FROM " & strTablePrefix & "TOPICS T, " & _
strTablePrefix & "CATEGORY C, " & _
strTablePrefix & "FORUM F " & _
"WHERE T.T_ISEVENT=1 " & _
"AND (T.T_EVENT_DATE > '" & DateToStr(DateSerial(Year(dateHolder),Month(dateHolder),1-1)) & "') " & _
"AND (T.T_EVENT_DATE < '" & DateToStr(DateSerial(Year(dateHolder),Month(dateHolder)+1,1)) & "') " & _
"AND F.FORUM_ID = T.FORUM_ID " & _
"AND C.CAT_ID = T.CAT_ID "
intForum_ID = chkString(Request.Querystring("FORUM_ID"),"SQLString")
if intForum_ID <> "" and IsNumeric(intForum_ID) then
strSql = strSql & "AND T.FORUM_ID = " & clng(intForum_ID) & " "
end if
strSql = strSql & "ORDER BY T.T_EVENT_DATE Asc" |
My Mods: New Events Calendar New Non-database Active Users |
|
|
Jóhannes
Junior Member
Iceland
139 Posts |
Posted - 15 January 2003 : 08:19:17
|
red1, you are a genius. Many thanks for your support. That fixed it.
|
Jóhannes
|
|
|
Jóhannes
Junior Member
Iceland
139 Posts |
Posted - 20 January 2003 : 09:44:52
|
...one more
This is working fine in all view's except in the yearly-view (cal.asp?view=yearly)
There is no "strsql" in the cal.asp page for the "Sub Yearlyview" to edit, but there is one in the cal_functions.asp. If I edit that like this:
strSql = "SELECT T_EVENT_DATE " & _
"FROM " & strTablePrefix & "TOPICS " & _
"WHERE (T_ISEVENT=1) " & _
"AND (T_EVENT_DATE >= '" & datetostr(DateSerial(Year(dateToDraw),Month(dateToDraw),1)) & "') " & _
"AND (T_EVENT_DATE < '" & datetostr(DateSerial(Year(dateToDraw),Month(dateToDraw)+1,1)) & "') "
intForum_ID = chkString(Request.Querystring("FORUM_ID"),"SQLString")
if intForum_ID <> "" and IsNumeric(intForum_ID) then
strSql = strSql & "AND T.FORUM_ID = " & clng(intForum_ID) & " "
end if
strSql = strSql & "ORDER BY T.T_EVENT_DATE Asc"
I get this error:
Microsoft JET Database Engine error '80040e10' No value given for one or more required parameters.
Help !!! |
Jóhannes
|
|
|
red1
Junior Member
355 Posts |
Posted - 20 January 2003 : 10:31:17
|
try this:
intForum_ID = chkString(Request.Querystring("FORUM_ID"),"SQLString")
if intForum_ID <> "" and IsNumeric(intForum_ID) then
strSql = strSql & "AND FORUM_ID = " & clng(intForum_ID) & " "
end if
strSql = strSql & "ORDER BY T_EVENT_DATE Asc"
Let me know if it works. |
My Mods: New Events Calendar New Non-database Active Users |
|
|
Jóhannes
Junior Member
Iceland
139 Posts |
Posted - 20 January 2003 : 11:08:08
|
That fixed it.
Thanks.
|
Jóhannes
|
|
|
|
Topic |
|