I'm working on a favorite system, but I need some help of some javascript programmers to make it pretty. (AJAX is killing me...)
Currently you can only just favorite the items (soon categories) but can't see 'em. I'll add that functionality this week.
Also, this is a hack/mod. Not a plugin, so I need help with that as well.
You can check it out at animekyun.com (NSFW).
This is how it works:
Using the object provided by K2 and Joomla Framework, I can define the userID ItemID and CatID. These variables are then inserted in hidden fields. Only the submit button is visible in the form of a heart. Once it's clicked, the variables are passed onto a php script which queries the DB. It first checks if item is already existing for the user. If not, it will insert the itemid, userid, and catid into the DB. Each favorite has it's own auto increment id just in case i would ever need it.
Once the query is complete, it will notify the user that it's done.
I am however facing 1 little problem. For some reason my javascript is not returning the response of the php script. The php echoes "Success!" on completion but it's not returned. Instead I have the javascript say "Favorited" once it's complete but it should also append my response to that which is not happening. Firebug also reports a undefined response.
Included are the AJAX framework script, the PHP insertion script and the Item.php file.
You need to make your own dbconnect.php script which has the database info for the php insertion script. just define the variables listed in the insertion script.