Profile like feature

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Profile like feature

    hey guys, how to create profile like feature for lavalair script, plz share it

    #2
    You can create a profile like feature using notepad++

    here`s the share: Notepad++ Home

    ;) lol

    Comment


      #3
      like feature

      Originally posted by something else View Post
      You can create a profile like feature using notepad++

      here`s the share: Notepad++ Home

      ;) lol
      no no, i mean that how to code . plz share that codings. .hug. plzzz sir

      Comment


        #4
        simple. add a like field in your users table .

        add mysql_query(update like in users where like=$who blah blah blah blah .lol .

        onlong those lines. try and try again you will never learn if you dont try .
        Wapchat4u


        Topsites4u

        Comment


          #5
          Originally posted by nclemale36 View Post
          simple. add a like field in your users table .

          add mysql_query(update like in users where like=$who blah blah blah blah .lol .

          onlong those lines. try and try again you will never learn if you dont try .
          yah, thats true dr, but i cant understand how to add that.

          Comment


            #6
            create some sql eg:
            PHP Code:
            CREATE TABLE  `ibwf_profile_likes` (
             `
            idINT100 NOT NULL AUTO_INCREMENT ,
             `
            uidINT100 ) DEFAULT 0,
             `
            likedbyINT100 ) DEFAULT 0,
            PRIMARY KEY (  `id` )
            ); 
            Then Create a mysql query to check if the user has liked the persons profile before followed by a simple if/else statement:

            PHP Code:
            $hasLiked mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_profile_likes WHERE uid='".$who."' AND likedby='".$uid."'"));

            if(
            $hasLiked[0]<1)
            {
                echo 
            "<a href=\"profile.php?who=$who&amp;sid=$sid&amp;like=1\">Like</a><br/>";
            }
            else
            {
                echo 
            "<a href=\"profile.php?who=$who&amp;sid=$sid&amp;like=0\">Dislike</a><br/>";

            Then you need to add a collection method of the like or dislike using $_GET and add or delete an database entry:
            PHP Code:
            if($_GET['like']==1)
            {
                
            mysql_query("INSERT INTO ibwf_profile_likes SET uid='".$who."', likedby='".$uid."'");
            }
            if(
            $_GET['like']==0)
            {
                
            mysql_query("DELETE FROM ibwf_profile_likes WHERE uid='".$who."' AND likedby='".$uid."'");

            then last of all show total number of likes:
            PHP Code:
            $numOfLikes mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_profile_likes WHERE uid='".$who."'"));
            echo 
            $numOfLikes[0]." Likes<br/>"
            This code is basic and could be made better but that's for you to work out, oh and also re-arranging the code on the page will make it work a lot better than copy and pasting it straight from her on to your profile page, and also i couldn't remember what the index.php?action=viewuser was called at the time of writing this so i just used profile.php and i cant be bothered to edit it lol

            Comment

            Working...
            X