jonassanoj / dbpro

DB Project 1
19 stars 1 forks source link

controllers/util::vote() #73

Closed ahmadnawid closed 12 years ago

ahmadnawid commented 12 years ago

@ahmadnawid @Sediqi

ahmadnawid commented 12 years ago

Is the voting system just for up rating? @jonassanoj @tilman-schieber

tilman-schieber commented 12 years ago

Each user should be able to either upvote or downvote each question/answer

ahmadnawid commented 12 years ago

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

tilman-schieber commented 12 years ago

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>
tilman-schieber commented 12 years ago
jonassanoj commented 12 years ago

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

ahmadnawid commented 12 years ago

Ok sir, just give us a little time.

jonassanoj commented 12 years ago

This was a résumé for this task. You are welcome to bring changes but they will not affect the grade.