adergaard (@adergaard)

Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • actually, the display_name and user_nicename columns already exist in the bb_users table in bbpress.

    So my question is still, how come they are not used? Is there a plan for using them later and have they been added already for future use in accordance with what I wrote in my first post above?

    Thanks for any info on this.

    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.

    Great.

    Yes that would work. Thanks much.

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