Billiard Scoreboard Documentation v4.5

This documentation contains all installation steps as well as explanations for table control, UI logic, training features and OBS integration.

New in Version 4.5:

1 Requirements

2 System Installation

sudo apt update
sudo apt install nginx php8.3-fpm php8.3-sqlite3 -y

3 Folder Structure

/var/www/billard/ ├── index.php # Main application ├── api.php # Backend API ├── monitor_de.php # Live monitor (German) ├── monitor_en.php # Live monitor (English) ├── obs_small.php # OBS overlay small (Style 1) ├── obs_small_2.php # OBS overlay small (Style 2) ├── obs_small_3.php # OBS overlay small (Style 3) ├── obs_small_4.php # OBS overlay small (Style 4) ├── obs_big.php # OBS overlay large (Style 1) ├── obs_big_2.php # OBS overlay large (Style 2) ├── obs_big_3.php # OBS overlay large (Style 3) ├── obs_big_4.php # OBS overlay large (Style 4) ├── help_de.html # Dokumentation (German) ├── help_en.html # Documentation (English) ├── scoreboard_logo.svg # Logo ├── billiard_data.db # SQLite database ├── tables.json # Live table data ├── config.php # Configuration (PIN, OBS_INTERVAL, Icons, Legal, Login) ├── legal_de.php # Legal texts German (Impressum, Datenschutz) ├── legal_en.php # Legal texts English (Legal Notice, Privacy) │ ├── /obs/ # OBS text files (auto-generated) │ ├── table1_player1.txt │ ├── table1_score1.txt │ └── ... │ ├── /assets/ │ ├── /css/ │ │ └── styles.css # Complete CSS │ └── /js/ │ ├── app.js # Base logic │ ├── game.js # Game functions │ └── training.js # Training functions │ ├── /logos/ # Club logos for OBS │ ├── BC Berlin.png │ ├── BC Bremen.png │ └── [ClubName].png │ ├── /EO/ # Equal Offense images │ └── EO_*.svg │ └── /regeln/ # Rule graphics (SVG) ├── /8ball/ │ └── 8ball_1.svg # 8-Ball rack ├── /9ball/ │ └── 9ball_1.svg # 9-Ball rack ├── /10ball/ │ └── 10_ball.svg # 10-Ball rack └── /14_1/ └── Aufbau_[1-7]_[1-2].svg # 14/1 rerack examples
sudo mkdir -p /var/www/billard/assets/css
sudo mkdir -p /var/www/billard/assets/js
sudo mkdir -p /var/www/billard/logos

4 Set Permissions

Note: SQLite is a file. PHP needs write access to the entire folder.
sudo chown -R www-data:www-data /var/www/billard
sudo chmod -R 775 /var/www/billard

or e.g.:

sudo chown -R www-data:www-data /var/www/html
sudo chmod -R 775 /var/www/html

depending on where the files are located.

5 Nginx Configuration

Configuration path: /etc/nginx/sites-available/default

server {
    listen 80;
    root /var/www/billard;
    index index.php index.html;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
    }
}
sudo nginx -t
sudo systemctl restart nginx

6 URL Overview

ViewURLDescription
Scoreboard http://[IP]/ Main application for players
Monitor (DE) http://[IP]/monitor_de.php Live display of all tables (German)
Monitor (EN) http://[IP]/monitor_en.php Live display of all tables (English)
OBS Small http://[IP]/obs_small.php?Tisch=1 OBS overlay small - Style 1
OBS Small 2 http://[IP]/obs_small_2.php?Tisch=1 OBS overlay small - Style 2 (black scores, red stripe)
OBS Small 3 http://[IP]/obs_small_3.php?Tisch=1 OBS overlay small - Style 3 (blue scores)
OBS Small 4 http://[IP]/obs_small_4.php?Tisch=1 OBS overlay small - Style 4 (Maroon/Bordeaux)
OBS Big http://[IP]/obs_big.php?Tisch=1 OBS overlay large - Style 1
OBS Big 2 http://[IP]/obs_big_2.php?Tisch=1 OBS overlay large - Style 2 (split stripes, logos)
OBS Big 3 http://[IP]/obs_big_3.php?Tisch=1 OBS overlay large - Style 3 (logos, blue scores)
OBS Big 4 http://[IP]/obs_big_4.php?Tisch=1 OBS overlay large - Style 4 (Maroon/Bordeaux, logos)
Hilfe (DE) http://[IP]/help_de.html Documentation (German)
Help (EN) http://[IP]/help_en.html This documentation (English)

7 Table Control via URL

ParameterBehavior
index.php Free selection: Tables 1-8 selectable in setup
index.php?Tisch=0 Admin mode: Table selection hidden
index.php?Tisch=1 Fixed mode: Table fixed (1-8)

Color Scheme via URL NEW

The color scheme can be set directly via a URL parameter. Both German and English names are accepted:

Parameter (EN)Parameter (DE)Color Scheme
?theme=yellow ?theme=gelb Default (Yellow/Gold)
?theme=blue ?theme=blau Blue/Cyan
?theme=green ?theme=gruen Green
?theme=white ?theme=weiss Light Mode

Language via URL NEW

The language can be set directly via a URL parameter:

ParameterLanguage
?lang=de German
?lang=en English
Tip: Parameters can be combined, e.g. http://[IP]/?Tisch=1&theme=blue&lang=en

8 OBS Studio Integration NEW

Setup in OBS

  1. In OBS: Sources → + → Browser
  2. Enter name (e.g. "Scoreboard Table 1")
  3. Enter URL: http://[SERVER-IP]/obs_big.php?Tisch=1
  4. Width: 1400 (big) or 700 (small)
  5. Height: 150 (big) or 100 (small)
  6. Leave "Custom CSS" empty
  7. Enable "Refresh browser when scene becomes active"

Recommended Sizes

VersionWidthHeightUsage
obs_small.php 700 px 100 px Compact display, stream corner
obs_small_2.php 700 px 120 px Separate fields, black scores, red stripe
obs_small_3.php 700 px 120 px Separate fields, blue scores
obs_small_4.php 500 px 120 px Maroon/Bordeaux design, compact
obs_big.php 1400 px 150 px Full width, bottom of screen
obs_big_2.php 1400 px 180 px Split stripes (name/club), logos, red accents
obs_big_3.php 1400 px 150 px Logos, blue score boxes
obs_big_4.php 1200 px 150 px Maroon/Bordeaux design, logos, yellow accents

Setting Up Club Logos

Logos are automatically displayed when a PNG file with the exact club name exists:

# Create logo folder
sudo mkdir -p /var/www/billard/logos

# Upload logos (examples)
/var/www/billard/logos/BC Berlin.png
/var/www/billard/logos/BC Bremen.png
/var/www/billard/logos/Imperium.png
Tip: Logo files should be square (e.g. 200x200 px) with transparent background (PNG). The filename must exactly match the club name!
OBS Troubleshooting: If the scoreboard doesn't display completely in OBS:

9 Game Timer & Header Display NEW v4.2

During a running game, the discipline and running game time are displayed in the header.

Features

Tip: The game time is also transmitted to the OBS text files (as start time).

10 OBS Text Files NEW v4.2

In addition to the browser overlays, individual TXT files are automatically generated in the /obs/ folder. These can be used as browser sources in OBS.

Available Files per Table

FileContentExample
table1_discipline.txtDiscipline14/1
table1_raceto.txtRace to100
table1_player1.txtPlayer 1 nameMax Mustermann
table1_player2.txtPlayer 2 nameJohn Doe
table1_club1.txtClub player 1BC Berlin
table1_club2.txtClub player 2BC Bremen
table1_score1.txtScore player 142
table1_score2.txtScore player 238
table1_innings1.txtInnings player 112
table1_innings2.txtInnings player 211
table1_highseries1.txtHigh run player 115
table1_highseries2.txtHigh run player 29
table1_series1.txtCurrent run player 13
table1_series2.txtCurrent run player 20
table1_gd1.txtGD player 13.50
table1_gd2.txtGD player 23.45
table1_starttime.txtStart time14:30:00
table1_matchtime.txtMatch time (HH:MM)01:23
table1_balls1.txtBalls pocketed player 1 (One Pocket / Bank Pool)5
table1_balls2.txtBalls pocketed player 2 (One Pocket / Bank Pool)3
table1_runout1.txtRunouts player 12
table1_runout2.txtRunouts player 21

Setup in OBS (Browser Source)

The recommended method is using a Browser source with the xObsBrowserAutoRefresh plugin:

  1. Install the xObsBrowserAutoRefresh plugin
  2. In OBS: Sources → + → Browser
  3. Enter URL: http://[SERVER-IP]/obs/table1_score1.txt
  4. Adjust width/height as needed
  5. Enter Custom CSS for text formatting:
body {
    background-color: rgba(0, 0, 0, 0);
    color: #ffffff;
    font-family: "Arial";
    font-size: 40px;
    font-weight: bold;
    text-shadow: 2px 2px 4px #000000;
    overflow: hidden;
}
  1. Right-click on the browser source → Filters
  2. Click + to add the "Browser Auto-refresh" filter
  3. Set the interval to 15 seconds
Tip: Font, size, color and shadow can be freely customized via CSS. Each text file can be added as its own browser source with individual styling.

CSS with Text Alignment

To display text vertically centered with horizontal alignment, use the following CSS variants:

Text left-aligned:

body {
    background-color: rgba(0, 0, 0, 0);
    color: #ffffff;
    font-family: "Arial";
    font-size: 40px;
    font-weight: bold;
    text-shadow: 2px 2px 4px #000000;
    overflow: hidden;
    margin: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

Text centered:

body {
    background-color: rgba(0, 0, 0, 0);
    color: #ffffff;
    font-family: "Arial";
    font-size: 40px;
    font-weight: bold;
    text-shadow: 2px 2px 4px #000000;
    overflow: hidden;
    margin: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

Text right-aligned:

body {
    background-color: rgba(0, 0, 0, 0);
    color: #ffffff;
    font-family: "Arial";
    font-size: 40px;
    font-weight: bold;
    text-shadow: 2px 2px 4px #000000;
    overflow: hidden;
    margin: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
Note: Files are updated every 15 seconds (configurable via OBS_INTERVAL in config.php). The /obs/ folder is created automatically.
matchtime: Shows elapsed match time in HH:MM format (no seconds). Only calculated during an active game, otherwise "-".
balls: Shows ball count only for One Pocket and Bank Pool disciplines (e.g. "5/8 - 3/8"). Shows "-" for all other disciplines.
Tip: Text files are ideal for custom OBS layouts where name, score and statistics need to be freely positioned.

11 Winner/Alternate Break

For 8-Ball, 9-Ball and 10-Ball, the break mode can be selected in setup:

ModeBehavior
Alternate Break The break alternates after each rack (+ or -) to the other player
Winner Break The winner of a rack keeps the break (only switches on +)

Procedure

  1. In setup select Discipline (8-Ball, 9-Ball or 10-Ball)
  2. Select Break Mode (Alternate Break or Winner Break)
  3. When clicking START GAME the popup "Who breaks first?" appears
  4. Select player - the active player is marked with a border
  5. On REMATCH you'll be asked again who breaks
Tip: At game end, all input buttons are disabled. Only Undo and Restart remain active.

12 Help Buttons (Rules & Rack)

All disciplines (14/1, 8-Ball, 9-Ball, 10-Ball) have a Help Button (question mark) in the control bar.

Content per Discipline

DisciplinePagesFeatures
14/1 Continuous 5 rule pages + 7 examples Rerack examples with before/after SVGs
8-Ball 4 rule pages Rack image (SVG) directly on the "Rack & Break" page
9-Ball 4 rule pages Rack image (SVG) directly on the "Rack & Break" page
10-Ball 4 rule pages Rack image (SVG) directly on the "Rack & Break" page
Tip: Rack SVGs are located in the /regeln/ folder. The popup is scrollable and has Prev/Next buttons for navigation.

13 GD (Game Average)

The GD (Game Average = Points / Innings) is displayed for 14/1 games in multiple places:

LocationDisplayDescription
Running Game GD: X.XX Live GD in the stats row below the score (Inn | Series | HS | GD)
Player Stats Best GD: X.XX Highest GD ever achieved on the player card
Champions Best GD New champion card for the player with the highest GD
History Innings: X / HS: X / GD: X.XX GD per player in each 14/1 history entry
Calculation: GD = Points / Innings (rounded to 2 decimal places). The best GD is automatically saved at game end.

14 14/1 History (Player Statistics)

Each player now has a history chart for their 14/1 games. The chart shows the development of high run and GD over the last 20 matches.

How to Open History

  1. Navigate to Player Database
  2. Click on a Player Card
  3. In the popup click "14/1 History" (blue button)

Chart Explanation

ElementColorY-AxisDescription
High Run Green Left (0-100) Best run per game
GD Blue Right (0-20) Game average per match
X-Axis - - Last 20 games (-20 to 0)

Statistics Box

Below the chart the following values are displayed:

Tip: The history only shows 14/1 games. For players without 14/1 history, "No 14/1 games found" appears.

15 Multi-language Support (i18n)

The scoreboard now supports full multi-language capability. The language can be switched at any time in the sidebar.

Supported Languages

LanguageCodeFile
Germande/assets/lang/de.json
Englishen/assets/lang/en.json

Language Switch

  1. Open sidebar (burger menu)
  2. Click DE or EN at the bottom
  3. The entire UI is immediately translated
Tip: The language setting is saved in the browser and automatically restored on the next visit.

16 14/1 Live Innings

During a 14/1 game, an overview of all innings played so far can be displayed at any time.

How to Open the Overview

  1. During a 14/1 game
  2. Click the History Button (clock icon) in the control bar
  3. A popup shows all innings with points and intermediate scores

Displayed Information

ColumnDescription
Inn.Inning number
Points (left)Points of player 1 in this inning
ScoreCurrent score after the inning
Points (right)Points of player 2 in this inning
Tip: Ideal for checking during the game and for referees.

17 New Disciplines

Rotation

61 points game with the 3-foul rule. If a player commits 3 fouls in a row, they lose the game.

One Pocket

Sink balls into your designated pocket. Default target: 8 balls.

Bank Pool 9-Ball

Only bank shots allowed. Target: 5 balls.

Bank Pool 15-Ball

Only bank shots with all 15 balls. Target: 8 balls.

Doubles Modes

8-Ball, 9-Ball and 10-Ball can be played as doubles (2 vs 2). Team names are automatically combined.

18 Equal Offense Training

Pool 14/1 Levels (1-4)

LevelErrorsGDTargetMaximum
Level 124120150
Level 216120150
Level 3012120150
Level 4017170200
Level 4 - Special Features (v3.5):

9-Ball Levels (1-3)

LevelErrorsStart BallsTargetMaximum
Level 1244090
Level 2166090
Level 3099090

Bowlliards NEW

Bowling scoring on the pool table. Single player training with classic bowling point calculation.

PropertyValue
Frames10
Balls per Frame10
Max. Attempts per Frame2 (Frame 10: up to 3)
Maximum Score300 (12 Strikes)

Scoring

ResultSymbolPoints
StrikeX (red)10 + next 2 throws
Spare/ (blue)10 + next 1 throw
OpenNumberSum of pocketed balls

10th Frame Special Rules

Tip: The bowling scorecard shows all 10 frames with running totals. The active ball is highlighted.

19 PIN System

PIN TypeDefaultUsage
Master PIN 12345 Manage players, delete stats, delete history entries
Player PIN 000000 Start training
Note: Change master PIN in assets/js/app.js (line 7): masterPin: "12345"

20 API Endpoints

EndpointDescription
api.php?action=load Load all player data
api.php?action=save Save data (POST)
api.php?action=get_tables Live table data for Monitor/OBS
api.php?action=update_table Send table update (POST)

21 Troubleshooting

ProblemSolution
HTTP 500 Check write permissions (Step 4)
OBS shows nothing Increase browser source width, leave CSS empty
Logo not visible Filename must exactly match the club name
Training buttons not responding Check browser console (F12), training.js complete?
Debug Commands:
sudo tail -f /var/log/nginx/error.log - Error log

22 Backup (Server)

# Create backup
cd /var/www
sudo tar -czf billard-backup-$(date +%Y%m%d).tar.gz billard/

# Restore backup
sudo tar -xzf billard-backup-20250127.tar.gz

23 In-App Backup & Restore NEW v4.3

All data can be exported as a JSON file and re-imported directly in the app.

Create Backup

  1. Navigate to Player Database
  2. Click "Backup" (download icon)
  3. A JSON file is downloaded: billard-backup-YYYY-MM-DD.json

Import Backup

  1. Click "Restore" (upload icon)
  2. Enter the Master PIN
  3. Select the JSON backup file
  4. Confirm the import - all data will be overwritten

Included Data

Warning: Importing a backup will overwrite all existing data! Create a backup first.

24 Rankings NEW v4.3

The rankings show all players in a sortable table.

Sort Options

Sort ByDescription
Win%Win percentage (default) - Players with less than 5 games are dimmed
WinsNumber of games won
High RunBest run (HS)
Best GDBest game average

Displayed Columns

25 Player Statistics NEW v4.3

Detailed statistics per player, accessible via the player action popup.

How to Open Statistics

  1. Navigate to Player Database
  2. Click on a Player Card
  3. Click "Statistics" in the popup

Included Information

SectionContent
OverviewWin%, total games, wins, losses
Win StreaksCurrent streak (wins/losses), best win streak
Per DisciplineWins, losses, high run, GD - broken down by 14/1, 8-Ball, 9-Ball etc.
Head-to-HeadRecord against each opponent (W / L)

Win% on Player Cards

The win percentage is displayed directly on each player card (with at least 1 game). Players with 3+ consecutive wins receive a green streak badge (e.g. "5W").

Win% Champion

In the champions section, the player with the best win percentage is displayed (minimum 5 games required).

26 Player Comparison NEW v4.3

Two players can be compared directly.

How to Open Comparison

  1. Navigate to Player Database
  2. Click "Compare" (scale icon)
  3. Select two players from the dropdowns

Compared Values

CategoryDescription
Win%Win percentage
Wins / LossesTotal count
High RunBest run
Best GDGame average
Head-to-HeadDirect record against each other
Tip: The better value in each category is highlighted in green.

27 History Improvements NEW v4.3

Filter

History entries can be filtered:

CSV Export

The game history can be exported as a CSV file (semicolon-separated, UTF-8 with BOM for Excel).

Included columns: Date, Discipline, Race, Player 1, Player 2, Score 1, Score 2, Winner

28 Training Progress Chart NEW v4.3

Shows the development of training results as a line chart.

How to Open the Chart

  1. Click on a Player Card
  2. Click "Training Progress" in the popup
  3. Select an exercise from the dropdown

Chart Elements

Tip: The chart uses Chart.js and only shows exercises that have results.

29 Cancel Game NEW v4.4

A new button in the popup menu (tool icons) allows you to cancel the current game.

How It Works

  1. During a game, click the Tools button (wrench icon)
  2. In the popup, a new Cancel icon (X) appears next to Restart, Undo and Help
  3. After clicking, a confirmation popup is displayed
  4. Upon confirmation, the game ends - without saving any values to statistics
Important: When cancelled, no results are saved - neither wins/losses nor high runs or GD values. The game is treated as if it never took place.

30 Icon Configuration NEW v4.4

The appearance of buttons can be configured in config.php.

Settings

ConstantValuesDescription
ICON_STYLE 'round' / 'square' Round icons (default) or square icons with rounded corners
ICON_3D true / false Enable or disable 3D shadows (neumorphism effect) (default: flat)

Example config.php

define('ICON_STYLE', 'square');   // 'round' or 'square'
define('ICON_3D', true);          // true = 3D shadows, false = flat
Tip: The settings affect all buttons in the application (score buttons, control bar, training). The 3D effect automatically adapts to the selected color scheme (Dark/Light).

31 Legal Notice & Privacy Policy NEW v4.4

The sidebar provides access to Legal Notice (Impressum) and Privacy Policy pages. The pages contain sample texts that should be customized.

Activation

In config.php:

define('SHOW_LEGAL', true);   // true = visible, false = hidden

Access

  1. Open sidebar (burger menu)
  2. Below "Fullscreen", the links Legal Notice and Privacy Policy appear
  3. Click the respective link
Important: The pages contain sample texts with a notice banner. The texts must be customized with your own information. German texts are in legal_de.php, English texts in legal_en.php. Texts switch automatically when changing the language.

32 Login System NEW v4.5

The start page (index.php) can optionally be protected with a login. There are two login methods: admin login and player login.

Activation

In config.php:

define('REQUIRE_LOGIN', true);    // true = login required, false = no login
define('LOGIN_USER', 'admin');    // Admin username
define('LOGIN_PASS', 'billard'); // Admin password

Admin Login

The administrator can log in using the credentials defined in config.php (LOGIN_USER / LOGIN_PASS).

Player Login

Players can log in with their name and PIN, provided the "Login Startpage" checkbox is enabled in the player editor.

  1. Navigate to Player Database
  2. Edit player (pencil icon)
  3. Enable the "Login Startpage" checkbox
  4. Save

Login Form

Logout

A Logout button appears in the sidebar (only visible when login is active). Clicking it ends the session.

Important: Only the start page (index.php) is protected. Monitor pages, OBS overlays and help pages remain freely accessible.
Tip: With REQUIRE_LOGIN = false (default), no login is required and the logout button is hidden.

Version History


Pro Billiard Scoreboard System v4.5 | Developed for billiard players