Profile Last View By...

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Profile Last View By...

    firstly..i want to say that i hv search but didnt found..so dont ask me to search..2ndly..anybody have that code share wit me plz..

    #2
    what script iv got a code let me c if i can find it
    Want something coded email me at sales@webnwaphost.com for a prices.




    Comment


      #3
      that shows it

      Code:
       $sqlthing = mysql_query("SELECT * FROM last WHERE username='$name'");
       $dt=(mysql_result($sqlthing,0,"date"));
         $by=(mysql_result($sqlthing,0,"who"));
      //echo "
      Profile Last Viewed At
      $dt";
      echo "
      Profile Last Viewed By: $by
      ";
      this updates it

      Code:
      sql2 = "UPDATE last SET who='$username' WHERE username='$name'";
      $result2 = mysql_query($sql2);
      
      
      
      
      $dt = date('Y-m-d H:i:s');
      $sql = "SELECT * FROM last where username='$name'";
      $result = mysql_query($sql);
      $number_of_rows = mysql_num_rows($result);
      if ($number_of_rows=="1")
      {
      $sql = "UPDATE last SET date='$dt' WHERE username='$name'";
      $result = mysql_query($sql);
      
      
      
      
      }
      if ($number_of_rows=="0")
      {
      
      $dt = date('Y-m-d H:i:s');
      
      $sql11 = "INSERT INTO last (username,date,who) VALUES
      ('$name','$dt','$username')";
      $result11 = mysql_query($sql11);
      }
      hope this works for you but it will need slite alteration to your specific script
      Want something coded email me at sales@webnwaphost.com for a prices.




      Comment


        #4
        ///////////index.php (viewuser)
        Code:
         $sqlthing = mysql_query("SELECT * FROM last WHERE username='$name'");
         $dt=(mysql_result($sqlthing,0,"date"));
           $by=(mysql_result($sqlthing,0,"who"));
        //echo "
        Profile Last Viewed At
        $dt";
        echo "
        Profile Last Viewed By: $by
        ";

        //////////where must iput this code?
        Code:
        sql2 = "UPDATE last SET who='$username' WHERE username='$name'";
        $result2 = mysql_query($sql2);
        $dt = date('Y-m-d H:i:s');
        $sql = "SELECT * FROM last where username='$name'";
        $result = mysql_query($sql);
        $number_of_rows = mysql_num_rows($result);
        if ($number_of_rows=="1")
        {
        $sql = "UPDATE last SET date='$dt' WHERE username='$name'";
        $result = mysql_query($sql);
        }
        if ($number_of_rows=="0")
        {
        
        $dt = date('Y-m-d H:i:s');
        
        $sql11 = "INSERT INTO last (username,date,who) VALUES
        ('$name','$dt','$username')";
        $result11 = mysql_query($sql11);
        }

        Comment


          #5
          under it
          Want something coded email me at sales@webnwaphost.com for a prices.




          Comment


            #6
            thats too long mate this is how i do mine
            Code:
            $wid = $_GET["wid"];
            
            $me = userid_sesid($sesid);
            
            
            
            $update = mysql_query("INSERT INTO mc_users SET last_view='".$me."' WHERE id='".$wid."'"));  
            //fetch last view
            $lv = mysql_fetch_array(mysql_query("SELECT last_view FROM mc_users WHERE id='".$wid."'"));
            
            echo "Last viewed by: ".nick_userid($lb[0]);

            R.M.C
            ----------
            PHP Adovocate B)

            Comment


              #7
              wut is the sql table for bcfc n mckeny coding?

              Comment


                #8
                wut is the sql table for bcfc n mckeny coding?[/b]

                Code:
                -- --------------------------------------------------------
                
                -- 
                -- Table structure for table `last`
                -- 
                
                CREATE TABLE `last` (
                  `username` varchar(30) NOT NULL default '',
                  `date` varchar(50) NOT NULL default '0000-00-00',
                  `who` varchar(30) NOT NULL default ''
                ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
                
                -- 
                -- Dumping data for table `last`
                -- 
                
                -- --------------------------------------------------------
                Want something coded email me at sales@webnwaphost.com for a prices.




                Comment


                  #9
                  thats too long mate this is how i do mine
                  Code:
                  $wid = $_GET["wid"];
                  
                  $me = userid_sesid($sesid);
                  $update = mysql_query("INSERT INTO mc_users SET last_view='".$me."' WHERE id='".$wid."'"));  
                  //fetch last view
                  $lv = mysql_fetch_array(mysql_query("SELECT last_view FROM mc_users WHERE id='".$wid."'"));
                  
                  echo "Last viewed by: ".nick_userid($lb[0]);
                  [/b]

                  if your using lavalair its best for yu 2 use the code mckeny gave ya as its been coded for it wer as my code came from my script
                  Want something coded email me at sales@webnwaphost.com for a prices.




                  Comment


                    #10
                    wat about a list of the last 10 users who view ur profile?

                    am gonna code it....

                    Comment


                      #11
                      wat about a list of the last 10 users who view ur profile?

                      am gonna code it....[/b]
                      too easy
                      add these two new fields in ibwf_users
                      Code:
                      lastview int(100) NOT NULL default '0'
                      ltime int(100) NOT NULL default '0'
                      in index.php under $action=="viewuser"
                      Code:
                      $lv= getuid_sid($sid);
                      $tm = time();
                      mysql_query("INSERT INTO ibwf_users SET lastview='".$lv."',ltime='".$tm."' WHERE uid='".$who."'")); 
                      $sql = (mysql_query("SELECT lastview,ltime FROM ibwf_users WHERE uid='".$who."' ORDER BY ltime DESC LIMIT 10"));
                      while($row = mysql_fetch_array($sql)){
                      echo "Last viewed by: ".getnick_uid($row[0]);
                      $newtime =$row[1]+(6 *60 *60); 
                      echo ".date("D d M y - H:i:s",$newtime).
                      ";
                              echo "------------
                      ";
                      
                      }

                      Comment


                        #12
                        This Cod not Work

                        Comment


                          #13
                          if thats for the last ten viewer that definitely wouldn't work you would have to create a complete new table... if its regarding alexim question thats still too long check how short mine is...

                          R.M.C
                          ----------
                          PHP Adovocate B)

                          Comment


                            #14
                            Code:
                            mysql_query("INSERT INTO ibwf_users SET lastview='".$lv."',ltime='".$tm."' WHERE uid='".$who."'"));
                            Here is error!Look Parse error: syntax error, unexpected ')' in /home2/lidijama/public_html/proba/index.php on line 2434

                            Comment


                              #15
                              Code:
                              mysql_query("INSERT INTO ibwf_users SET lastview='".$lv."',ltime='".$tm."' WHERE uid='".$who."'"));
                              Here is error!Look Parse error: syntax error, unexpected ')' in /home2/lidijama/public_html/proba/index.php on line 2434[/b]
                              Ha ha, this shall work:
                              Code:
                              mysql_query("INSERT INTO ibwf_users SET lastview='".$lv."',ltime='".$tm."' WHERE uid='".$who."'");
                              Advertise your mobile site for FREE with AdTwirl

                              Comment

                              Working...
                              X