Author |
Topic |
Jeepaholic
Average Member
USA
697 Posts |
Posted - 22 October 2002 : 17:07:50
|
Actually, I did the following to the drop-down code in cal_functions.asp around line 487. Changes are in red. I simply added one column to the FORUM_FORUM table called F_EVENTS_ALLOWED. This is a 1 if that forum is to be allowed.
allowSql = "SELECT FORUM_ID, F_PRIVATEFORUMS, F_PASSWORD_NEW, F_EVENTS_ALLOWED"
allowSql = allowSql & " FROM " & strTablePrefix & "FORUM"
allowSql = allowSql & " WHERE F_TYPE = 0"
allowSql = allowSql & " AND F_EVENTS_ALLOWED = 1"
allowSql = allowSql & " ORDER BY FORUM_ID"
Haven't figured out code for forum.asp yet...< |
Al Bsharah Aholics.com
Jeepaholics Anonymous Broncoholics Anonymous Network Insight
|
Edited by - Jeepaholic on 22 October 2002 17:08:41 |
|
|
Jeepaholic
Average Member
USA
697 Posts |
Posted - 22 October 2002 : 17:34:50
|
Also...anyone have a script for copying events over from the old mod? Of course there are issues with selecting which forum to put them in, but that's a minor problem. I'm just curious if mapping the fields to fields in FORUM_TOPIC will work correctly, or if anyone has any advice on what the script should look like.
The table structure for the old FORUM_EVENTS table is as such:
1 EVENT_ID int 4 0
0 DATE_ADDED nvarchar 20 0
0 START_DATE nvarchar 20 0
0 END_DATE nvarchar 20 0
0 EVENT_TITLE nvarchar 100 0
0 EVENT_DETAILS ntext 16 0
0 ADDED_BY int 4 0
0 PRIVATE int 4 0
Table structure for the existing FORUM_TOPICS table is as such:
3 CAT_ID int 4 0
2 FORUM_ID int 4 0
2 TOPIC_ID int 4 0
0 T_STATUS smallint 2 1
0 T_MAIL smallint 2 1
0 T_SUBJECT nvarchar 100 1
0 T_MESSAGE ntext 16 1
0 T_AUTHOR int 4 1
0 T_REPLIES int 4 1
0 T_UREPLIES int 4 1
0 T_VIEW_COUNT int 4 1
0 T_LAST_POST nvarchar 14 1
0 T_DATE nvarchar 14 1
0 T_LAST_POSTER int 4 1
0 T_IP nvarchar 15 1
0 T_LAST_POST_AUTHOR int 4 1
0 T_LAST_POST_REPLY_ID int 4 1
0 T_ARCHIVE_FLAG int 4 1
0 T_LAST_EDIT nvarchar 14 1
0 T_LAST_EDITBY int 4 1
0 T_STICKY smallint 2 1
0 T_SIG smallint 2 1
0 T_EVENT_DATE nvarchar 50 1
0 T_ISEVENT int 4 1
My thoughts on mapping are below. Please let me know what you think!
CAT_ID = Whatever FORUM_ID = Whatever TOPIC_ID = AutoGenerated (Identity) T_STATUS = <what is this?> T_MAIL = 0 T_SUBJECT = EVENT_TITLE T_MESSAGE = EVENT_DETAILS T_AUTHOR = ADDED_BY T_REPLIES = 0 T_UREPLIES = <what is this?> T_VIEW_COUNT = 0 T_LAST_POST = DATE_ADDED T_DATE = DATE_ADDED T_LAST_POSTER = <what is this?> T_IP = <default> T_LAST_POST_AUTHOR = ADDED_BY T_LAST_POST_REPLY_ID = <what is this?> T_ARCHIVE_FLAG = <what is this?> T_LAST_EDIT = <default> T_LAST_EDITBY = <default> T_STICKY = 0 T_SIG = <what is this?> T_EVENT_DATE = START_DATE T_ISEVENT = 1< |
Al Bsharah Aholics.com
Jeepaholics Anonymous Broncoholics Anonymous Network Insight
|
Edited by - Jeepaholic on 22 October 2002 17:50:47 |
|
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 22 October 2002 : 18:13:50
|
I'm not sure, but can you even compare this MOD to the previous one ?? .. I never touched the previous one, but the new one is implemented as topics (with an additional flag). I think the old one used a completely different table ?
Anyway, I think most of your <what is this?>'s can be answered by looking at normal posts.
Fields like T_SIG, T_ARCHIVE_FLAG, etc are just flags, so find the default status by checking in some other posts.< |
|
|
Jeepaholic
Average Member
USA
697 Posts |
Posted - 22 October 2002 : 18:26:02
|
I'm not trying to compare the two, simply migrate old to new. Yes, they are completely different...but if you will look at the tables I posted they have similar enough columns that one should be able to migrate them over.
Most of my "<what is this?>" comments cannot be answered by looking at the posts, or I probably wouldn't have asked. Many of them are full of NULLs in the database and I'm trying to figure out if they're old columns left for compatibility or what. The rest are, in fact, flags. I asked "What is this?" because I would like to know what they are flags for so that I don't force poor data during my migration.< |
Al Bsharah Aholics.com
Jeepaholics Anonymous Broncoholics Anonymous Network Insight
|
|
|
Jeepaholic
Average Member
USA
697 Posts |
|
red1
Junior Member
355 Posts |
Posted - 24 October 2002 : 17:56:08
|
quote:
1) Anyone have any code (or suggestions on what needs to be done) that will restrict which forums you may post events to?
You're going in the right direction. After putting a flag for events in the forum table, put checks in post.asp and post_info.asp to see if the forum has the event flag.
quote:
2) Do any of the cal_style.asp styles identify days where events occur on? I would like to bold those dates in the small calendar so folks can see which days have events. I haven't figured out which style (if any) sets this.
You can add font-weight: bold to the style definition of .isevent< |
My Mods: New Events Calendar New Non-database Active Users |
Edited by - red1 on 24 October 2002 17:59:37 |
|
|
red1
Junior Member
355 Posts |
Posted - 24 October 2002 : 18:07:22
|
Eveyone I found a bug with TopicQuote. Find these lines in post.asp (around line 352):
dateHolder=strtodate(rs("T_EVENT_DATE"))
isevent=rs("T_ISEVENT")
Insert this line below:
if strRqMethod = "TopicQuote" then isevent="0"
< |
My Mods: New Events Calendar New Non-database Active Users |
Edited by - red1 on 24 October 2002 18:09:42 |
|
|
Jeepaholic
Average Member
USA
697 Posts |
Posted - 25 October 2002 : 17:02:31
|
quote: Originally posted by Jeepaholic
The migration worked flawlessly...I did it with DTS so I don't have a script, but I will post the exact mappings tomorrow (they're at the office, where I am not).
Here is the mapping I used to copy the old Events Calendar into the new one. I did this in DTS (SQL 2k database), so I do not have a script for it. However, someone should be able to create one I would think if necessary...
<whatever> = value of the category and forum you want your events to go to <ignore> = do not send this data, the DB defaults will work fine value = an actual number that is passed to the column
SOURCE DESTINATION
<whatever> CAT_ID
<whatever> FORUM_ID
<ignore> TOPIC_ID
<ignore> T_STATUS
<ignore> T_MAIL
EVENT_TITLE T_SUBJECT
EVENT_DETAILS T_MESSAGE
ADDED_BY T_AUTHOR
<ignore> T_REPLIES
value = 0 T_UREPLIES
<ignore> T_VIEW_COUNT
DATE_ADDED T_LAST_POST
DATE_ADDED T_DATE
<ignore> T_LAST_POSTER
<ignore> T_IP
ADDED_BY T_LAST_POST_AUTHOR
value = 0 T_LAST_POST_REPLY_ID
value = 1 T_ARCHIVE_FLAG
<ignore> T_LAST_EDIT
<ignore> T_LAST_EDITBY
<ignore> T_STICKY
<ignore> T_SIG
START_DATE T_EVENT_DATE
value = 1 T_ISEVENT
< |
Al Bsharah Aholics.com
Jeepaholics Anonymous Broncoholics Anonymous Network Insight
|
Edited by - Jeepaholic on 25 October 2002 17:03:27 |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 01 November 2002 : 08:50:24
|
Hrmmm,
I have added the Events Calendar to a clean install using all the files in the zip and a MySql database and get this error:
The Calendar itself is showing January and the 'Up coming events' is showing:
Microsoft OLE DB Provider for ODBC Drivers error '80040e09'
[TCX][MyODBC]You have an error in your SQL syntax near '5 T.TOPIC_ID, T.T_SUBJECT, T.FORUM_ID, T.T_STATUS, T.T_EVENT_DATE, C.CAT_MODERAT' at line 1
/events/cal_functions.asp, line 267
In cal_functions.asp, Lines 240-267, inclusive, show:
strSql = "SELECT TOP " & intEventstoDisplay & " " strSql = strSql & "T.TOPIC_ID, " & _ "T.T_SUBJECT, " & _ "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_EVENT_DATE > '" & datetostr(DateValue(strForumTimeAdjust)) & "' " & _ "AND F.FORUM_ID = T.FORUM_ID " & _ "AND C.CAT_ID = T.CAT_ID " & _ "ORDER BY T.T_EVENT_DATE Asc"
set rs = Server.CreateObject("ADODB.Recordset") rs.open StrSql, My_conn
Any clues as to what might be wrong?
Regards, Dave
< |
Edited by - Webbo on 04 November 2002 19:58:20 |
|
|
red1
Junior Member
355 Posts |
Posted - 01 November 2002 : 14:40:48
|
Dave can you please try downloading the mod again? A few days ago I was messing around with the code and I inadvertently uploaded a wrong version of the mod to snitzbitz. Reapply the dbs file and try it again< |
My Mods: New Events Calendar New Non-database Active Users |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 01 November 2002 : 15:26:07
|
Hi red1,
Thanks for the reply.
I have just setup a fresh board using the database and uploaded the files and run the dbs_events_mod.asp again but infortunately the exact same problem still exists.
You can see it here: http://www.maggotdrowning.com/events/default.asp
I spent a bit of time earlier firstly using the files in the mod to overwrite the original forum files and then starting from scratch, writing the changes into the original snitz files just to rule any indifferences out but it didn't make any difference.
Regards, Dave< |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 01 November 2002 : 16:07:56
|
Hrmm, I don't know if this is relevant or not but changing the number of events to display in Cal_constant.asp at this point:
'### The Number of Upcoming/Recent Events to Display ### Const intEventstoDisplay = 5
also changes the number in the error line:
[TCX][MyODBC]You have an error in your SQL syntax near '5 T.TOPIC_ID, T.T_SUBJECT, T.FORU...........
<<Scratching head now>> Dave< |
|
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 01 November 2002 : 17:49:19
|
Yep, that's fine, I think it's the SQL that is wrong.< |
|
|
jim123
Starting Member
13 Posts |
Posted - 02 November 2002 : 08:48:56
|
I'm getting the same sql error...line 266. any suggestions anyone?< |
|
|
jim123
Starting Member
13 Posts |
Posted - 02 November 2002 : 11:21:35
|
Does anyone see an error in here? I know absoultely nothing about asp...Thanks '####################################################### Sub WriteUpcomingEvents '## '#######################################################
strSql = "SELECT TOP " & intEventstoDisplay & " " strSql = strSql & "T.TOPIC_ID, " & _ "T.T_SUBJECT, " & _ "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_EVENT_DATE > '" & datetostr(DateValue(strForumTimeAdjust)) & "' " & _ "AND F.FORUM_ID = T.FORUM_ID " & _ "AND C.CAT_ID = T.CAT_ID " & _ "ORDER BY T.T_EVENT_DATE Asc"
set rs = Server.CreateObject("ADODB.Recordset") rs.open StrSql, My_conn
Response.Write "<DIV class=""smalleventslist"">" & vbnewline Response.Write "<DL>" If rs.EOF then Response.Write "<DT>" & strCalNoUpcoming & "</DT>" & vbnewline else do while not rs.eof Topic_ID = rs("TOPIC_ID") Topic_Subject = rs("T_SUBJECT") Forum_ID = rs("FORUM_ID") Topic_Status = rs("T_STATUS") Event_Date = StrToDate(rs("T_EVENT_DATE")) Cat_Moderation = rs("CAT_MODERATION") Forum_Moderation = rs("F_MODERATION") < |
|
|
Topic |
|