- (OPTIONAL) Discord server (to notify about new quotation)
- MariaDB or MySQL Database
- Inside: index.php
$conn = mysqli_connect('localhost','user','password','database');
fill it with connection credentials for your database
- Inside insert.php:
$con = mysqli_connect('localhost','user','password','database');
same as in index.php just fill it with you connection credentials
"url" => "discord webhook link here",
fill it with your discord webhook link
- Run in your database querry:
CREATE TABLE `cytaty_tabela` (
`id` int(50) NOT NULL,
`cytat` varchar(80) NOT NULL,
`osoba` varchar(50) NOT NULL,
`date_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`ip` varchar(50) NOT NULL,
`zatwierdzony` enum('0','1') NOT NULL
)
- delete from: insert.php
// load Webhook
require_once "DiscordWebhook.php";
require_once "DiscordEmbed.php";
$webhook = [
"url" => "discord webhook link here",
"username" => "",
"avatar" => ""
];
$message = "Someone added a quote to jajuwa";
$msg = new DiscordWebhook($webhook["url"]);
$msg->setMessage($message)->setUsername("test")->setAvatar("")->setTts("")->send();
- Delete file: DiscordEmbed.php
- Delete file: Discord Webhook.php
Done :D
- (OPCJONALNIE) Serwer Discord (do informowania o nowych cytatach)
- Baza danych MariaDB lub MySQL
- w pliku: index.php
$conn = mysqli_connect('localhost','user','password','database');
wypełnij danymi do twojej bazy danych
- Inside insert.php:
$con = mysqli_connect('localhost','user','password','database');
Tak samo jak w pliku index.php poprostu wypełnij danymi do twojej bazy danych
"url" => "discord webhook link here",
w miejscu discord webhook link here wstaw link webhooka twojego serwera discord
- Wykonaj w swojej bazie danych:
CREATE TABLE `cytaty_tabela` (
`id` int(50) NOT NULL,
`cytat` varchar(80) NOT NULL,
`osoba` varchar(50) NOT NULL,
`date_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`ip` varchar(50) NOT NULL,
`zatwierdzony` enum('0','1') NOT NULL
)
- Usuń z pliku: insert.php
// load Webhook
require_once "DiscordWebhook.php";
require_once "DiscordEmbed.php";
$webhook = [
"url" => "discord webhook link here",
"username" => "",
"avatar" => ""
];
$message = "Ktos cos dodal na jajuwe";
$msg = new DiscordWebhook($webhook["url"]);
$msg->setMessage($message)->setUsername("test")->setAvatar("")->setTts("")->send();
- Usuń plik: DiscordEmbed.php
- Usuń plik: Discord Webhook.php
Gotowe :D