Pagina 1 van 1

Poll probleem

Geplaatst: 04 aug 2005, 11:08
door Kielse Rat
Dit is de hack:

Code: Selecteer alles

############################################################## 
## MOD Title: 		Admin Voting 
## MOD Version: 	1.1.8 
## Author: 		ErDrRon < ErDrRon@aol.com > < http://www.ErDrRon.com/phpBB2/ >
##
## Description: 	Allows forum administrators, via the Admin Control
##			Panel, to see who voted in a poll and, optionally,
##			HOW they voted. 
## 
## Installation Level:	easy 
## Installation Time:	2 minutes 
## Files To Edit (1):	posting.php
## Included Files (6):	voting_admin_install.txt
##			admin_voting_database_install.php
##			admin_voting.php
##			admin_vote_body.tpl
##			lang_admin_voting.php (use language of choice)
##			admin_voting_icon.gif
## 
############################################################## 
## This MOD is released under the GPL License. 
## Intellectual Property is retained by the MOD Author(s) listed above 
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/ 
############################################################## 
##
## Authors Notes:
##
## Because of potential privacy issues, users of your forum should be notified
## of the installation of this MOD.
##
## N.B. Please note that prior to installation of this MOD, phpBB had no built-in capacity to track
## the actual votes of users in polls.  It was designed to track only the total number of votes of 
## each choice in a poll. After installing this MOD, you will be able to track not only
## the totals of each choice in a poll but the actual votes of your users in any future polls posted
## on your forum.  There is, however, no way to retroactively view the actual votes in polls already
## on your forum prior to the installation of this MOD.  You will still have normal access to the poll
## results of previous polls as you did prior to the installation of this MOD.
##
## Once the files are installed and the database modified you should have a new section
## in the Admin Control Panel entitled Poll Admin.  Click on Poll Results to view Poll data.
##
## Plans for new features: Awaiting suggestions.
##
##############################################################
##
## Revision History:
##
## v1.1.8 12/04/2003
##  - now compatible with Mozilla and Netscape as well as Internet Explorer browser.
##    Added language support for Russian and Slovak.
##
## v1.1.7 10/12/2002
##  - added language support for Dutch, French, German, Hebrew and Spanish.  Fixed error in installation
##   script that was allowing users to vote in a poll more than once.
##
## v1.1.6	9/23/2002
##  - added script to automatically install database changes without the need of an external
##	database manager (i.e. phpMyAdmin).  This script only works with mySQL databases.
##
## v1.1.5	9/7/2002
##  - added Admin Voting icon to MOD
##
## v1.1.4	9/6/2002
##  - incorporated language entries into uploadable file, no need to edit lang_admin anymore.
##
## v1.1.3	9/6/2002
##  - added pagination.
##
## v1.1.2	9/4/2002
##  - now EasyMod compliant.
##
## v1.1.1	9/4/2002
##  - fixed database queries to be DBAL-compliant.
##  - a few housekeeping and format changes in the code .. doesn't affect capabilities.
##
## v1.1.0	9/1/2002
##  - added vote duration (start date, end date, status [ongoing, completed, infinite]).
##  - added capability to sort by Poll #, Topic title, or Start date.
##  - added capability to sort any of the above in ascending or descending fashion.
##
## v1.0.2	9/1/2002
##  - changed L_USERNAME and $lang['Username'] to L_VOTE_USERNAME and $lang['Vote_username']
##   respectively to avoid conflict with previously declared language variables. 
##
## v1.0.1	8/29/2002
##  - fixed issue with username MySQL query having incorrect format.
##
## v1.0.0	8/27/2002
##  - initial Release
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 
##
## Installing the database changes:
##
##	Only upload and run the admin_voting_database_install.php script if this is a
##	first-time installation of the Admin Voting MOD AND you are using mySQL for your database.
##	DO NOT upload or run this script if you have already installed the database changes with a
##	prior version of the Admin Voting MOD.  IF this is a new installation of the MOD then:
##
##		Upload admin_voting_database_install.php to your root phpBB directory
##		Open a new browser window and run the script; a typical address would be:
##		http://www.your.domain.name.com/phpbb/admin_voting_database_install.php
##
##		** For security purposes, once you've had a successful install delete the
##		admin_voting_database_install.php script immediately.
##
##		For those that wish to install the database changes manually, the SQL query is:
##
##		ALTER TABLE phpbb_vote_voters ADD vote_cast TINYINT( 4 ) UNSIGNED DEFAULT '0' NOT NULL;
##
##		(This query assumes the default database name of phpbb; you will need to change this if
##		you have chosen a different prefix for your database name).
##
##############################################################
##
## Language choices:
##
##   There are language files included for Dutch, English, French, German, Hebrew, Russian, Slovak and Spanish.
##   Copy the language file of your choosing to the appropriate /language/ subdirectory.
##
##############################################################
# 
#-----[ COPY ]--------------------------------------- 
# 
copy admin_voting.php to /phpbb_root/admin/admin_voting.php
copy admin_voting_body.tpl to /phpbb_root/templates/subSilver/admin/admin_voting_body.tpl
copy lang_admin_voting.php to /phpbb_root/language/lang_english/lang_admin_voting.php
copy admin_voting_icon.gif to /phpbb_root/templates/subSilver/images/admin_voting_icon.gif

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

