Discussion Forum

Return of the Lost ...
 

Return of the Lost Likers

 

werdermouth
Site Creator Webmaster
Joined: 4 years ago
Posts: 560
Topic starter  

While I've been quite impressed with how the new Forum add-on software functions since I installed and configured it to run on Diasboro, there was one slightly annoying feature that I was keen to try and override at some point - i.e. the fact that only the names of the last three people who liked a post were displayed.

Unfortunately, the makers of the Forum software have no plans to add an option to allow sites to display all names as they argue it becomes unwieldly for large sites with many members. However, as you know by now, where there's a will there's always a way!

I looked into the matter during the previous international break and searched through the thousands of lines of code to see where and how this last three likers is produced. There were a number of functions across several files that handle this but wasn't sure what I needed to change - besides  'editing' the actual code in a Wordpress add-on is highly frowned upon as it could crash the site plus all changes made get overwritten and lost with each update.

So in the last break I did the sensible (though quite complicated) thing and installed Wordpress on my laptop that can run through software that acts as a local server (i.e. it works like a kind of local internet) and then made a local copy of the Diasboro site (also a bit complicated) so I could play around with adding some custom code. Basically, Wordpress stores all the content of posts, as well as information about who wrote what and who liked something in a database - the programming code then pulls out this data and adds formatting to display it in a browser.

OK, to cut a long story a bit shorter for those whose eyes have long since glazed over, I managed to find a way to override the code that the Forum software displays the likers and also discovered there's a method to hook custom code into functions while keeping it separate from the Forum add-on. It took me a bit of time to understand the concept as you can imagine the jargon used to explain it only usually succeeds in making it less understandable. It's bit like getting directions on a first-time holiday from someone who assumes you've lived in the local village all your life.

Anyway, you should now notice all posts contain all the names of those who like them - I added the number of likes for those over three so you can easily notice if someone new has liked it since the last time you looked.

 

This topic was modified 7 months ago by werdermouth

Selwynoz
Member
Joined: 12 months ago
Posts: 182
 

Definitely worth a like 🙂


ReplyQuote
Powmill-Naemore
Member
Joined: 1 year ago
Posts: 261
 
Posted by: @selwynoz

Definitely worth a like 🙂

And it definitely  works!


ReplyQuote
Share: