View Full Version : Poll Start - End - Days Run/Remaining Hack v1.1
Boofo
03-24-2003, 10:00 PM
Poll Start - End - Days Run/Remaining Hack
Version 1.1
(By Boofo and Zzed)
What this hack does:
It will list the Start Date, End Date, Days to Run and the Days remaining for a poll in both the forumdisplay (under the thread title) and the showthread (under the poll question or status). If the poll does not have an ending time, the Start Date, End Date, Days to Run and Days Remaining will not show up.
Files to edit: 2 (forumdisplay.php, showthread.php)
Templates to edit: 3 (forumdisplaybit, showthread_polloptions, showthread_pollresults)
Install Time: 5 minutes (if you are REALLY slow)
Version 1.0 - Initial release
Version 1.1 - Fixed the error that a few people were having with the poll start and end time showing up in each thread instead of just the thread it was intended for.
French translation of this hack in post 7.
Screenshots in posts 4, 5 and 6 below.
If you find this hack useful, please click the install button.
Mathieu
03-25-2003, 07:37 AM
Thanks for this hack i will install it imediatly.
Boofo
03-25-2003, 07:41 AM
You're very welcome. Enjoy! ;)
Boofo
03-25-2003, 08:07 AM
Image from a poll with a start and end date. This is the forumdisplay view.
Boofo
03-25-2003, 08:09 AM
Image from a poll with a start and end date. This is the poll view.
Boofo
03-25-2003, 08:10 AM
Image from a poll with NO start and end date. This is the poll view.
Boofo
03-25-2003, 09:25 AM
Here is the French translation of this hack (provided by Mathieu).
Kars10
03-25-2003, 09:35 AM
He very cool Hack!!
Thanks for sharing with us!
Kars
/me kicks installed!
Boofo
03-25-2003, 09:38 AM
No problemo. Glad you like it. See you on the site. ;)
Lesane
03-25-2003, 10:30 AM
Pretty cool Boofo, a nice addon for my Gamblick addon.
Well done.
Boofo
03-25-2003, 10:33 AM
Thank you, sir. Coming from you, that means alot. ;)
Dean C
03-25-2003, 03:55 PM
Nice hack buddy - you sure love using the date systems in php don't you ;)
- miSt
Boofo
03-25-2003, 04:02 PM
If you really think about it, that is the main backbone of vBulletin. I love the $ourtimenow variable. Can't get enough of it. ;)
And Zzed came up with the core of the code. I just re-worked it to fit what we needed. ;)
Intex
03-25-2003, 04:57 PM
Nice one Boofo - I'll add this to my install list :cool:.
Today at 10:02 AM Boofo said this in Post #13 (https://vborg.vbsupport.ru/showthread.php?postid=373118#post373118)
If you really think about it, that is the main backbone of vBulletin. I love the $ourtimenow variable. Can't get enough of it. ;)
And Zzed came up with the core of the code. I just re-worked it to fit what we needed. ;)
Very nice Boofo. Well done my friend. :)
And thank you for your kind words. :)
Stud_Muffin
03-26-2003, 03:49 AM
I installed it in vb 2.3.0 and it seams to be showing in almost all the threads :surprised: Something in the forumdisplay.php ??
Boofo
03-26-2003, 04:58 AM
If you have a start time and end time configured with the poll, it will show. It you don't have an ending time configured, it will not show. Check your polls and see how many of them are set up with the start and end time. ;)
Stud_Muffin
03-26-2003, 02:39 PM
NO, sorry my fault. Perhaps i should include a screenshot to explain :p They all have the same start and end date as the test poll i just posted. so if you set all the polls of the forum not to time out it does not display like the screenshot
Boofo
03-26-2003, 05:34 PM
Today at 10:39 AM Stud_Muffin said this in Post #18 (https://vborg.vbsupport.ru/showthread.php?postid=373620#post373620)
NO, sorry my fault. Perhaps i should include a screenshot to explain :p They all have the same start and end date as the test poll i just posted. so if you set all the polls of the forum not to time out it does not display like the screenshot
Ok, make sure you edit the "forumdisplaybit" template with:
$thread[pagenav]$pollrun
I had that happen as I was putting this together before I added:
} else {
$pollrun = '';
to the code but that fixed it on my site.
Please recheck the instructions and make sure everything is there and let me know. There's really no way that should be happening unless you either missed a piece of code or got it in the wrong place. ;)
Sebastian
03-26-2003, 06:52 PM
nice job., Boofo :)
Stud_Muffin
03-26-2003, 07:27 PM
So where abouts do i add
} else {
$pollrun = '';
Boofo
03-26-2003, 07:27 PM
Today at 02:52 PM Sebastian said this in Post #20 (https://vborg.vbsupport.ru/showthread.php?postid=373730#post373730)
nice job., Boofo :)
Thank for the kind words. Don't forget the install button. ;)
Boofo
03-26-2003, 07:29 PM
Today at 03:27 PM Stud_Muffin said this in Post #21 (https://vborg.vbsupport.ru/showthread.php?postid=373754#post373754)
So where abouts do i add
} else {
$pollrun = '';
That is in the code you were supposed to add to the php files. Check the instructions and make sure you added all of the code exactly like it says. ;)
Bison
04-10-2003, 07:42 PM
Boofo,
I just experienced the same problem as the guy above. Once a poll is created in any forum and is given a expiration date, all of the threads in that forum inherits the poll start and expiration date printed under all threads. If you don't enter a expiration date, everything works fine.
Also i've noticed that if someone uses the "Move with redirect" ... it in advertantly adds the polls start/exp date to each thread in that forum where the "Move with Redirect" was applied.
Boofo
04-11-2003, 12:19 AM
Was it working fine before? I have not experienced that at all on my forums. It works like clock-work. I will look into it and see if I can figure out what is going on.
Stud_Muffin
04-11-2003, 08:34 AM
My Vb version is 2.3.0 RC3
Boofo
04-11-2003, 05:40 PM
Stud_Muffin & Rolodex - Try the following code. Replace it in both the forumdisplay.php and showthread.php files
Find:
$pollrun = "<br><nobr><smallfont>Start Date: $start | End Date: $finish | Days to Run: $days | Days Remaining: $remaining</nobr></smallfont>";
} else {
$pollrun = '';
Replace it with this:
$pollrun = "<br><nobr><smallfont>Start Date: $start | End Date: $finish | Days to Run: $days | Days Remaining: $remaining</nobr></smallfont>";
} else {
$pollrun = "<br /><smallfont>(<b>No ending date set</b>)</smallfont>";
and let me know if this fixes your problem. If it does, I will update the first post. I am not experiencing this, myself, but this should take care of the problem for you. ;)
BigJohnson
04-13-2003, 11:53 AM
Nope that definaltey does not work. It has to be a problem in one of the IF statements then. Calloing for the wrong variable.
But I am using 2.2.9 and am having the same problem.
Boofo
04-13-2003, 06:37 PM
I am running 2.2.9 and using the same exact code and it works fine for me and the others who have installed it. Recheck the instructions and make sure you have entered it into the right templates.
Cyricx
04-16-2003, 06:42 PM
Getting the same thing for me on VB 2.2.9 followed the instructions carefully as listed and it's displaying the run time on all threads including polls :(
Boofo
04-16-2003, 07:58 PM
I'm looking into this now. I will be sending an update with whatever fix I find to anyone who has installed this and clicked the install button.
Bison
04-17-2003, 01:37 PM
Remove this (high-lighted):
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
In the "forumdisplaybit" template
Find:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
$thread[pagenav]
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Replace it with:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
$thread[pagenav]$pollrun
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Everything should work! ;)
subu1
04-17-2003, 04:33 PM
hi Boofo, you know my english is not the best, but i thing you unterstand if i say "your Hack is very fine, it works*
thank you
subu1
subu1
04-17-2003, 06:01 PM
ups, i dont see in my forum display, i have the same problem with the other Friends here, i have 2.2.8
subu1
04-17-2003, 06:05 PM
Today at 02:37 PM Rolodex said this in Post #32 (https://vborg.vbsupport.ru/showthread.php?postid=383360#post383360)
Remove this (high-lighted):
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
In the "forumdisplaybit" template
Find:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
$thread[pagenav]
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Replace it with:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
$thread[pagenav]$pollrun
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Everything should work! ;)
ok i have removed $pollrun now it will work :classic: I hope so :bunny:
Boofo
04-17-2003, 07:19 PM
Ok, we think some global info might be carrying over to the other polls. Try this fix and it should take care of any problems you guys have been having with this hack.
Look for:
if($thread[pollid]) {
$polldatetime = $DB_site->query_first("SELECT dateline, timeout from poll where pollid = $thread[pollid];");
and replace it with:
if($thread[pollid]) {
$pollrun = "";
$polldatetime = $DB_site->query_first("SELECT dateline, timeout from poll where pollid = $thread[pollid];");
subu1
04-17-2003, 07:47 PM
sorry,it work not
Try this:
$pollrun = "";
if($thread[pollid]) {
$polldatetime = $DB_site->query_first("SELECT dateline, timeout from poll where pollid = $thread[pollid];");
Bison
04-17-2003, 08:08 PM
Look guys,
All you need to do is *remove* what I said above and the dang hack will work without error.
It worked for me ... that whole bit of code is un-necessary
Boofo
04-17-2003, 08:11 PM
Today at 03:08 PM Rolodex said this in Post #39 (https://vborg.vbsupport.ru/showthread.php?postid=383489#post383489)
Look guys,
All you need to do is *remove* what I said above and the dang hack will work without error.
It worked for me ... that whole bit of code is un-necessary
That whole bit of code is if you want the poll start and end date in the foumdisplay, also. That was the original idea for the hack. ;)
Bison
04-17-2003, 08:15 PM
Well after taking that out, it seems to work ok for me. Long as the polls are printing out the date, it's ok with me!
Boofo
04-17-2003, 08:20 PM
What's really strange is that is has been working for me with no problems. It seems it doesn't do this with everyone. Only certain sites. I'm curious as to why some have problems and some don't. That is why I want to fix it. ;)
Bison
04-17-2003, 08:27 PM
I forgot to mention that the $pollrun has to be initialized to zero (No String) before executing the "if" statement.
subu1
04-17-2003, 08:32 PM
Today at 08:53 PM Zzed said this in Post #38 (https://vborg.vbsupport.ru/showthread.php?postid=383480#post383480)
Try this:
$pollrun = "";
if($thread[pollid]) {
$polldatetime = $DB_site->query_first("SELECT dateline, timeout from poll where pollid = $thread[pollid];");
yes sorry, for my remove :bunny: now it works perfekt :banana:
Boofo
04-17-2003, 08:42 PM
Today at 03:27 PM Rolodex said this in Post #43 (https://vborg.vbsupport.ru/showthread.php?postid=383497#post383497)
I forgot to mention that the $pollrun has to be initialized to zero (No String) before executing the "if" statement.
https://vborg.vbsupport.ru/showthread.php?postid=383480#post383480 ;)
Boofo
04-17-2003, 08:43 PM
Today at 03:32 PM subu1 said this in Post #44 (https://vborg.vbsupport.ru/showthread.php?postid=383499#post383499)
yes sorry, for my remove :bunny: now it works perfekt :banana:
Great! I'll update the first post. ;)
subu1
04-17-2003, 08:51 PM
on Pic my Forumdisplay
subu1
04-17-2003, 08:55 PM
and my showthread :)
greetz subu
Boofo
04-17-2003, 08:57 PM
What does Heute mean? Today? ;)
StealthAnime
04-17-2003, 08:58 PM
danka for this hack m8, this will come in handy :)
Boofo
04-17-2003, 09:00 PM
Today at 03:58 PM StealthAnime said this in Post #50 (https://vborg.vbsupport.ru/showthread.php?postid=383517#post383517)
danka for this hack m8, this will come in handy :)
Thank you for the kind words. ;)
Don't forget to click install. ;)
Bison
04-17-2003, 09:29 PM
I saw that Boofo, but I had already done this before posting what I call "my fix" to this.
But I see no need for the $Pollrun to be *concatenated* to the forumdisplaybit>nav ... unless you have polls that show outside the forum.
Boofo
04-17-2003, 09:35 PM
I did it for the forumdisplay so that users could see how long a poll had to run without having to go into the poll itself.
subu1
04-17-2003, 09:40 PM
Today at 09:57 PM Boofo said this in Post #49 (https://vborg.vbsupport.ru/showthread.php?postid=383516#post383516)
What does Heute mean? Today? ;)
oh yes, this is my german Board. Today is Heute, Umfrage is poll, Tage is Day
greetz subu1
Boofo
04-17-2003, 09:42 PM
Great! I just learned 3 German words. ;)
moosey
04-25-2003, 10:29 PM
Boofo - great hack! worked first time and so easy to use!!
now for my cheeky bit!! :)
Is there a way of delaying the start dates for the polls to actually open?
say if I was running a competition thread and at a certain date the pool just opened for voting and then closed on the given date?
any ideas here?
many thanks
Boofo
04-25-2003, 10:58 PM
You're very welcome. ;)
Don't forget to click the install button. ;)
As far as the delaying part goes, I'm not quite sure I understand what you are wanting to do.
moosey
04-26-2003, 06:57 AM
clicked it mate :)
many thanks - as far as my request goes..
I run a competition in certain threads ...
some of these competitions are 7 days long but I dont want people voting until 2 days before the end of the competition.
So I need a delay in the poll, so is there a way of setting the poll to start on a different date then it starting automatically on that day
so a delayed poll i guess :)
thx man
Crazy Pete
05-16-2003, 07:50 PM
Very nice addition. :D Installed.
Boofo
05-16-2003, 07:57 PM
Thank you for the kind words. Enjoy! ;)
Mike Gaidin
05-16-2003, 09:22 PM
Great hack Boofo. Gonna install it tonight. :)
Boofo
05-16-2003, 09:32 PM
Thank you and enjoy! ;)
DelFDgfd_gT
05-21-2003, 02:04 AM
how do i change the colors?
In showthread.php when viewing a thread you see this:
test poll forum
Start Date: 05-20-2003 | End Date: 05-25-2003 | Days to Run: 5 | Days Remaining: 4
the "test poll forum" is in white and the "Start Date: 05-20-2003 | End Date: 05-25-2003 | Days to Run: 5 | Days Remaining: 4" is in black.
This is unreadable because it is on adark blue background.
Anyways to help?
Boofo
05-21-2003, 02:07 AM
You need to add the colors to the code in the showthread.php. Also, there is going to be an update to this in the next week or so, so you might want to click the install button so you will be notified when it is updated. ;)
DelFDgfd_gT
05-21-2003, 02:10 AM
can you tell me how to change the colors to #ffffff
Mike Gaidin
05-21-2003, 02:28 AM
Forgot to mention that I installed it and it works great Boofo.
DelFDgfd_gT
05-21-2003, 04:14 AM
well.....can you tell me how to change the colors to #ffffff
DelFDgfd_gT
05-22-2003, 04:37 AM
un-installing due to lack of support. help me out, and i'll re-install.
Boofo
05-22-2003, 04:46 AM
How did I know you had it installed if you never clicked the install button? ;)
DelFDgfd_gT
05-23-2003, 01:17 AM
why cant you just tell me how to change it so I can re-install it.
Thanks.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.