Installation von PPBB V2.0

1. MySQL-Tabellen

Das Script benötigt fünf Tabellen mit dem Namen users, categories, posts, threads, profiles.

1.1 Tabelle [users]

  1. user_id [INT] [AUTOINCREMENT]
  2. username [VARCHAR]
  3. user_password [CHAR]
  4. user_email [VARCHAR]
  5. user_level [VARCHAR]
  6. user_date [DATETIME]

1.2 Tabelle [categories]

  1. cat_id [INT] [AUTOINCREMENT]
  2. cat_name [VARCHAR]
  3. cat_description [TEXT]

1.3 Tabelle [posts]

  1. post_id [INT] [AUTOINCREMENT]
  2. post_content [TEXT]
  3. thread_id [INT]
  4. post_by [VARCHAR]
  5. post_created [DATETIME]
  6. user_id [INT]
  7. FOREIGN KEY (thread_id) REFERENCES threads(thread_id) ON DELETE CASCADE ON UPDATE CASCADE
  8. FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE

1.4 Tabelle [threads]

  1. thread_id [INT] [AUTOINCREMENT]
  2. thread_title [VARCHAR]
  3. category_id [INT]
  4. thread_created [DATETIME]
  5. thread_updated [DATETIME]
  6. thread_by [VARCHAR]
  7. user_id [INT]
  8. FOREIGN KEY (category_id) REFERENCES categories(cat_id) ON DELETE CASCADE ON UPDATE CASCADE
  9. FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE

1.5 Tabelle [profiles]

  1. profile_id [INT] [AUTOINCREMENT]
  2. profile_image [VARCHAR]
  3. profile_about [VARCHAR]
  4. profile_location [VARCHAR]
  5. profile_videogames [VARCHAR]
  6. profile_movies [VARCHAR]
  7. user_id [INT]
  8. FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE

Alternativ kann auch der unten aufgeführte SQL-Code über phpMyAdmin eingefügt werden.


CREATE TABLE `users` (
`user_id` int(10) NOT NULL AUTO_INCREMENT,
`username` varchar(30) NOT NULL,
`user_password` char(255) NOT NULL,
`user_email` varchar(50) NOT NULL,
`user_level` varchar(50) NOT NULL DEFAULT 'user',
`user_date` datetime NOT NULL,
PRIMARY KEY (`user_id`),
UNIQUE KEY `username_unique` (`username`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci

CREATE TABLE `categories` (
`cat_id` int(10) NOT NULL AUTO_INCREMENT,
`cat_name` varchar(100) NOT NULL,
`cat_description` text NOT NULL,
PRIMARY KEY (`cat_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci

CREATE TABLE `posts` (
`post_id` int(10) NOT NULL AUTO_INCREMENT,
`post_content` text NOT NULL,
`thread_id` int(11) NOT NULL,
`post_by` varchar(30) NOT NULL,
`post_created` datetime NOT NULL,
`user_id` int(10) NOT NULL,
PRIMARY KEY (`post_id`),
KEY `posts_ibfk_1` (`thread_id`),
KEY `posts_ibfk_2` (`user_id`),
CONSTRAINT `posts_ibfk_1` FOREIGN KEY (`thread_id`) REFERENCES `threads` (`thread_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `posts_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci

CREATE TABLE `threads` (
`thread_id` int(10) NOT NULL AUTO_INCREMENT,
`thread_title` varchar(50) NOT NULL,
`category_id` int(10) NOT NULL,
`thread_created` datetime NOT NULL,
`thread_updated` datetime NOT NULL,
`thread_by` varchar(30) NOT NULL,
`user_id` int(10) NOT NULL,
PRIMARY KEY (`thread_id`),
KEY `category_id` (`category_id`),
KEY `threads_ibfk_2` (`user_id`),
CONSTRAINT `threads_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`cat_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `threads_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci

CREATE TABLE `profiles` (
`profile_id` int(10) NOT NULL AUTO_INCREMENT,
`profile_image` varchar(250) NOT NULL DEFAULT 'no_profile_picture.jpg',
`profile_about` varchar(500) NOT NULL,
`profile_location` varchar(25) NOT NULL,
`profile_videogames` varchar(500) NOT NULL,
`profile_movies` varchar(500) NOT NULL,
`user_id` int(10) NOT NULL,
PRIMARY KEY (`profile_id`),
KEY `user_id` (`user_id`),
CONSTRAINT `profiles_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci

2. Verbindungsaufbau zur Datenbank

Der Verbindungsaufbau zur Datenbank erfolgt über [includes/db.php] [Z4-7], wo Name des Servers, Name der Datenbank, Nutzername und Passwort eingetragen werden müssen.

3. Administrationszugang und Registrierung

Ein Administrationszugang wird angelegt, indem man sich über [signup.php] registriert und dann über phpMyAdmin das [user_level] von [user] auf [administrator] ändert. Registrierte Nutzern haben automatisch das [user_level] [user].

4. BB-Code

Der Inhalt eines Beitrages kann mit dem integrierten BB-Code formatiert werden.

Changelog

Update zur Version 2.0 (16.10.2024)

Update zur Version 1.2 (20.09.2024)

Update zur Version 1.1 (18.09.2024)