https://www.icyphoenix.com/viewtopic.php?f=35&t=7355
-----------------------------------
mort
Tue 07 Sep, 2010 02:46

Bug? Can't Change Vote To ALL In Forum Permissions
-----------------------------------
IP v53a

No matter which Forum-Permissions apps I use in the ACP I can't get any forum permissions to accept individual AUTH settings to change vote permissions from "REG" to "ALL" (Guests) in any forums?

I really [b][i][u]do need[/u][/i][/b] permission for Guests to be able to vote in some forums - Can someone help me with this please?


-----------------------------------
Costa
Tue 07 Sep, 2010 12:12

Re: Bug? Can't Change Vote To ALL In Forum Permissions
-----------------------------------
far as I know it is not possible to vote by visitors.

This issue is from the original phpbb ....  :(


-----------------------------------
mort
Wed 08 Sep, 2010 08:06

Re: Bug? Can't Change Vote To ALL In Forum Permissions
-----------------------------------
[b]Damn![/b]

I'll have to check phpbbhacks and maybe see if there's something that I can use  - Or try to find something else that is free-standing and can be clicked (Swapped) out to.

:(

Otherwise I'll have to use this YaBB Forum:

 [img]http://www.icyphoenix.com/files/images/8840/yabb_poll.png[/img] 

[b][i]And is not really the way I wanted to go.[/i][/b] :(

[b]UPDATE:[/b]

This seems to work OK [b]if you're NOT running serious polls,[/b] as it uses IP's rather than cookies! :P

But in ACP Forum / Permissions you have to use the third option to change the AUTH?

Permissions List
Permissions ADV
[b]Permissions[/b]

Why the hell does Icy Phoenix need three forum-permission apps - Anyone would think that one would be enough?

[b]MODIFIED FOR ICY PHOENIX ? 53a[/b]

[spoiler][code linenumbers=false]##############################################################
## MOD Title: Allow Guest Voting
## MOD Author: Thoul < thoul@phpbbsmith.com > (Jeremy Rogers) http://www.phpbbsmith.com
## MOD Description: Allows admins to enable voting by users that are not logged in.
## MOD Version: 2.0.3
## MODIFIED FOR ICY PHOENIX ? 53a 08 Sept 2010
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit:
##      adm/admin_forumauth.php,
##      posting.php,
##      viewtopic.php,
##      includes/functions.php
## Included Files: N/A
## License: contrib/license.txt GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## Before using this hack, you should be aware that while it does allow guest
## voting and will attempt to restrict this to one vote per guest, the
## restrictions are easily bypassed.  This modification is intended for those
## who simply want to have some relaxing, fun polls and don't need to worry
## about someone skewing the voting.
##
## When a guest votes, their IP address is recorded, and no one with that IP
## address will be able to vote again in that poll.  This form of tracking is
## not perfect.  A user on a dial-up modem connection may have a different IP
## address each time they connect to the internet and could vote multiple times
## by disconnecting and reconnecting.  Many businesses and universities have a
## few IP addresses for all the computers at their locations.  If even one guest
## user votes from one of these locations, it could mean that hundreds, perhaps
## thousands, of other potential guest voters will not be able to vote.
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ OPEN ]------------------------------------------
#
adm/admin_forumauth.php



#
#-----[ FIND ]------------------------------------------
#

				if ($forum_auth_fields[$i] == 'auth_vote')
				{
					if ($_POST['auth_vote'] == AUTH_ALL)
					{
						$value = AUTH_REG;
					}
				}

#
#-----[ BEFORE, ADD ]------------------------------------------
#

//------------------------------------------------------------------------------
// Allow Guest Voting - Begin Code Addition
//
// Next line disables the Original phpBB Code following it.

/*

#
#-----[ AFTER, ADD ]------------------------------------------
#

*/

// Above line marks the end of disabling of the Original phpBB Code.
//
// Allow Guest Voting - End Code Addition
//------------------------------------------------------------------------------


#
#-----[ OPEN ]------------------------------------------
#
posting.php


#
#-----[ FIND ]------------------------------------------
#

			$sql = "SELECT *
				FROM " . VOTE_USERS_TABLE . "
				WHERE vote_id = $vote_id
					AND vote_user_id = " . $userdata['user_id'];

#
#-----[ AFTER, ADD ]------------------------------------------
#

//----------------------------------------------------------------------
// Allow Guest Voting - Begin Code Alteration
//
			make_guest_sql($sql);
//
// Allow Guest Voting - End Code Addition
//------------------------------------------------------------------------------


#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php

#
#-----[ FIND ]------------------------------------------
#

			$sql = "SELECT vote_id
				FROM " . VOTE_USERS_TABLE . "
				WHERE vote_id = $vote_id
					AND vote_user_id = " . intval($userdata['user_id']);

#
#-----[ AFTER, ADD ]------------------------------------------
#

//----------------------------------------------------------------------
// Allow Guest Voting - Begin Code Alteration
//
			make_guest_sql($sql);
//
// Allow Guest Voting - End Code Addition
//------------------------------------------------------------------------------


#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php

#
#-----[ FIND ]------------------------------------------
#

#
#-----[ FIND ]------------------------------------------
#

?>

#
#-----[ BEFORE, ADD ]------------------------------------------
#

//------------------------------------------------------------------------------
// Allow Guest Voting - Begin Code Addition
//
/*	make_guest_sql
       Adds an IP clause to SQL queries that check for a member's poll votes.

    Arguments:
       $sql	- The SQL query.

    Return:
       None.
                                                                             */
function make_guest_sql(&$sql)
{
	if ( $GLOBALS['userdata']['user_id'] == ANONYMOUS )
	{
		$sql .= " AND vote_user_ip = '" . $GLOBALS['user_ip'] . "'";
	}
}
//
// Allow Guest Voting - End Code Addition
//------------------------------------------------------------------------------

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
[/code][/spoiler]


-----------------------------------
Mighty Gorgon
Wed 15 Sep, 2010 23:30

Re: Bug? Can't Change Vote To ALL In Forum Permissions
-----------------------------------
[quote user="mort" post="50104"]This seems to work OK [b]if you're NOT running serious polls,[/b] as it uses IP's rather than cookies! :P[/quote]
Cookies can be emptied... in this way users can vote several times... that is why IP is better.

[quote user="mort" post="50104"]But in ACP Forum / Permissions you have to use the third option to change the AUTH?

Permissions List
Permissions ADV
[b]Permissions[/b]

Why the hell does Icy Phoenix need three forum-permission apps - Anyone would think that one would be enough?[/quote]
I have created 3 to be able to edit multiple permissions at once... I firstly created them for my own needs, and then I thought they could have been useful for someone else.

Here is a quick explanation about the goal of each of them:
[list][*][b]Permissions[/b]: the standard permissions system... you can edit one forum per time.
[*][b]Permissions List[/b]: you can check every permissions on every forum... so you can have a quick overall view on permissions and change what you like with only one page... this can be useful if you have a lot of forums and don't want to reload tons of pages and also remember each setting.
[*][b]Permissions Advanced[/b]: this feature is to quickly assign same permissions on multiple forums, very useful if you want to quickly review global permissions on some forums and apply the same all at once.[/list]

To be onest there is also a fourth place to edit permissions... and it is in Forums Extended (in new Icy Phoenix there will be only this one). :lol:

If you don't like having extra options, you just need to remove the PHP related file in ADM folder, and those modules will disappear next time you reload your ACP.


