• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Kier can you post your most liked post mod?

dmnkhhn

Active member
#7
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 ( :D) and (of course) the template file.

Take it and do whatever you want. There might be some typos in it, beware. :)

Edit:
Nevermind, got it working. The template is the only missing thing right now. :)

Edit 2:
Now I need to create that template. Easy. ;)
 

CyberAP

Well-known member
#8
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 ( :D) and (of course) the template file.

Take it and do whatever you want. There might be some typos in it, beware. :)

Edit:
Nevermind, got it working. The template is the only missing thing right now. :)

Edit 2:
Now I need to create that template. Easy. ;)
Can we try it? :)
 

dmnkhhn

Active member
#11
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.


Edit:
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.
 

Attachments