moot

Open full view…

Custom landing page - Troubles with post count script

Flashover
Mon, 25 Jun 2018 04:28:08 GMT

Hey there. i'm trying to set up a custom landing page, what variables need to be changed in order to retrieve post counts? Currently my script is : <script src="https://muut.com/common/js/jquery-1.11.2.min.js"></script> --- <script> // fetch post counts var url = 'https://api.muut.com/postcounts?'; $('li').map(function() { url += '&path=/flashover/' + $(this).attr('channel'); }) $.getJSON(url, function(json) { $.each(json, function(path, data) { var key = path.replace('/flashover/', '') $('[channel="' + key + '"] i').text(data.size) }) }) // make items clickable $('li').click(function() { location.href = 'custom-headers.html#!/' + $(this).attr('channel') }) </script> --- But that returns 0 for all post counts?

Flashover
Mon, 25 Jun 2018 04:30:53 GMT

It also seems to be dropping the heading to a new line? [Offset](//muut.com/u/moot/s1/:moot:ncEU:offset.jpg.jpg)

Monika
Mon, 25 Jun 2018 05:51:34 GMT

It looks like the restful postcounts method is only tracking replies and not threads. I'll check in on that and see if I can't come up with a reason why and/or a fix. Regarding dropping a heading to a new line? I'm not sure I follow

Flashover
Mon, 25 Jun 2018 06:18:34 GMT

Thanks, Monkia. :) I'm running the same code you have in your demo / example code, which shows the channel name and the count to the right. My code Shows the code figure, then it is dropping the channel name to a new line - see my screenshot.

Monika
Tue, 26 Jun 2018 21:02:32 GMT

It's really hard to say what's causing that without seeing it. That's usually the case with CSS issues

Flashover
Wed, 27 Jun 2018 09:51:51 GMT

Any feedback on the API?

Monika
Thu, 28 Jun 2018 01:52:51 GMT

No word on why the API is doing that just yet. We're still doing some research