PDA

View Full Version : Poll Widget Help


Kitch87
07-16-2014, 03:40 PM
I want people to be able to vote and view results of the poll in the poll widget on the homepage but do not want them to be able to view the thread where the widget is pulling polls from.

How can I achieve this?

tbworld
07-16-2014, 04:06 PM
Try this: (This has not been tested):

Template Showthread


<vb:comment>{vb:raw poll}</vb:comment>



For individual polls you will have to create a template conditional with your criteria around the same section of code.

------------------------------------

You can also do this by adding a plugin at hook: "showthread_complete"

// Hook: showthread_complete

// If poll ID = 3, then empty the $poll template contents.
if ($pollid == 3) {
$poll = '';
}

Kitch87
07-16-2014, 08:40 PM
Try this: (This has not been tested):

Template Showthread


<vb:comment>{vb:raw poll}</vb:comment>



For individual polls you will have to create a template conditional with your criteria around the same section of code.

------------------------------------

You can also do this by adding a plugin at hook: "showthread_complete"

// Hook: showthread_complete

// If poll ID = 3, then empty the $poll template contents.
if ($pollid == 3) {
$poll = '';
}


Thanks for the reply. Where abouts in showthread would I have to put that code, or can it go anywhere?

tbworld
07-16-2014, 09:20 PM
1.) Open AdminCP.
2.) Plugins & Products -> Plugin Manager -> Add New Plugin (very bottom of the page)

Fill in the following:

Product: vBulletin
Hook Location: showthread_complete
Title: Nullify Poll in Showthread
Execution Order: 5

Plugin PHP Code:

// if ($pollid == 3) // Uncomment this line for a specific poll ID.
{
$poll = '';
}

Plugin is Active: Yes

Click Save.

Kitch87
07-17-2014, 07:17 PM
Thanks a lot for trying to help, very much appreciated.

It turns out I found a pretty easy way to solve this. In admin CP click on to the forum where the polls are being pulled from and click on forum active - NO. This way the forum is invisible so no one can see it, but the polls on the poll widget on the homepage are still visible and able to vote on them and see results.

Can still access the forum by knowing the forum's URL to post more polls.