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

Reply
 
Thread Tools
[HTL] and [Normal] Hide Poll Results Details »»
[HTL] and [Normal] Hide Poll Results
Version: 1.1, by Hurricane Hurricane is offline
Developer Last Online: Sep 2022 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 04-06-2004 Last Update: 04-04-2005 Installs: 35
DB Changes
 
No support by the author.

Hide Poll Results
Version: V1.1
vB-version: 3.0.7
Developer: Glenn H. Shelton III
Install difficulty: Medium
File edits: 12
Template edits: 3



History & Hack Information
==========================
First of all, MAJOR credit goes to Firefly and Scott MacVicar for the original creation of this hack in VB2.

I attempted to just port this over to VB3, but that did not quite happen. Most of it was rewritten, but I could not have done it without the VB2 hack as a guide.

What is Hide Poll Results ver 1?
This hack allows you to choose whether or not you want the results of your poll displayed while the polls are open. It only allows the original poll poster, admins and mods of that form to view the results of the poll and none of the regular users. They can only view the poll if the poll is closed either by a admin/mod or the poll ends.

Testing
=======
Tested on vBulletin 3.0.0 Gold, across multiple hacked and unhacked installations.
Updated For vBulletin 3.0.7 on 04/05/2005

Thanks to
=========
Firefly and Scott MacVicar for the original VB2 version and the idea.
68 Z-28 for making the request for a VB3 version.
Boofo for telling me to make it happen.
pjk for the changes to the pollresults_table TEMPLATE

About me
========
This is my first public hack release. It seems all the good ideas for VB2 had already been done by the time I got there. I am not new to php and MySQL however and I hope this is not my last release.



HACK INSTALLATION DETAILS:
Files modified for this Hack:
poll.php
showthread.php

Templates modified for this Hack:
editpoll
newpoll
pollresults_table

DB Tables modified for this Hack:
poll

New DB columns for this Hack:
hidepoll


HACK UPGRADE DETAILS:
See the install file for the sections of:
Poll.php
FIND: (Around Line 677)

showthread.php
FIND: (Around Line 653)

pollresults_table TEMPLATE

No other changes were made from V1 to V1.1

Support is available in this thread only.

As always, if you install, please click the install button.

Thanks!

Supporters / CoAuthors

Show Your Support

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

Comments
  #12  
Old 11-02-2004, 02:52 PM
JamesFrost JamesFrost is offline
 
Join Date: Feb 2003
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by JamesFrost
ignore me - just read the readme
installed - works brilliantly. Many thanks.
Reply With Quote
  #13  
Old 11-20-2004, 02:49 PM
Kamran Kamran is offline
 
Join Date: Sep 2002
Location: Bucks, UK
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,

I've installed the hack, but when I click on any thread I get the following error:

Quote:
Parse error: parse error, unexpected T_ELSE in /home/talkwres/public_html/forum/showthread.php on line 649

Heres that part of the code from the file:

PHP Code:
//Now we check if the user has voted or not
        
