Jump to content


Favorite Toggle Like P2L


2 replies to this topic

#1 trs21219

    Young Padawan

  • Members
  • Pip
  • 31 posts
  • Gender:Male
  • Location:Pittsburgh, Pa

Posted 27 February 2008 - 09:52 PM

could someone tell me how to make a favorite toggle like this site has for the toggle of favorite tutorials?

it would first get the value of true or false for it already being bookmarked by my function $Users -> isFavorite($id);

and would update with $Users -> updateFavorite($id); (both written in php) all i need is the javascript to toggle this and to make it switch the icon from let say no.png to yes.png

if someone could help me out i would be greatful :D

#2 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 28 February 2008 - 06:00 PM

If you're looking for help with just the JS and not the PHP, you could always check the source:

/js/prototype.js
/js/global.js
/js/quicktags.js
/share-this/js.js

I don't use the site enough to really know what you're talking about, but if you find out which function is tied to the icon you're talking about, you can sift through those files till you find it.

Disclaimer: I'm not condoning ripping of any sort, i'm merely implying that the best way to learn how to do something is to actually see how it is done. Websites happen to be conveniently open-source (in terms of JS, HTML, etc...).

#3 trs21219

    Young Padawan

  • Members
  • Pip
  • 31 posts
  • Gender:Male
  • Location:Pittsburgh, Pa

Posted 28 February 2008 - 09:52 PM

oh thanks rc, i didnt even think of looking at the view source... and i wont copy it ill just look how it implements calling the function... thanks again





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users