PDA

View Full Version : Miscellaneous Hacks - Show Checked Icon if User voted on Poll


Andreas
07-04-2005, 10:00 PM
Show Checked Icon if User voted on Poll
Description
This Hack show a checked Icon and a Voted Poll:-Thread-Prefix if the User
has already voted on a Poll.

Details
1 Plugin XML
2 Phrases
1 Image

Please note

1 Query is added for each Forum Display where Threads contain Polls.
If there are no Polls on the Page being displayed, it does not add a Query
The check only works for Registered Users.
So if you allow guests to vote on Polls they won't see the checked Icon, even if they have voted. This might change in future Versions.


History
1.0.0 Initial Version
1.0.1 Updated for vBulletin 3.5 RC 1
Also supports Search, User CP and Subscriptions now.
Attention: This Hack is only compatible with vBulletin 3.5 RC1 and up!

Compatibility
This Add-on is compatible with vBulletin 3.5.X, 3.6.X, 3.7.X and 3.8.X

Please only click Install if you actually have installed/are using this Hack, and click Uninstall when you don't use it any longer!

Chris M
07-05-2005, 12:11 AM
Nice idea :)

Satan

Andreas
07-05-2005, 12:13 AM
Been using this since almost 1 1/2 years on my Boad, now converted to a Plugin :)
But I am not that happy with the Code yet ... another Hook would make it easier

Chris M
07-05-2005, 12:15 AM
You should request it on .com ;)

I can confirm this works though :)

Satan

Andreas
07-05-2005, 12:16 AM
I already requested it (http://www.vbulletin.com/forum/showthread.php?p=901618&#post901618) several days ago ;)

Andreas
07-27-2005, 02:49 PM
Updated for RC1.
Does also support Search, User CP and Subscriptions now.

If you are updating, please delete the old Pluin first

Boofo
07-27-2005, 09:10 PM
Is there a setting anywhere for this or is it all automatic?

Andreas
07-27-2005, 09:13 PM
No setting. It just does show the Icon/Prefix when the Product is enabled.
To disable it, disable the Product :)

Boofo
07-27-2005, 09:16 PM
Thank you, sir. That's all I needed to know. ;)

FleaBag
07-27-2005, 10:06 PM
OK, I may be being a little stupid here.

But there were 2 XML files, I imported product-votedpolls.xml. I don't have to do anything with the other file, right?

Andreas
07-27-2005, 10:26 PM
Instead of the 2nd XML there should have been readme.txt, fixed now ;)

FleaBag
07-27-2005, 10:28 PM
Ah cool, thanks for the heads up.

Boofo
07-27-2005, 10:53 PM
Instead of the 2nd XML there should have been readme.txt, fixed now ;)

What do I need to delete? I installed both of them.

Andreas
07-27-2005, 11:00 PM
Delete the Plugins that show Product=vBulletin.

Boofo
07-27-2005, 11:07 PM
Delete the Plugins that show Product=vBulletin.

I hope there were only 2 of them. I have a lot of plug-ins that show that. ;)

Andreas
07-27-2005, 11:12 PM
As this Hack uses only 1 Plugin, I guess 2 is correct - if you had 1 without Product :)

prawn
07-28-2005, 04:41 PM
Really cool. Shows the "power" of the Product System! :)
Thanks Kirby

Oblivion Knight
09-13-2005, 07:29 PM
Awesome, I didn't realise this mod had already been ported! :D

Cheers Kirby.

Brinnie
09-13-2005, 07:54 PM
Now if you could only search for polls. :D Hmmm...

FleaBag
08-13-2006, 10:28 AM
Just thought I would stop by and advise that this works in 3.6 as well. Not many people seem to be using this one but I think it's a nice touch. Andreas, get it into the main code so I can have one less product. ;)

Exitilus
04-29-2008, 11:58 PM
It appears to work fine in 3.7 as well ....

Boofo
02-27-2011, 11:34 AM
Believe it or not, one little line edit and it works on vb 4.1.0 PL2.

Manoel J?nior
02-27-2011, 12:29 PM
Believe it or not, one little line edit and it works on vb 4.1.0 PL2.
Please tell us what line we have to edit.

Boofo
02-27-2011, 04:16 PM
Change this line:

$thread['threadiconpath'] = "$stylevar[imgdir_misc]/poll_posticon_checked.gif";


to this:
$thread['threadiconpath'] = vB_Template_Runtime::fetchStyleVar('imgdir_misc') . "/poll_posticon_checked.gif";


$stylevar doesn't work in vb 4.

Boofo
02-28-2011, 09:46 AM
I guess there is more to this that doesn't work with vb 4. The following give a foreach error during a What's New search.

case 'search':
foreach ($GLOBALS['itemids'] AS $pollcheck)
{
if ($pollcheck['pollid'] AND $pollcheck['open'] != 10)
{
$pollids[] = $pollcheck['pollid'];
}
}
break;


Andreas, can this be fixed or updated for vb 4?