How can we use one and 0 only in ranking system ?
Also how we can build a star system like in Gmail ?
Thank you.
simple rating sytem
simple rating sytem
Last edited by jacek on Mon Jul 09, 2012 4:07 pm, edited 1 time in total.
Reason: Please learn to type.
Reason: Please learn to type.
Re: simple rating sytem
What?mhakd14 wrote:how can we use one and 0 only in ranking sysytem.
I'm guessing you're asking about a star rating system? Considering the title. If so:mhakd14 wrote: And also how we can build a star system like in g mail
You could post 5 ( or however many ) stars and give them a value when clicked, for example 1-5.
Star 1 = 1, Star 2 = 2, and so on.
You would then count each vote as well as the value of each vote and then do some basic math. Divide total value of votes with total count of votes.
Example: 257 Points / 150 votes = 1.7 average. This means we should highlight one full and seven tenth of a star, or just round it up and show two full stars.
The principles behind this is really simple. And there are tonnes of tutorials on how to create a 5-star rating system online.
If you're wondering about this:
Clicking that star sets a boolean value in a database. Click it once for 1 ( true or on ) and again for 0 ( false or off ). Then a check is made to see if that item is starred ( if the Star is set to 1 ). Simple as that.
You're welcome!mhakd14 wrote: thank you
Re: simple rating sytem
Yes I mean the Gmail thing not the 5 star rating System. Temor just explain that Gmail thing bit more or please guide me for a good tutorial.
I am new to coding that's why.
I am new to coding that's why.
Last edited by jacek on Mon Jul 09, 2012 3:17 pm, edited 1 time in total.
Reason: Please learn to type.
Reason: Please learn to type.
Re: simple rating sytem
It depends entirely on what you want to use it for. I'll give you an example of how it might look for email purposes like in Gmail.
The star has an " onclick " function attached to it, so that when the star is clicked it will set " Star " to " true ". They then check to see if " Star " is " true ". If it is, that means it's Starred and should be put in a separate inbox.
Really, this would be very easy for you if you had some basic understanding of PHP coding, or coding in general.
I would suggest you start by watching some Basics tutorials and then work your way up to longer series of tutorials.
The star has an " onclick " function attached to it, so that when the star is clicked it will set " Star " to " true ". They then check to see if " Star " is " true ". If it is, that means it's Starred and should be put in a separate inbox.
UPDATE `emails` SET `star` = 'true' WHERE `email_id` = 1
if($star = true){ echo "star is true". }
Really, this would be very easy for you if you had some basic understanding of PHP coding, or coding in general.
I would suggest you start by watching some Basics tutorials and then work your way up to longer series of tutorials.
Re: simple rating sytem
realy thank you.You are a great helper