Log in

View Full Version : New Posting Features - Must Vote in Poll to Post in Thread VB4


BirdOPrey5
12-27-2010, 10:00 PM
Brought to you by BirdOPrey5 (http://www.qapla.com/mods/) and kh99

Version 2.1

This mod will require users who want to post in a poll thread to actually vote in the poll before they are allowed to post.

The main code of this mod was developed by kh99 and I made it into an installable mod with options at his request.

Options include:

Turn mod on or off
Allow thread starter to reply without voting
Immune Usergroups - Usergroups who don't need to vote before posting.
Enable in All Forums - Yes/No (New in V 1.5)
Enable in Specific Forums Only (Updated in V 2.0)
Hide posts until vote (New in V 2.0)
Hide View Results link until vote (New in V 2.0)


Live Demo: http://www.qapla.com/mods/showthread.php/329-Multi-Vote-Poll-Test

Testing and working on VB 3.8.7 and 4.1.12 and am sure it will work on all 3.8.x - 4.0/4.x.x. It will probably work on 3.7 and maybe earlier as well.

If a user hasn't voted they will be given a message to vote before posting, see the screen shots.

The message displayed in hidden posts is the Postbit phrase: bop5_mustvote_hidden_message
The message a user gets if they try to post before voting is the GLOBAL phrase: mustvote2post

Full instructions in .txt file in zip file.

If you used the VB4 version you must uninstall the old 1.x mod before upgrading to 2.0

Please Mark as Installed if you use this. :)
Donations Always Apprecicated but please include kh99 in any donation. :up:

Russian Translations thanks to xorex. :cool:

sticky
12-29-2010, 01:25 AM
Great mod idea! Tagged

OldSchoolDSL
12-29-2010, 02:27 AM
Installed and working

4.1 PL2

mitch84
12-29-2010, 05:10 AM
thank you

BirdOPrey5
01-04-2011, 03:19 PM
Upgraded this to version 1.5- adds new options and fixed an incorrectly worded setting.

OldSchoolDSL
01-04-2011, 03:41 PM
Update Installed and working

4.1 PL2

SilverBoy
01-11-2011, 06:32 PM
nice hack.

Is there a way to modify this hack to work as (force users to vote before continues crowsing the forum)?

BirdOPrey5
01-11-2011, 06:42 PM
No, that would be a completely different mod.

SilverBoy
01-11-2011, 08:07 PM
I know, but cold you program some thing like this?

BirdOPrey5
01-12-2011, 12:40 AM
No, I really can't imagine how I'd even start to freeze people out of everything but a single poll, sorry.

RK KINGKONG
02-01-2011, 07:47 AM
thanks again BoP5 as always great work man , thank you for bringing simple useful mods like this to 4.1.1 without all the troublesome installs

Sforums
03-25-2011, 01:12 PM
Tested and nothing, I don't get it.....
Using 4.1.0 pl2

Mod enabled, allow thread starter = yes (I am not threadstarter), immune usergroup 6 (tested with other user group), enable in all forums = yes.

Any ideas?

BirdOPrey5
03-25-2011, 05:24 PM
Can you give me a link to your forum and a poll?

Lord. Dela
03-26-2011, 10:18 PM
Thanks :D

Videx
03-28-2011, 11:58 PM
Feature request: If you've been playing with the poll code, maybe you can figure out a way to allow users to change their votes? I see the current "vote once and never change your mind or correct an error" system as rendering polls useless.

BirdOPrey5
03-29-2011, 10:59 AM
That would be very different from the code for this mod.

vetty
03-13-2012, 04:05 PM
I have chosen the option that a member can vote only once in a poll.
Can the user who has already voted and posted a reply, can again and again post replies ?

OcR Envy
03-13-2012, 06:41 PM
I'd love a reverse IE: Must Post in Thread to Vote in Poll

BirdOPrey5
03-15-2012, 03:22 AM
I have chosen the option that a member can vote only once in a poll.
Can the user who has already voted and posted a reply, can again and again post replies ?

Once a user votes in the poll they can post in the thread as much as they want.

