Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By hmdnawaz on
Hi i want to create a block using hook_block. Which will display top posters of discussion forums.
Any one who can write code for me? Thanks
Comments
hook_block
I want to retrieve users
I want to retrieve users from the database who are the top posters in forum discussion but using nodeapi or node_load function.
Ahmad Nawaz
Acquia Certified Developer
Email: hmdnawaz@gmail.com
Skype: hmdnawaz
This would get top 5 posters
This would get top 5 posters and top 5 commenters and table them. You'd probably want to add some lime limit, too.
Within the block, you would use
Disclaimer: I tested only the SQL part, so there may be some silly mistake within PHP part.
BUt Without queries
But i want top 5 posters without using sql queries. Using nodeapi or Variable_get() or any other method but not with queries.
Ahmad Nawaz
Acquia Certified Developer
Email: hmdnawaz@gmail.com
Skype: hmdnawaz