Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons

Reply
 
Thread Tools
Must Vote in Poll to Post in Thread VB4 Details »»
Must Vote in Poll to Post in Thread VB4
Version: 2.1, by BirdOPrey5 (Senior Member) BirdOPrey5 is offline
Developer Last Online: Aug 2023 Show Printable Version Email this Page

Category: New Posting Features - Version: 4.x.x Rating:
Released: 12-27-2010 Last Update: 06-02-2012 Installs: 46
Supported Uses Plugins
Re-useable Code Translations  

Brought to you by BirdOPrey5 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...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.

Download Now

File Type: xml mustvote2postbop5_Russian (RU)_cp1251.xml (4.1 KB, 22 views)
File Type: xml mustvote2postbop5_Russian (RU)_utf-8.xml (5.2 KB, 23 views)
File Type: zip Must Vote to Post BOP5 v21.zip (4.5 KB, 117 views)

Screenshots

File Type: jpg ss_mustvotevb4.jpg (40.4 KB, 0 views)
File Type: jpg mustvote_settings.jpg (119.4 KB, 0 views)

Supporters / CoAuthors

Show Your Support

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

Comments
  #32  
Old 06-02-2012, 10:36 PM
Nirjonadda Nirjonadda is offline
 
Join Date: Dec 2011
Location: Italy
Posts: 739
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Now bug on Hide View Results ?

Attachment 138891
Reply With Quote
  #33  
Old 06-03-2012, 02:31 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #34  
Old 06-03-2012, 07:09 AM
Nirjonadda Nirjonadda is offline
 
Join Date: Dec 2011
Location: Italy
Posts: 739
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Custom and default style its same Condition.
Reply With Quote
  #35  
Old 06-03-2012, 11:21 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #36  
Old 06-03-2012, 11:27 AM
Nirjonadda Nirjonadda is offline
 
Join Date: Dec 2011
Location: Italy
Posts: 739
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

"polloptions_table" template contents on 4.1.10


Code:
<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>
Reply With Quote
  #37  
Old 06-04-2012, 12:31 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:

Code:
if ($mv_hide_link AND version_compare($vbulletin->versionnumber, '4.0.0' , 'ge'))
and change it to:

Code:
if ($mv_hide_link)
See if that helps.
Reply With Quote
  #38  
Old 06-04-2012, 01:25 PM
Nirjonadda Nirjonadda is offline
 
Join Date: Dec 2011
Location: Italy
Posts: 739
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Same Condition , Not working

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

Code:
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']);
}
Reply With Quote
  #39  
Old 06-05-2012, 04:49 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just temporarily change it to this:

Code:
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.
Reply With Quote
Благодарность от:
Nirjonadda
  #40  
Old 06-05-2012, 04:57 PM
Nirjonadda Nirjonadda is offline
 
Join Date: Dec 2011
Location: Italy
Posts: 739
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Now Working Perfect ! Thanks.
Reply With Quote
  #41  
Old 06-05-2012, 05:04 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, you need to put it back to

Code:
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.
Reply With Quote
Reply

Thread Tools

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 08:28 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.05139 seconds
  • Memory Usage 2,344KB
  • Queries Executed 27 (?)
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
  • (6)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (1)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (5)postbit_attachment
  • (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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete