Jump to content

Image "likes"


Sabir
 Share

Recommended Posts

Hello.

I want implement image "likes" system. I want to use built-in description field to store values (because client needs opportunity to change values by himself). 

I have one problem - how change image description with ajax request? 

For example, I send request via jQuery to file likes.php

<php
include "./index.php";

$gal_page = $wire->pages->get(1188);

//I don't know how can I pass image id or something similar and then select this image
$image_id = $wire->input->get("img_id");

//set OF false
$gal_page->of(false);

//I know that there isn't such method, just for example
$gal_page->images->eq($image_id)->description = "34512";

$gal_page->save();
?>

As you see from code comments, my main problem is saving image id or something else and finding image by this info.

Have you any ideas, how can I implement this?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...