Hikarin
04-13-2012, 12:27 PM
I like the idea of this but I'd rather you be able to select the thread in which you can't post without voting.
This sounds like it stops you from posting on any thread if you haven't voted in it's poll....

Nirjonadda
04-30-2012, 12:18 PM
Not working I posted in thread without vote in poll.

BirdOPrey5
04-30-2012, 02:05 PM
Most likely explanation is the settings are incorrect-

Is mod enabled?
Are you (testing it) in an immune usergroup?
Do you have it enabled in the forum you are testing it in?
Do you have allow thread starter to vote enabled? (And if so, are you the thread starter?)

If they all look right, can you give a screenshot of the settings and a link to your forum to me so I can test it.

BirdOPrey5
04-30-2012, 11:59 PM
Just tested this on 4.1.12, and it still works.

I have noticed though now vBulletin will put the error message right above the quick reply box instead of on a new page when you try to submit your response and this mod blocks it-

Therefore I suggest VB 4.1.12 users EDIT the Phrase mustvote2post in Phrase Manager- and provide a translation without the <input> code included.

Make the translation say: You must vote before you can reply to this thread.

Or whatever else you want it to say.

This will remove the unnecessary "Go Back" button that used to be part of the phrase.

BirdOPrey5
05-04-2012, 01:07 PM
If you used the VB4 version you must uninstall the old 1.x mod before upgrading to 2.0

Updated to 2.0 - New Options Include

Hide posts until vote
Hide view results link until vote
Easy forum selections
Quick Reply not visible if no permission to post


Unified VB3 and VB4 version.

Nirjonadda
05-04-2012, 03:51 PM
Nice updated but Enable in All Forums (If "Yes" enables "Must Vote" in all forums and all threads. If "No" will only enable in forumids specified below.) when enables all forums its not working.

Nirjonadda
05-04-2012, 04:03 PM
Allow Thread Starter to Post...If "Yes" Not working for other member.please check to fix.
You Can add Quick Reply visible on/off option ?

BirdOPrey5
05-05-2012, 01:07 AM
I have tested both options on several forums, including a freshly installed forum and all are working as expected-

That is to say-
If "Enable in All Forums" is YES the mod works in ALL forums
If it is NO it works ONLY in the forum selected below

AND

Allow Thread Starter to Post is Working fine for allowing whoever started the thread (and posted the poll) to vote.

Please double-check your settings. If it's not working please post a screenshot of your settings.

