vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Poll Start - End - Days Run/Remaining Hack v1.1 (https://vborg.vbsupport.ru/showthread.php?t=50785)

Boofo 03-24-2003 10:00 PM

Poll Start - End - Days Run/Remaining Hack v1.1
 
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:.

Zzed 03-25-2003 05:09 PM

Quote:

Today at 10:02 AM Boofo said this in Post #13
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

Quote:

Today at 10:39 AM Stud_Muffin said this in Post #18
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:

PHP Code:

    } 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

PHP Code:

} else {
    
$pollrun ''


Boofo 03-26-2003 07:27 PM

Quote:

Today at 02:52 PM Sebastian said this in Post #20
nice job., Boofo :)
Thank for the kind words. Don't forget the install button. ;)

Boofo 03-26-2003 07:29 PM

Quote:

Today at 03:27 PM Stud_Muffin said this in Post #21
So where abouts do i add

PHP Code:

} 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:

PHP Code:

    $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:

PHP Code:

    $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

Quote:

Today at 02:37 PM Rolodex said this in Post #32
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:

PHP Code:

if($thread[pollid]) {
  
$polldatetime $DB_site->query_first("SELECT dateline, timeout from poll where pollid = $thread[pollid];"); 

and replace it with:

PHP Code:

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

Zzed 04-17-2003 07:53 PM

Try this:
PHP Code:

$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

Quote:

Today at 03:08 PM Rolodex said this in Post #39
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. ;)


All times are GMT. The time now is 03:51 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01509 seconds
  • Memory Usage 1,826KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete