View Full Version : Newbie needs help with a "rating system" code

01-13-2008, 05:23 PM
Hello, everyone!

I found this code here (http://sharetv.org/shows/batman), to allow users to rate certain pages. Can anyone instruct me on how to use it?

I tried finding the source code and personalizing it, but it doesn't work.

Here is what I've been trying to work with:

<table style="border:1px solid #ccc;text-align:center;font-family:arial;font-size:13px" cellpadding=1 cellspacing=2 width=100>
<tr><td style="background:#ccc" colspan=4 align="center"><i style="font-size:10px">Show Rating</i></td></tr>
<tr id="loader" style="display:none"><td colspan=4 align="center"><img id='loading' src="/images/loading.gif" width=16 height=16 style="padding:4px"></td></tr>
<tr id="voting">
<td><a href="#" onClick='sendVote("m","guest",1); return false'><img src="/images/hateit.gif" width=21 height=18 border=0 title="Hate it" style="padding:3px"></a></td>
<td width=15><b id="hate" style="color:red">1</b></td>

<td width=15><b id="love" style="color:green">57</b></td>
<td><a href="#" onClick='sendVote("m","guest",2); return false;'><img src="/images/loveit.gif" width=21 height=18 border=0 title="Love it" style="padding:3px"></a></td>

Any help would be appreciated!

AoR Zeta
01-13-2008, 05:29 PM
Eh. When you click on the "hate it" or "love it" image, it runs the Javascript function sendVote() which no doubt uses AJAX to send the vote to a PHP script. When I click that link I see that you are trying to use someone else's script.

That means that you didn't download it so you don't have the PHP script that is required for it to work so I can't help you.

Well I could, because I know PHP/Javascript... but I really can't be bothered right now, sorry. Maybe someone else will be able to help you.

Later on when I'm more in the mood for coding, I'll help you out. But not yet. :P

01-13-2008, 05:38 PM
for rating system u need some more code in back end PHP ASP or .net etc and DB also. You hav to save all rating in DB and display it from DB . i think what u got is incomplete

AoR Zeta
01-13-2008, 05:44 PM
You don't have to use a Database, you could use a file-storage if you wanted. But you will need to use a server-side language.

Well it's probably possible to use just Javascript, but I don't know Javascript well enough to do it that way.

01-21-2008, 10:37 PM
Thanks everyone!

It seems like its a really troublesome thing, so I think I'll just try something else.

Still, thanks for the input (and sorry for the late reply).