Author |
Topic |
|
cripto9t
Average Member
USA
881 Posts |
Posted - 20 February 2005 : 19:49:48
|
I've been working on an "auto poll end date" for Davios' "Poll Mod". I'm not done with it yet but I think I have the hard part finished.
Would anybody be interested in testing this out? |
_-/Cripto9t\-_ |
|
zinpin
Junior Member
Australia
202 Posts |
Posted - 20 February 2005 : 21:43:46
|
sure C ill be in it, sounds like a good idea! |
|
|
Davio
Development Team Member
Jamaica
12217 Posts |
Posted - 20 February 2005 : 22:00:56
|
That's a feature I am planning for the next update. I'll be interested in your code after you're done. |
Support Snitz Forums
|
|
|
cripto9t
Average Member
USA
881 Posts |
Posted - 25 February 2005 : 11:39:41
|
download updates - 2/27/05 9:00am - Made changes in post.asp for Access 2000 db. Changes listed in post below.
- 3/1/05 4:30pm - Added a couple of checks using the isDate() function to post_info.asp (just in case )
Here it is Right Click and Save Modified files are admin_polls, inc_polls, pop_polls, post, post_info and topic. Most changes are code add ons, so it should be an easy modification.
I did't write a readme, but the files are marked well. Search for "end time".
The mod is basicly an add on, it could probaby have been integrated into the code better but that was more work than I wanted. It works along with "poll lock" whereas "poll lock" will override it. I might have went a little overboard by adding some "poll status messages" but I have them marked as optional, so you can omit them if you want.
Anyone who tests it out or looks over the files, let me know what you think.
screenshots
post.asp
featured poll
|
_-/Cripto9t\-_ |
Edited by - cripto9t on 01 March 2005 17:42:21 |
|
|
cripto9t
Average Member
USA
881 Posts |
Posted - 25 February 2005 : 11:44:15
|
edit - dbs file is now in the download - end edit I forgot the dbs file in the zip . Here it is incase someone downloads before I update.
Poll Time Limit Mod
[ALTER]
POLLS
DROP#P_END###
[END]
[ALTER]
POLLS
ADD#P_END#varchar(14)#NULL#
[END] |
_-/Cripto9t\-_ |
Edited by - cripto9t on 25 February 2005 11:52:35 |
|
|
TStewartFan
Junior Member
190 Posts |
Posted - 26 February 2005 : 06:14:52
|
Well it's six in the morning and I seriously need some more coffee before I venture off to work but as of right now I am getting the famous type mismatch error in post.asp. I will look at it later to see if i missed something but it is in post.asp:
if cLng(nHour) = iHr then Response.Write " selected" Response.Write ">" & pollTime(iHr) & "</option>" & vbNewLine next
The middle line is getting it.
Type mismatch: 'pollTime' /mysite/Forum/post.asp, line 1372
Can't wait to add it because it is definately a great add on to this mod.
|
If You Have to Ask, You Wouldn't Understand. |
|
|
cripto9t
Average Member
USA
881 Posts |
Posted - 26 February 2005 : 08:46:10
|
Yea, that's something I was having trouble with. That's why I added bogus numerical values "457".
I think if you change if cLng(nHour) = iHr then Response.Write " selected" Toif cLng(nHour) = cLng(iHr) then Response.Write " selected" I've only tested on mySql and it works for me. I know that Access is a little more touchy when it comes to things like this. |
_-/Cripto9t\-_ |
|
|
cripto9t
Average Member
USA
881 Posts |
Posted - 27 February 2005 : 10:29:50
|
I changed a few things and got this working in Access. I've updated the download with these changes.
These changes are in post.asp.
First I changed this bit
if isNull(rsPoll("P_END")) or trim(rsPoll("P_END")) = "" then
nYear = "457"
nMonth = "457"
nDay = "457"
nHour = "457"
nMin = "457" To this (remove "")
if isNull(rsPoll("P_END")) or trim(rsPoll("P_END")) = "" then
nYear = 457
nMonth = 457
nDay = 457
nHour = 457
nMin = 457
Second , I changed this block
Response.Write " <tr>" & vbnewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""top"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Poll Auto End: </b></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""left""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
" <font color=""red""><b>*</b></font>Year: <select name=""strY"">" & vbNewLine & _
" <option value="""""
if cLng(nYear) = "457" then Response.Write " selected"
Response.Write "> </option>" & vbNewLine & _
" <option value=""" & Year(Date) & """"
if cLng(nYear) = Year(Date) then Response.Write " selected"
Response.Write ">" & Year(Date) & "</option>" & vbNewLine & _
" <option value=""" & DatePart("yyyy",DateAdd("yyyy",1,Date)) & """"
if cLng(nYear) = DatePart("yyyy",DateAdd("yyyy",1,Date)) then Response.Write " selected"
Response.Write ">" & DatePart("yyyy",DateAdd("yyyy",1,Date)) & "</option>" & vbNewLine & _
" </select>" & vbNewLine & _
" <font color=""red""><b>*</b></font>Month: <select name=""strM"">" & vbNewLine & _
" <option value = """""
if cLng(nMonth) = "457" then Response.Write " selected"
Response.Write ">" & vbNewLine
for iMonth = 1 to 12
Response.Write " <option value=""" & doublenum(iMonth) & """"
if cLng(nMonth) = iMonth then Response.Write " selected"
Response.Write ">" & MonthName(iMonth,true) & "</option>" & vbNewLine
next
Response.Write " </select>" & vbNewLine & _
" <font color=""red""><b>*</b></font>Day: <select name=""strD"">" & vbNewLine & _
" <option value = """""
if cLng(nDay) = "457" then Response.Write " selected"
Response.Write ">" & vbNewLine
for iDay = 1 to 31
Response.Write " <option value=""" & doublenum(iDay) & """"
if cLng(NDay) = (iDay) then Response.Write " selected"
Response.Write ">" & (iDay) & "</option>" & vbNewLine
next
Response.Write " </select>" & vbNewLine & _
" Hour: <select name=""strH"">" & vbNewLine & _
" <option value = """""
if cLng(nHour) = "457" then Response.Write " selected"
Response.Write ">" & vbNewLine
for iHr = 0 to 23
Response.Write " <option value=""" & doublenum(iHr) & """"
if cLng(nHour) = iHr then Response.Write " selected"
Response.Write ">" & pollTime(iHr) & "</option>" & vbNewLine
next
Response.Write " </select>" & vbNewLine & _
" Minute: <select name=""strN"">" & vbNewLine & _
" <option value = """""
if cLng(nMin) = "457" then Response.Write " selected"
Response.Write ">" & vbNewLine
for iMin = 0 to 59
Response.Write " <option value=""" & doublenum(iMin) & """"
if cLng(nMin) = (iMin) then Response.Write " selected"
Response.Write ">" & (iMin) & "</option>" & vbNewLine
next
Response.Write " </select>" & vbNewLine & _
" <br /> <font size=""" & strFooterFontSize & """color=""red""><b>*</b>These fields are required for poll auto end date to be set.<br /> Leave blank to shut down poll manually.</font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine To this (useing the "chkSelect" function)
Response.Write " <tr>" & vbnewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""top"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Poll Auto End: </b></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""left""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
" <font color=""red""><b>*</b></font>Year: <select name=""strY"">" & vbNewLine & _
" <option value="""""
if cLng(nYear) = 457 then Response.Write " selected"
Response.Write "> </option>" & vbNewLine & _
" <option value=""" & Year(Date) & """"
if cLng(nYear) = Year(Date) then Response.Write " selected"
Response.Write ">" & Year(Date) & "</option>" & vbNewLine & _
" <option value=""" & DatePart("yyyy",DateAdd("yyyy",1,Date)) & """"
if cLng(nYear) = DatePart("yyyy",DateAdd("yyyy",1,Date)) then Response.Write " selected"
Response.Write ">" & DatePart("yyyy",DateAdd("yyyy",1,Date)) & "</option>" & vbNewLine & _
" </select>" & vbNewLine & _
" <font color=""red""><b>*</b></font>Month: <select name=""strM"">" & vbNewLine & _
" <option value = """""
if cLng(nMonth) = 457 then Response.Write " selected"
Response.Write ">" & vbNewLine
for iMonth = 1 to 12
Response.Write " <option value=""" & doublenum(iMonth) & """ " & chkSelect(nMonth,iMonth) & ">" & MonthName(iMonth,true) & "</option>" & vbNewLine
next
Response.Write " </select>" & vbNewLine & _
" <font color=""red""><b>*</b></font>Day: <select name=""strD"">" & vbNewLine & _
" <option value = """""
if cLng(nDay) = 457 then Response.Write " selected"
Response.Write ">" & vbNewLine
for iDay = 1 to 31
Response.Write " <option value=""" & doublenum(iDay) & """ " & chkSelect(nDay,iDay) & ">" & (iDay) & "</option>" & vbNewLine
next
Response.Write " </select>" & vbNewLine & _
" Hour: <select name=""strH"">" & vbNewLine & _
" <option value = """""
if cLng(nHour) = 457 then Response.Write " selected"
Response.Write ">" & vbNewLine
for iHr = 0 to 23
Response.Write " <option value=""" & doublenum(iHr) & """ " & chkSelect(nHour,iHr) & ">" & (iHr) & "</option>" & vbNewLine
next
Response.Write " </select>" & vbNewLine & _
" Minute: <select name=""strN"">" & vbNewLine & _
" <option value = """""
if cLng(nMin) = 457 then Response.Write " selected"
Response.Write ">" & vbNewLine
for iMin = 0 to 59
Response.Write " <option value=""" & doublenum(iMin) & """ " & chkSelect(nMin,iMin) & ">" & (iMin) & "</option>" & vbNewLine
next
Response.Write " </select>" & vbNewLine & _
" <br /> <font size=""" & strFooterFontSize & """color=""red""><b>*</b>These fields are required for poll auto end date to be set.<br /> Leave blank to shut down poll manually.</font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine
That's all |
_-/Cripto9t\-_ |
Edited by - cripto9t on 27 February 2005 17:08:34 |
|
|
TStewartFan
Junior Member
190 Posts |
Posted - 27 February 2005 : 14:57:38
|
Just out of curiosity what is this function: & pollTime?!? I ran a search throughout all the modified files and can not find it anywhere?!? Essientially I just trashed the call out and it worked perfectly. Ends when it is suppose to end....sets the correct start and end date....do I still need to make the above changes?!? Mine looks like this:
if cLng(nHour) = iHr then Response.Write " selected" Response.Write ">" & (iHr) & "</option>" & vbNewLine next |
If You Have to Ask, You Wouldn't Understand. |
|
|
cripto9t
Average Member
USA
881 Posts |
Posted - 27 February 2005 : 16:56:46
|
pollTime() was a function I was going to use but decided to ditch. I didn't even notice it in your first post. Flew right over my head :(. It was working for me because I still had the function . Sorry about that.
You don't need to make the changes as long as it's working. The changes just make sure everything will match numerically. the chkSelect() function is part of the Snitz base code and will make the file a few bytes lighter .
I'm glad you got it working. A visit to your site was the inspiration for this in the first place. I was able to vote on the Bud Shoot-Out after the race .
edit - I just noticed, I left that function in the update. Download fixed. |
_-/Cripto9t\-_ |
Edited by - cripto9t on 27 February 2005 17:15:35 |
|
|
cripto9t
Average Member
USA
881 Posts |
Posted - 01 March 2005 : 17:50:56
|
Download update
I added a couple of checks in post_info.asp using the isDate() function. To make sure nothing goes wrong with the time variable.
I'm going to leave the mod "as is" unless someone reports a bug.
|
_-/Cripto9t\-_ |
|
|
TStewartFan
Junior Member
190 Posts |
Posted - 01 March 2005 : 23:10:42
|
Although it isn't a bug but prolly a misplacement of some of your code...I noticed when I post a normal topic the time shows as an option. Prolly since I have the poll an event tab installed I will just need to play around with the elseif statement. Just noticed it today while I was finishing the upgrade to Speedball 2....<<whew>> will figure out the error of my ways tomorrow when I get in from another day of the freezing cold. |
If You Have to Ask, You Wouldn't Understand. |
|
|
cripto9t
Average Member
USA
881 Posts |
Posted - 02 March 2005 : 07:36:38
|
Yea, I don't have that problem. Just make sure the code is betweenif isPoll = "1" then andend if
18 degrees here, and I'll be in it all day. Thank god for Carharts . |
_-/Cripto9t\-_ |
|
|
|
Topic |
|