Cabal Website Source 

Joined
Oct 14, 2008
Messages
1,292
Reaction score
516
Hello RageZone,
Here's a website i build and improved/enhanched with the help of AI, the website has very basic functionalities to it, but can be easily updated with more systems.
The website includes:
  1. Themes System
  2. Characters Ranking
  3. Register Account
  4. Login with 'remember me' and Login Attempts.
  5. Change Password
  6. Recover Password based on UserKey.(You choose UserKey on registration form)
  7. News System (With database table, no admin panel for it, use the SQL i provided to add news to the website.)
  8. FAQ & Wiki with search system which filters the results live while being typed.
Languages used for the project: CSS, HTML, PHP, JAVA (only for the collapsible content on FAQ & Wiki section).
Tested on Webhosting using PHP 7.4 works with PHP 8.4 too.

More Screenshots:
https://imgur.com/a/FlB5tdr
SQL Query's:

First:
SQL:
USE [Account]
ALTER TABLE cabal_auth_table
ADD login_attempts INT DEFAULT 0,
    last_attempt_time DATETIME NULL;

Second:
SQL:
USE [Account]
CREATE TABLE News (
    NewsID INT PRIMARY KEY IDENTITY(1,1),
    Title NVARCHAR(255) NOT NULL,
    Content NVARCHAR(MAX) NOT NULL,
    PostDate DATETIME DEFAULT GETDATE()
);

How to add news to the website via Query:
SQL:
USE [Account]
INSERT INTO News (Title, Content)
VALUES    ('Title  1', 'Ragezone is the new Pope of Rome, https://forum.ragezone.com/'),
    ('Title  2', 'Ragezone is the new Pope of Rome, https://forum.ragezone.com/'),
    ('Title  3', 'Ragezone is the new Pope of Rome, https://forum.ragezone.com/');


To view the content, you need to sign In or register.

Update 1 - Rankings:

public_html/cabal/Themes/Dark/style.css

CSS:
/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #121212; /* Dark background for body */
    color: #e0e0e0; /* Light text color */
    line-height: 1.6;
    padding: 20px;
}

/* Header */
header {
    background-color: #1f1f1f;
    color: #f0f0f0;
    padding: 20px;
    text-align: center;
}

header h1 {
    font-size: 2em;
    margin: 0;
}

header nav {
    margin-top: 10px;
}

header nav a {
    color: #f0f0f0;
    text-decoration: none;
    padding: 10px;
    margin: 5px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

header nav a:hover {
    background-color: #4CAF50;
}

/* Card Container */
.card {
    background-color: #1f1f1f;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.card h3,
.card h4 {
    color: #e0e0e0;
}

/* Form Elements */
.form-label {
    color: #e0e0e0; /* Lighter text for labels */
    font-weight: bold;
}

.form-input {
    background-color: #333; /* Dark background for inputs */
    color: #f0f0f0; /* Light text inside input */
    border: 1px solid #444;
    padding: 10px;
    width: 100%;
    margin-bottom: 15px;
    border-radius: 4px;
}

.form-input:focus {
    border-color: #4CAF50; /* Highlight on focus */
}

.form-checkbox-input {
    accent-color: #4CAF50; /* Customize checkbox color for dark theme */
}

/* Buttons */
.btn-submit {
    background-color: #4CAF50; /* Green button for dark theme */
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    transition: background-color 0.3s ease;
}

.btn-submit:hover {
    background-color: #45a049; /* Hover effect */
}

/* Links */
.dark-link {
    color: #f0f0f0;
    text-decoration: none;
    font-weight: bold;
}

.dark-link:hover {
    color: #4CAF50; /* Highlight color for links */
}

/* Error Message */
.error-message {
    color: #f44336; /* Red color for error messages */
    font-weight: bold;
}

/* Page Titles */
.page-title {
    font-size: 2em;
    margin-bottom: 20px;
    color: #e0e0e0;
}

/* Navigation Bar */
nav {
    background-color: #1f1f1f;
    padding: 15px;
    text-align: center;
}

nav a {
    color: #f0f0f0;
    text-decoration: none;
    padding: 10px;
    margin: 0 5px;
    border-radius: 4px;
}

nav a:hover {
    background-color: #4CAF50;
}

/* Footer */
footer {
    background-color: #1f1f1f;
    color: #e0e0e0;
    padding: 20px;
    text-align: center;
}

footer p {
    margin: 0;
    font-size: 0.9em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .card {
        padding: 15px;
    }

    .form-input, .btn-submit {
        width: 100%;
    }
}

/* Modal (Optional for alerts or dialogs) */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    padding-top: 60px;
}

.modal-content {
    background-color: #1f1f1f;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #444;
    width: 80%;
    max-width: 400px;
}

.modal-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
}

.modal-close:hover,
.modal-close:focus {
    color: #f44336;
    text-decoration: none;
    cursor: pointer;
}

/* Cards */
.card-header {
    font-size: 1.5em;
    color: #e0e0e0;
}

.card-body {
    margin-top: 10px;
}

.card-footer {
    font-size: 0.9em;
    color: #9e9e9e;
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px; /* Add some space above the table */
}

table th,
table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #444;
    /* color: #e0e0e0; */
    /* Remove forced color so class-based styles apply */
    /* Or set it only if no color class is present */
    /* Optional fallback */
    color: inherit;
}

table th {
    background-color: #333;
    font-weight: bold;
    text-transform: uppercase; /* Make the table headers uppercase for better readability */
}

table tr:hover {
    background-color: #333; /* Darken the row when hovered */
    cursor: pointer; /* Make the pointer a hand to show it's clickable */
}

table td {
    font-size: 1.1em; /* Increase font size for better readability */
}

/* Custom Row Styling for Specific Columns */
table td:nth-child(2) {
    font-weight: bold;
    color: #f1c40f; /* Highlight Name column with a gold color */
}

table td:nth-child(7) {
    font-weight: bold;
    color: #e74c3c; /* Color for Nation */
}

/* Card Styling */
.card {
    background-color: #1f1f1f;
    border-radius: 10px;
    border: 1px solid #333;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); /* Add shadow for better depth */
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px); /* Add hover effect for the card */
}

/* Page Title Styling */
.page-title {
    font-size: 2.5em;
    font-weight: bold;
    color: #fff;
    margin-bottom: 20px;
}

/* Header Styling */
header {
    background-color: #1f1f1f;
    color: #f0f0f0;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* Slight shadow for the header */
}

/* Table Row Hover Effects */
table tr:hover {
    background-color: #444;
    transform: scale(1.02); /* Slightly scale up the row on hover */
}

/* Styling Table Columns */
table th:nth-child(1) {
    width: 5%;
}

table th:nth-child(2) {
    width: 30%;
}

table th:nth-child(3),
table th:nth-child(4) {
    width: 15%;
}

table th:nth-child(5) {
    width: 20%;
}

table th:nth-child(6) {
    width: 15%;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #2c2c2c;
}

::-webkit-scrollbar-thumb {
    background-color: #444;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #4CAF50;
}

/* Nation Colors */
.lightpurple {
    color: #b19cd9; /* Light Purple */
}

.lightblue {
    color: #add8e6; /* Light Blue */
}

.lightgreen {
    color: #90ee90; /* Light Green */
}

.news-list {
    margin-top: 20px;
}

.news-item {
    background-color: #1c1c1c;
    border: 1px solid #333;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
}

.news-item h3 {
    margin: 0;
    color: #00ffff;
}

.news-item small {
    color: #aaa;
    display: block;
    margin-bottom: 10px;
}

.news-item p {
    color: #ddd;
}

.container {
    max-width: 1920px;
    margin: 40px auto;
    padding: 0 20px;
    color: #e0e0e0;
    font-family: Arial, sans-serif;
}
.container {
    max-width: 1920px;
    margin: 40px auto;
    padding: 0 20px;
    color: #e0e0e0;
    font-family: Arial, sans-serif;
}
.page-title, .news-title {
    text-align: center;
    color: #00bcd4;
    margin-bottom: 20px;
}

