vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   [HTL] and [Normal] Hide Poll Results (https://vborg.vbsupport.ru/showthread.php?t=63576)

Hurricane 04-06-2004 10:00 PM

[HTL] and [Normal] Hide Poll Results
 
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!

Boofo 04-07-2004 02:24 PM

Excellent job! Clicking install. ;)

Chris Blount 04-14-2004 12:56 PM

Okay, we may have found a possible bug.

We created some polls and checked the "Hide results" checkbox AND the checkbox labeled "Make votes public: Displays all users who voted, and what choice they voted for".

All users cannot see the results but some of our users have reported that they can see the usernames of who voted in the polls while the polls are still open.

I really don't know if there is anything you can do about this but I thought I would report it anyway in case you have some idea why it is happening.

Hurricane 04-14-2004 02:06 PM

Quote:

Originally Posted by Chris Blount
Okay, we may have found a possible bug.

We created some polls and checked the "Hide results" checkbox AND the checkbox labeled "Make votes public: Displays all users who voted, and what choice they voted for".

All users cannot see the results but some of our users have reported that they can see the usernames of who voted in the polls while the polls are still open.

I really don't know if there is anything you can do about this but I thought I would report it anyway in case you have some idea why it is happening.


That is not really a bug. You have just turned on 2 features. It is like telling it not to tell you how many times the light has been turned on, but show me who turned it on. ;)

These 2 should not be used together.

ZeroZone 05-18-2004 10:27 AM

What should I modify to allow only admin to use this poll's option (hide result)?

TheMusicMan 10-26-2004 07:09 AM

Quote:

Originally Posted by ZeroZone
What should I modify to allow only admin to use this poll's option (hide result)?

Has anyone installed and tested this hack on vB303...?

TheMusicMan 10-26-2004 04:32 PM

Hide Poll Results hack works with vB3.0.3

Today Colin F installed this hack firstly on my vB3.0.3 development/test board and it all worked OK. He then installed it onto my live www site here. It works fine.

The Hide Poll Results hack works 100% error free and though I am sure there are many good coders/developers on here, I can thoroughly recommend that anyone wanting any Mod installed you should really contact Colin F. His standard of work is superb, his customer relation skills are excellent, and he's a totally cool chap too.

He will certainly have all of my mod work... cheers Colin... :cool:

HiDeo 10-26-2004 04:55 PM

Thanks for this hack ;)

JamesFrost 11-02-2004 11:04 AM

Looks great - is there a non HTL version?

JamesFrost 11-02-2004 11:05 AM

Quote:

Originally Posted by JamesFrost
Looks great - is there a non HTL version?

ignore me - just read the readme

JamesFrost 11-02-2004 02:52 PM

Quote:

Originally Posted by JamesFrost
ignore me - just read the readme

installed - works brilliantly. Many thanks. :D

Kamran 11-20-2004 02:49 PM

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.

TheMusicMan 11-20-2004 03:34 PM

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.

Kamran 11-20-2004 04:32 PM

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.

ambumann 02-03-2005 08:05 PM

Great hack, installed right away!

ambumann 02-04-2005 02:45 PM

Is it possible to add an option to this mod to let the users see the results after they have voted?

pjk 03-20-2005 06:32 AM

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>

pjk 03-20-2005 07:36 PM

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

Hurricane 04-05-2005 01:02 PM

Sorry all. I have been away for a bit. I will get this updated ASAP.

Hurricane 04-05-2005 06:40 PM

Updated to work with 3.0.7.

Thanks pjk for the fix. ;)

zoomforce 07-06-2005 04:59 AM

hey quick thing.. im totally new to php and SQL (dinasour from the CGI days) and have no idea how to enter the SQL table thing, i know this is a total newbie thing but is there an easy way to do it? do i do it from Vbulletin or through Cpanel?

Marco van Herwaarden 07-06-2005 05:46 AM

You can run a SQL-command from your AdminCP->Import & Maintenance->Execute SQL Query.

If you don't see the above option, add your userid in the ./includes/config.php to the $canrunqueries variable.

Alternativly you can use something like phpMyAdmin if your host provides that.

zoomforce 07-06-2005 05:54 AM

yeah i saw the Execute SQL Query option adn i went straight for it but i press it and it says i dont have permission, i will try and add my userid to the config file that should fix that. Thanks Marco.

rapcriminals 07-06-2005 07:32 AM

nice installs...this will go great with my rap battle system hack.

SilverBoy 07-23-2005 10:22 AM

nice hack, everything goes ok, but when the poll is ended by time it still hidden, but if I close it manually it appears.

I want the results shows aotumaicaly when the poll time is end

chikkoo 08-14-2005 06:50 AM

This is a very nice hack, I have been using this in 3.0.7,
but now I am using 3.5.0 and I am really handicapped without this.
Anybody converting this Mod for 3.5.0???

Hurricane 08-14-2005 12:13 PM

I am not yet running 3.5.0, but I will install it on my test server and see what I can come up with for you.

ERuiz 08-16-2005 04:38 AM

Quote:

Originally Posted by TheMusicMan
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.

Yup! I have the same problem. What needs to be done so that the poll displayed on the vbAdvanced home page does not display the results. Thanks in advance.

chefsache 08-28-2005 03:55 PM

Hi @all,

great job, thanks!! I click install... :squareeyed:

But my user could see the results before they vote...
Where is the mistake....i checked the installation
and every modifications is all right...

Thanks
chefsache

chefsache 08-31-2005 09:47 AM

Hi @ all...

No ideas?
Wich part can i check again for this problem?

Thanks a lot
Andreas

chefsache 09-10-2005 07:03 AM

Hi @all,

problem is solved.... :)

Regards
Andreas

sunnycher 09-28-2005 11:47 PM

So I cut and paste the below in the "Execute SQL Query?

ALTER TABLE `poll` ADD `hidepoll` SMALLINT(5) UNSIGNED NOT NULL AFTER `voters`

sunnycher 09-29-2005 12:23 AM

I ran the query and this is what I get.

error number: 1146
error desc: Table 'lgpcommunity.poll' doesn't exist

Where do I fix this issue?

Marco van Herwaarden 09-29-2005 03:25 AM

If you are using table prefixes, put that in fron of the tablename.

stumparoooo 10-22-2005 03:30 AM

Does this work with VB 3.0.5??

Hurricane 10-29-2005 11:58 PM

I am fairly sure it will work with 3.0.5.

It will be ported over to 3.5.0 very soon.

Hurricane 10-31-2005 12:13 AM

I think someone already took care of the port.

https://vborg.vbsupport.ru/showthread.php?t=98957


All times are GMT. The time now is 04:52 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.01375 seconds
  • Memory Usage 1,831KB
  • 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
  • (1)bbcode_php_printable
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (37)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete