Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 MOD: New Events Calendar for 3.4.03 beta
 New Topic  Reply to Topic
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 32

Jeepaholic
Average Member

USA
697 Posts

Posted - 22 October 2002 :  17:07:50  Show Profile  Visit Jeepaholic's Homepage  Reply with Quote
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
Go to Top of Page

Jeepaholic
Average Member

USA
697 Posts

Posted - 22 October 2002 :  17:34:50  Show Profile  Visit Jeepaholic's Homepage  Reply with Quote
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
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 22 October 2002 :  18:13:50  Show Profile  Reply with Quote
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.<
Go to Top of Page

Jeepaholic
Average Member

USA
697 Posts

Posted - 22 October 2002 :  18:26:02  Show Profile  Visit Jeepaholic's Homepage  Reply with Quote
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
Go to Top of Page

Jeepaholic
Average Member

USA
697 Posts

Posted - 24 October 2002 :  17:03:35  Show Profile  Visit Jeepaholic's Homepage  Reply with Quote
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).<

Al Bsharah
Aholics.com

Jeepaholics Anonymous
Broncoholics Anonymous
Network Insight
Go to Top of Page

red1
Junior Member

355 Posts

Posted - 24 October 2002 :  17:56:08  Show Profile  Reply with Quote
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
Go to Top of Page

red1
Junior Member

355 Posts

Posted - 24 October 2002 :  18:07:22  Show Profile  Reply with Quote
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
Go to Top of Page

Jeepaholic
Average Member

USA
697 Posts

Posted - 25 October 2002 :  17:02:31  Show Profile  Visit Jeepaholic's Homepage  Reply with Quote
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
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 01 November 2002 :  08:50:24  Show Profile  Visit Webbo's Homepage  Reply with Quote
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
Go to Top of Page

red1
Junior Member

355 Posts

Posted - 01 November 2002 :  14:40:48  Show Profile  Reply with Quote
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
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 01 November 2002 :  15:26:07  Show Profile  Visit Webbo's Homepage  Reply with Quote
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<
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 01 November 2002 :  16:07:56  Show Profile  Visit Webbo's Homepage  Reply with Quote
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<
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 01 November 2002 :  17:49:19  Show Profile  Reply with Quote
Yep, that's fine, I think it's the SQL that is wrong.<
Go to Top of Page

jim123
Starting Member

13 Posts

Posted - 02 November 2002 :  08:48:56  Show Profile  Reply with Quote
I'm getting the same sql error...line 266. any suggestions anyone?<
Go to Top of Page

jim123
Starting Member

13 Posts

Posted - 02 November 2002 :  11:21:35  Show Profile  Reply with Quote
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")
<
Go to Top of Page
Page: of 32 Previous Topic Topic Next Topic  
Previous Page | Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.55 seconds. Powered By: Snitz Forums 2000 Version 3.4.07