Like or Dislike Topics Code

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

    Like or Dislike Topics Code

    How to code this?

    I am using a lavalair script, Show the user who like and dislike the topic.
    LESS TALK. LESS MISTAKE.

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

    #2
    i got a code where u can like a persons profile
    ________________
    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

    Comment


      #3
      this code like facebook function for gallery pics / blogs.
      if like my post click:

      http://coding-talk.com/images/totall...ost_thanks.gif

      Comment


        #4
        Originally posted by sweetangel View Post
        this code like facebook function for gallery pics / blogs.
        Yeah, sweetangel.. is there Anyone can share this script?
        LESS TALK. LESS MISTAKE.

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

        Comment


          #5
          in ibwf_topics add 2 new rows `like`, `dislike`
          add a select option having like dislike options below the topic
          when user select like option use query select `like` from ibwf_topics where tid ( topicid)=$.....
          explode the `like` field of the sql using comma (,)
          search the uid in the exploded array using in_array()
          if uid exists you show message already liked by uid else implode the uid using comma (,) then update `like` with new imploded string where tid=$.....
          Same rule will be applied for `dislike`

          to show the `like` and `dislike` fetch the `like` or `dislike` where tid=$..... then explode `like` or `dislike` using comma (,)

          Comment


            #6
            Originally posted by rukiya View Post
            in ibwf_topics add 2 new rows `like`, `dislike`
            add a select option having like dislike options below the topic
            when user select like option use query select `like` from ibwf_topics where tid ( topicid)=$.....
            explode the `like` field of the sql using comma (,)
            search the uid in the exploded array using in_array()
            if uid exists you show message already liked by uid else implode the uid using comma (,) then update `like` with new imploded string where tid=$.....
            Same rule will be applied for `dislike`

            to show the `like` and `dislike` fetch the `like` or `dislike` where tid=$..... then explode `like` or `dislike` using comma (,)
            Thanks rukiya, can you code this for me?
            LESS TALK. LESS MISTAKE.

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

            Comment


              #7
              no .

              Comment


                #8


                Like this ?? thumb's up for coding it your self lol
                Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
                Visit: WapMasterz Coming Back Soon!
                _______
                SCRIPTS FOR SALE BY SUBZERO
                Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
                FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
                _______
                Info & Tips
                php.net
                w3schools.com

                Comment


                  #9
                  Just like that,
                  LESS TALK. LESS MISTAKE.

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

                  Comment


                    #10
                    Give me some idea about this function.
                    LESS TALK. LESS MISTAKE.

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

                    Comment


                      #11
                      Originally posted by robzky View Post
                      Give me some idea about this function.
                      Originally posted by rukiya View Post
                      in ibwf_topics add 2 new rows `like`, `dislike`
                      add a select option having like dislike options below the topic
                      when user select like option use query select `like` from ibwf_topics where tid ( topicid)=$.....
                      explode the `like` field of the sql using comma (,)
                      search the uid in the exploded array using in_array()
                      if uid exists you show message already liked by uid else implode the uid using comma (,) then update `like` with new imploded string where tid=$.....
                      Same rule will be applied for `dislike`
                      to show the `like` and `dislike` fetch the `like` or `dislike` where tid=$..... then explode `like` or `dislike` using comma (,)
                      all idea you need...
                      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


                        #12
                        pls code tnx..tnx..tnx..

                        Comment


                          #13
                          ive already posted the code go look at my topic in coding zone
                          ________________
                          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

                          Comment


                            #14
                            Code:
                            else if($action=="like")
                            {
                                $who = $_GET["who"];
                                $wnick = getnick_uid($who);
                                 addonline(getuid_sid($sid),"Ocenjuje profil","");
                              echo "<card id=\"main\" title=\"ocena profila\">";
                            
                                echo "<p align=\"center\">";
                                echo "Njima se   dopada <a href=\"index.php?action=viewuser&amp;who=$who&amp;sid=$sid\">$wnick</a> Profil...";
                                echo "</p>";
                                //////ALL LISTS SCRIPT <<
                                
                                if($page=="" || $page<=0)$page=1;
                                $noi = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_rate WHERE target='".$who."' AND action='likeprof'")); //changable
                                $num_items = $noi[0];
                                $items_per_page= 10;
                                $num_pages = ceil($num_items/$items_per_page);
                                if(($page>$num_pages)&&$page!=1)$page= $num_pages;
                                $limit_start = ($page-1)*$items_per_page;
                            
                                //changable sql
                            
                                    $sql = "
                                    SELECT a.uid, b.name
                                    FROM ibwf_rate a INNER JOIN ibwf_users b ON a.uid = b.id
                                    WHERE a.target='".$who."' AND a.action='likeprof'
                                    ORDER BY a.actime DESC LIMIT $limit_start, $items_per_page
                                    ;";
                            
                            
                                echo "<p><small>";
                                $items = mysql_query($sql);
                                echo mysql_error();
                                if(mysql_num_rows($items)>0)
                                {
                                while ($item = mysql_fetch_array($items))
                                {
                            
                                  $lnk = "<a href=\"index.php?action=viewuser&amp;who=$item[0]&amp;sid=$sid\">$item[1]</a>";
                                  echo "$lnk<br/>";
                                }
                                }
                                echo "</small></p>";
                                echo "<p align=\"center\">";
                                if($page>1)
                                {
                                  $ppage = $page-1;
                                  echo "<a href=\"index.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">&#171;</a> ";
                                }
                                if($page<$num_pages)
                                {
                                  $npage = $page+1;
                                  echo "<a href=\"index.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">&#187;</a>";
                                }
                                if($num_pages>1)
                                {
                                echo "<br/>$page/$num_pages<br/>";
                                }
                                if($num_pages>2)
                                {
                                  $rets = "Idi na stranu<input name=\"pg\" format=\"*N\" size=\"3\"/>";
                                    $rets .= "<anchor>[IDI]";
                                    $rets .= "<go href=\"index.php\" method=\"get\">";
                                    $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                                    $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                                    $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                                    $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                                    $rets .= "</go></anchor>";
                            
                                    echo $rets;
                                }
                                echo "</p>";
                              ////// UNTILL HERE >>
                                echo "<p align=\"center\">";
                                    echo "<a href=\"index.php?action=main&amp;sid=$sid\">$glavna";
                            echo "HAPPY</a>";
                              echo "</p>";
                                echo "</card>";
                            }
                            else if($action=="dislike")
                            {
                                $who = $_GET["who"];
                                $wnick = getnick_uid($who);
                                 addonline(getuid_sid($sid),"Ocenjuje profil","");
                              echo "<card id=\"main\" title=\"ocena profila\">";
                            
                                echo "<p align=\"center\">";
                                echo "Njima se ne  dopada <a href=\"index.php?action=viewuser&amp;who=$who&amp;sid=$sid\">$wnick</a> Profil...";
                                echo "</p>";
                                //////ALL LISTS SCRIPT <<
                                
                                if($page=="" || $page<=0)$page=1;
                                $noi = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_rate WHERE target='".$who."' AND action='dislikeprof'")); //changable
                                $num_items = $noi[0];
                                $items_per_page= 10;
                                $num_pages = ceil($num_items/$items_per_page);
                                if(($page>$num_pages)&&$page!=1)$page= $num_pages;
                                $limit_start = ($page-1)*$items_per_page;
                            
                                //changable sql
                            
                                    $sql = "
                                    SELECT a.uid, b.name
                                    FROM ibwf_rate a INNER JOIN ibwf_users b ON a.uid = b.id
                                    WHERE a.target='".$who."' AND a.action='dislikeprof'
                                    ORDER BY a.actime DESC LIMIT $limit_start, $items_per_page
                                    ;";
                            
                            
                                echo "<p><small>";
                                $items = mysql_query($sql);
                                echo mysql_error();
                                if(mysql_num_rows($items)>0)
                                {
                                while ($item = mysql_fetch_array($items))
                                {
                            
                                  $lnk = "<a href=\"index.php?action=viewuser&amp;who=$item[0]&amp;sid=$sid\">$item[1]</a>";
                                  echo "$lnk<br/>";
                                }
                                }
                                echo "</small></p>";
                                echo "<p align=\"center\">";
                                if($page>1)
                                {
                                  $ppage = $page-1;
                                  echo "<a href=\"index.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">&#171;</a> ";
                                }
                                if($page<$num_pages)
                                {
                                  $npage = $page+1;
                                  echo "<a href=\"index.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">&#187;</a>";
                                }
                                if($num_pages>1)
                                {
                                echo "<br/>$page/$num_pages<br/>";
                                }
                                if($num_pages>2)
                                {
                                  $rets = "Idi na stranu<input name=\"pg\" format=\"*N\" size=\"3\"/>";
                                    $rets .= "<anchor>[IDI]";
                                    $rets .= "<go href=\"index.php\" method=\"get\">";
                                    $rets .= "<postfield name=\"action\" value=\"$action\"/>";
                                    $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                                    $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                                    $rets .= "<postfield name=\"who\" value=\"$who\"/>";
                                    $rets .= "</go></anchor>";
                            
                                    echo $rets;
                                }
                                echo "</p>";
                              ////// UNTILL HERE >>
                                echo "<p align=\"center\">";
                                    echo "<a href=\"index.php?action=main&amp;sid=$sid\">$glavna";
                            echo "HAPPY</a>";
                              echo "</p>";
                                echo "</card>";
                            }
                            
                            
                            else if($action=="dislikeprof")
                            {
                            
                            
                                addonline(getuid_sid($sid),"Ocenjuje profil","");
                              echo "<card id=\"main\" title=\"ocena profila\">";
                            echo "<p align=\"center\">";
                             echo "<b>Ne dopada ti se profil</b><br/>";
                            $dislikeswho = getuid_sid($sid);
                             $dislikeswho = $_REQUEST["who"];
                             $dislikenick = getnick_sid($sid);
                            $whonick=$_POST["whonick"];
                                    $who = $_GET["who"];
                                    $whonick = getnick_uid($who);
                            $byuid = getuid_sid($sid);
                             $tm = time();
                            
                            
                            
                            
                            $actime = mysql_fetch_array(mysql_query("SELECT actime FROM ibwf_rate WHERE uid='".$uid."' AND target='".$who."' ORDER BY actime DESC LIMIT 1"));
                                    $timeout = $actime[0] + (7*24*60*60);
                                    if(time()<$timeout)
                                    {
                                        echo "<img src=\"images/notok.gif\" alt=\"X\"/>Mozes samo jednom na svakih 7 dana oceniti ovaj profil.<br/><br/>";
                                    }else{
                                        if($uid==$who)
                                        {
                                            echo "<img src=\"images/notok.gif\" alt=\"X\"/>Glupo je ocenjivati sa sebe, zar ne ?<br/><br/>";
                                        }else{
                            
                            
                            $res = mysql_query("INSERT INTO ibwf_rate SET uid='".$uid."', action='".$action."', target='".$who."', actime='".time()."'");
                            
                            $res = mysql_query("INSERT INTO ibwf_obavestenja SET text='$dislikenick se ne  dopada  tvoj profil!!! Samo ti napreduj...  doci ce maca na vratanca...    [B] [br/][br/] ps. Ovo je automatska poruka i ne treba odgovarati na ovu poruku [/B]', byuid='".$byuid."', touid='".$who."', timesent='".$tm."'");
                            
                            if($res)
                              {
                            
                            
                            
                            
                            
                            
                                echo "<img src=\"../images/ok.gif\" alt=\"O\"/>";
                               echo "$whonick profil je ocenjen <br/>";
                              }
                              }
                              }
                            
                            
                             echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
                            echo "HAPPY</a><br/>";
                            echo "</p>";
                                echo "</card>";
                            
                            
                            }
                            ///////////////////////////////////////////
                            else if($action=="likeprof")
                            {
                            
                            
                            
                              addonline(getuid_sid($sid),"Ocenjuje profil","");
                              echo "<card id=\"main\" title=\"ocena profila\">";
                            echo "<p align=\"center\">";
                              echo "<b>Dopada ti se profil</b><br/>";
                             $likeswho = getuid_sid($sid);
                             $likeswho = $_REQUEST["who"];
                             $likenick = getnick_sid($sid);
                            $whonick=$_POST["whonick"];
                                    $who = $_GET["who"];
                                    $whonick = getnick_uid($who);
                            $byuid = getuid_sid($sid);
                             $tm = time();
                            
                            $actime = mysql_fetch_array(mysql_query("SELECT actime FROM ibwf_rate WHERE uid='".$uid."' AND target='".$who."' ORDER BY actime DESC LIMIT 1"));
                                    $timeout = $actime[0] + (7*24*60*60);
                                    if(time()<$timeout)
                                    {
                                        echo "<img src=\"images/notok.gif\" alt=\"X\"/>Mozes samo jednom na svakih 7 dana oceniti ovaj profil.<br/><br/>";
                                    }else{
                                        if($uid==$who)
                                        {
                                            echo "<img src=\"images/notok.gif\" alt=\"X\"/>Glupo je ocenjivati sa sebe, zar ne ?<br/><br/>";
                                        }else{
                            
                            $res = mysql_query("INSERT INTO ibwf_obavestenja SET text='$likenick se  dopada  tvoj profil!!! To je jos jedan razlog  vise  da i dalje napredujes ...    [B] [br/][br/] ps. Ovo je automatska poruka i ne treba odgovarati na ovu poruku [/B]', byuid='".$byuid."', touid='".$who."', timesent='".$tm."'");
                            $res = mysql_query("INSERT INTO ibwf_rate SET uid='".$uid."', action='".$action."', target='".$who."', actime='".time()."'");
                            
                            if($res)
                              {
                            
                            
                            
                            
                            
                            
                                echo "<img src=\"../images/ok.gif\" alt=\"O\"/>";
                               echo "$whonick profil je ocenjen <br/>";
                              }
                            }
                            }
                            
                             echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
                            echo "HAPPY</a><br/>";
                            echo "</p>";
                                echo "</card>";
                            
                            
                            
                            }
                            in wievuser profile add this
                            echo "<u><b>Oceni ovaj profil</b></u><br/>";
                            $likes = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_rate WHERE target='".$who."' AND action='likeprof'")); //changable
                            $dislikes = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_rate WHERE target='".$who."' AND action='dislikeprof'")); //changable

                            echo "<a href=\"index.php?action=like&amp;who=$who&amp;sid= $sid\">$likes[0]</a>--- <a href=\"index.php?action=likeprof&amp;who=$who&amp; sid=$sid\"><img src=\"images/like.PNG\" alt=\"OK profil\"/></a>---";
                            echo "<a href=\"index.php?action=dislikeprof&amp;who=$who&a mp;sid=$sid\"><img src=\"images/dont.PNG\" alt=\"Los profil\"/></a>---<a href=\"index.php?action=dislike&amp;who=$who&amp;s id=$sid\">$dislikes[0]</a><br/>";
                            SQL
                            CREATE TABLE IF NOT EXISTS `ibwf_rate` (
                            `id` int(100) NOT NULL AUTO_INCREMENT,
                            `uid` int(100) NOT NULL DEFAULT '0',
                            `action` varchar(100) NOT NULL DEFAULT '',
                            `target` int(100) NOT NULL DEFAULT '0',
                            `actime` int(100) NOT NULL DEFAULT '0',
                            PRIMARY KEY (`id`)
                            ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
                            this Serbian language.. translate to english
                            Attached Files
                            Last edited by srecnica; 17.08.10, 13:45.
                            sigpichttp://happy.srecnica.com/web

                            Comment


                              #15
                              I dont need a code for profile, i need a code for topic.
                              LESS TALK. LESS MISTAKE.

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

                              Comment

                              Working...
                              X