mairving
06-01-2012, 02:15 AM
BirdOPrey5, I too am having issues with the mod working. I have already posted the information about the issue on your forums here (http://www.qapla.com/mods/showthread.php/403-Must-Vote-in-Poll-to-Post-in-Thread-Or-optionally-view-replies-view-results?goto=newpost).

Any help would be greatly appreciated!

BirdOPrey5
06-01-2012, 03:58 PM
If the details are on my forum I will answer it there. :up:

BirdOPrey5
06-02-2012, 10:06 PM
Allow Thread Starter to Post...If "Yes" Not working for other member.please check to fix.
You Can add Quick Reply visible on/off option ?

Looks like you were right. I apologize, I had to see it on someone else's forum.

There were indeed a couple bugs. I have released version 2.1 which should fix it.

-Joe

Nirjonadda
06-02-2012, 10:36 PM
Now bug on Hide View Results ?

138891

BirdOPrey5
06-03-2012, 02:31 AM
That is actually removed by n automatic template edit. Are you using a custom style?

If so please post the contents of your polloptions_table template- it shouldn't be that big.

Nirjonadda
06-03-2012, 07:09 AM
Custom and default style its same Condition.

BirdOPrey5
06-03-2012, 11:21 AM
Please post the polloptions_table template contents, I don't have a copy of 4.1.10 installed at the moment to see if there is a change.

Nirjonadda
06-03-2012, 11:27 AM
"polloptions_table" template contents on 4.1.10


<div id="pollinfo" class="polloptionsblock">
<form class="block" action="{vb:raw $vboptions.vbforum_url}{vb:if "$vboptions['vbforum_url']", '/', ''}poll.php?do=pollvote&amp;pollid={vb:raw pollinfo.pollid}" method="post">
<div class="blockhead">
<h2>{vb:rawphrase poll}: <span class="polltitle">{vb:raw pollinfo.question}</span></h2>
<vb:if condition="$show['editpoll']">
<a class="textcontrol blockhead_info" href="{vb:link poll, {vb:raw pollinfo}, 'do=polledit'}"><img class="inlineimg" src="{vb:stylevar imgdir_cms}/edit_small.png" alt="{vb:rawphrase edit_poll}" title="{vb:rawphrase edit_poll}"/></a>
</vb:if>
</div>
<div class="blockbody">
<vb:if condition="$show['pollenddate'] OR $show['publicwarning']">
<h3 class="pollsubhead">
<vb:if condition="$show['pollenddate']">{vb:rawphrase this_poll_will_close_on_x_at_y, {vb:raw pollenddate}, {vb:raw pollendtime}}</vb:if>
<vb:if condition="$show['publicwarning']">{vb:rawphrase public_poll_users_see_choices}</vb:if>
</h3>
</vb:if>

<div id="polloptions" class="blockrow">
<ul class="checkradio group">
{vb:raw pollbits}
</ul>
</div>
</div>

<div class="blockfoot">
<div class="group">
<input type="submit" class="button" value="{vb:rawphrase vote_now}" tabindex="1" />
<a class="textcontrol" href="{vb:link poll, {vb:raw pollinfo}, 'do=showresults'}">{vb:rawphrase view_poll_results}</a>
<input type="hidden" name="s" value="{vb:raw session.sessionhash}" />
<input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
<input type="hidden" name="do" value="pollvote" />
<input type="hidden" name="pollid" value="{vb:raw pollinfo.pollid}" />
</div>
</div>
</form>
</div>

BirdOPrey5
06-04-2012, 12:31 PM
That's what it should be...

Weird.

Please go to the Admin CP -> Plugin Manger -> Edit the plugin "Remove Results Button VB4 Only"

Find this line:


if ($mv_hide_link AND version_compare($vbulletin->versionnumber, '4.0.0' , 'ge'))


and change it to:


if ($mv_hide_link)


See if that helps.

Nirjonadda
06-04-2012, 01:25 PM
Same Condition , Not working

Admin CP -> Plugin Manger -> Edit the plugin "Remove Results Button VB4 Only"

global $mv_hide_link, $vbulletin;

if ($mv_hide_link)
{
$vbulletin->templatecache['polloptions_table'] = str_replace('<a class="textcontrol"', '<a style="display: none;"', $vbulletin->templatecache['polloptions_table']);
}

BirdOPrey5
06-05-2012, 04:49 PM
Just temporarily change it to this:


global $mv_hide_link, $vbulletin;

//if ($mv_hide_link)
{
$vbulletin->templatecache['polloptions_table'] = str_replace('<a class="textcontrol"', '<a style="display: none;"', $vbulletin->templatecache['polloptions_table']);
}


Don't leave it like that though.

Let me know if it "works" like that... This will let me know for sure if it's the logic that is failing or the template edit that is failing.

Nirjonadda
06-05-2012, 04:57 PM
Now Working Perfect ! Thanks.

BirdOPrey5
06-05-2012, 05:04 PM
No, you need to put it back to

global $mv_hide_link, $vbulletin;

if ($mv_hide_link)
{
$vbulletin->templatecache['polloptions_table'] = str_replace('<a class="textcontrol"', '<a style="display: none;"', $vbulletin->templatecache['polloptions_table']);
}

else it will be disabled for everyone all the time... It just means I need to find out why $mv_hide_link isn't "true" on your forum.

Nirjonadda
06-05-2012, 07:46 PM
"Remove Results Button VB4 Only" When this code not working Hide View Results.

global $mv_hide_link, $vbulletin;

if ($mv_hide_link)
{
$vbulletin->templatecache['polloptions_table'] = str_replace('<a class="textcontrol"', '<a style="display: none;"', $vbulletin->templatecache['polloptions_table']);
}

Nirjonadda
08-13-2012, 05:20 PM
No, you need to put it back to

global $mv_hide_link, $vbulletin;

if ($mv_hide_link)
{
$vbulletin->templatecache['polloptions_table'] = str_replace('<a class="textcontrol"', '<a style="display: none;"', $vbulletin->templatecache['polloptions_table']);
}

else it will be disabled for everyone all the time... It just means I need to find out why $mv_hide_link isn't "true" on your forum.

Could you please get any solution about this problem ?

BirdOPrey5
08-15-2012, 07:50 PM
I wasn't looking into anything because you said it was "Working Perfect."

Can you please explain the problem you are having?

Are you using the original/default code?

Nirjonadda
08-15-2012, 09:00 PM
Now bug on Hide View Results ?

138891

Yes I using the original/default code !

BirdOPrey5
08-18-2012, 09:10 AM
I don't know what it is, sorry. My guess is a conflict with something else- would suggest you just don't use it.

mitch84
05-28-2013, 08:50 AM
Hi, This mod requires to vote in the topic before posting in another forum or only in this topic? somewhat similar to Hack (https://vborg.vbsupport.ru/showthread.php?t=241754) abel1, read before posting? or I misunderstood, thank you

BirdOPrey5
05-28-2013, 05:54 PM
Hi, This mod requires to vote in the topic before posting in another forum or only in this topic? somewhat similar to Hack (https://vborg.vbsupport.ru/showthread.php?t=241754) abel1, read before posting? or I misunderstood, thank you

No... if a thread has a poll the user must vote before posting in that thread.

mitch84
05-29-2013, 09:36 AM
it would be interesting, what do you think?

Muhammad Rahman
05-29-2013, 12:17 PM
installed ..
work fine vb 4.2.1

DemOnstar
09-15-2013, 05:11 PM
Clicked

If Yes the mod will hide the "View Poll Results" link so users cannot click on it to see poll results before voting.

But the results are already seen....

https://www.mightymoiety.com/showthread.php?33-C_The-C-word

Is there something that we are missing here?

Ta..........

Bubble #5
09-20-2013, 10:02 PM
Trying to create a "Poll Only" forum, and this mod will help greatly, but is there a way to make polls mandatory in a forum, so people don't post regular (UN-polled) threads in it? :confused:

Bubble #5
09-20-2013, 10:06 PM
If Yes the mod will hide the "View Poll Results" link so users cannot click on it to see poll results before voting.

But the results are already seen....
.......

What's funny is that when I went to the poll I saw everyone's post saying "This post has been hidden. You must vote in the poll to view this post.
Guests must log in or Register to vote." and I was wondering why everyone was saying the same thing.... DOH! :D

The way yours is working is not how mine is working (4.2.1). On mine the poll result IS hidden, AND each post is completely empty (blank) until you vote.

There is no "This post is hidden..." notice.

BirdOPrey5
09-20-2013, 11:31 PM
Trying to create a "Poll Only" forum, and this mod will help greatly, but is there a way to make polls mandatory in a forum, so people don't post regular (UN-polled) threads in it? :confused:

No way I know of to make polls mandatory... Threads actually get posted first and polls added to them later, even on a live forum. The thread always precedes the poll. I suppose could be made to hide threads with no polls but it would be a different mod.

Bubble #5
09-21-2013, 12:07 AM
What about having the 'add poll' check box pre-checked off by default?

DemOnstar
09-21-2013, 06:39 AM
What's funny is that when I went to the poll I saw everyone's post saying "This post has been hidden. You must vote in the poll to view this post.
Guests must log in or Register to vote."

and I was wondering why everyone was saying the same thing.... DOH! :D

No comment :erm:

The way yours is working is not how mine is working (4.2.1). On mine the poll result IS hidden, AND each post is completely empty (blank) until you vote.


Not sure how to change this...https://www.mightymoiety.com/showthread.php?33-C_The-C-word

Bubble #5
09-21-2013, 02:45 PM
Not sure how to change this...https://www.mightymoiety.com/showthread.php?33-C_The-C-word

Are you logged in as an Admin or Mod when you're viewing it?

I think they are exempt from the poll rules.