Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Closed Poll thread title Details »»
Closed Poll thread title
Version: 1.00, by noppid noppid is offline
Developer Last Online: Sep 2015 Show Printable Version Email this Page

Version: 2.3.x Rating:
Released: 05-04-2003 Last Update: Never Installs: 12
 
No support by the author.

A user requested that if a poll is closed the thread be preceeded by Closed Poll: instead of just Poll:.

Here's a few lines of code that did it for us. (see attachment )

All you have to do is insert a few lines of code to forumdisplay.php.

Good luck, hope it helps.

History:
  • 1.4
    Added closed poll functionality to search.php in showresult function.
  • 1.3
    Added field to poll table lookup.
    Added condition to show poll closed when timeout has occured.
    Elimiated HTML tags for bold since the default vB prefixes are not bold.
  • 1.2
    Removed HTML tag for font color.
  • 1.1
    Added condition to show poll closed if thread or poll is closed.
  • 1.0
    Initial release.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 05-07-2003, 05:33 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here's my query:

$polldatetime = $DB_site->query_first("SELECT dateline,timeout,active,votes,voters from poll where pollid = $thread[pollid];");
Reply With Quote
  #33  
Old 05-07-2003, 05:40 PM
noppid noppid is offline
 
Join Date: Mar 2003
Location: Florida
Posts: 1,875
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Change $votesstring to $polldatetime['votes'] as below...

PHP Code:
$totalvotes=0;
$myvotes explode("|||",$polldatetime['votes']);
foreach(
$myvotes as $v ) {
    
$totalvotes $totalvotes $v;

EDIT:
repaired code
Reply With Quote
  #34  
Old 05-07-2003, 05:43 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried that just before you wrote this and now the count reads 1 vote.
Reply With Quote
  #35  
Old 05-07-2003, 05:50 PM
noppid noppid is offline
 
Join Date: Mar 2003
Location: Florida
Posts: 1,875
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

try

PHP Code:
 $totalvotes $totalvotes intval($v);

I don't have your code in place to test it for ya.

EDIT:
repaired code
Reply With Quote
  #36  
Old 05-07-2003, 05:56 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Still only shows 1.
Reply With Quote
  #37  
Old 05-07-2003, 06:00 PM
noppid noppid is offline
 
Join Date: Mar 2003
Location: Florida
Posts: 1,875
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Dammit man, it's my fault!!! I left the $ off of the var...
Here ya go.
PHP Code:
$totalvotes=0;
$myvotes explode("|||",$polldatetime['votes']);
foreach(
$myvotes as $v ) {
    
$totalvotes $totalvotes $v;

Reply With Quote
  #38  
Old 05-07-2003, 06:03 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I put the $ on the variable when I tried it. It gave me an error until I did.
Reply With Quote
  #39  
Old 05-07-2003, 06:05 PM
noppid noppid is offline
 
Join Date: Mar 2003
Location: Florida
Posts: 1,875
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 03:03 PM Boofo said this in Post #37
I put the $ on the variable when I tried it. It gave me an error until I did.
I left the $ off of 2 vars
$polldatetime['votes']
and
$totalvotes
Reply With Quote
  #40  
Old 05-07-2003, 06:07 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh, ok. Now it works. You meant the $totalvotes variable. You also left it off of the polldatetime['votes'] the first time. LOL Great! Now it work fantastic. Do you want to look over everything now that I have it working to give me your honest opinion? I can pm it to you.
Reply With Quote
  #41  
Old 05-07-2003, 06:10 PM
noppid noppid is offline
 
Join Date: Mar 2003
Location: Florida
Posts: 1,875
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If it's based on your existing code, from what I saw you should be fine.

I guess it's time to post an update to your hack.

I'd be glad to review it.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:28 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05319 seconds
  • Memory Usage 2,308KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete