No duplicate Nickname

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

    help No duplicate Nickname

    hey guys i have a small problem with last 10 viewers in profile list..

    i have this code in list:
    PHP Code:
      echo "<p class="secd"><u>$whonick - My Profile Viewers:</u>\n";
      echo 
    "<br/>";
      echo 
    "</div>";

      echo 
    "<p align="center">";

        
    //////ALL LISTS SCRIPT <<

        
    if($page=="" || $page<=0)$page=1;
        
    $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_lastview WHERE whonick='".$who."'")); //changable
        
    $num_items $noi[0];
        
    $items_per_page10;
        
    $num_pages ceil($num_items/$items_per_page);
        if((
    $page>$num_pages)&&$page!=1)$page$num_pages;
        
    $limit_start = ($page-1)*$items_per_page;

    $sql "SELECT lastview,ltime FROM ibwf_lastview WHERE whonick='".$who."'ORDER BY ltime DESC LIMIT $limit_start$items_per_page ";

        echo 
    "<div>";
        
    $items mysql_query($sql);
        echo 
    mysql_error();
        if(
    mysql_num_rows($items)>0)
        {
        while (
    $item mysql_fetch_array($items))
        {
      
    $snick getnick_uid($item[0]);

      if(
    isonline($item[0]))
      {
        
    $iml "<img src="images/onl.gif" alt="+"/>";
      }else{
        
    $iml "<img src="images/ofl.gif" alt="-"/>";
      }

    $lnk "<a href="index.php?action=viewuser&amp;sid=$sid&amp;who=$item[0]">$snick</a><br/>";
    $newtime =$item[1]+(*60 *60);
    $dte "".date("D d M y - h:i:s a",$newtime)."<br/>";
    echo 
    "$iml $lnk $dte<br/>";
    }

    and this code in profile view:

    PHP Code:
    $lv=getuid_sid($sid);
    $me getuid_sid($sid);
    if (
    $me != "$who")
    {
    mysql_query("INSERT INTO ibwf_lastview SET lastview='".$lv."', whonick='".$who."', ltime='".time()."'");
    }
      
    $sqlmysql_fetch_array(mysql_query("SELECT lastview,ltime FROM ibwf_lastview WHERE whonick='".$who."'ORDER BY ltime DESC LIMIT 1"));
      
    $a getuid_sid($sql[0]);
      
    $tm time();
      
    $timeout $tm 86400//time out = 1 day
      
    mysql_query("DELETE FROM ibwf_lastview WHERE ltime <'".$timeout."'"); 
    my problem is: If USER A visit my profile 10 times i show him 10 times in this list.
    how i can have the most recent viewer by the USER A in only 1 result and not in all 10?

    Thanks for help
    Last edited by sweetangel; 21.01.17, 19:04.
    if like my post click:

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

    #2
    try this
    Code:
    $lv=getuid_sid($sid);
    $me = getuid_sid($sid);
    if ($me != "$who")
    {
    mysql_query("INSERT IGNORE INTO ibwf_lastview SET lastview='".$lv."', whonick='".$who."', ltime='".time()."'");
    }
      $sql= mysql_fetch_array(mysql_query("SELECT lastview,ltime FROM ibwf_lastview WHERE whonick='".$who."'ORDER BY ltime DESC LIMIT 1"));
      $a = getuid_sid($sql[0]);
      $tm = time();
      $timeout = $tm - 86400; //time out = 1 day
      mysql_query("DELETE FROM ibwf_lastview WHERE ltime <'".$timeout."'");
    Creator of
    Epix.Mobi

    Keep an Eye on us Big things coming soon!!!!
    Need something for your site hit me up here

    http://coding-talk.com/forum/main-fo...r-your-wapsite

    Comment


      #3
      hey guys i need some help i am trying to get a code for my php site chat.php that will allow you to next pages in the chatroom to view old messages and also allow the message to stay in long enough it's the basic chat.php file can anyone help?

      Comment

      Working...
      X