Discussion in 'Add-on Requests [Archive]' started by Miko, Oct 6, 2010.
Kier can you post your most liked post mod? Thank you
agree liked that mod that took what 5 minutes to make.
Where did he talk about it? I remember reading about it but I forget where it was.
I think it was in a "have you seen..." video.
Maybe this one http://xenforo.com/community/threads/creating-a-simple-modification.3532/page-5#post-56529
I have watched that video 2 times, he talks about a different mod related to the number of posts per page.
Here it is: http://xenforo.com/community/threads/playing-with-color.3798/
And the page: http://xenforo.com/community/likes-review
Alright, I have written down all the code that can be seen in the video.
The only part missing is the protected function '_getPostModel()' because Kier didn't scroll down far enough ( ) and (of course) the template file.
Take it and do whatever you want. There might be some typos in it, beware.
Nevermind, got it working. The template is the only missing thing right now.
Now I need to create that template. Easy.
Can we try it?
Not yet, let me finish the template.. At least a part of it.
Ok, sorry for interrupting you.
I got it working, see the attached file.
Import the *.xml and move the included directory 'LikeReview' into library/.
PLEASE NOTE: For educational purpose only. I copied Kier's code, it still belongs to him.
One small thing that's different from Kier's code:
I didn't want to create a custom option so I set the number of maxMostLikedPosts in the controller to be 10.
At least I thought that it would require a custom option, that's why I hardcoded it. Creating a custom option shouldn't be hard, just make sure it's called 'maxMostLikedPosts'.
Oh and you should update the template, for whatever reason the ordered list is displayed inline so that on the screenshot it looks kind of broken.
Well, at least I've learned something about XenForo.
On a different topic (but related to your screen shot)....
It is good to see how many people are quickly working on changing their XF style instead of the default colors.
Separate names with a comma.