[Website] Trinity Account Creator

I’ve been working on some side projects to fill out my portfolio, and one of these projects is an account creation website for TrinityCore. I wrote this so that anyone can take this website and use it for their own server. This website is responsive, so it will work on mobile- and tablet-sized browsers.

Here is a live example: http://www.adamelders.com/trinity/account/

I have an ‘auth’ database set up on my server for testing purposes, it doesn’t get used anywhere else, or by anything else. Still, you should not enter your own private information into the live example site.

Here is the source code: https://github.com/adamelders/trinity-projects/tree/master/Trinity Account Creator

NOTE: You will need a web server that supports at least PHP version 7.1 or higher. I have not tested with any versions below that. Your web server will also need to support the PDO extension, with the pdo_mysql driver. These options should be available with most modern hosting services, but if you encounter any issues, this should be the first thing for you to check.

[SIZE=18px]How to install/set up:[/SIZE]

First, download and extract the files: http://www.adamelders/com/trinity/Trinity Account Creator.rar

You will then need to configure the website for your own server. Open up the db.php file inside the db folder. There is a section at the top you can edit to your database information:

[CODE]
/* --------------------- ONLY EDIT THE VALUES BELOW THIS LINE --------------------- */

private $host = "localhost";      // IP or hostname of your server.
private $username = "username";   // Database username.
private $password = "password";   // Database password.
private $dbname = "auth";         // Database name (i.e. "auth").

/* --------------------- DO NOT EDIT ANYTHING BELOW THIS LINE --------------------- */
[/CODE]

After you edit the above information, you will need to upload the files to your web server, doesn’t matter where. Then you should be done!

[SIZE=18px]Additional Options:[/SIZE]

There are a couple of additional options you can use to customize this website.

  1. I have uploaded 5 backgrounds for use with the site, you can change the backgrounds in /css/style.css:
  /* Change this to the desired background image */
  background-image: url('../img/bg-1.png');
  /* ------------------------------------------- */

The five background images are named “bg-1.png”, “bg-2.png”, “bg-3.png”, bg-4.png", and “bg-5.png”. Edit the above line in style.css to your desired background image.

  1. You can upload your own logo to appear at the top of the page instead of the TrinityCore logo. To do this, upload your logo image to the /img/ folder. Then, edit the following line in index.html (line 23):
<img src="img/tc_logo.png" class="img-fluid rounded mx-auto d-block" alt="Logo">

Edit the “src” attribute to match the name of your logo image file, i.e. “img/my_logo.jpg”.

[SIZE=18px]Technical stuff:[/SIZE]

This website uses jQuery to stop the form submission (so it will still use HTML5/Bootstrap input validation), then runs a JavaScript function that uses an AJAX call to a PHP script. A status message is shown with the results from the AJAX call.

If you find any issues with this website, or have any questions, just let me know. I will try to answer them as soon as possible.

Lastly, feel free to modify the site to your liking. I only ask that you provide some credit on your website (i.e. leave the footer as-is, just add your own info to it).

Yep!

I have a doubt:

Works with latest Trinitycore master branch Legion 7.2?

@Ramor

Sorry, I forgot to mention this in the original post. This site was designed for use with the 3.3.5a branch.

I haven’t been able to get my hands on a copy of 7.2 yet (my retail version is already at 7.3), but as soon as I do, I’ll upload an updated version that supports it.

If you use soap it will be quite branching independent.

I think that the registration method for 7.2.5 and 7.3.2 (TC now works in 7.3.2) are the same. Same tables in the database, right?

yes, but it’s very different algorithm from 3.3.5a with soap you don’t need to care about algorithms, you send commands to create accounts.

I’ve never used SOAP before, but I will look into it so I won’t have to maintain two separate versions. Thanks!

You can use these two libraries (composer require them in the following order)

[ul][li]composer require freedomcore/trinitycore-support (Github Page)[/li]
[li]composer require freedomcore/trinitycore-console (Github Page)[/li]
[/ul]
After that you can use the available commands, which are described here.

Only limitation (i guess it shouldn’t be since PHP >= 7.1 is available in most of the dists) is PHP 7.1 and up. You can still run it on the PHP 7.0 (i guess) if you skip requirement of the developer dependencies.

P.S. IF you are not planning on sending items to the players, you might skip the requirement procedure of the support library

Thanks! I’ll check that out.