==========================================================================
  TorrentTrader 3.8.3 - installation package            (20261128_1605)
==========================================================================

CONTENTS
--------
  1. What is in the package
  2. Requirements
  3. Installation
  4. After the installation
  5. Admin CP - what every class can see and do
  6. Other staff pages (outside admincp.php)
  7. Problems


1. WHAT IS IN THE PACKAGE
-------------------------
  One ZIP file. Its content goes STRAIGHT into the web folder (public_html):

    install.php           the web installer
    install/              the tables of the tracker, this README and the list
                          of files the installer completes. It can not be
                          read over the web and is deleted by the installer.
    backend/ modules/ themes/ languages/ blocks/ ...   the site

  The package has no name, domain or folder path of another site. The
  installer writes YOUR site name, address and folder path into the files
  and tables.

  All tables are empty. Only the tables the site can not open without have
  their basic rows: user classes, themes, languages, blocks, countries and
  torrent languages. There are no members (the installer makes your owner
  account and the System account), no categories, torrents, forums, posts,
  messages, news or logs. Database access, API keys, SMTP and Cloudflare
  values are empty.


2. REQUIREMENTS
---------------
  Required
    - PHP 8.1 or newer (tested with PHP 8.5)
    - PHP extensions: mysqli, mbstring, json
    - Argon2id password support in PHP (password_hash with PASSWORD_ARGON2ID)
    - MySQL 5.7+ / MariaDB 10.3+ (tested with MariaDB 10.11), utf8mb4,
      on the same server (localhost)
    - Apache or LiteSpeed with .htaccess (nginx only: protect backend/,
      cache/ and the torrent folders yourself)

  Recommended
    - iconv, gd, curl, zlib (IMDb / TMDB data, trailers, pictures, compression)
    - HTTPS certificate (Let's Encrypt / AutoSSL / Cloudflare)


3. INSTALLATION
---------------
  1. Files
     Upload the ZIP into the web folder (e.g. /home/USER/public_html) and
     unpack it there (CWP / cPanel File manager: Upload, then Extract), or
     unpack it on your computer and upload the content with FTP (FileZilla,
     WinSCP). install.php must be directly in public_html, next to index.php.
     Folders 755, files 644 (CWP / cPanel do this themselves).

  2. Database
     In your hosting panel (CWP: MySQL Manager, cPanel: MySQL Databases)
     create a NEW EMPTY database and a database user, and give the user ALL
     PRIVILEGES on this database. Write down the database name, the user and
     the password. Nothing has to be imported - the installer makes the
     tables.

  3. Installer
     Open https://your-domain/install.php in the browser. Every other page of
     the site goes to install.php until the installation is finished.

       Step 1  Requirements - the server is checked. Red lines must be fixed,
               yellow lines are optional.
       Step 2  Database - host localhost, database name, user, password ->
               "Test connection" -> "Import and continue". The tables are
               made in small parts, so there are no time limit problems.
               Only a database on this server is accepted, and the installer
               refuses a database that already has members or tables of
               another program - it never overwrites a site.
       Step 3  Site - site name, site address (found automatically, without a
               slash at the end), site e-mail, default language, registration
               (invite only / open).
       Step 4  Owner account - username, e-mail, password (at least 10
               characters). The account gets the class Owner. Press
               "Install".
       Step 5  Finish - the installer
                 - writes backend/mysql.php (database access) and
                   backend/config.php (site name, address, e-mail, new
                   security key),
                 - writes the site name, address and the folder path of this
                   server into the files and tables (e.g. torrent folder
                   /home/USER/public_html/torrents),
                 - makes the System account and the missing data folders,
                 - writes cache/install.lock, deletes install/ and tries to
                   delete install.php.

  4. install.php
     If the finish page says "Last step: delete install.php", delete
     install.php from public_html (FTP / File manager).
     WHILE install.php IS IN public_html THE WHOLE SITE IS CLOSED
     (maintenance page). This is on purpose.

  The installer can not be run twice: cache/install.lock makes it show only
  "Already installed". To install again from the beginning: empty the
  database, delete cache/install.lock and unpack the package again.


4. AFTER THE INSTALLATION
-------------------------
  1. Log in with the owner account.
  2. Make the torrent categories: Admin CP -> Owner panel -> Categories
     manager (the package has none). Then forums (Team leader panel ->
     Forum manager), FAQ, rules and news as you want them.
  3. API keys and mail - ONLY in backend/config.php (never in the admin
     panel): OMDb / TMDB / YouTube keys, SMTP host / user / password,
     Cloudflare and reCAPTCHA keys. Without them the site works; only those
     parts stay empty.
  4. Admin CP -> Owner panel -> Site settings: description, registration,
     limits, blocks on pages (left / right blocks only on the start page by
     default), forum, ratios ... Values from the panel are saved in the table
     site_settings and are stronger than config.php.
  5. Cron job for the cleanup (every 15 minutes is enough), e.g. in CWP:
       */15 * * * * /usr/local/bin/php /home/USER/public_html/backend/cron-cleanup.php >/dev/null 2>&1
     (PHP of CWP with Remi PHP 8.5: /opt/remi/php85/root/usr/bin/php)
     Without cron the cleanup runs from page views (Admin CP -> Force clean).
  6. Announce address for torrents: https://your-domain/announce.php
  7. Theme pictures (logo, banner): put your own pictures in themes/.
  8. Make a backup of the database once the site runs.


5. ADMIN CP - WHAT EVERY CLASS CAN SEE AND DO
---------------------------------------------
  User classes of the package
     1 User   2 Power User   3 VIP   4 Uploader   5 Moderator
     6 Super Moderator   7 Administrator   8 Owner   9 System

  "System" (9) is the account that sends automatic messages - nobody logs in
  with it. The package has no separate "coder" class: the person who works on
  the code uses an Owner (8) account. If you want a coder class, add it in
  Admin CP -> User classes and give it the levels you want with ADMINCP_ACL
  (see the end of this section).

  Who can open admincp.php at all
     A member needs the right "control_panel" = yes in his user class
     (Admin CP -> User classes). Moderator and higher have it in the package.
     Inside the panel every page has its own minimum class (table below).

  The start page of the panel shows the menu with icons (Owner also sees
  the server data: PHP / MySQL version, last cleanup with "Force clean",
  members waiting for confirmation). Every other page has a
  "Back to Admin CP" button.

  ----------------------------------------------------------------------
  OWNER (8) - everything below, plus three panels only for class 8
  ----------------------------------------------------------------------
  Owner panel
     User classes (rights of every class), Themes manager, Blocks manager,
     Categories manager, Mass e-mail, Invites manager (see the note at the
     end of this section), Donations, FAQ manager, Owner image host,
     SQL errors, Upload manager, Rules manager, Simple user search,
     Announcements, Freeleech manager, Site settings, Text repair,
     Seed bonus manager, Word censor, Banners manager, Inactive users,
     Languages manager, Camelot mailer, Snatch list,
     Set one theme for all members

  Team leader panel
     Staff contacts, Privacy level, Site log, Clear staff shoutbox,
     Advanced user search, Message spy, Mass PM, Polls, E-mail bans,
     Banned IPs, News manager, Teams manager, Donors list,
     Dead torrents (external / local when external torrents are allowed),
     Who is where, View torrents, Disabled users,
     Forum manager (forum v2)

  Administrator panel
     Image host, Invited users, Pending invited users, Add new user,
     Clear shoutbox

  ----------------------------------------------------------------------
  ADMINISTRATOR (7) - "Super moderator panel" and everything below
  (the panel names are the old TorrentTrader names, one step higher
  than the class names)
  ----------------------------------------------------------------------
     Banned torrents, Latest comments, Warned users, Peers list (client and
     version from the Peer-ID), Punished users, Bitbucket gallery,
     Free leech torrents, Avatar log, Uploader applications, Hit and run list,
     BitTorrent clients, Detect possible cheaters

  ----------------------------------------------------------------------
  SUPER MODERATOR (6) - "Moderator panel" and everything below
  ----------------------------------------------------------------------
     Upload activity, Reports, Duplicate IPs

  ----------------------------------------------------------------------
  MODERATOR (5) - "Uploader panel"
  ----------------------------------------------------------------------
     Searched words, Torrents import

  ----------------------------------------------------------------------
  UPLOADER (4), VIP (3), POWER USER (2), USER (1)
  ----------------------------------------------------------------------
     No Admin CP. They use the normal site (upload for Uploader and higher,
     as set in User classes).

  Changing the levels
     The levels are in $ACP_ACL at the top of modules/admin/admincp.php.
     Do not change that file - set single values in backend/config.php:

        $site_config['ADMINCP_ACL'] = array('peers' => 6, 'invites' => 8);

     The key is the action in the address (admincp.php?action=peers).
     ADMINCP_DEFAULT_CLASS (default 8) is used for actions that are not in
     the table. A member whose class is lower than the level gets
     "no rights". In the package "invites" has level 9, so even the Owner
     can not open the Invites manager until you add 'invites' => 8 as above.


6. OTHER STAFF PAGES (OUTSIDE admincp.php)
------------------------------------------
  Page                         Address                 Minimum class (config.php key)
  Site settings                site-settings.php       SITE_SETTINGS_CLASS (Owner)
  Forum manager (forum v2)     forum-manager.php       FORUM_ADMIN_CLASS   (8)
  Text repair (broken letters) text-repair.php         TEXT_REPAIR_CLASS   (7)
  Staff part of torrent page   torrents-details        TD_STAFF_CLASS      (5)
    (info hash, peers, file list, edit / delete, NFO for staff)

  The routes are in core/routes.php:
     'site-settings' => 'modules/admin/site-settings.php',
     'forum-manager' => 'modules/admin/forum-manager.php',
     'text-repair'   => 'modules/admin/text-repair.php',

  Staff also see the moderation tools inside the forum (move, lock, pin,
  delete topics) as set in the forum manager.


7. PROBLEMS
-----------
  Every page goes to install.php
     The installation is not finished (cache/install.lock is missing).

  "The site is closed for maintenance"
     The installation is finished, but install.php is still in public_html.
     Delete it.

  "Only a database on this server can be used"
     Use the host localhost. A database on another server is not accepted.

  "Too many failed connections"
     Wait one hour (or delete cache/.install_tries) and check the database
     name, user and password in your hosting panel.

  Import stops with an SQL error
     The database is not empty, or the user has no CREATE / INSERT rights.
     Empty the database (or make a new one) and press "Import and continue"
     again.

  "config.php is not writable" / "mysql.php is not writable"
     Give backend/config.php and backend/mysql.php permission 664 (or 666)
     for the installation.

  Broken letters (Ä, Å¡ ... instead of č, š)
     The database must be utf8mb4. Old texts can be fixed with Text repair.

  White page / error 500
     Check the error_log of the site (CWP: /home/USER/logs/) and the PHP
     version of the domain (8.1 or newer).
