![]() |
Testing for user never posted?
I'm working on a mod in attachment.php
I know $vbulletin->userinfo['posts'] could be '0' (zero) even if a user has posted before but their posts were deleted or are in a forum that doesn't count posts. What's the best way to test if a user has never posted before? Would testing $vbulletin->userinfo['lastpost'] work? If they have never posted before would this value be NULL or '0' (zero)? Or is there a better way to definitively test if a user has never even tried to make a single post in the past? Thanks for your help, James |
None of those will actually work, since in theory a user could have posted and have had all their posts hard deleted in which case no record of any posts will exist. Short of changing the db by adding a field to user which is a boolean that gets set when they first make a post.
|
Quote:
And what would be the value of $vbulletin->userinfo['lastpost'] after a user's posts have been hard deleted? Maybe I can find a compromise that would work. Thanks, James --------------- Added [DATE]1363145263[/DATE] at [TIME]1363145263[/TIME] --------------- Okay. I did some testing and found something that should work for me. When a user firsts posts the value for $vbulletin->userinfo['lastpost'] changes from '0' to a unix timestamp. Even if that post gets hard deleted, the value of $vbulletin->userinfo['lastpost'] will not revert to '0'. It stays set to the last updated unix timestamp. This seems to be an option for testing if a user has never posted: PHP Code:
|
All times are GMT. The time now is 10:00 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|