Skip to:
Content
Pages
Categories
Search
Top
Bottom

req: most recent user / users online list for bottom of forum


  • Nola1974
    Participant

    @nolageek

    I’d like to have a user list at the bottom of the forum, like:

    10 registered user. Most recently registered: username3, username2, username1

    also, users online.

    I was trying to play with it, but kept breaking it.

Viewing 5 replies - 1 through 5 (of 5 total)

  • Shawn Maddock
    Participant

    @flutedrumr

    I was also looking for a user list, more for the purposes of a user directory. If no one else has had a go at this, I’ll mess around with it more this afternoon and let you know what I can hack together.


    adergaard
    Member

    @adergaard

    This is meant as help, not as condecending in any way.

    Best tip right now is to create one yourself.

    Do this (in psuedo code):

    – create a table that holds session_id, user_id, and timestamp.

    – add a hook for when any page is requested (or ugly way would be to add a call to a function in the header-template).

    – The function you call in the header should insert session_id, user_id, and timestamp if the session_id doesn’t already exist. if exist, update it instead. The function should also start by deleting rows older than X minutes (look at time stamp and compare to NOW() )

    – in footer file or where ever, make a call to another function you create that populates the values from the table holding session_id, user_id, and timestamp. The rows with a user_id != null -> logged on members. The rows with user_id == null, visitors.

    For the most recent user, add “SELECT * FROM bb_users ORDER BY user_registered DESC LIMIT 1”. Wrap it in a function and call it from the footer or where ever you want to display it.

    Done.


    Shawn Maddock
    Participant

    @flutedrumr

    adergaard, first of all, thanks for the suggestions. I think we’re talking about three different things. nolageek wanted a list of most recent registrations (similar to what shows on the dashboard, I assume, with less info); I was looking for a sortable list of all registered users, and the suggestions you posted would be a recent activity or “currently online”. Now that you mention it, though, I think I may add your ideas too. :-)


    Nola1974
    Participant

    @nolageek

    Thanks! I don’t take it as condecending at all. I’ll post what I come up with.


    Nola1974
    Participant

    @nolageek

    Uhg. I suck.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar