Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Add-ons

Reply
 
Thread Tools
Make poll preview a REAL preview Details »»
Make poll preview a REAL preview
Version: 1.00, by Lea Verou Lea Verou is offline
Developer Last Online: Jul 2012 Show Printable Version Email this Page

Category: New Posting Features - Version: 3.7.2 Rating:
Released: 08-11-2008 Last Update: 08-11-2008 Installs: 13
Template Edits
Re-useable Code Code Changes Translations  
No support by the author.

As I stated in my corresponding vB suggestion, the current poll preview feature sucks.

For those who can't wait till Jelsoft fixes this, here is a solution:

Warning: If you are allergic to file edits or to manual template changes, don't read further.

Template changes: 1
File edits: 1


In poll.php find (around lines 202-215 in an unmodified version of poll.php):
PHP Code:
        if ($vbulletin->GPC['preview'] != '')
        {
            
$previewpost 1;

            
$counter 0;
            
$pollpreview '';
            
$previewquestion $bbcode_parser->parse(unhtmlspecialchars($question), $foruminfo['forumid'], $foruminfo['allowsmilies']);
            while (
$counter++ < $polloptions)
            {
                
$pollpreviewbits .= "&nbsp;&nbsp; $counter. &nbsp; " $bbcode_parser->parse($vbulletin->GPC['options']["$counter"], $foruminfo['forumid'], $foruminfo['allowsmilies']) . '<br />';
            }

            eval(
'$pollpreview = "' fetch_template('pollpreview') . '";');
        } 
and delete (or comment) them.

Then find (it should be right after the lines you just deleted/commented):
PHP Code:
        $checked = array(
            
'multiple'       => ($vbulletin->GPC['multiple'] ? 'checked="checked"' ''),
            
'public'         => ($vbulletin->GPC['public'] ? 'checked="checked"' ''),
            
'parseurl'       => ($vbulletin->GPC['parseurl'] ? 'checked="checked"' ''),
        ); 
and add below:
PHP Code:
        if ($vbulletin->GPC['preview'] != '')
        {
            
$previewpost 1;

            
$counter 0;
            
$pollpreview '';
            
$pollinfo['question'] = $bbcode_parser->parse(unhtmlspecialchars($question), $foruminfo['forumid'], $foruminfo['allowsmilies']);
            if(
$checked['public']) $show['publicwarning'] = true;
            if(
$timeout)
            {
                
$pollinfo['dateline'] = TIMENOW;
                
$pollinfo['timeout'] = $timeout;
                
$pollendtime vbdate($vbulletin->options['timeformat'], $pollinfo['dateline'] + ($pollinfo['timeout'] * 86400));
                
$pollenddate vbdate($vbulletin->options['dateformat'], $pollinfo['dateline'] + ($pollinfo['timeout'] * 86400));
                
$show['pollenddate'] = true;
            }
            
            while (
$counter++ < $polloptions)
            {
                
$option['number'] = $counter;
                
$option['question'] = $bbcode_parser->parse($vbulletin->GPC['options']["$counter"], $foruminfo['forumid'], $foruminfo['allowsmilies']);
                
                if (
$checked['multiple'])
                {
                    eval(
'$pollbits .= "' fetch_template('polloption_multiple') . '";');
                }
                else
                {
                    eval(
'$pollbits .= "' fetch_template('polloption') . '";');
                }
                    
            }

            eval(
'$pollpreview = "' fetch_template('polloptions_table') . '";');
        } 
In template newpoll find:
HTML Code:
<form action="poll.php?do=postpoll&amp;t=$threadid" method="post">

$pollpreview
and change it to:
HTML Code:
$pollpreview

<form action="poll.php?do=postpoll&amp;t=$threadid" method="post">
Presto!
Enjoy your new REAL poll preview!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
Abu2

Comments
  #12  
Old 08-13-2008, 08:05 AM
Lea Verou Lea Verou is offline
 
Join Date: Jul 2005
Location: Greece
Posts: 1,856
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's very nice of them

I don't think though that it's needed to duplicate it in the Bug Tracker since I opened a suggestion thread for it, do I? What's your opinion?
Reply With Quote
  #13  
Old 08-13-2008, 01:40 PM
sockwater's Avatar
sockwater sockwater is offline
 
Join Date: Apr 2008
Posts: 187
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't know. You're probably right, since they read the suggestion threads as well.
Reply With Quote
  #14  
Old 08-13-2008, 01:43 PM
Corndog235 Corndog235 is offline
 
Join Date: Dec 2007
Location: Durham,North Carolina
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, havent ran into a problem yet
Reply With Quote
  #15  
Old 08-13-2008, 05:37 PM
xorex's Avatar
xorex xorex is offline
 
Join Date: Jan 2008
Posts: 99
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks !
Reply With Quote
  #16  
Old 11-09-2009, 09:03 PM
Taragon's Avatar
Taragon Taragon is offline
 
Join Date: Sep 2007
Location: The Netherlands
Posts: 390
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks working fine on v3.8.4
Reply With Quote
Reply

Thread Tools

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 01:24 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.04283 seconds
  • Memory Usage 2,290KB
  • Queries Executed 22 (?)
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
  • (2)bbcode_html
  • (3)bbcode_php
  • (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
  • (1)pagenav_pagelink
  • (6)post_thanks_box
  • (1)post_thanks_box_bit
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (6)post_thanks_postbit_info
  • (5)postbit
  • (6)postbit_onlinestatus
  • (6)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_postinfo_query
  • fetch_postinfo
  • 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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • 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