[v2.0.3] New poll feature: Multiple choice poll!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • GenSec
    Member
    • Jul 2001
    • 50

    #16
    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!

    Comment

    • Cyrus
      Senior Member
      • Apr 2001
      • 413

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

      Comment

      • Chen
        Senior Member
        • Jun 2001
        • 8388

        #18
        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?
        Chen Avinadav
        Better to remain silent and be thought a fool than to speak out and remove all doubt.

        גם אני מאוכזב מסיקור תחרות לתור מוטור של NRG הרשת ע"י מעריב

        Comment

        • Cyrus
          Senior Member
          • Apr 2001
          • 413

          #19
          what about me FF ??

          Comment

          • RobAC
            Senior Member
            • Jan 2001
            • 1414
            • 3.8.x

            #20
            I get all kinds of undefined function errors such as cpheader and makelinkcode.
            Rob

            Comment

            • Chen
              Senior Member
              • Jun 2001
              • 8388

              #21
              Cyrus, I don't use vbPortal.

              RobAC, I suspect you didn't upload the installer to the admin folder. Is that correct?
              Chen Avinadav
              Better to remain silent and be thought a fool than to speak out and remove all doubt.

              גם אני מאוכזב מסיקור תחרות לתור מוטור של NRG הרשת ע"י מעריב

              Comment

              • RobAC
                Senior Member
                • Jan 2001
                • 1414
                • 3.8.x

                #22
                argh.....ok.....just slap me now!
                Rob

                Comment

                • Chen
                  Senior Member
                  • Jun 2001
                  • 8388

                  #23
                  *looks around - BAM!*
                  Chen Avinadav
                  Better to remain silent and be thought a fool than to speak out and remove all doubt.

                  גם אני מאוכזב מסיקור תחרות לתור מוטור של NRG הרשת ע"י מעריב

                  Comment

                  • RobAC
                    Senior Member
                    • Jan 2001
                    • 1414
                    • 3.8.x

                    #24
                    Works perfectly! Thanks Chen!
                    Rob

                    Comment

                    • MarkG
                      Member
                      • Aug 2000
                      • 59

                      #25
                      it's wonderfull firefly!

                      thanks!!

                      Comment

                      • GenSec
                        Member
                        • Jul 2001
                        • 50

                        #26
                        Originally posted by Cyrus
                        there is no file called vbpstuff.php in version 2.0.3 if vbportal !!!

                        In your vbportal version should be something analogical. Look in your "phpinclude" template.

                        Comment

                        • Cyrus
                          Senior Member
                          • Apr 2001
                          • 413

                          #27
                          Ive searched high and low, cant seem to find it anywhere myself

                          what should I Do ???

                          Comment

                          • GenSec
                            Member
                            • Jul 2001
                            • 50

                            #28
                            Originally posted by Cyrus
                            Ive searched high and low, cant seem to find it anywhere myself

                            what should I Do ???
                            [list=1][*]To find temlate which produce poll table on your portal page. (Use admin CP -->options-->templates-->yes. Then view source of your page)[*]Find php file, which uses this template[/list=1]

                            Comment

                            • Cyrus
                              Senior Member
                              • Apr 2001
                              • 413

                              #29
                              i did that,

                              I then went and daw the source for the vbportal homepage, and it says p_home is the template.
                              so i searched for p_home in the vbp files and mailfile.php and header.php seem to mention it

                              what now ?

                              Comment

                              • GenSec
                                Member
                                • Jul 2001
                                • 50

                                #30
                                It can't be p_home. The temlate name should be like polloption... and looks like
                                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>

                                Comment

                                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                                Working...