.subtitle {
    text-align: center;
    color: #aaa;
    margin-bottom: 40px;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.news-card {
    background: #1c1c1c;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 188, 212, 0.1);
    transition: transform 0.2s;
}

.news-card:hover {
    transform: translateY(-5px);
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.news-header h3 {
    margin: 0;
    font-size: 20px;
    color: #ffffff;
}

.news-date {
    font-size: 14px;
    color: #999;
}

.news-content {
    font-size: 16px;
    line-height: 1.5;
}

.no-news {
    text-align: center;
    color: #999;
}

.page-title {
    text-align: center;
    margin-bottom: 25px;
    color: #00bcd4;
}

.card {
    background: #1c1c1c;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 0 10px rgba(0, 188, 212, 0.1);
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
    color: #ccc;
}

.form-input {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #444;
    background: #2a2a2a;
    color: #eee;
    margin-bottom: 15px;
}

.form-checkbox {
    display: flex;
    align-items: center;
    color: #aaa;
}

.form-checkbox input {
    margin-right: 6px;
}

.form-extras {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.btn-submit {
    width: 100%;
    background: #00bcd4;
    border: none;
    color: #fff;
    padding: 10px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-submit:hover {
    background: #0097a7;
}

.user-panel h2 {
    text-align: center;
    color: #fff;
}

.user-panel .highlight {
    color: #00e5ff;
}

.user-links {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

.user-links li {
    margin-bottom: 10px;
    text-align: center;
}

.dark-link {
    color: #00bcd4;
    text-decoration: none;
}

.dark-link:hover {
    text-decoration: underline;
}

.info-message,
.error-message {
    text-align: center;
    margin: 15px 0;
    padding: 10px;
    border-radius: 6px;
}

.info-message {
    background: #2c3e50;
    color: #76d7c4;
}

.error-message {
    background: #c0392b;
    color: #fff;
}

.collapsible-item {
    border-bottom: 1px solid #333;
}

.collapsible-toggle {
    width: 100%;
    background: none;
    color: #00bcd4;
    text-align: left;
    font-weight: bold;
    padding: 12px 15px;
    border: none;
    outline: none;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s ease;
}

.collapsible-toggle:hover,
.collapsible-toggle.active {
    background: #2c2c2c;
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background-color: #1b1b1b;
    color: #ccc;
    padding: 0 25px;
}

/* Class Name Colors */
.class-warrior   { color: #e67e22; } /* Orange */
.class-blader    { color: #f1c40f; } /* Yellow */
.class-wizard    { color: #9b59b6; } /* Purple */
.class-archer    { color: #2ecc71; } /* Green */
.class-shielder  { color: #3498db; } /* Blue */
.class-fblader   { color: #e74c3c; } /* Red */
.class-gladiator { color: #ff69b4; } /* Pink */
.class-gunner    { color: #1abc9c; } /* Teal */
.class-dmage     { color: #7f8c8d; } /* Gray */
.class-unknown   { color: #bdc3c7; } /* Light gray for unknown */

public_html/cabal/rankings.php
PHP:
<?php include 'Themes/Dark/header.php'; ?>

<h2 class="page-title">Rankings</h2>

<div class="card">
    <table class="styled-table">
        <thead>
            <tr>
                <th>Rank</th>
                <th>Name</th>
                <th>Level</th>
                <th>EXP</th>
                <th>Class</th>
                <th>Nation</th>
                <th>Status</th>
            </tr>
        </thead>
        <tbody>
            <?php
            include 'config.php';

            // Nation mapping
            $nations = [
                0 => 'Neutral',
                1 => 'Capella',
                2 => 'Procyon'
            ];

            // Status
            $status = [
                0 => 'Offline',
                1 => 'Online'
            ];

            // SQL query to fetch the data
            $tsql = "SELECT TOP 100
                Name, LEV, EXP, Nation, Login, Style,
                CASE
                WHEN (Style & POWER(2, 23)) > 0 THEN (Style & 7) + 8
                ELSE (Style & 7)
                END AS ClassId
                FROM cabal_character_table
                WHERE Nation IN (0, 1, 2)
                ORDER BY LEV DESC, EXP DESC";
       
            $stmt = sqlsrv_query($conn_server01, $tsql);

            // Check for errors
            if ($stmt === false) {
                echo "Error in SQL query execution.";
                die(print_r(sqlsrv_errors(), true));
            }
   
            // Class Name
            $classNames = [
                1 => '<span class="class-warrior">๐Ÿ—ก๏ธ Warrior</span>',
                2 => '<span class="class-blader">โš”๏ธ Blader</span>',
                3 => '<span class="class-wizard">๐Ÿง™ Wizard</span>',
                4 => '<span class="class-archer">๐Ÿน Force Archer</span>',
                5 => '<span class="class-shielder">๐Ÿ›ก Force Shielder</span>',
                6 => '<span class="class-fblader">๐Ÿฆน Force Blader</span>',
                7 => '<span class="class-gladiator">๐ŸฅŠ Gladiator</span>',
                8 => '<span class="class-gunner">๐Ÿ”ซ Force Gunner</span>',
                9 => '<span class="class-dmage">๐ŸŒ‘ Dark Mage</span>',
            ];
            // Emoticons and their names for ranks 1 to 100
            $rankEmoticons = [
                1 => ['emoji' => '๐Ÿ†', 'name' => 'Gold Trophy'],
                2 => ['emoji' => '๐ŸŽ–๏ธ', 'name' => 'Gold Medal'],
                3 => ['emoji' => '๐Ÿฅˆ', 'name' => 'Silver Medal'],
                4 => ['emoji' => '๐Ÿฅ‰', 'name' => 'Bronze Medal'],
                5 => ['emoji' => '๐Ÿ’Ž', 'name' => 'Diamond'],
                6 => ['emoji' => '๐Ÿ’Ž', 'name' => 'Diamond'],
                7 => ['emoji' => '๐Ÿ’Ž', 'name' => 'Diamond'],
                8 => ['emoji' => '๐Ÿ’Ž', 'name' => 'Diamond'],
                9 => ['emoji' => '๐Ÿ’Ž', 'name' => 'Diamond'],
                10 => ['emoji' => '๐Ÿ’Ž', 'name' => 'Diamond'],
                11 => ['emoji' => '๐Ÿ”ฅ', 'name' => 'Fire'],
                12 => ['emoji' => '๐Ÿ”ฅ', 'name' => 'Fire'],
                13 => ['emoji' => '๐Ÿ”ฅ', 'name' => 'Fire'],
                14 => ['emoji' => '๐Ÿ”ฅ', 'name' => 'Fire'],
                15 => ['emoji' => '๐Ÿ”ฅ', 'name' => 'Fire'],
                16 => ['emoji' => '๐Ÿ”ฅ', 'name' => 'Fire'],
                17 => ['emoji' => '๐Ÿ”ฅ', 'name' => 'Fire'],
                18 => ['emoji' => '๐Ÿ”ฅ', 'name' => 'Fire'],
                19 => ['emoji' => '๐Ÿ”ฅ', 'name' => 'Fire'],
                20 => ['emoji' => '๐Ÿ”ฅ', 'name' => 'Fire'],
                21 => ['emoji' => 'โšก', 'name' => 'Lightning'],
                22 => ['emoji' => 'โšก', 'name' => 'Lightning'],
                23 => ['emoji' => 'โšก', 'name' => 'Lightning'],
                24 => ['emoji' => 'โšก', 'name' => 'Lightning'],
                25 => ['emoji' => 'โšก', 'name' => 'Lightning'],
                26 => ['emoji' => 'โšก', 'name' => 'Lightning'],
                27 => ['emoji' => 'โšก', 'name' => 'Lightning'],
                28 => ['emoji' => 'โšก', 'name' => 'Lightning'],
                29 => ['emoji' => 'โšก', 'name' => 'Lightning'],
                30 => ['emoji' => 'โšก', 'name' => 'Lightning'],
                31 => ['emoji' => '๐Ÿ’ช', 'name' => 'Muscle'],
                32 => ['emoji' => '๐Ÿ’ช', 'name' => 'Muscle'],
                33 => ['emoji' => '๐Ÿ’ช', 'name' => 'Muscle'],
                34 => ['emoji' => '๐Ÿ’ช', 'name' => 'Muscle'],
                35 => ['emoji' => '๐Ÿ’ช', 'name' => 'Muscle'],
                36 => ['emoji' => '๐Ÿ’ช', 'name' => 'Muscle'],
                37 => ['emoji' => '๐Ÿ’ช', 'name' => 'Muscle'],
                38 => ['emoji' => '๐Ÿ’ช', 'name' => 'Muscle'],
                39 => ['emoji' => '๐Ÿ’ช', 'name' => 'Muscle'],
                40 => ['emoji' => '๐Ÿ’ช', 'name' => 'Muscle'],
                41 => ['emoji' => '๐Ÿ’ซ', 'name' => 'Sparkles'],
                42 => ['emoji' => '๐Ÿ’ซ', 'name' => 'Sparkles'],
                43 => ['emoji' => '๐Ÿ’ซ', 'name' => 'Sparkles'],
                44 => ['emoji' => '๐Ÿ’ซ', 'name' => 'Sparkles'],
                45 => ['emoji' => '๐Ÿ’ซ', 'name' => 'Sparkles'],
                46 => ['emoji' => '๐Ÿ’ซ', 'name' => 'Sparkles'],
                47 => ['emoji' => '๐Ÿ’ซ', 'name' => 'Sparkles'],
                48 => ['emoji' => '๐Ÿ’ซ', 'name' => 'Sparkles'],
                49 => ['emoji' => '๐Ÿ’ซ', 'name' => 'Sparkles'],
                50 => ['emoji' => '๐Ÿ’ซ', 'name' => 'Sparkles'],
                51 => ['emoji' => '๐ŸŒŸ', 'name' => 'Star'],
                52 => ['emoji' => '๐ŸŒŸ', 'name' => 'Star'],
                53 => ['emoji' => '๐ŸŒŸ', 'name' => 'Star'],
                54 => ['emoji' => '๐ŸŒŸ', 'name' => 'Star'],
                55 => ['emoji' => '๐ŸŒŸ', 'name' => 'Star'],
                56 => ['emoji' => '๐ŸŒŸ', 'name' => 'Star'],
                57 => ['emoji' => '๐ŸŒŸ', 'name' => 'Star'],
                58 => ['emoji' => '๐ŸŒŸ', 'name' => 'Star'],
                59 => ['emoji' => '๐ŸŒŸ', 'name' => 'Star'],
                60 => ['emoji' => '๐ŸŒŸ', 'name' => 'Star'],
                61 => ['emoji' => '๐ŸŒˆ', 'name' => 'Rainbow'],
                62 => ['emoji' => '๐ŸŒˆ', 'name' => 'Rainbow'],
                63 => ['emoji' => '๐ŸŒˆ', 'name' => 'Rainbow'],
                64 => ['emoji' => '๐ŸŒˆ', 'name' => 'Rainbow'],
                65 => ['emoji' => '๐ŸŒˆ', 'name' => 'Rainbow'],
                66 => ['emoji' => '๐ŸŒˆ', 'name' => 'Rainbow'],
                67 => ['emoji' => '๐ŸŒˆ', 'name' => 'Rainbow'],
                68 => ['emoji' => '๐ŸŒˆ', 'name' => 'Rainbow'],
                69 => ['emoji' => '๐ŸŒˆ', 'name' => 'Rainbow'],
                70 => ['emoji' => '๐ŸŒˆ', 'name' => 'Rainbow'],
                71 => ['emoji' => '๐ŸŽ‰', 'name' => 'Party Popper'],
                72 => ['emoji' => '๐ŸŽ‰', 'name' => 'Party Popper'],
                73 => ['emoji' => '๐ŸŽ‰', 'name' => 'Party Popper'],
                74 => ['emoji' => '๐ŸŽ‰', 'name' => 'Party Popper'],
                75 => ['emoji' => '๐ŸŽ‰', 'name' => 'Party Popper'],
                76 => ['emoji' => '๐ŸŽ‰', 'name' => 'Party Popper'],
                77 => ['emoji' => '๐ŸŽ‰', 'name' => 'Party Popper'],
                78 => ['emoji' => '๐ŸŽ‰', 'name' => 'Party Popper'],
                79 => ['emoji' => '๐ŸŽ‰', 'name' => 'Party Popper'],
                80 => ['emoji' => '๐ŸŽ‰', 'name' => 'Party Popper'],
                81 => ['emoji' => '๐Ÿ’ฅ', 'name' => 'Explosion'],
                82 => ['emoji' => '๐Ÿ’ฅ', 'name' => 'Explosion'],
                83 => ['emoji' => '๐Ÿ’ฅ', 'name' => 'Explosion'],
                84 => ['emoji' => '๐Ÿ’ฅ', 'name' => 'Explosion'],
                85 => ['emoji' => '๐Ÿ’ฅ', 'name' => 'Explosion'],
                86 => ['emoji' => '๐Ÿ’ฅ', 'name' => 'Explosion'],
                87 => ['emoji' => '๐Ÿ’ฅ', 'name' => 'Explosion'],
                88 => ['emoji' => '๐Ÿ’ฅ', 'name' => 'Explosion'],
                89 => ['emoji' => '๐Ÿ’ฅ', 'name' => 'Explosion'],
                90 => ['emoji' => '๐Ÿ’ฅ', 'name' => 'Explosion'],
                91 => ['emoji' => '๐Ÿ’ฅ', 'name' => 'Explosion'],
                92 => ['emoji' => '๐Ÿ’ฅ', 'name' => 'Explosion'],
                93 => ['emoji' => '๐Ÿ’ฅ', 'name' => 'Explosion'],
                94 => ['emoji' => '๐Ÿ’ฅ', 'name' => 'Explosion'],
                95 => ['emoji' => '๐Ÿ’ฅ', 'name' => 'Explosion'],
                96 => ['emoji' => '๐Ÿ’ฅ', 'name' => 'Explosion'],
                97 => ['emoji' => '๐Ÿ’ฅ', 'name' => 'Explosion'],
                98 => ['emoji' => '๐Ÿ’ฅ', 'name' => 'Explosion'],
                99 => ['emoji' => '๐Ÿ’ฅ', 'name' => 'Explosion'],
                100 => ['emoji' => '๐Ÿ’ฅ', 'name' => 'Explosion']
            ];

            function formatExp($number) {
    if ($number == 0) {
        return '0'; // If the number is 0, return '0'
    }

    $units = ['', 'K', 'M', 'B', 'T', 'Qa', 'Qi', 'Sx', 'Sp', 'Oc'];
    $k = 1000;
    $i = 0;

    while ($number >= $k && $i < count($units) - 1) {
        $number /= $k;
        $i++;
    }

    // Localized decimal separator
    $formattedNumber = number_format($number, 1, ',', ''); // Change the decimal separator to comma
    return $formattedNumber . ' ' . $units[$i];
}
       
            $rank = 1;

            while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)) {
                $name = htmlspecialchars($row['Name']);
                $level = $row['LEV'];
                $exp = formatExp($row['EXP']);
                $statuss = $status[$row['Login']] ?? 'Unknown';
                $nation = $nations[$row['Nation']] ?? 'Unknown';
       
                //Style
                $style = $row['Style'];
                $classId = $row['ClassId'];
                $className = $classNames[$classId] ?? 'Unknown';

                //Debug unknown classes
                if (!isset($classNames[$classId])) {
                error_log("Unknown classId: {$classId} for character {$name} (Style: {$style})");
                }
       
                // Assign the emoticon for the current rank
                $rankIcon = $rankEmoticons[$rank]['emoji'] ?? '';
                $rankName = $rankEmoticons[$rank]['name'] ?? '';

                // Assign colors based on Nation and Status
                $nationColor = '';
                switch ($row['Nation']) {
                    case 1:
                        $nationColor = 'lightpurple'; // Capella Light Purple
                        break;
                    case 2:
                        $nationColor = 'lightblue'; // Procyon Light Blue
                        break;
                    case 0:
                    default:
                        $nationColor = 'lightgreen'; // Neutral Light Green
                        break;
                }

               $statusColor = '';

               $loginStatus = (int) $row['Login'];  // Explicitly cast to integer

               if ($loginStatus === 1) {
    $statusColor = 'darkgreen'; // Online -> Green
               } elseif ($loginStatus === 0) {
    $statusColor = 'red'; // Offline -> Red
               } else {
    $statusColor = 'gray'; // Unexpected or unknown value
               error_log("Unexpected Login value for {$name}: {$row['Login']}");
               }

                // Displaying the rankings with title attribute and color styles
                echo "<tr>
                        <td>{$rank} <span title='{$rankName}'>{$rankIcon}</span></td>
                        <td>{$name}</td>
                        <td>{$level}</td>
                        <td>{$exp}</td>
                        <td>{$className}</td>
                        <td class='{$nationColor}'>{$nation}</td>
                        <td style='color: {$statusColor}; font-weight: bold;'>{$statuss}</td>
                      </tr>";
                $rank++;
            }
            ?>
        </tbody>
    </table>
</div>

<?php include 'Themes/Dark/footer.php'; ?>

Logs:
Diff:
Added Class Name on characters ranking sytem which includes the formula calculation thanks to @upanddown - https://forum.ragezone.com/threads/help-style-formula-calculator-ep-33.1244934/
Fixed Online color not being green.
Experience now is displayed by Thousand, Million, Billion, Trillion, and so on...
Fixed Rank emojy icon and name.

PS: Please me help me to find other formula's so i can update the website : https://forum.ragezone.com/threads/help-style-formula-calculator-ep-33.1244934/

1746472450090 - Cabal Website - RaGEZONE Forums


FAQ & Wiki - Cabal Website - RaGEZONE Forums

index - Cabal Website - RaGEZONE Forums

Rankings - Cabal Website - RaGEZONE Forums

Register - Cabal Website - RaGEZONE Forums
 
Last edited:
Hello RageZone,
Here's a website i build and improved/enhanched with the help of AI, the website has very basic functionalities to it, but can be easily updated with more systems.
The website includes:
  1. Themes System
  2. Characters Ranking
  3. Register Account
  4. Login with 'remember me' and Login Attempts.
  5. Change Password
  6. Recover Password based on UserKey.(You choose UserKey on registration form)
  7. News System (With database table, no admin panel for it, use the SQL i provided to add news to the website.)
  8. FAQ & Wiki with search system that filter the results out while being typed.
Languages used for the project: CSS, HTML, PHP, JAVA (only for the collapsible content on FAQ & Wiki section).
Tested on Webhosting using PHP 7.4 works with PHP 8.4 too.

More Screenshots:
https://imgur.com/a/FlB5tdr
SQL Query's:

First:
SQL:
USE [Account]
ALTER TABLE cabal_auth_table
ADD login_attempts INT DEFAULT 0,
    last_attempt_time DATETIME NULL;

Second:
SQL:
USE [Account]
CREATE TABLE News (
    NewsID INT PRIMARY KEY IDENTITY(1,1),
    Title NVARCHAR(255) NOT NULL,
    Content NVARCHAR(MAX) NOT NULL,
    PostDate DATETIME DEFAULT GETDATE()
);

How to add news to the website via Query:
SQL:
USE [Account]
INSERT INTO News (Title, Content)
VALUES    ('Title  1', 'Ragezone is the new Pope of Rome, https://forum.ragezone.com/'),
    ('Title  2', 'Ragezone is the new Pope of Rome, https://forum.ragezone.com/'),
    ('Title  3', 'Ragezone is the new Pope of Rome, https://forum.ragezone.com/');


Download:
Sendspace:
Mediafire:

Password:
ragezone.com

View attachment 281582

View attachment 281583

View attachment 281584

View attachment 281586

View attachment 281589
bro can you make a guide how to install php in debian
 
Hello RageZone,
Here's a website i build and improved/enhanched with the help of AI, the website has very basic functionalities to it, but can be easily updated with more systems.
The website includes:
  1. Themes System
  2. Characters Ranking
  3. Register Account
  4. Login with 'remember me' and Login Attempts.
  5. Change Password
  6. Recover Password based on UserKey.(You choose UserKey on registration form)
  7. News System (With database table, no admin panel for it, use the SQL i provided to add news to the website.)
  8. FAQ & Wiki with search system that filter the results out while being typed.
Languages used for the project: CSS, HTML, PHP, JAVA (only for the collapsible content on FAQ & Wiki section).
Tested on Webhosting using PHP 7.4 works with PHP 8.4 too.

More Screenshots:
https://imgur.com/a/FlB5tdr
SQL Query's:

First:
SQL:
USE [Account]
ALTER TABLE cabal_auth_table
ADD login_attempts INT DEFAULT 0,
    last_attempt_time DATETIME NULL;

Second:
SQL:
USE [Account]
CREATE TABLE News (
    NewsID INT PRIMARY KEY IDENTITY(1,1),
    Title NVARCHAR(255) NOT NULL,
    Content NVARCHAR(MAX) NOT NULL,
    PostDate DATETIME DEFAULT GETDATE()
);

How to add news to the website via Query:
SQL:
USE [Account]
INSERT INTO News (Title, Content)
VALUES    ('Title  1', 'Ragezone is the new Pope of Rome, https://forum.ragezone.com/'),
    ('Title  2', 'Ragezone is the new Pope of Rome, https://forum.ragezone.com/'),
    ('Title  3', 'Ragezone is the new Pope of Rome, https://forum.ragezone.com/');


Download:
Sendspace:
Mediafire:

Password:
ragezone.com

View attachment 281582

View attachment 281583

View attachment 281584

View attachment 281586

View attachment 281589
thanks bro ..
web_rz - Cabal Website - RaGEZONE Forums
 
almost!

View attachment 281751

brother did i miss something?! hehe
Looks like there's no php installed? I've been using webhosting for the tests, do you own a webhost?
Optional: can be done locally too, there's no restriction, requires a bit more time for you to install the right php version to match ur database connetions, that's all.

Edit: First post updated with Class Name added to rankings system.
Diff:
Added Class Name on characters ranking sytem which includes the formula calculation thanks to @upanddown - https://forum.ragezone.com/threads/help-style-formula-calculator-ep-33.1244934/
Fixed Online color not being green.
Experience now is displayed by Thousand, Million, Billion, Trillion, and so on...
 
Last edited:
the website take 12 seconds to finish loading :fuuu: :fuuu: :fuuu:


im not saying its bad but it could be improve
 

Attachments

  • Screenshot_2025-05-06-08-15-55-99_40deb401b9ffe8e1df2f1cc5ba480b12 - Cabal Website - RaGEZONE Forums
    Screenshot_2025-05-06-08-15-55-99_40deb401b9ffe8e1df2f1cc5ba480b12.webp
    21.1 KB · Views: 127
Last edited:
What do you exactly mean?

On my end works smooth, every time i use CTRL+F5 for refresh (Force Refresh) and as u can see there is no way to take that long. (Webhosting not Local)

This is your website no cache ,hard refresh CTRL+ F5 take 12 secs to finish ....

rewrwerg - Cabal Website - RaGEZONE Forums
 
Looks like there's no php installed? I've been using webhosting for the tests, do you own a webhost?
Optional: can be done locally too, there's no restriction, requires a bit more time for you to install the right php version to match ur database connetions, that's all.

Edit: First post updated with Class Name added to rankings system.
Diff:
Added Class Name on characters ranking sytem which includes the formula calculation thanks to @upanddown - https://forum.ragezone.com/threads/help-style-formula-calculator-ep-33.1244934/
Fixed Online color not being green.
Experience now is displayed by Thousand, Million, Billion, Trillion, and so on...

installed it here using this guide?!

Installing a Web Server:
  • Update and Upgrade:
    Open a terminal in your Ubuntu VM and run sudo apt update and sudo apt upgrade to ensure your system is up-to-date.

  • Install Apache or Nginx:
    Choose either Apache (for example, sudo apt install apache2) or Nginx (for example, sudo apt install nginx) as your web server.
    • Apache: Configure Apache by editing the /etc/apache2/apache2.conf and /etc/apache2/sites-available/default.conf files.

    • Nginx: Configure Nginx by editing the /etc/nginx/nginx.conf file.
  • Start the Web Server:
    Start the web server using commands like sudo systemctl start apache2 or sudo systemctl start nginx.

  • Enable the Web Server:
    Enable the web server to start automatically on boot using commands like sudo systemctl enable apache2 or sudo systemctl enable nginx.
3. Placing Your Website Files:
  • Locate the Web Server's Root Directory:
    Apache:
    The default root directory is usually /var/www/html.
    • Nginx: The default root directory is usually /var/www.
 
installed it here using this guide?!

Installing a Web Server:
  • Update and Upgrade:
    Open a terminal in your Ubuntu VM and run sudo apt update and sudo apt upgrade to ensure your system is up-to-date.

  • Install Apache or Nginx:
    Choose either Apache (for example, sudo apt install apache2) or Nginx (for example, sudo apt install nginx) as your web server.
    • Apache: Configure Apache by editing the /etc/apache2/apache2.conf and /etc/apache2/sites-available/default.conf files.

    • Nginx: Configure Nginx by editing the /etc/nginx/nginx.conf file.
  • Start the Web Server:
    Start the web server using commands like sudo systemctl start apache2 or sudo systemctl start nginx.

  • Enable the Web Server:
    Enable the web server to start automatically on boot using commands like sudo systemctl enable apache2 or sudo systemctl enable nginx.
3. Placing Your Website Files:
  • Locate the Web Server's Root Directory:
    Apache:
    The default root directory is usually /var/www/html.
    • Nginx: The default root directory is usually /var/www.
You still did not installed the PHP and MSSQL connection for that php.
 
If you install PHP, do it like this.

[Hidden content]

Works well! Thanks for this, will add some other things like OTP, and so on.View attachment 281830
Im still working and updating it, if you get something done, let me know so i can update the original post.
I will include the credits for everything you do to the project, let's contribute together so we can create a good website that ragezone can use it as base.
Im still enhancing the ranking system, for the moment it looks like this, when i'm done with it i will update the original post.
1746553515306 - Cabal Website - RaGEZONE Forums
 
The "bg.png" cannot be displayed. What needs to be modified?
 
Back