By mrwhizkid on
I have searched for this over the past week or two and I can' find any information about it. I have seen it implemented on one site but I can't figure out how to do it.
How can I list (on a user profile for example), how many times a particular user has had content promoted to the front page.
Like: Kevin's content has been promoted to the front page 5 times
Thanks for any suggestions on how to do this. I was thinking Views but I don't see any counting mechanism...so I guess a PHP snippet?
Comments
^
Create a View on node table. name it "user_promoted_count"
Add an argument for user: ID
Add a filter to check if node is promoted.
Add an NID field (we are not going to show this View to the user).
Enable PHP Filter module (unfortunately).
Following code (not tested. may be some errors ?)
Get user object as $userobject.
To get logged in user's details, replace following code, without php tags,in above snippet and then change "$userobject" text to "$user"
To get user ID of the currently viewing user profile,
:)
What's new and changing in PHP 8.4
Wow. Thanks! I'll try this
Wow. Thanks! I'll try this out in the next few days and report back on how it goes. Looks good though.