Author |
Topic |
Steve D.
Average Member
USA
640 Posts |
Posted - 31 January 2003 : 11:52:58
|
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 |
|
Etymon
Advanced Member
United States
2385 Posts |
Posted - 01 February 2003 : 21:49:23
|
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
|
|
|
Steve D.
Average Member
USA
640 Posts |
Posted - 03 February 2003 : 10:13:49
|
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 |
|
|
svx
Starting Member
USA
35 Posts |
Posted - 16 March 2003 : 23:09:29
|
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 |
|
|
Steve D.
Average Member
USA
640 Posts |
Posted - 17 March 2003 : 00:12:58
|
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 |
|
|
spyordie007
Junior Member
USA
408 Posts |
Posted - 17 March 2003 : 01:13:31
|
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 |
|
|
spyordie007
Junior Member
USA
408 Posts |
Posted - 17 March 2003 : 01:20:09
|
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 |
|
|
Steve D.
Average Member
USA
640 Posts |
Posted - 17 March 2003 : 01:38:12
|
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 |
|
|
spyordie007
Junior Member
USA
408 Posts |
Posted - 17 March 2003 : 11:21:46
|
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 |
|
|
Steve D.
Average Member
USA
640 Posts |
|
spyordie007
Junior Member
USA
408 Posts |
Posted - 17 March 2003 : 11:31:00
|
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 |
|
|
Steve D.
Average Member
USA
640 Posts |
|
spyordie007
Junior Member
USA
408 Posts |
Posted - 17 March 2003 : 11:37:00
|
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 |
|
|
Steve D.
Average Member
USA
640 Posts |
|
Hobeeb
Starting Member
17 Posts |
Posted - 21 March 2003 : 13:56:12
|
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 |
|
|
Topic |
|