Closed ahmadnawid closed 12 years ago
Is the voting system just for up rating? @jonassanoj @tilman-schieber
Each user should be able to either upvote or downvote each question/answer
I stack in a point, how to send data from view to controller? I created two links for upvote and downvote so how to send questionID and also which link the user clicked to the associated controller? @tilman-schieber @jonassanoj
why don't you look at the qlist.php view? you will see how it is done there.
But to give you a quick answer: controller functions get their parameters via the URI if $id holds the id of the question you can do an upvote link like this:
<a href=<?php echo site_url('controllername/functionname/'.$id)?> > Click here to upvote! </a>
clean up the function interface: clean separation of model/controller. modify view to post +/- . Replace pure MySQL by active record functions. Update documentation. Optional: use constants to beautify the code.
not completed: redirect in model, still pure sql queries, just minor cleanup
Change view to only show the vote button if a user can vote: modify question_model::get_details() and answer_model::get_answers() to return if a question/answer is votable.
incomplete functionality: if no user is logged in voting is possible just once and the buttons are shown
replace ugly buttons with nice images
complete
Optional: update css to make a nice button bar
not completed
Ok sir, just give us a little time.
This was a résumé for this task. You are welcome to bring changes but they will not affect the grade.
@ahmadnawid @Sediqi