Like and Dislike Profile

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

    Like and Dislike Profile

    This code will be able to like and dislike just get ur own images like.gif and dislike.gif

    in viewusers profile
    Code:
      
     echo "<a href=\"index.php?action=likeprof&amp;who=$who&amp;sid=$sid\"><img src=\"images/like.gif\" alt=\"*\"/>L</a>/";
            echo "<a href=\"index.php?action=dislikeprof&amp;who=$who&amp;sid=$sid\"><img src=\"images/dislike.gif\" alt=\"*\"/>D</a></br>";
            $likes = mysql_fetch_array(mysql_query("SELECT likes FROM ibwf_users WHERE id='".$who."'"));
      echo "<b>$likes[0]</b>/";
      $dislikes = mysql_fetch_array(mysql_query("SELECT dislikes FROM ibwf_users WHERE id='".$who."'"));
        echo "<b>$dislikes[0]</b><br/>";
    in index
    Code:
    ///////////////////////////////////////////
    else if($action=="dislikeprof")
    {
    
    
    echo "<p align=\"center\">";
         echo "<div class=\"box_cen\" align=\"center\">";
      echo "<b>I dislike this profile</b>";
     echo "<div class=\"box_sub\" align=\"left\">";
    $dislikeswho = getuid_sid($sid);
    setaction($uid, "$dislikeswho being disliked");
    $stampiti = mysql_fetch_array(mysql_query("SELECT dislike FROM ibwf_users WHERE id='$likeswho'"));
    
    mysql_query("UPDATE ibwf_users SET dislike='$stampit' WHERE id='$dislikeswho'");
    $dislikeswho = $_REQUEST["who"];
    
    mysql_query("UPDATE ibwf_users SET dislikes=dislikes+1 WHERE id='$dislikeswho'");
    $dislikenick = getnick_sid($sid);
    $msg = "ahw $dislikenick dont like your profile!!! U better go and improve it....[br/][small][i]p.s: this is an automated pm[/i][/small]";
    autopm($msg, $givewho);
    print "You have now given your dislikes for this profile!</br>";
    
     $thid = mysql_fetch_array(mysql_query("SELECT themeid FROM ibwf_users WHERE id='".$uid."'"));
        $themeimageset = mysql_fetch_array(mysql_query("SELECT themedir FROM iconset WHERE id='".$thid[0]."'"));
        $unick = getnick_uid($who);
            include ("footer.php");
      echo "</p></div>";
    
    exit();
    }
    ///////////////////////////////////////////
    else if($action=="likeprof")
    {
    
    
    echo "<p align=\"center\">";
         echo "<div class=\"box_cen\" align=\"center\">";
      echo "<b>I like this profile</b>";
     echo "<div class=\"box_sub\" align=\"left\">";
    $likeswho = getuid_sid($sid);
    setaction($uid, "$likeswho being liked");
    $stampiti = mysql_fetch_array(mysql_query("SELECT likes FROM ibwf_users WHERE id='$likeswho'"));
    
    mysql_query("UPDATE ibwf_users SET likes='$stampit' WHERE id='$likeswho'");
    $likeswho = $_REQUEST["who"];
    
    mysql_query("UPDATE ibwf_users SET likes=likes+1 WHERE id='$likeswho'");
    $likenick = getnick_sid($sid);
    $msg = "congratulations $likenick has sent you his/her like for your profile today[br/][small][i]p.s: this is an automated pm[/i][/small]";
    autopm($msg, $givewho);
    print "You have now given your likes for this profile!";
    
     $thid = mysql_fetch_array(mysql_query("SELECT themeid FROM ibwf_users WHERE id='".$uid."'"));
        $themeimageset = mysql_fetch_array(mysql_query("SELECT themedir FROM iconset WHERE id='".$thid[0]."'"));
        $unick = getnick_uid($who);
            include ("footer.php");
      echo "</p></div>";
    
    exit();
    }
    SQL
    Code:
    ibwf_users
    
    like int 100 0
    dislike int 100 0
    ________________
    Jacques
    jacques@gw-designs.co.za
    http://coding.biz.tm
    Come join and lets make it a place to learn all the noobies how to code
    __________________

    NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

    #2
    How about for Topic??
    LESS TALK. LESS MISTAKE.

    HTTP://APPSROB.COM - LIST OF MY FACEBOOK APPS!

    Comment


      #3
      all the coding you need for topics is here ...all you have to do is copy and paste :P

      the only major update that needs doing is an extra table with uid and profile ids in it so people cant keep hitting like over and over again

      on the dislikes there is sql called dislikes and dislike ...think thats a typo
      Last edited by something else; 15.08.10, 17:35.

      Comment


        #4
        Nice share

        Comment


          #5
          @riderz bro? If anyone click like again n again ones profile then what will happen?

          Comment


            #6
            riderz i hv puted all codes in my script but there show some errors check
            ///////////////////////
            Fatal error: Call to undefined function setaction() in /home/wapcult/public_html/test/wap/index.php on line 432
            datz core error can u make core function plz

            Comment


              #7
              these like dislike profile codes are made by chainsaw..
              great confusion between like (likes) dislike (dislikes) ..

              sql are like and dislike instead in the code are made as likes and dislikes in ibf_users

              somebody has something about this function working right ?
              sigpicthe italian/international COMMUNITY of friendship
              http://people2000.netne.net
              WAP/WEB
              peoplemailbox@katamail.com

              Comment


                #8
                Originally posted by honkytonkman View Post
                these like dislike profile codes are made by chainsaw..
                great confusion between like (likes) dislike (dislikes) ..
                sql are like and dislike instead in the code are made as likes and dislikes in ibf_users
                somebody has something about this function working right ?
                rename ALL to like & dislike
                OR
                rename ALL to likes & dislikes

                how about that ?
                It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt.
                ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ !
                ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
                キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

                Comment


                  #9
                  done it but it don't work..for this reason i 'm gonna search an alternative working code..if i 'll be able to doit i didn't have problem..doing it by myself
                  sigpicthe italian/international COMMUNITY of friendship
                  http://people2000.netne.net
                  WAP/WEB
                  peoplemailbox@katamail.com

                  Comment


                    #10
                    this function, you can vote once every seven days, as is set to vote only once?
                    $timeout = $actime[0] + (7*24*60*60);

                    if(time()<$timeout)

                    Comment


                      #11
                      (7*24*60*60) =7 days..
                      (15*24*60*60) =15 days

                      easy like drinkin'a glass of water..
                      sigpicthe italian/international COMMUNITY of friendship
                      http://people2000.netne.net
                      WAP/WEB
                      peoplemailbox@katamail.com

                      Comment


                        #12
                        your better off doing the sum yourself rather than letting server do sum every time page is loaded (save some load time)
                        604800 = 7 days
                        1296000 = 15 days

                        Comment


                          #13
                          <_<the function is wrong, it is every 15 days, but like I wrote before is that they can vote only 1 time .. I can not set..
                          (99999999*24*60*60)

                          Comment

                          Working...
                          X