New account registrations are disabed. This website is now an archive. Read more here.

Recent Activity module is up!

Snapshot    Posted April 1, 2020

    Aloha amigos. 🤣

    The first iteration of the Recent Activity sidebar thingy is up! A little project I started during lockdown.

    Why is this a big deal?

    Great question, albeit a little bit rude. Firstly, there's a lot of content types here at GDU and people will only go to one place to see what's new. As per the image above, you can see the same list on both the homepage and forum board index. Secondly, well it's a little bit complex to make.

    How I made it

    I wanted to post this to give you guys an insight into how I build these things, since there's not so much other activity on the site at the moment.

    • Getting the data: There are three separate queries to the DB made just to get the different content types. These are forum posts, website posts (refinery, games, game blogs) and comments for refinery, game and blog posts. I know 3 queries is a bit inefficient and maybe I could potentially build one giant single query, but this works ok and since it's an ajax call, there's no speed penalty on page loads.
    • Formatting the data: The content stuff is obviously from 3 different sources, but it all needs to flow into the same list. For this, I simply made a function which adds items to an array in an identical format. You can kind of see what I mean in my previous post.
    • Implementation on the forums and website: This one is slightly tricky, but really fundamental. The integration system, which I wrote from scratch, flows from the Forums to the website CMS. That is to say that the CMS can use most stuff from the forums, but the forums have nothing from the CMS. This means that the styling was built from CSS classes borrowed from the Forums, and any custom styles (which is just the colourful labels) is inline. Because I get the output from an ajax call to the CMS (all my custom code is written in the CMS), I can very easily use this anywhere across the forums or CMS.

    This isn't important! Work on something important, you filthy swine.

    Another rude statement from you, but I take your point. The most important function that the site doesn't have is the ability to actually post new content. This is a chicken and egg thing, really. If you post in one of the content sections, say a new game or blog post, then you'll want someone to see it. This had to come now or immediately after those content submission functions are done.

    I am still mulling over methodology for that, and I'm not sure when I'll have the time. Soon, I hope. Still 3 weeks of lockdown left so we'll see…. 🙂

    Leave a Reply


    Marked

    • about 5 years ago

    Stats

    843 views

    0 comments

    Tags

    No tags.