2013-05-16, 07:08 PM
Hi All
This plugin generates an attractive table with the "top" threads in different periods of time, like the top of the day, of the week, of the month, of the year and top overall. The plugin creates a thumbnail taken from the image found on the first post of the thread, and reuses it for later views. If there is no image on the first post, it uses a generic image (inc/plugins/topposts/defaultImage.png).
When someone passes the mouse over the each top thread cell, a line is shown with the number of views, replies, thanks (if thanks/like plugin is enabled) and stars.
It shows a really attractive list of posts with images and with the title on the bottom with a bit transparent background.
I added the code to this GIT repository:
https://github.com/blogantinom/topposts
As it is, it takes in account the views, ratings, replies and the number of thanks (if installed) of the the thread to create the ranking. At the moment this math is hard-coded, but could be configurable in the future.
The plugin was based on the ProStats (1.7.7) (by SaeedGh), I ended up hardcoding a few things on the plugin, instead of the template. Help in refactoring this is highly welcome.
Improvements that can be done:
- Make it work on remote server (done)
- clean up the code (half done)
- Make the criteria configurable
- Configure periods (columns)
- Configure size of thumbnail.
- Make it more robust.
- Make the calls as a task, to be ran once at every X minutes, instead of call for every single viewer of the index page. (done)
- Cache the html to be reused (done)
Download it here:
http://forum.antinovaordemmundial.com/im...Plugin.zip
I would really appreciate if you guys could test it, and also be free to make suggestions. I don't recommend to use it on a production server, as it made mine hang the requests of the index. It was fixed disabling the plugin on the configuration.
I would like to thank @SaeedGh for his ProStats plugin, which help me a lot in making this plugin. Also thanks to Euan T, that helped me with regular expressions to find the images in the post.
I hope this plugin is useful for all.
Eco
The one known problem is that the task that updates the thumbnails and topposts table works only when called manually. If it is left to run by the schedule it creates broken tables. When ran by the task manager everything works fine.
This plugin generates an attractive table with the "top" threads in different periods of time, like the top of the day, of the week, of the month, of the year and top overall. The plugin creates a thumbnail taken from the image found on the first post of the thread, and reuses it for later views. If there is no image on the first post, it uses a generic image (inc/plugins/topposts/defaultImage.png).
When someone passes the mouse over the each top thread cell, a line is shown with the number of views, replies, thanks (if thanks/like plugin is enabled) and stars.
It shows a really attractive list of posts with images and with the title on the bottom with a bit transparent background.
I added the code to this GIT repository:
https://github.com/blogantinom/topposts
As it is, it takes in account the views, ratings, replies and the number of thanks (if installed) of the the thread to create the ranking. At the moment this math is hard-coded, but could be configurable in the future.
The plugin was based on the ProStats (1.7.7) (by SaeedGh), I ended up hardcoding a few things on the plugin, instead of the template. Help in refactoring this is highly welcome.
Improvements that can be done:
- Make it work on remote server (done)
- clean up the code (half done)
- Make the criteria configurable
- Configure periods (columns)
- Configure size of thumbnail.
- Make it more robust.
- Make the calls as a task, to be ran once at every X minutes, instead of call for every single viewer of the index page. (done)
- Cache the html to be reused (done)
Download it here:
http://forum.antinovaordemmundial.com/im...Plugin.zip
I would really appreciate if you guys could test it, and also be free to make suggestions. I don't recommend to use it on a production server, as it made mine hang the requests of the index. It was fixed disabling the plugin on the configuration.
I would like to thank @SaeedGh for his ProStats plugin, which help me a lot in making this plugin. Also thanks to Euan T, that helped me with regular expressions to find the images in the post.
I hope this plugin is useful for all.
Eco
The one known problem is that the task that updates the thumbnails and topposts table works only when called manually. If it is left to run by the schedule it creates broken tables. When ran by the task manager everything works fine.