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 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Dec 2013
    Posts
    6
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Simple Like/Dislike script?

    Hi CF,

    I want to make a simple like/dislike script. Pretty much have a random photo centered with a like on the left side of the random picture and a dislike on the right. Once you like or dislike the photo a new random photo appears and so on..

    Would this be simple to do? If so were would I start? I'm good with html css and I know a bit of php.

    Or if someone can make it for really cheap I happy to pay

    Cheers.

  • #2
    Regular Coder
    Join Date
    Sep 2011
    Posts
    408
    Thanks
    18
    Thanked 26 Times in 26 Posts
    Are you doing any limitations for this? Such as they need to have an account or only one vote per IP address? It would help stop people spamming ones they like. Do you have these images logged into a database or are you simply running off files? You should use a database to log the photos and such to keep track of them easier if you don't.
    If I've helped you out, show your appreciation by clicking the "Thanks" link as well as a link below!

    AdFly
    Facebook | Twitter
    Google | YouTube

  • Users who have thanked Dubz for this post:

    liambs (05-16-2014)

  • #3
    New to the CF scene
    Join Date
    Dec 2013
    Posts
    6
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thanks for the reply.

    I would like them to login through facebook or sign up. Also yes I think having a db to host it all would be the best way to do this.

    The Tinder app is a good example.

  • #4
    Regular Coder
    Join Date
    Sep 2011
    Posts
    408
    Thanks
    18
    Thanked 26 Times in 26 Posts
    Then yes this should be fairly simple to make. I haven't done any facebook login plugins with websites, mainly because I refuse to associate facebook with my sites and not everyone has/wants one. This could be done easily with a simple db structure and some jquery (to make picture loading dynamic rather than refreshing the page every time).
    If I've helped you out, show your appreciation by clicking the "Thanks" link as well as a link below!

    AdFly
    Facebook | Twitter
    Google | YouTube

  • Users who have thanked Dubz for this post:

    liambs (05-16-2014)

  • #5
    New to the CF scene
    Join Date
    Dec 2013
    Posts
    6
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Fair enough. Where would I go to get started on something like this?

  • #6
    Regular Coder
    Join Date
    Sep 2011
    Posts
    408
    Thanks
    18
    Thanked 26 Times in 26 Posts
    You need to map out a database structure for how you want the data to be handled, that's usually where I start mostly.

    Map a table to store the photos, keeping an index of them that's unique, such as giving them a unique ID and pointing to their name to know which it is, that way you can keep them indexed and know, also you might want to have an upload script to rename them to avoid overwrites. Consider a timestamp name with an incrementing value if multiple people upload pictures at the same time.

    Next you'd need to build a table to store the likes and dislikes. This could be done with 3 columns, 2 for the photo/user ID and the other for whether it was liked or not (you could add more for timestamps if wanted, that's up to you, but 3 would be minimal) and make the two ID columns a unique pair (index on 2 columns).

    As for the users table, that's up to you. If you don't know how to build the tables then you might need to take a step down from this and learn that first. The votes table would be easy, but be prepared for it to hod a lot of values. If you don't want this, you could used a serialized array, or a comma separated list with two columns, in the photos table, it's just all in what you favor for.
    If I've helped you out, show your appreciation by clicking the "Thanks" link as well as a link below!

    AdFly
    Facebook | Twitter
    Google | YouTube


  •  

    Posting Permissions

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