Home Tutorials Usage

Jcink Auto Claim Generator

This is a script that can pull information from the memberlist to use as an auto claim list. The example I am going to use here is Occupation, but this script is set up in a way that you can have multiple "categories" to create different lists. Like Clubs or Schools or Factions or whatever.

HTML Structure

Add the structure to your memberlist. This should be added to the memberlist row HTML template. You can put it at the bottom and add a display:none; to .autoclaim and it will still work fine.

The script will pull the CategoryName and where ever you want that category to show up, you can just put the following and the script will do the rest:

This allows you to put them on different pages if you like, or call specific categories to a particular tab in a guidebook for example. I would recommend putting the script only on the pages you want to use it and not in your wrapper or on every page so that members don't accidentally call it for some reason.

This script will pull everything from a category and sort it alphabetically first by the Header, then the Subheader, followed by the character's name. In the script, there is an option for you to select a special position to show above the others, for example if you want the Owner tag to be the top and THEN alphabetize the rest by name. This is the sample loaded into the script. You can see that it is set so that the CategoryName Occupation will prioritize the Owner position first.

Using the example of Occupation, the memberlist code might look like:

Then, you could have a webpage setup that just has div id="Occupation" and the script on it.

The HTML that will appear on the page automatically is:

Please note: The Name field is the only one that will bring HTML over from the memberlist. The styling was intended to be done off of the above structure. You can change it if you match the other fields to let name = nameElement but I'm not going to go over that.

Please be sure to include jquery if it doesn't work:

The Script

Using a dropdown for users to select options can help make sure there aren't duplicate sections from spelling differences. You can also use fields that can show on the profile but only be changed by admin if you want to have full control over it, but that means you updating their profile as needed.

The reason only the name field includes the HTML is to prevent people from messing it up too bad on their end but also so it will pull the link to the profile as well as the prefix/suffix, eliminating the need to make another function just to pull the member group. Which is the fancy way of saying I was too lazy to use the script to recreate the link and usergroup. Haha!

If you want to add it to a post but don't want to have the script on every page, open the script in notepad, remove the script tags, save as autoclaim.js, upload to the file manager and add script src="https://files.jcink.net/uploads/YOURSITE/autoclaim.js as a macro and then put that macro into a custom bbcode. Use custom bbcode on post you want to use. Or you could just make it so the script only loads on certain pages, but that will be up to you to work out. 😄

If you want an uncategorized section, I would give it a name and have then have members add that to the autohead field you have set up, aka company name as like "Unemployed" and/or "Freelance" in the occupation example and then it would work.

Sort by Position Too

If you want it to sort by position and then name, then... I didn't do that.

Find:

And replace with:

Add the answer as a class

If you want to have a little more style control and you want to be able to include the person's answer in the html for CSS targeting, for example div class="autopost Owner" or div class="autopost Cashier" you can use the following code. I did not include this because if people use special characters it could mess things up.

You can also look at this area to make changes to the way the HTML is spat out by the script as well, if you want. *This code will not pull for the name field. Only the Header, Subheader, and Position fields, but you could probably figure it out.*

Header

Find:

Replace with:

Subheader

Find:

Replace with:

Position

Find:

Replace with:

More than 1000 accounts

If you have more than 1k accounts, please use the following script instead. I would not use this unless you need it just to eliminate the extra scripting:

Navbar by w3schools