Open dragoonis opened 12 years ago
Sounds good, for point 4, I propose cookies + IP, since in some cases the IP is dynamic. (Specially in my country, My modem grabs a different IP any time it connects to the net)
Ammending original comment.
I propose a friendly way for reading routes. On config you have defined routes like: Module:Controller:Method, my propose is to distinguish module name and method in other way like: Module::Controller@Method. And for more complex controllers you can use a point to refer folder controllers. Example: Module::path.to.controller@method. I think, this way is more friendly readable.
Hi Miguel,
From a simple perspective there's no technical advantage on changing a ":" to a "@". This is syntax being re-used from the Symfony2 component library which is in our advantage to be consistent with.
There may be a need for revising the syntax if a developer would like to use sub-controllers to further organise their /Controllers/ directory. However deviating from the globally known ":" syntax does seem disadvantageous.
Regards,
Hi Everyone,
The IP check would be easily bypassed via a proxy and cookies can be removed by the user.
My opinion is that anonymous votes should not be allowed and that users who wish to contribute should create an account and vote that way.
Opinions?
I like @BenTheDesigner 's opinion, if anyone wants to contribute/vote, there's no harm for a 2 minutes registration form.
@BenTheDesigner Good points.
Lets roll this out, and then we can debate over making it secure and unique at the end.
I have some things I can to achieve first, before I allow user registrations, that's why.
Cheers :)
Found a website similar to what we're looking to do: http://puu.sh/15Evn
Purpose
The purpose of this page is to let users input their suggestions of what's missing in PPI, and let people vote on these ideas, similar to stack overflow, where the item with the most votes is at the top.
Implementation
1) The route for this should be at /ideas (
/modules/Application/resources/config/routes.yml
) 2) This should be mapped to an Ideas controller (Application/Controller/Ideas.php
) 3) There should be anideas
database table containing fields.id, title, vote_score
3.1) There should be a Storage class to map to theideas
table named:Application/Storage/Ideas.php
3.2) Their should be anApplication\Entity\Idea
class to be returned by the above Storage class4) The issue of duplication should be avoided, so we need to match on IP Address and cookie, thus a second database table is needed. 4.1) DB table named:
ideas_votes
with fields.id, idea_id, ip_address
this will let us determine if a user of a specific ip_address has already voted on thisidea_id
before. 4.2) A cookie will be set on this namedppi_idea_x
where X is the ID of the idea, this will let them still vote on multiple ideas.5) When someone is voting it will maintain the
ideas.vote_score
field, either incrementing or decrementing the value. 5.1) When displaying the ideas a simpleORDER BY ideas.vote_score DESC
will be enough to show ideas with the highest votes.