[2.0.20] Vote Manager

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
34
64%
Very Good
10
19%
Good
4
8%
Fair
1
2%
Poor
4
8%
 
Total votes: 53

robbalvey
Registered User
Posts: 64
Joined: Sat Feb 12, 2005 5:49 am
Contact:

Post by robbalvey »

That worked!!!!

THANK YOU VERY MUCH!!!!!

--Robb

cwallace
Registered User
Posts: 523
Joined: Tue Dec 14, 2004 4:26 am
Location: Fort Wayne, Indiana
Contact:

Post by cwallace »

I think the phone rang 50 times while I was trying to install this so it is probably an error on my end...

Everything works until I submit the post and I get this:


INSERT INTO phpbb_test_vote_desc (topic_id, vote_text, vote_start, vote_length) VALUES (3, 'Who sucks more Al or Chris', 1164250024, 3895200, '', '', '')

Line : 266
File : functions_post.php


I looked at that line in the functions_post.php and didn't see anything that made sense to me...I am not a coder though..:)

Help would be great, but the MOD looks to be a damn good MOD once installed.

Chris
http://www.FortWayneMusic.com - Your source for the best in local music and entertainment.

add99man2
Registered User
Posts: 13
Joined: Tue May 30, 2006 10:38 pm

Post by add99man2 »

Does this mod work with phpbb version 2.0.21?

User avatar
stevemagruder
Registered User
Posts: 210
Joined: Wed Jul 02, 2003 2:05 pm
Location: Louisville, KY
Contact:

Post by stevemagruder »

add99man2 wrote: Does this mod work with phpbb version 2.0.21?


Yes, with the bug fix I discussed previously in this thread.
Steve Magruder - WebCommons :: Media
Administrator for the Louisville History & Issues discussion board

maxpi3
Registered User
Posts: 4
Joined: Tue Nov 28, 2006 10:29 pm

Post by maxpi3 »

sorry i'd to know before install it... if this mod make me see all users has voting and what has voting every single user (public vote).

User avatar
stevemagruder
Registered User
Posts: 210
Joined: Wed Jul 02, 2003 2:05 pm
Location: Louisville, KY
Contact:

Post by stevemagruder »

maxpi3 wrote: sorry i'd to know before install it... if this mod make me see all users has voting and what has voting every single user (public vote).


Yes, if you're an admin, you can see all the users voting and what every single user has voted for, even if you block regular users from seeing this information.
Steve Magruder - WebCommons :: Media
Administrator for the Louisville History & Issues discussion board

maxpi3
Registered User
Posts: 4
Joined: Tue Nov 28, 2006 10:29 pm

Post by maxpi3 »

stevemagruder wrote:
maxpi3 wrote:sorry i'd to know before install it... if this mod make me see all users has voting and what has voting every single user (public vote).


Yes, if you're an admin, you can see all the users voting and what every single user has voted for, even if you block regular users from seeing this information.


Ehm... i want to make see visible to ALL users
i'd like to make a poll that's make visible chooses... isn't possible? :(

User avatar
stevemagruder
Registered User
Posts: 210
Joined: Wed Jul 02, 2003 2:05 pm
Location: Louisville, KY
Contact:

Post by stevemagruder »

maxpi3 wrote:
stevemagruder wrote:
maxpi3 wrote:sorry i'd to know before install it... if this mod make me see all users has voting and what has voting every single user (public vote).


Yes, if you're an admin, you can see all the users voting and what every single user has voted for, even if you block regular users from seeing this information.


Ehm... i want to make see visible to ALL users
i'd like to make a poll that's make visible chooses... isn't possible? :(


Yes it is possible and it depends upon what options are selected when creating a poll.
Steve Magruder - WebCommons :: Media
Administrator for the Louisville History & Issues discussion board

maxpi3
Registered User
Posts: 4
Joined: Tue Nov 28, 2006 10:29 pm

Post by maxpi3 »

I've try yesterday to mod my site on phpbbXS2 version... but doesn't work...

this it's the only version released about this mod ? there's a hope to see this mod apply to phpbbXS version ? :o

User avatar
stevemagruder
Registered User
Posts: 210
Joined: Wed Jul 02, 2003 2:05 pm
Location: Louisville, KY
Contact:

Post by stevemagruder »

maxpi3 wrote: I've try yesterday to mod my site on phpbbXS2 version... but doesn't work...

this it's the only version released about this mod ? there's a hope to see this mod apply to phpbbXS version ? :o


This is a mod to phpBB 2.0.x.
Steve Magruder - WebCommons :: Media
Administrator for the Louisville History & Issues discussion board

maxpi3
Registered User
Posts: 4
Joined: Tue Nov 28, 2006 10:29 pm

Post by maxpi3 »

I've notify to phpbbplus staff this mod.. i hope that someone are avaible to convert it to that version.

mbastin
Registered User
Posts: 8
Joined: Mon Dec 11, 2006 7:59 pm

Post by mbastin »

stevemagruder wrote: Sorry, I was working from memory when I should have reviewed my code again.

Change $vote_id = $vote_info['$id_vote']; to $id_vote = $vote_info['vote_id'];

and change WHERE vote_id = $vote_id back to WHERE vote_id = $id_vote

That should do it.


Hi !

I have exactly the same problem :

Code: Select all

Could not obtain user vote data for this topic

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND vote_user_id = 5' at line 4

SELECT * FROM phpbb_vote_voters WHERE vote_id = AND vote_user_id = 5

Line : 549
File : posting.php
BUT :

Code: Select all

	//
	// Vote in a poll
	//
	if (( !empty($HTTP_POST_VARS['vote_id'])) && (is_array($HTTP_POST_VARS['vote_id'])) && (isset($HTTP_POST_VARS['vote_id'])))
	{
		$vote_option_id = intval($HTTP_POST_VARS['vote_id']);
		$vote_id = $HTTP_POST_VARS['vote_id'];

		$sql = "SELECT vd.vote_id, vd.vote_max
			FROM " . VOTE_DESC_TABLE . " vd, " . VOTE_RESULTS_TABLE . " vr
			WHERE vd.topic_id = $topic_id
				AND vr.vote_id = vd.vote_id
				AND vr.vote_option_id = $vote_option_id
			GROUP BY vd.vote_id";
		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, 'Could not obtain vote data for this topic', '', __LINE__, __FILE__, $sql);
		}

		if ( $vote_info = $db->sql_fetchrow($result) )
		{
			$max_vote = $vote_info['vote_max'];
			$id_vote = $vote_info['vote_id'];
		}
			$sql = "SELECT *
				FROM " . VOTE_USERS_TABLE . "
				WHERE vote_id = $id_vote
					AND vote_user_id = " . $userdata['user_id'];
			if ( !($result2 = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not obtain user vote data for this topic', '', __LINE__, __FILE__, $sql);
			}

		$prev_vote = $db->sql_numrows();
		$counter = 0;
		$row = $db->sql_fetchrowset($result2);

		$vbn = array();
		for ($i = 0; $i < count($vote_id); $i++)
		{
			//	check if already voted on certain options
			$flag = false;
			for ($j = 0; $j < $prev_vote; $j++)
			{
				if ($vote_id[$i] == $row[$j]['vote_option_id'])
				{
					$flag = true;
					break;
				}
			}
			if (!$flag)
			{
				$vbn[$counter] = $vote_id[$i];
				$counter++;
			}
		}

		$db->sql_freeresult($result2);

		$sql = "SELECT vd.vote_id
			FROM " . VOTE_DESC_TABLE . " vd, " . VOTE_RESULTS_TABLE . " vr
			WHERE vd.topic_id = $topic_id
				AND vr.vote_id = vd.vote_id
				AND vr.vote_option_id = $vote_option_id
			GROUP BY vd.vote_id";
		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, 'Could not obtain vote data for this topic', '', __LINE__, __FILE__, $sql);
		}

		if ( $vote_info = $db->sql_fetchrow($result) )
		{
			$vote_id = $vote_info['vote_id'];

			$sql = "SELECT *
				FROM " . VOTE_USERS_TABLE . "
				WHERE vote_id = $vote_id
					AND vote_user_id = " . $userdata['user_id'];
			if ( !($result2 = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not obtain user vote data for this topic', '', __LINE__, __FILE__, $sql);
			}
			if ( $max_vote >= (count($vbn) + $prev_vote) )	//	Modded
			{
				foreach ($vbn as $vote_option_id)
				{


				$sql = "UPDATE " . VOTE_RESULTS_TABLE . "
					SET vote_result = vote_result + 1
					WHERE vote_id = $vote_id
						AND vote_option_id = $vote_option_id";
				if ( !$db->sql_query($sql, BEGIN_TRANSACTION) )
				{
					message_die(GENERAL_ERROR, 'Could not update poll result', '', __LINE__, __FILE__, $sql);
				}

				$sql = "INSERT INTO " . VOTE_USERS_TABLE . " (vote_id, vote_user_id, vote_user_ip, vote_option_id)
					VALUES ($vote_id, " . $userdata['user_id'] . ", '$user_ip', $vote_option_id)";
				if ( !$db->sql_query($sql, END_TRANSACTION) )
				{
					message_die(GENERAL_ERROR, "Could not insert user_id for poll", "", __LINE__, __FILE__, $sql);
				}

				}
				if ( !($prev_vote) )
				{
					$sql = "UPDATE " . VOTE_DESC_TABLE . "
						SET vote_voted = vote_voted + 1
						WHERE vote_id = $vote_id
							AND topic_id = $topic_id";
					if ( !$db->sql_query($sql) )
					{
						message_die(GENERAL_ERROR, 'Could not update poll voted', '', __LINE__, __FILE__, $sql);
					}
				}

				$message = $lang['Vote_cast'];
			}
			else
			{
				$message = $lang['Already_voted'];
			}
			$db->sql_freeresult($result2);
		}
		else
		{
			$message = $lang['No_vote_option'];
		}
		$db->sql_freeresult($result);

		$template->assign_vars(array(
			'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">')
		);
		$message .=  '<br /><br />' . sprintf($lang['Click_view_message'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>');
		message_die(GENERAL_MESSAGE, $message);
	}
	else
	{
		redirect(append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id", true));
	}
}
When I create a new poll, I have no prob ...

Please help me ...

(sorry for my english, I'm french speaking).

mb.

mbastin
Registered User
Posts: 8
Joined: Mon Dec 11, 2006 7:59 pm

Post by mbastin »

Nobody ?

Help please ...

mb. :?

User avatar
stevemagruder
Registered User
Posts: 210
Joined: Wed Jul 02, 2003 2:05 pm
Location: Louisville, KY
Contact:

Post by stevemagruder »

Sorry, but I don't know how to help here. The mod, with the fixes I suggested earlier, works fine.

You may want to go through the mod again and ensure that you installed it correctly.
Steve Magruder - WebCommons :: Media
Administrator for the Louisville History & Issues discussion board

mbastin
Registered User
Posts: 8
Joined: Mon Dec 11, 2006 7:59 pm

Post by mbastin »

Thanks for reply.

I did for the review...

The strange thing is that it's the only one (poll) who do that. The other ones have no probs ...

mb.

Post Reply

Return to “[2.0.x] MOD Database Releases”