MyBB Community Forums

Full Version: Generate spreadsheet join date & first post date
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can I automatically generate a spreadsheet based on my forum’s membership with these columns:
  • Member
  • Join Date
  • First Post

What I am after is this:
Cell 1 of row 1 of column 1 would contain the member name.
Cell 2 of row 1 of column 2 would contain the member join date.
Cell 3 of row 1 of column 3 would contain the member first post date.

If anyone can suggest a better place to post this I will ask mod to move it. Thank you for your help.
user name and join date can be easily exported from your server's database manager (eg. phpMyAdmin)
getting the date of first post appears to be a difficult task.
...................
Edit : below SQL Query should work and result can be exported to a CSV file

SELECT u.uid, u.username, FROM_UNIXTIME( u.regdate ) AS  "Join Date", FROM_UNIXTIME( m.dateline ) AS  "First Post"
FROM  `mybb_users` AS u

INNER JOIN (
SELECT uid, dateline
FROM  `mybb_posts` 
GROUP BY uid
ORDER BY dateline
)m ON u.uid = m.uid
ORDER BY uid ASC 
php file is attached with above content. can be used from forum directory where global.php file exists.
[attachment=29129]