Page Index Toggle Pages: 1 [2]  Send TopicPrint
Hot Topic (More than 10 Replies) Poll ShowVote 1.1 for YaBB2 RC1 (Read 7399 times)
Valtiel
God Member
*****
Offline


Copy & paste coder

Posts: 873
Joined: Sep 5th, 2003
Gender: Male
Re: Poll ShowVote 1.1 for YaBB2 RC1
Reply #15 - Sep 2nd, 2005 at 1:01pm
Print Post  
Nice mod  Smiley

If someone needs it for YaBB 1 (Polls 3 mod must be installed!), see attachment.
  

Poll_ShowVote_11_YaBB1.mod ( 1 KB | Downloads )

Proud copy & paste coder Grin
Admin @ Silent Hill Forum
Back to top
WWW  
IP Logged
 
Jeff
God Member
*****
Offline


There are no bugs there
are only features

Posts: 2552
Joined: Jan 14th, 2005
Gender: Male
Re: Poll ShowVote 1.1 for YaBB2 RC1
Reply #16 - Oct 2nd, 2005 at 9:06am
Print Post  
Hi Michael,
I think this can be final too and add Modlist.pl  Wink This works fine.
  

greetings
Jeff
Back to top
WWW  
IP Logged
 
Administrator
Forum Administrator
*****
Offline


Yummm

Posts: 7
Location: Modders Rile
Joined: Oct 7th, 2014
Gender: Male
Re: Poll ShowVote 1.1 for YaBB2 RC1
Reply #17 - Oct 21st, 2005 at 4:26pm
Print Post  
Moving this mod into the FINALs board. I've added the mod to the database and modified the mod file to update Modlist.pl.
  

The Administrator.
Back to top
WWW  
IP Logged
 
jans
Senior Member
****
Offline


Oooops!

Posts: 374
Location: Meppel
Joined: Oct 27th, 2005
Gender: Male
Re: Poll ShowVote 1.1 for YaBB2 RC1
Reply #18 - Jan 17th, 2006 at 2:30pm
Print Post  
Added code at the end of file to make it appear in the modlist so an admin can see he installed it.


Code
Select All
<id>
Poll Show Vote Mod
</id>

<version>
1.1
</version>

<mod info>
Normally a poll does not show you what you have voted for. This mod updates your YaBB 2 Board to show your vote via a star next the option you chose in a poll.

To Install:
-----------
- Install the mod file as usual. (See the BoardMod FAQ if you do not know how to do this).

Version History:
----------------

Written by Peter Enzerink

Version 1.0
- For each poll, show voter what they voted for

Version 1.1
- Revised to accommodate multi option polls



</mod info>

<author>
Peter Enzerink
</author>

<homepage>
http://enzerink.net/peter/
</homepage>

<edit file>
Sources/Poll.pl
</edit file>

<search for>
			($voters_ip, $voters_name, $voters_vote, $vote_date) = split(/\|/, $tmpLine);
</search for>

<add after>
			@has_voted_for = split(/,/,$voters_vote);	# only used if $has_voted > 0
</add after>

<search for>
				# Display Poll Results
</search for>

<add after>
				$showvote = "";
				foreach $one_vote (@has_voted_for) {
					if ($one_vote == $i) {
						$showvote = qq~ <img src="$imagesdir/star.gif" align="middle" alt="" />~;
						last;
					}
				}
</add after>

<search for>
		    <div style="float: left; text-align: left;">&nbsp;<img src="$imagesdir/poll_left.gif" align="middle" alt="" /><img src="$imagesdir/poll_middle.gif" height="12" width="$pollbar" align="middle" alt="" /><img src="$imagesdir/poll_right.gif" align="middle" alt="" /> $votes[$i] ($pollpercent%)</div>
</search for>

<replace>
		    <div style="float: left; text-align: left;">&nbsp;<img src="$imagesdir/poll_left.gif" align="middle" alt="" /><img src="$imagesdir/poll_middle.gif" height="12" width="$pollbar" align="middle" alt="" /><img src="$imagesdir/poll_right.gif" align="middle" alt="" /> $votes[$i] ($pollpercent%)$showvote</div>
</replace>


<edit file>
Admin/Modlist.pl
</edit file>

<search for>
### END BOARDMOD ANCHOR ###
</search for>

<add before>
	$Poll_ShowVote_11 = "Poll_ShowVote_1.1|garglebutt|This is a mod for YaBB 2 that shows a star after YOUR vote(s) in polls so you don't have to remember what you voted for. Quick and simple. Affects all polls on a board.
.|Works with YaBB 2 RC1 011005 onwards.|05/02/2005";
	push (@installed_mods, "$Poll_ShowVote_11");
</add before> 

  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint