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)
-   -   New poll feature: Multiple choice poll! (https://vborg.vbsupport.ru/showthread.php?t=30921)

cyrus 10-22-2001 08:30 AM

beautiful hack BUT, when I use it with vbportal, it doesnt allow multiple selections on the portal :(

can anyone help ?

cyrus 10-22-2001 08:36 AM

also, gives an error that I have not selected an option even when I know I have , so I cant vote full stop ! :(

Bane 10-22-2001 09:45 AM

Cyrus, you'll likely have to do some additional hacking if you want this to appear in the front page poll.

BluSmurf 10-22-2001 10:17 AM

great hack, installed with ease!

c0bra 10-22-2001 12:56 PM

Another great hack FireFly! Installation was a breeze, thanks very much... :D

GenSec 10-22-2001 01:45 PM

Quote:

Originally posted by Cyrus
beautiful hack BUT, when I use it with vbportal, it doesnt allow multiple selections on the portal :(

can anyone help ?

  • Add temlate P_polloption_mult
    Code:

    <tr>
      <td bgcolor="#DFDFDF" width="5%"><input type="checkbox" name="allvotes[$P_option[number]]" value="yes"></td>
      <td bgcolor="#DFDFDF" colspan="3"><smallfont>$P_option[question]</smallfont></td>
    </tr>

  • Find in vbpstuff.php
    Code:

    eval("\$P_pollbits .= \"".gettemplate("P_polloption")."\";");
    Replace with
    Code:

    // Multi-Choice Hack
          if ($P_pollinfo[multiple]!=0) {
            eval("\$P_pollbits .= \"".gettemplate("P_polloption_mult")."\";");
          } else {
            eval("\$P_pollbits .= \"".gettemplate("P_polloption")."\";");
          }
    // Multi-Choice Hack

That's all.

P.S. Bravo FireFly!

cyrus 10-22-2001 04:37 PM

there is no file called vbpstuff.php in version 2.0.3 if vbportal !!!

:(

Admin 10-22-2001 05:05 PM

Small addon re floleb7's first post.
This will display the number of voters with multi choice polls, instead of number of votes.

In showthread.php, find this:
Code:

  $counter=0;
  while ($counter++<$pollinfo[numberoptions]) {
    $pollinfo[numbervotes]+=$splitvotes[$counter-1];
  }

and add this right below it:
Code:

  if ($pollinfo[multiple]!=0) {
    $getvoters=$DB_site->query_first("SELECT COUNT(DISTINCT(userid)) AS voters FROM pollvote WHERE pollid='$pollid'");
    $pollinfo[voters]=$getvoters[voters];
  } else {
    $pollinfo[voters]=$pollinfo[numbervotes];
  }

Now in showthread_pollresults template, replace $pollinfo[numbervotes] votes with $pollinfo[voters] voters.

Easy wasn't it? :)

cyrus 10-22-2001 05:09 PM

what about me FF ?? :( :(

RobAC 10-22-2001 05:15 PM

I get all kinds of undefined function errors such as cpheader and makelinkcode. :(


All times are GMT. The time now is 04:30 PM.

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.01109 seconds
  • Memory Usage 1,734KB
  • 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
  • (5)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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