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/O Code)
 Poll Mod Add-On (Auto End Date)
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

cripto9t
Average Member

USA
881 Posts

Posted - 20 February 2005 :  19:49:48  Show Profile
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  Show Profile
sure C ill be in it, sounds like a good idea!
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 20 February 2005 :  22:00:56  Show Profile
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
Go to Top of Page

cripto9t
Average Member

USA
881 Posts

Posted - 25 February 2005 :  11:39:41  Show Profile
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
Go to Top of Page

cripto9t
Average Member

USA
881 Posts

Posted - 25 February 2005 :  11:44:15  Show Profile
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
Go to Top of Page

TStewartFan
Junior Member

190 Posts

Posted - 26 February 2005 :  06:14:52  Show Profile  Visit TStewartFan's Homepage
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.
Go to Top of Page

cripto9t
Average Member

USA
881 Posts

Posted - 26 February 2005 :  08:46:10  Show Profile
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"
To
if 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\-_
Go to Top of Page

cripto9t
Average Member

USA
881 Posts

Posted - 27 February 2005 :  10:29:50  Show Profile
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
Go to Top of Page

TStewartFan
Junior Member

190 Posts

Posted - 27 February 2005 :  14:57:38  Show Profile  Visit TStewartFan's Homepage
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.
Go to Top of Page

cripto9t
Average Member

USA
881 Posts

Posted - 27 February 2005 :  16:56:46  Show Profile
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
Go to Top of Page

cripto9t
Average Member

USA
881 Posts

Posted - 01 March 2005 :  17:50:56  Show Profile
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\-_
Go to Top of Page

TStewartFan
Junior Member

190 Posts

Posted - 01 March 2005 :  23:10:42  Show Profile  Visit TStewartFan's Homepage
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.
Go to Top of Page

cripto9t
Average Member

USA
881 Posts

Posted - 02 March 2005 :  07:36:38  Show Profile
Yea, I don't have that problem. Just make sure the code is between
if isPoll = "1" then
and
end if


18 degrees here, and I'll be in it all day. Thank god for Carharts .

    _-/Cripto9t\-_
Go to Top of Page
  Previous Topic Topic Next Topic  
 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.38 seconds. Powered By: Snitz Forums 2000 Version 3.4.07