Home Tutorials Usage

Automated Jcink Guidebook from Thread

The following setup will allow you to create a guidebook using a thread instead of webpages. This makes it easier to edit on the front end and eliminates the need for admincp access just for lore updates. Lore mods should be a thing on some of y'alls sites, and you know it!

This project is licensed under CC BY-NC 4.0. This means that you are welcome to use it and make whatever changes you like with it, even share what you make with others, but you can not sell it or include it in paid skins.

This works by creating a new forum and assigning a skin to it. I'm going to call my skin "Guidebook." You will then create a thread in that forum to serve as the guidebook. Each post in that thread will become a tab, so long as you add the proper html to each post which will be explained in detail later. You can use dohtml in these threads and the quick edit function works. Please note that using quick edit will not create the last edited by line.

Setup HTML Template for Forum

Create a new set of HTML templates and add the following to the "post row"

The following are all important to the script, so please do not change them: id="tab-", class="guide-entry", class="pbuttons", and <span id="edit-<!-- |pid| -->" class="edited"></span>. You can make other changes to the structure as needed. Group id can be removed safely, but I included it for customization options.

New Skin Set

Now, create a new skin set, maybe title it Guidebook and make sure that it uses your main skin's Macro set, Stylesheet, and wrapper. Only the HTML set should be your new html template set. If you let members switch skins, be sure to hide this one and do not set it as default.

Create New Forum

Create new forum wherever you like for your guidebook. On theme, I called mine Guidebook. You won't need a redirect link for this, so it will appear like a normal forum on your index, unless you choose to hide it. Be sure that you assign the new Guidebook skin set to this forum and ensure dohtml is enabled. Because you left the wrapper and stylesheet attached it should look normal so far. The script is setup so that if a user tries to access the forum instead of your thread, it will redirect to the thread. This does mean you are making a forum for one thread, but... that's fine!

Create New Thread

While we are here, we will go ahead and create a new thread. There are a few very important parts needed in the first post of the thread.

Only put this in the first post. Do not repeat it. The script will add a class="tabhead#" to this div with the # being the sort number you will define below. Use css to change it per tab. For example, you could assign a different background image per tab or generate subheaders using pseudo elements. If you use quick edit, the header will appear in the post. Please refresh the page and it will appear normally.

Example of subheaders via css:

Please note that the quick edit function does not allow for you to add the "Edited by" line to the post. This means that you must use the full edit option if you would like the "Last updated by" line to appear.

Required

This one defines the text of the link that appears in the sidebar. Every post will need this one or it will not appear in the list. Avoid special characters. This also serves as the way to direct link to your tab. Example index.php?showtopic=69&tab=Welcome

Required for full functionality

This one defines the order in which you would like the tab to appear in the list. I created this because sometimes I post things out of order but also so that it would create another anchor I could use to target in the script for customization purposes. If this is missing, the custom headers will not be possible, but it will still create the tabs in the order the posts are made.

The rest of your post can be the content you want to have in the tab using whatever structure you want, really.

Update Wrapper

Now, let's add the script to the wrapper. At the bottom of your wrapper before the /body tag, add the following:

The forum number will be the number of the forum you just created and the thread is the same. The script will automatically redirect anyone who tried to access index.php?showforum=# based on what you put here to the thread that is your actual guidebook.

You are welcome to host the script yourself if you want to make changes, but I don't mind hosting it. Any updates to the code will be automatic for you if you use the remote hosted link, but you don't have to! The full script is below if you prefer.

Update Stylesheets

This hides part of the regular structure of a page. Some changes made be required to properly work on your skin.

Be sure to update .g-4 as needed so that the add new button will be properly hidden to other users. The script can not tell if a user has access to make replies via forum settings or not. If you do not have this variable in your wrapper, add the following to make it work.

This will need styling to match your skins and the like, but I did my best to provide some basic coding to get you started.

The rest is up to you!

Navbar by w3schools