already like/dislike topic

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

    already like/dislike topic

    i already solve it.. please delete this topic
    Last edited by whitewingz; 29.01.11, 15:23.

    #2
    Originally posted by whitewingz View Post
    i already solve it.. please delete this topic
    so... why dont you share then ?
    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


      #3
      Originally posted by metulj View Post
      so... why dont you share then ?
      ok ill share it when i finish this error i think u can help me? like this

      when user not like or dislike the topic the link of like and dislike topic is visible right?

      and when the user already is hitted the like/dislike in topic the link in like and dislike must be not clickeble or it is visible only visible is the result like this..


      not hitted the like/dislike

      like(0) dislike(0)

      and already hitted

      like(1) dislike(0)


      this is my code that can base for it..

      $vdone = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_like WHERE uid='".$uid."' AND target='".$tid."'"));
      $nov = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_like WHERE target='".$tid."'"));
      $nov = $nov[0];
      if($vdone[0]>0)
      {
      $voted= true;
      }else{
      $voted = false;
      }
      $likes = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_like WHERE target='".$tid."' AND action='liketopic'")); //changable
      $dislikes = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_dislike WHERE target='".$tid."' AND action='disliketopic'")); //changable
      if($voted)
      {
      $lnk = "like($likes[0]]) dislike($dislikes[0])";
      }else{
      $lnk = "a href=\"index.php?do=liketopic&amp;tid=$tid&amp;sid =$sid\">Like($likes[0])</a> <a href=\"index.php?do=disliketopic&amp;tid=$tid&amp; sid=$sid\">Dislike($dislikes[0])</a>";
      }

      Comment


        #4
        PHP Code:
        $vdone mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_like WHERE uid='".$uid."' AND target='".$tid."'"));
        $nov mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_dislike WHERE uid='".$uid."' AND target='".$tid."'")); //changed to fetch dislikes of user
        if($vdone[0]>0||$nov[0]>0// added has user disliked ?
        {
        $votedtrue;
        }else{
        $voted false;
        }
        $likes mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_like WHERE target='".$tid."' AND action='liketopic'")); //changable
        $dislikes mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_dislike WHERE target='".$tid."' AND action='disliketopic'")); //changable
        if($voted)
        {
        $lnk "like($likes[0]) dislike($dislikes[0])"//removed extra ]
        }else{
        $lnk "<a href=\"index.php?do=liketopic&amp;tid=$tid&amp;sid=$sid\">Like($likes[0])</a> <a href=\"index.php?do=disliketopic&amp;tid=$tid&amp;sid=$sid\">Dislike($dislikes[0])</a>"//removed the 2 spaces that shouldnt be there next to both $sid and added missing < at start

        Last edited by something else; 29.01.11, 17:14.

        Comment

        Working...
        X