# 
#-----[ FIND ]-------------------------------------------- 
#
# -around line 494-
# NOTE: the complete line to find is:
#				$sql = "INSERT INTO " . VOTE_USERS_TABLE . " (vote_id, vote_user_id, vote_user_ip) 
#					VALUES ($vote_id, " . $userdata['user_id'] . ", '$user_ip')";
#
				$sql = "INSERT INTO " . VOTE_USERS_TABLE 
					VALUES

# 
#-----[ IN-LINE FIND ]------------------------------------
#
vote_user_ip

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------
#
, vote_cast

# 
#-----[ IN-LINE FIND ]------------------------------------
#
'$user_ip'

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------
#
, $vote_option_id

#
# NOTE: Many users make a mistake when performing the above edit.  After the above instructions are performed
#		the code should look like this:
#
#				$sql = "INSERT INTO " . VOTE_USERS_TABLE . " (vote_id, vote_user_id, vote_user_ip, vote_cast) 
#					VALUES ($vote_id, " . $userdata['user_id'] . ", '$user_ip', $vote_option_id)";
#

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM 
En dan krijg ik deze error:

Code: Selecteer alles

Could not query vote results.

DEBUG MODE

SQL Error : 1054 Unknown column 'vote_cast' in 'field list'

SELECT vote_id, vote_user_id, vote_cast FROM phpbb_vote_voters ORDER BY vote_id

Line : 209
File : admin_voting.php

Geplaatst: 04 aug 2005, 11:15
door Wout -- w00t
Je bent dit vergeten:

Code: Selecteer alles

##############################################################
##
## Installing the database changes:
##
##   Only upload and run the admin_voting_database_install.php script if this is a
##   first-time installation of the Admin Voting MOD AND you are using mySQL for your database.
##   DO NOT upload or run this script if you have already installed the database changes with a
##   prior version of the Admin Voting MOD.  IF this is a new installation of the MOD then:
##
##      Upload admin_voting_database_install.php to your root phpBB directory
##      Open a new browser window and run the script; a typical address would be:
##      http://www.your.domain.name.com/phpbb/admin_voting_database_install.php
##
##      ** For security purposes, once you've had a successful install delete the
##      admin_voting_database_install.php script immediately.
##
##      For those that wish to install the database changes manually, the SQL query is:
##
##      ALTER TABLE phpbb_vote_voters ADD vote_cast TINYINT( 4 ) UNSIGNED DEFAULT '0' NOT NULL;
##
##      (This query assumes the default database name of phpbb; you will need to change this if
##      you have chosen a different prefix for your database name).
##
##############################################################