1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Latest Member:

Discussion in 'Troubleshooting and Problems' started by emma57573, Sep 1, 2012.

  1. emma57573

    emma57573 Member

    Hi this is a quick one (I hope)
    I have an external registration process that Ive built so that any new users are automatically registered to the forum.

    However I have a tiny bug in that when a new user registers externally the 'latest member' on the forum fails to update.
    I get the member numbers updating but not the username of the latest member.

    Ive figured this must be in the database somewhere and I need to write to it on my registration script. But where? Ive searched high and low :) If its not and is a script somewhere that i need to adapt where can i find it?
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    That statistic is updated by a cron that runs every 10 minutes. It should update automatically if you wait.

    This is the code that queries the latest user:


    	public function getLatestUser()
    		return $this->_getDb()->fetchRow($this->limitQueryResults('
    			SELECT *
    			FROM xf_user
    			WHERE user_state = \'valid\'
    				 AND is_banned = 0
    			ORDER BY register_date DESC
    		', 1));
    Note that it only fetches 'valid' users who are not banned.

    And that runs every 10 minutes via this cron:

    Admin CP -> Tools -> Cron Entries -> Rebuild Board Totals Counter
  3. emma57573

    emma57573 Member

    Ok thanks, was looking in completely the wrong place for this! The issue must be something to do with how I've imported the users register date. I noticed this morning that I am getting one new update a day so must be to do with the time. Will investigate thanks
  4. emma57573

    emma57573 Member

    Yes it was, quick fix when you know where to look thanks :)

Share This Page