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)
 Tweak of New Events Calendar Add-on
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 3

Steve D.
Average Member

USA
640 Posts

Posted - 31 January 2003 :  11:52:58  Show Profile  Visit Steve D.'s Homepage  Send Steve D. a Yahoo! Message
Laser posted an add-on to the Calendar mod that allowed you to turn the calendar in to a TV Guide.

I took his idea one step further and allowed the user's to enter the data in to form fields, instead of a pre-formatted message. In post_info.asp, it add's all the fields together, and combines it to the Message field and is stored as the message. When edited, now they see a pre-formatted message.

Test site removed.



There are three files that you need to edit.

post.asp

find this code

		Response.Write	"		 <tr>" & vbNewLine & _
				"		 <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""middle"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>" & strCalEventDate & "</b></font></td>" & vbNewLine & _
				"                <td bgColor=""" & strPopUpTableColor & """><input maxLength=""50"" name=""event_Date"" value=""" & dateHolder & """ size=""40""></td>" & vbNewLine & _
				"                </tr>" & vbNewLine

below it add this

'#### Steve D.'s Event Add On ####
If strRqMethod = "Topic" then

		Response.Write	"		 <tr>" & vbNewLine & _
				"		 <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""middle"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Location:</b></font></td>" & vbNewLine & _
				"                <td bgColor=""" & strPopUpTableColor & """><input maxLength=""50"" name=""event_Location"" size=""40""></td>" & vbNewLine & _
				"                </tr>" & vbNewLine

		Response.Write	"		 <tr>" & vbNewLine & _
				"		 <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""middle"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Time:</b></font></td>" & vbNewLine & _
				"                <td valign=""middle"" bgColor=""" & strPopUpTableColor & """><input maxLength=""8"" name=""event_StartTime"" size=""8""> - <input maxLength=""8"" name=""event_EndTime"" size=""8""></td>" & vbNewLine & _
				"                </tr>" & vbNewLine

		Response.Write	"		 <tr>" & vbNewLine & _
				"		 <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""middle"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Cost:</b></font></td>" & vbNewLine & _
				"                <td bgColor=""" & strPopUpTableColor & """><input maxLength=""6"" name=""event_Cost"" value=""$"" size=""6""></td>" & vbNewLine & _
				"                </tr>" & vbNewLine

		Response.Write	"		 <tr>" & vbNewLine & _
				"		 <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""middle"" align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Website:</b></font></td>" & vbNewLine & _
				"                <td bgColor=""" & strPopUpTableColor & """><input maxLength=""100"" name=""event_Website"" value=""http://""size=""40""></td>" & vbNewLine & _
				"                </tr>" & vbNewLine
End If 
'###########################

If you want more or less fields add them above.

in post_info.asp make the following change

Find this
		txtMessage = ChkString(Request.Form("Message"),"message")
		txtSubject = ChkString(Request.Form("Subject"),"SQLString")
		if Request.form("isevent")="1" then
			dateHolder = DatetoStr(CDate(Request.Form("event_date")))
		else
			dateHolder=""
		end if

replace that block
	' ##################### Events Mod ######################
		if Request.form("isevent")="1" then
			dateHolder = DatetoStr(CDate(Request.Form("event_date")))
			'#### Steve D.'s Event Add On ####	
				dim EventMessage
				EventMessage = "Location:  " & Request.Form("event_Location") & vbNewLine
				EventMessage = EventMessage & "Time:  " & Request.Form("event_StartTime") & " - " & Request.Form("event_EndTime") & vbNewLine
				EventMessage = EventMessage & "Cost:  " & Request.Form("event_Cost") & vbNewLine
				EventMessage = EventMessage & "Website:  " & Request.Form("event_Website") & vbNewLine

				txtMessage = ChkString(EventMessage & vbNewLine & Request.Form("Message"),"message")
		else
			dateHolder=""
		
			txtMessage = ChkString(Request.Form("Message"),"message")
		end if
	' #####################################################
		txtSubject = ChkString(Request.Form("Subject"),"SQLString")

For any additional items you added in the previous steps you will need to add here. Or if you removed any items, remeber to update this as well.

Last Error Checking (optional)

Edit inc_code.js

Directly after this
function validate(){
	if (document.PostTopic.Subject) {
		if (trim(document.PostTopic.Subject.value)=="") {
			alert("You must enter a Subject")
			return false
		}
	}
	if (document.PostTopic.Message) {
		if (trim(document.PostTopic.Message.value)=="") {
			alert("You must enter a Message")
			return false
		}
	}

insert the following

	if (document.PostTopic.event_Location) {
		if (trim(document.PostTopic.event_Location.value)=="") {
			alert("You must enter a Event Location")
			return false
		}
	}
	if (document.PostTopic.event_StartTime) {
		if (trim(document.PostTopic.event_StartTime.value)=="") {
			alert("You must enter a Start Time")
			return false
		}
	}
	if (document.PostTopic.event_EndTime) {
		if (trim(document.PostTopic.event_EndTime.value)=="") {
			alert("You must enter a End Time")
			return false
		}
	}
	if (document.PostTopic.event_Cost) {
		if (trim(document.PostTopic.event_Cost.value)=="$") {
			alert("You must enter an Event Cost")
			return false
		}
	}

Add only the values that you want to be required for the user to fill out here. Notice I did not require website.

That should be it. (You may want to Reply w/ Quote to copy the code to get the formatting correct.

Swing Dancing Video Clips - It's All Swing! Forum

Edited by - Steve D. on 17 March 2003 01:35:24

Steve D.
Average Member

USA
640 Posts

Posted - 31 January 2003 :  14:10:51  Show Profile  Visit Steve D.'s Homepage  Send Steve D. a Yahoo! Message
Test site has been removed.

Swing Dancing Video Clips - It's All Swing! Forum

Edited by - Steve D. on 19 February 2003 15:45:15
Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 01 February 2003 :  21:49:23  Show Profile  Visit Etymon's Homepage
I like the colors on your board, Steve.

Also, in case I forget later, I see you have a birthday coming up on the 17th. Happy Birthday!

Thanks for the extra script,

Etymon
Go to Top of Page

Steve D.
Average Member

USA
640 Posts

Posted - 03 February 2003 :  10:13:49  Show Profile  Visit Steve D.'s Homepage  Send Steve D. a Yahoo! Message
No problem, I was just so excited that I figured out how to add the extra fields to the actual message without having to put in more fields in the db.

Thanks for the early Happy Birthday. I'll be turning 30 this year!

Swing Dancing Video Clips - It's All Swing! Forum
Go to Top of Page

svx
Starting Member

USA
35 Posts

Posted - 16 March 2003 :  23:09:29  Show Profile  Visit svx's Homepage  Send svx an AOL message  Send svx an ICQ Message
I just tried this on my test site. It shows the fields when create the post, but it does not show the extra data entered into those field in the actual post. Ie, I enter the time, location, and website (removed cost), but when I click post only the text in the "Event Details" box show. Any ideas?

{ISV-K}SVX
"I'm on Fire!"
www.isv-knights.org
Go to Top of Page

Steve D.
Average Member

USA
640 Posts

Posted - 17 March 2003 :  00:12:58  Show Profile  Visit Steve D.'s Homepage  Send Steve D. a Yahoo! Message
hmmm... can you post a link to a text version of post.asp and post_info.asp

The info gets added on to the rest of the message in the post_info.asp page, so I would check there for any errors.


Swing Dancing Video Clips - It's All Swing! Forum
Go to Top of Page

spyordie007
Junior Member

USA
408 Posts

Posted - 17 March 2003 :  01:13:31  Show Profile  Visit spyordie007's Homepage  Send spyordie007 an AOL message
very easy very nice addon
<-- going to use this one
good job

-Spy

Power - The only narcotic controlled by the SEC, not the FDA.

Prosperity without pollution! The American Hydrogen Association - http://www.ahanw.org
Questions about Hydrogen? Post them on our forum - http://www.ahanw.org/forum
Go to Top of Page

spyordie007
Junior Member

USA
408 Posts

Posted - 17 March 2003 :  01:20:09  Show Profile  Visit spyordie007's Homepage  Send spyordie007 an AOL message
hmm, maybe not

I notice now that whenever I add a new regular topic (not an event) that those fields show up
example:
http://ahanw.dhs.org/forum/topic.asp?TOPIC_ID=175

Your suggestions?

-Spy

EDIT: Link fixed

Power - The only narcotic controlled by the SEC, not the FDA.

Prosperity without pollution! The American Hydrogen Association - http://www.ahanw.org
Questions about Hydrogen? Post them on our forum - http://www.ahanw.org/forum

Edited by - spyordie007 on 17 March 2003 01:21:15
Go to Top of Page

Steve D.
Average Member

USA
640 Posts

Posted - 17 March 2003 :  01:38:12  Show Profile  Visit Steve D.'s Homepage  Send Steve D. a Yahoo! Message
I forgot that I changed that. I edited my original post to show the change, but essentially it's the block of code on post_info.asp. I forgot to put the addition of that information inside of the IsEvents check. So it was putting in the extra info for all topics too.

When you copy the info, use a reply w/quote so you can get the forum code that is being interpreted here. Notice how the text is bold.

Sorry about that.

Swing Dancing Video Clips - It's All Swing! Forum
Go to Top of Page

spyordie007
Junior Member

USA
408 Posts

Posted - 17 March 2003 :  11:21:46  Show Profile  Visit spyordie007's Homepage  Send spyordie007 an AOL message
hey that's great, thanks for the modded mod Steve!

-Spy

Power - The only narcotic controlled by the SEC, not the FDA.

Prosperity without pollution! The American Hydrogen Association - http://www.ahanw.org
Questions about Hydrogen? Post them on our forum - http://www.ahanw.org/forum
Go to Top of Page

Steve D.
Average Member

USA
640 Posts

Posted - 17 March 2003 :  11:24:18  Show Profile  Visit Steve D.'s Homepage  Send Steve D. a Yahoo! Message
Everything working now?

Swing Dancing Video Clips - It's All Swing! Forum
Go to Top of Page

spyordie007
Junior Member

USA
408 Posts

Posted - 17 March 2003 :  11:31:00  Show Profile  Visit spyordie007's Homepage  Send spyordie007 an AOL message
appears so, I'll let you know if I have any problems with it. This is a fairly simple mod (just adds some fields to the event entry form and drops the text in the post field) but works very well so I've got it running in production now.

-Spy

Power - The only narcotic controlled by the SEC, not the FDA.

Prosperity without pollution! The American Hydrogen Association - http://www.ahanw.org
Questions about Hydrogen? Post them on our forum - http://www.ahanw.org/forum
Go to Top of Page

Steve D.
Average Member

USA
640 Posts

Posted - 17 March 2003 :  11:33:38  Show Profile  Visit Steve D.'s Homepage  Send Steve D. a Yahoo! Message
Cool.

Swing Dancing Video Clips - It's All Swing! Forum
Go to Top of Page

spyordie007
Junior Member

USA
408 Posts

Posted - 17 March 2003 :  11:37:00  Show Profile  Visit spyordie007's Homepage  Send spyordie007 an AOL message
you're quick Steve

-Spy

Power - The only narcotic controlled by the SEC, not the FDA.

Prosperity without pollution! The American Hydrogen Association - http://www.ahanw.org
Questions about Hydrogen? Post them on our forum - http://www.ahanw.org/forum

Edited by - spyordie007 on 17 March 2003 11:37:24
Go to Top of Page

Steve D.
Average Member

USA
640 Posts

Posted - 17 March 2003 :  11:38:11  Show Profile  Visit Steve D.'s Homepage  Send Steve D. a Yahoo! Message
just bored at work

Swing Dancing Video Clips - It's All Swing! Forum

Edited by - Steve D. on 17 March 2003 11:43:53
Go to Top of Page

Hobeeb
Starting Member

17 Posts

Posted - 21 March 2003 :  13:56:12  Show Profile  Send Hobeeb an AOL message  Send Hobeeb a Yahoo! Message
Steve, do I need to have the calender mod installed to use this? And can I still use the quick reply feature?

Thanks,
Vin

Edited by - Hobeeb on 21 March 2003 14:08:18
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.22 seconds. Powered By: Snitz Forums 2000 Version 3.4.07