One of the things I find useful as both a staffer and a member is having a list of all my subscribed topics displayed on every page. This means I get an update on every thread whenever I log in and it means that I don’t need to manually keep a list updated.
In jcink, we can do this with load(). This is exactly as it implies, it lets you load information from another webpage. To mitigate server load (and prevent your site from getting in trouble for resource usage), we bind load to a button. This means that your user needs to click on the button to see their subbed threads.
Since this button only needs to be used by members, I hide it from guests to prevent curious visitors from making pointless requests of the server. I presume you know how to hide something based on usergroup, so I’ll focus on the code for the Auto Thread Tracker.
Put the following HTML where you want it.
<a href="#threads" id="button-tracker">Thread Tracker</a> <div id="threads"> <div id="thread-container"> </div> </div>
Put the following script just before the closing </body> in your board wrapper.
<script> $(document).ready(function(){ $("#button-tracker").click(function(){ // first we prevent the page jump that happens when you have a hashtag in your link event.preventDefault(); // now we load the good stuff $("#thread-container").load("https://kit89.jcink.net/index.php?act=UserCP&CODE=26 .tableborder > table > tbody > tr:not(:first-of-type)"); }); }); </script>
Use CSS to hide the bits that you don’t want! For example:
div#thread-container tr:first-child, div#thread-container tr:last-child, div#thread-container tr td:first-child, div#thread-container tr td:nth-child(3), div#thread-container tr td:nth-child(4), div#thread-container tr td:nth-child(6) { display: none }
Will produce:
This is how it looks on my site!
I hope that this is for useful for someone! I find it very helpful for staying on top of my threads.
- 1
- 1