Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WDNDesignSurvey
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Digital Experience Group
WDNDesignSurvey
Commits
2b0733f3
Commit
2b0733f3
authored
16 years ago
by
Brett Bieber
Browse files
Options
Downloads
Patches
Plain Diff
Change voter IP to an unsigned integer for speed.
parent
6ef150da
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
DesignSurvey/Voter.php
+1
-1
1 addition, 1 deletion
DesignSurvey/Voter.php
DesignSurvey/designsurvey.ini
+2
-1
2 additions, 1 deletion
DesignSurvey/designsurvey.ini
database/designsurvey.sql
+3
-2
3 additions, 2 deletions
database/designsurvey.sql
functions.php
+3
-3
3 additions, 3 deletions
functions.php
with
9 additions
and
7 deletions
DesignSurvey/Voter.php
+
1
−
1
View file @
2b0733f3
...
...
@@ -14,7 +14,7 @@ class DesignSurvey_Voter extends DB_DataObject
var
$audience_id
;
// int(11)
var
$age_group_id
;
// int(11)
var
$gender
;
// string(1)
var
$ip
;
//
string(15
) not_null
var
$ip
;
//
int(32
) not_null
var
$step
;
// int(10) unsigned
var
$prototype_order
;
// blob(16777215) blob
var
$viewport
;
// string(50)
...
...
This diff is collapsed.
Click to expand it.
DesignSurvey/designsurvey.ini
+
2
−
1
View file @
2b0733f3
...
...
@@ -99,9 +99,10 @@ id = 129
audience_id
=
1
age_group_id
=
1
gender
=
2
ip
=
1
30
ip
=
1
29
step
=
1
prototype_order
=
66
viewport
=
130
submitdatetime
=
14
[voter__keys]
...
...
This diff is collapsed.
Click to expand it.
database/designsurvey.sql
+
3
−
2
View file @
2b0733f3
...
...
@@ -209,11 +209,12 @@ CREATE TABLE IF NOT EXISTS `voter` (
`audience_id`
int
(
11
)
default
NULL
,
`age_group_id`
int
(
11
)
default
NULL
,
`gender`
char
(
1
)
default
NULL
,
`ip`
varchar
(
15
)
NOT
NULL
default
''
,
`ip`
int
(
32
)
unsigned
NOT
NULL
,
`step`
int
(
10
)
unsigned
default
NULL
,
`prototype_order`
mediumtext
,
`viewport`
varchar
(
50
)
default
NULL
,
`submitdatetime`
datetime
default
NULL
,
PRIMARY
KEY
(
`id`
),
KEY
`ip`
(
`ip`
)
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
latin1
;
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
latin1
AUTO_INCREMENT
=
4
;
This diff is collapsed.
Click to expand it.
functions.php
+
3
−
3
View file @
2b0733f3
...
...
@@ -51,7 +51,7 @@ class Voting_System
function
initializeVoter
()
{
$options
=
&
PEAR
::
getStaticProperty
(
'DB_DataObject'
,
'options'
);
$this
->
voter
->
ip
=
$_SERVER
[
'REMOTE_ADDR'
];
$this
->
voter
->
ip
=
ip2long
(
$_SERVER
[
'REMOTE_ADDR'
]
)
;
$this
->
voter
->
step
=
START
;
$this
->
voter
->
submitdatetime
=
date
(
'Y-m-d H:i:s'
);
if
(
isset
(
$_GET
[
'at'
]))
{
...
...
@@ -133,7 +133,7 @@ class Voting_System
if
(
isset
(
$_SESSION
[
'voter_id'
])
&&
$this
->
voter
->
get
(
$_SESSION
[
'voter_id'
]))
{
$found
=
true
;
}
elseif
(
!
in_array
(
$_SERVER
[
'REMOTE_ADDR'
],
$sharedIPs
))
{
$this
->
voter
->
ip
=
$_SERVER
[
'REMOTE_ADDR'
];
$this
->
voter
->
ip
=
ip2long
(
$_SERVER
[
'REMOTE_ADDR'
]
)
;
if
(
$this
->
voter
->
find
()
&&
$this
->
voter
->
fetch
())
{
$found
=
true
;
$_SESSION
[
'voter_id'
]
=
$this
->
getVoterId
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment