Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Newbie needs help with a "rating system" code

    Hello, everyone!

    I found this code here, 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>
    </tr>
    </table>
    Any help would be appreciated!

  • #2
    New Coder
    Join Date
    Jan 2008
    Posts
    42
    Thanks
    4
    Thanked 4 Times in 4 Posts
    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

  • #3
    Regular Coder
    Join Date
    Nov 2007
    Posts
    110
    Thanks
    0
    Thanked 1 Time in 1 Post
    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

  • #4
    New Coder
    Join Date
    Jan 2008
    Posts
    42
    Thanks
    4
    Thanked 4 Times in 4 Posts
    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.

  • #5
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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).


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •