ForumSpark Support

support.forumspark.net

Official support and community forum for ForumSpark. Access announcements, troubleshooting, customization help, extension development, theme resources, and platform updates.

205 members 717 topics 3K replies
S Sarahkik ·Introductions ·1 year ago
Heya!

Hey everyone, how's it going? :)

6 replies 499 Read more →
Jamie ·Themes & Extensions ·1 year ago
Panels & Collapsible Panels

Wasn't sure whether or not to post this in Theme Dev help or Extensions Directory. Figured it's more appropriate for here.

With this code you can create something similar to this:

You can add this code in your Board Templates or in the Theme Layout wherever you want the panel to appear. You can add this as many times as you like, just make sure you change the name in the collapsible version.

<div class="panel">
    <div class="panel__title">
        <h2>Custom Panel</h2>
    </div>
    <div class="panel__content">
         Add whatever you like 🤷‍♀️
    </div>
    <div class="panel__footer"></div>
</div>

And if you want to make it collapsible you can jazz it up with this:

<div x-data="{collapsed: $persist(false).as('CUSTOM_PANEL_NAME')}" class="panel" :class="collapsed ? 'panel--collapsed' : ''">
    <div class="panel__title">
        <h2>Collapsable Panel</h2>
        <div class="panel__title__actions">
            <button type="button" class="btn btn-primary panel__expander" type="button" @click="collapsed = !collapsed">
                <template hidden x-if="collapsed">
                    <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
                         stroke="currentColor" class="icon">
                        <path stroke-linecap="round" stroke-linejoin="round" d="M12 6v12m6-6H6"/>
                    </svg>
                </template>
                <template hidden x-if="! collapsed">
                    <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
                         stroke="currentColor" class="icon">
                        <path stroke-linecap="round" stroke-linejoin="round" d="M18 12H6"/>
                    </svg>
                </template>
            </button>
        </div>
    </div>
    <div x-show="! collapsed" class="panel__content">
        Add whatever you like 🤷‍♀️
    </div>
    <div x-show="! collapsed" class="panel__footer"></div>
</div>

Make sure to replace CUSTOM_PANEL_NAME with a name of your choosing so that the state of whether the panel is open/closed can be saved correctly and not collide with another panel.

3 replies 80 Read more →
Jamie ·ForumSpark Headlines ·1 year ago
New Feature: Topic watchers

I've now implemented the ability for users to watch topics and be notified of replies.

For now, if you create a topic or reply to one, you are automatically subscribed to updates. If you wish to stop receiving updates, you can click the 'Unwatch' button next to the reply button on the topic page.

You can choose to watch a topic without replying, this is done by clicking the 'Watch' button next to the Add Reply button on the topic screen.

I intend to make it possible for you to reply to a topic without also subscribing but this was just the first step in a series of improvements to the notification system that I intend to make :)

As a small aside: I have now started to tag ForumSpark with version numbers to make Changelogs easier to see.

3 replies 484 Read more →
Cedric ·Themes & Extensions ·1 year ago
Extended Footer

Preview: https://prnt.sc/UqrDUGzopQXM

This code adds a footer to your forum. You can edit the styling as you please. If you need help, don't hesitate to create a topic in the support forum.

Themes > Edit Layout > Copy & paste code at the bottom.

   <footer style="background-color: #f8f9fa; padding: 20px 0; border-top: 1px solid #ddd;">
  <div style="max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap;">

<!-- About Us Section -->
<div style="flex: 1 1 300px; padding: 10px;">
  <h3 style="font-size: 1.25rem; margin-bottom: 10px;">About Us</h3>
  <p style="font-size: 0.9rem; line-height: 1.5; color: #555;">
    Change this text to your community's vision, mission or information.
  </p>
</div>

<!-- Links Section 1 -->
<div style="flex: 1 1 150px; padding: 10px;">
  <h3 style="font-size: 1.25rem; margin-bottom: 10px;">Quick Links</h3>
  <ul style="list-style: none; padding: 0; font-size: 0.9rem; color: #555;">
    <li><a href="#" style="text-decoration: none; color: #007bff;">Home</a></li>
    <li><a href="#" style="text-decoration: none; color: #007bff;">Forums</a></li>
    <li><a href="#" style="text-decoration: none; color: #007bff;">Contact</a></li>
  </ul>
</div>

<!-- Links Section 2 -->
<div style="flex: 1 1 150px; padding: 10px;">
  <h3 style="font-size: 1.25rem; margin-bottom: 10px;">Resources</h3>
  <ul style="list-style: none; padding: 0; font-size: 0.9rem; color: #555;">
    <li><a href="#" style="text-decoration: none; color: #007bff;">Help Center</a></li>
    <li><a href="#" style="text-decoration: none; color: #007bff;">Terms of Service</a></li>
    <li><a href="#" style="text-decoration: none; color: #007bff;">Privacy Policy</a></li>
  </ul>
</div>

<!-- Logo Section -->
<div style="flex: 1 1 200px; text-align: center; padding: 10px;">
  <h3 style="font-size: 1.25rem; margin-bottom: 10px;">ForumSpark</h3>
  <div style="width: 100px; height: 100px; margin: 0 auto; background-color: #ddd; display: flex; align-items: center; justify-content: center; border-radius: 50%;">
    <span style="font-size: 0.9rem; color: #555;">Logo</span>
  </div>
</div>

  </div>
</footer>
1 reply 75 Read more →
Bryn ·Feedback ·1 year ago
View guests and bots on Users Online

It's natural to see members and guests/bots on the Users Online list as with every other forum platform and, it would make more sense for admins and mods to be able to see IP addresses them also.

So I wonder if these can be added in, pretty please?

2 replies 451 Read more →
Jamie ·Customization Help ·1 year ago
A brief money extension example

I figured it would be good to give an explanation of how I see larger-scale extensions being built. An example is probably the best way to explain. Please keep in mind this code is not production code but more just a basis to give you an idea.

The repo for this commentary is here: https://github.com/forumspark/money-extension-example

It is a Laravel Breeze (PHP) app but I will point to the most important things, they will be applicable in whichever language.

This example includes the ability for forum users to gain "money" or "credits" for making topics and posts. They have the option to make a donation to other users. This is as far as the example goes because it demonstrates listening to webhooks, showing some additional data for users and performing (a sort of) authenticated user action.

So on to it. The first thing we need to do is set up the forum in our application. The board owner needs to tell us their Board URL, an API token and some other basic configuration.

From that we'll store their details in our database and tell ForumSpark to start sending us webhooks: https://github.com/forumspark/money-extension-example/blob/master/app/Http/Controllers/ForumController.php#L18

<?php

       $response = Http::withHeaders([
            'Authorization' => 'Bearer ' . $request->api_key,
            'Accept' => 'application/json',
            'Content-Type' => 'application/json',
        ])
            ->post("https://{$request->board_url}.forumspark.net/api/v1/webhooks", [
                'topics' => ['topics/create', 'replies/create'],
                'url' => route('webhooks')
            ]);

        if (! $response->successful()) {
            throw ValidationException::withMessages(['api_key' => $response->body()]);
        }

        $signingSecret = $response->json('signing_secret');

        Forum::create([
            'user_id' => auth()->id(),
            'board_url' => $request->board_url,
            'api_key' => $request->api_key,
            'shop_name' => $request->shop_name,
            'shop_currency' => $request->shop_currency,
            'shop_currency_prefix' => $request->shop_currency_prefix,
            'shop_currency_suffix' => $request->shop_currency_suffix,
            'signing_secret' => $signingSecret,
        ]);

Here we make a request to ForumSpark using the provided API key to tell it to start sending webhooks relating to the topics replies/create and topics/create. That is, whenever someone creates a post or topic we want to be notified about it. And we tell ForumSpark to reach us at /webhooks of our application.

Next we need to start listening to those webhooks: https://github.com/forumspark/money-extension-example/blob/master/routes/web.php#L11

$board = $request->header('X-ForumSpark-Board');
    $signature = $request->header('X-ForumSpark-Signature');

    if (! $forum = Forum::whereBoardUrl(Str::of($board)->remove('.forumspark.net'))->first()) {
        // the board is not set up, we'll return a 200 response so FS does not keep
        // retrying a board that doesn't exist
        return;
    }

    $generatedHmac = hash_hmac('sha256', $request->getContent(), $forum->signing_secret);
    if (! hash_equals($generatedHmac, $signature)) {
        \Log::error("Generated HMAC does not match incoming signature.");
        abort(401);
    }

Firstly we compare the incoming signature with a generated signature on our end. We generate a hmac using the SHA256 algorithm, the request body and the shared secret we got from the first step.

$topic = $request->json('topic');
    if (! $user = FSUser::whereFsUserId($request->json('data.user_id'))->first()) {
        $user = FSUser::create([
            'forum_id' => $forum->id,
            'fs_user_id' => $request->json('data.user_id')
        ]);
    }

    // pull this from user config
    $topicMap = [
        'topics/create' => 5,
        'replies/create' => 2,
    ];

    $user->update(['credits' => $user->credits + $topicMap[$topic] ?? 0]);

Next we listen to the type of event and then update (or create) our user accordingly. We have to create because it is possible that we receive an event for a user we do not know about.

Now that we have a way for users to accumulate money, we need a way to show it. This is a combination of an api endpoint and a frontend mini profile widget.

The endpoint is simple: https://github.com/forumspark/money-extension-example/blob/master/routes/api.php#L11

There is a middleware that runs before hitting /api/* - this pulls the ForumSpark board URL from the headers and then scopes all data to that specific forum. So when we query /api/users/1 the user data relates to the user from the supplied board.

Otherwise, we look for the user and supply a default value in cases where the user does not exist or the actual data stored in our database (ie. the number of credits they have).

    if (! $user = FSUser::whereFsUserId($userId)->first()) {
        return [
            'credits' => 0,
            'exists' => false,
            'currency' => $request->forum->shop_currency,
            'prefix' => $request->forum->shop_currency_prefix,
            'suffix' => $request->forum->shop_currency_suffix,
        ];
    }

    return [
        'credits' => $user->credits,
        'currency' => $request->forum->shop_currency,
        'prefix' => $request->forum->shop_currency_prefix,
        'suffix' => $request->forum->shop_currency_suffix,
        'exists' => true
    ];

The frontend side of this simply makes a request to this endpoint: https://github.com/forumspark/money-extension-example/blob/master/public/credits.js

It will take a bit of explanation but its worthwhile looking at our docs regarding profile widgets: https://docs.forumspark.net/api/js.html#mini-profile-widgets

Essentially we setup a shared store (so that we dont make repeated requests for users on the same page). When that shared store is initialised, we fetch the user's credit info so that it can be presented in the render function.

fetchCredits() {
                    fetch(`${url}/users/${user.id}`, {headers: {'X-ForumSpark-Board': 'jamie-test.forumspark.net'}})
                        .then(res => res.json())
                        .then(json => {
                            this.currency = json.currency;
                            this.prefix = json.prefix;
                            this.suffix = json.suffix;
                            this.credits = json.credits
                            this.loading = false
                        })
                },

and

<div class="credits">
                <dl>
                    <div>
                        <dt x-text="${store}.currency"></dt>
                        <dd @click="show = true" x-text="${store}.loading ? 'loading' : ${store}.formattedCredits" />
                    </div>
                </dl>
            </div>

respectively.

The donation element takes a similar tactic, we take the frontend_secret (https://docs.forumspark.net/api/js.html#current-user-data) and send it along to a backend endpoint so that it can be checked against the API. If the frontend_secret matches and the user has enough credits then we can make the transaction.

fetch(`${url}/donate`, {
                        method: "POST",
                        headers: {
                            accept: 'application/json',
                            'content-type': 'application/json',
                            'X-ForumSpark-Board': 'jamie-test.forumspark.net'
                        },
                        body: JSON.stringify({
                          to_id: user.id,
                          secret: window.ForumSpark.currentUser.frontend_secret,
                          user_id: window.ForumSpark.currentUser.id,
                          amount
                        })
                    }).catch(err => console.error(err));

The javascript request

and the relevant backend endpoint: https://github.com/forumspark/money-extension-example/blob/master/routes/api.php#L32

The steps are as follows:

  1. Check the incoming secret against the ForumSpark API
  2. Check that the target user exists in the ForumSpark API
  3. Check that the user donating has enough credits
  4. Perform the transaction

This is all a bit of a rush (and Im not much of a writer) so I will likely expand on this and improve my explanations but I wanted to put this out there at least as a start for anyone interested.

Of course any questions then please ask away.

Note that I have plans to deprecate the frontend_secret system in favour of short-lived JWTs that can be generated and then verified against the FS API. It will be more secure that way :). But for now this is ok!

Please feel free to take the code, adapt as you need it.

? Deleted user ·Feedback ·1 year ago
Show if I've replied to a thread

So on Xenforo it shows a little avatar icon (Mini Me Avatar) if I've replied to a thread. It would be cool to see if I've replied to a thread on Forum Spark.

5 replies 512 Read more →
Cory ·Feedback ·1 year ago
Links in Posts Should Open in a New Window/Tab

As the topic title implies. I think this should be done because no one wants to be navigated away from a site when they are viewing the site. You could have it where all links open in a new window/tab, or perhaps off-site links only.

1 reply 424 Read more →
AllanD ·Feedback ·1 year ago
Go to top Butten

Was just scrolling around and realized there isn't a go to top button or a bottom breadcrumb. Just a thought.

2 replies 512 Read more →
? Deleted user ·Feedback ·1 year ago
View New Posts

Another suggestion - a page that shows the latest posts from the forum since the last time I logged in.

4 replies 413 Read more →
Jamie ·Feedback ·1 year ago
Conversation notification count

Currently only regular notifications count in the topic title for the forum (eg. (1) Home - ForumSpark Support)

Should conversation notifications also count here? I am finding that I am missing conversation notifications because they are not quite as obvious.

I'm curious to hear others' thoughts and if it is the same for you.

1 reply 468 Read more →
Jamie ·Bug Report ·1 year ago
Moving a topic does not correctly set latest post for forum

Just in case anyone else spots this, I've put this here for now as a reminder for myself to fix this.

Steps to reproduce:

  1. Create a Topic
  2. Reply to the topic
  3. Move the topic to a different forum
  4. Observe that the forum takes the first post instead of the last post related to the topic
1 reply 644 Read more →
Ravenfreak ·Feedback ·1 year ago
Best Answer Feature

Now I don't expect this to be the next thing implemented but I think having a best answer feature would be great for Forum Spark! If you have a resource community or a research community where people are needing questions addressed, seeing the best answer can help others out. Heck it can even help out the support forum!

1 reply 499 Read more →
Jamie ·ForumSpark Headlines ·1 year ago
ForumSpark Update

Hey all!

I have now pushed quite a substantial release for ForumSpark. I've outlined the main areas below but please take a look at the changelog to see a full list of updates :)

New Look

As you will have noticed, Forum Spark has a new look. Whilst the purple and orange was a good nod to the past, we felt that it was best that we came up with our own look.

Now, I’m no designer but I tried to keep the look clean and professional so that maintains that ‘easy to use’ feel.

The old purple and orange has not gone away completely, and for anyone interested, it will be available soon to download and use. You can already find assets and source files in our GitHub https://github.com/forumspark/nostalgia-theme.

With the new theme, I’ve taken a great deal of time to go through and make sure all HTML is marked up with component classes rather than the Tailwind classes. This should make it easier for you to develop new themes.

I also introduced a Global Dark Mode toggle which theme designers can access and use in their themes (more information to follow)

API & Webhooks

Behind the scenes I’ve been working to build an API to allow developers to build extensions. This is a very pragmatic API but should open up a world of possibilities to extend the capabilities of your boards.

You can see the API documented in our Documentation: https://docs.forumspark.net/api/ and the full Admin API spec can be found here https://forumspark.net/api .

Other updates

I have been making lots of little updates throughout this last week and have updated our Changelog with a list of all of the changes.

Please let me know if you notice any issues of course!

8 replies 998 Read more →
Vilgefortz ·Introductions ·1 year ago
Alex here

Hello everyone. I saw on some forum that you are offering free hosting + free software and I liked how it looks like, so I decided to give it a try. AP seems to be very simple to navigate through, so that's a good thing. ^_^

6 replies 521 Read more →
Jamie ·Themes & Extensions ·1 year ago
FS Original

Name: FS Original
Author: ForumSpark
Version: 1.0.1

GitHub release: https://github.com/forumspark/nostalgia-theme/releases/tag/1.0.1

To install:

  1. Create a new theme in your admin area
  2. Untoggle the option to inherit from the default editor
  3. Edit the stylesheet and copy the stylesheet over
  4. That's it :) There's no layout differences for this theme

Direct Stylesheet download: https://github.com/forumspark/nostalgia-theme/releases/download/1.0.1/theme.css

You can download the original folder icons from: https://github.com/forumspark/nostalgia-theme/tree/master/assets

M Mace ·Feedback ·1 year ago
Admin control panel
  • In the ACP, the 'Read More' buttons in the ForumSpark News section do not work
  • It would be better if the 'Support Forum' link would open in a new tab, instead of navigating away from your ACP
  • The same goes for the 'Changelog' link
  • In 'API token', the link is 'Create Api Token': Api -> API
  • It'd be nice if the board templates would use the same font as the CSS editor

Also, it'd be nice if the registration/login screens used the same styling as the rest of the board.

2 replies 537 Read more →
Vilgefortz ·Support ·1 year ago
Emoticons & Reactions

Why haven't you added at least some default emoticons & reactions? I don't know where to find some so that it doesn't look ugly. Do you have a website to recommend in this case?

8 replies 568 Read more →
Vilgefortz ·Feedback ·1 year ago
Upload image in posts

I can't seem to find the ability to post an image inside the post. If I post youtube link, it will embbed it as it should, but if I post an URL of the image, nothing happens. Links stays like that.

2 replies 447 Read more →
Cory ·Feedback ·1 year ago
Discovering Boards Across the Network

How do y'all plan to help people discover boards across the network? An advertising forum, a directory, a profile field for users to input their board link, etc.

2 replies 653 Read more →
Cory ·Introductions ·1 year ago
Cory is here!

You all know Cory from various communities, starting on the Zathyus Networks (InvisionFree/ZetaBoards) platform. I've been using forums for over two decades. The first forum I created was on the InvisionFree platform, which I later converted to ZetaBoards. I've also used ProBoards for a short period and currently use Jcink. As you can see, I've always used non-self-hosted forum software because I don't like spending much money on a hobby I can do freely.

My board on Jcink is for Jcink forum resources. Once I become more acquainted with ForumSpark, I may consider creating a resource board on this platform. I know HTML, CSS, and JavaScript/jQuery.

Aside from message boards/coding, my hobbies include listening to music (mainly hard rock and metal), playing video games such as Pokemon GO and Call of Duty, fantasy media such as The Lord of the Rings and Game of Thrones, and collecting Yu-Gi-Oh TCG cards.

6 replies 585 Read more →
Jamie ·ForumSpark Headlines ·1 year ago
Theme Development Experience

We will be making improvements all round to the theme development experience.

There are still some remnants of Tailwind classes but I am making a concentrated effort to remove them in favour of more structured css. This should make overriding of things much easier.

Obviously, if you are intending to develop themes for Forum Spark in the meantime, please be aware that some things will be tricky to override or that some class names / structures may change.

We're also working on the ability to create themes that do not inherit from the base theme, as they currently do.

And finally, as alluded to in the APIs topic we're also working on a CLI tool assist in theme development workflows:

Preview (forgive the crudeness of the demo)

1 reply 777 Read more →
Load more
ForumSpark © 2023 - 2026 · ForumSpark.net · Terms