if ($showresults OR $uservoted)
        { 
// user did vote or poll is closed    if ($value == 0  || $noshow == 1)
            
{
                
$option['percent'] = 0;
                
$option['votes'] = 0;
            }
            else 
//line 649//
            
{
                
$option['percent'] = vb_number_format($value $pollinfo['numbervotes'] * 1002);
            }

            
$option['graphicnumber'] = $option['number'] % 1;
            
$option['barnumber'] = round($option['percent']) * 2
Any suggestions?

Thanks.
Reply With Quote
  #14  
Old 11-20-2004, 03:34 PM
TheMusicMan's Avatar
TheMusicMan TheMusicMan is offline
 
Join Date: Oct 2002
Location: South Wales
Posts: 202
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have also found a bug in this....

I installed onto vB303 which works fine except that when using vBadvanced and one has a random poll pulled into the portal page... if you have chosen to hide the results of this poll that is displayed on portal, you still see the bitmap and hence users can see the results of a poll which should be hidden.
Reply With Quote
  #15  
Old 11-20-2004, 04:32 PM
Kamran Kamran is offline
 
Join Date: Sep 2002
Location: Bucks, UK
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK - I re-did the showthread file, and it seems to work now

Just a quick question - is there a way to stop moderators seeing the results also - or have it so that the only way to see the results is through the admin panel - until the poll closes?

Thanks.
Reply With Quote
  #16  
Old 02-03-2005, 08:05 PM
ambumann ambumann is offline
 
Join Date: Jun 2004
Posts: 86
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great hack, installed right away!
Reply With Quote
  #17  
Old 02-04-2005, 02:45 PM
ambumann ambumann is offline
 
Join Date: Jun 2004
Posts: 86
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is it possible to add an option to this mod to let the users see the results after they have voted?
Reply With Quote
  #18  
Old 03-20-2005, 06:32 AM
pjk pjk is offline
 
Join Date: Apr 2002
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Today I'm install this hack to vbulletin 3.0.6 and found this paragraph might need update

Quote:
pollresults_table TEMPLATE
==========================

FIND:

<td class="tfoot" colspan="4" align="center"><span class="smallfont">$vbphrase[voters]: <strong>$pollinfo[numbervotes]</strong>. $pollstatus</strong></td>

REPLACE WITH:

<if condition="$noshow == 0">
<td class="tfoot" colspan="4" align="center"><span class="smallfont">$vbphrase[voters]: <strong>$pollinfo[numbervotes]</strong>. $pollstatus</strong></td>
</if>
<if condition="$noshow == 1">
<td class="tfoot" colspan="4" align="center"><span class="smallfont"><strong>$vbphrase[hidden_poll_footer]<br>$pollstatus</strong></td>
</if>
should it be
Quote:
pollresults_table TEMPLATE
==========================

FIND:

<td class="tfoot" colspan="4" align="center"><span class="smallfont"><if condition="$show['multiple']">$vbphrase[multiple_choice_poll] </if>$vbphrase[voters]: <strong>$pollinfo[numbervotes]</strong>. $pollstatus</span></td>

REPLACE WITH:

<if condition="$noshow == 0">
<td class="tfoot" colspan="4" align="center"><span class="smallfont"><if condition="$show['multiple']">$vbphrase[multiple_choice_poll] </if>$vbphrase[voters]: <strong>$pollinfo[numbervotes]</strong>. $pollstatus</span></td>
</if>
<if condition="$noshow == 1">
<td class="tfoot" colspan="4" align="center"><span class="smallfont"><strong>$vbphrase[hidden_poll_footer]<br>$pollstatus</strong></td>
</if>
Reply With Quote
  #19  
Old 03-20-2005, 07:36 PM
pjk pjk is offline
 
Join Date: Apr 2002
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ambumann
Is it possible to add an option to this mod to let the users see the results after they have voted?
Here
Quote:
pollresults_table TEMPLATE
==========================
FIND:

<td class="tfoot" colspan="4" align="center"><span class="smallfont"><if condition="$show['multiple']">$vbphrase[multiple_choice_poll] </if>$vbphrase[voters]: <strong>$pollinfo[numbervotes]</strong>. $pollstatus</span></td>

REPLACE WITH:

<if condition="$noshow == 0 || $uservoted == 1">
<td class="tfoot" colspan="4" align="center"><span class="smallfont"><if condition="$show['multiple']">$vbphrase[multiple_choice_poll] </if>$vbphrase[voters]: <strong>$pollinfo[numbervotes]</strong>. $pollstatus</span></td>
</if>
<if condition="$noshow == 1 && $uservoted == 0">
<td class="tfoot" colspan="4" align="center"><span class="smallfont"><strong>$vbphrase[hidden_poll_footer]<br>$pollstatus</strong></td>
</if>
Quote:
showthread.php
======================
FIND:

if ($value == 0)
{
$option['percent'] = 0;
}
else
{
$option['percent'] = vb_number_format($value / $pollinfo['numbervotes'] * 100, 2);
}

REPLACE WITH:

// Start Hide Poll Results v1.0
if ($value == 0 || $noshow == 1 && $uservoted == 0)
{
$option['percent'] = 0;
$option['votes'] = 0;
}
else
{
$option['percent'] = vb_number_format($value / $pollinfo['numbervotes'] * 100, 2);
}
// End Hide Poll Results v1.0
Reply With Quote
  #20  
Old 04-05-2005, 01:02 PM
Hurricane Hurricane is offline
 
Join Date: Feb 2002
Location: Central Florida
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry all. I have been away for a bit. I will get this updated ASAP.
Reply With Quote
  #21  
Old 04-05-2005, 06:40 PM
Hurricane Hurricane is offline
 
Join Date: Feb 2002
Location: Central Florida
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Updated to work with 3.0.7.

Thanks pjk for the fix.
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 04:33 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.04552 seconds
  • Memory Usage 2,324KB
  • Queries Executed 26 (?)
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
  • (1)bbcode_php
  • (7)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
  • (3)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