mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2025-06-19 08:30:36 +00:00
Upading README slowwwwwly
This commit is contained in:
parent
43658efc88
commit
4005bc2d87
3 changed files with 24 additions and 12 deletions
18
README.md
18
README.md
|
@ -28,11 +28,19 @@ I also recommend not using root for this and setting up a user specifically for
|
||||||
|
|
||||||
You will next need to setup the following 5 tables:
|
You will next need to setup the following 5 tables:
|
||||||
|
|
||||||
- images
|
#### Images
|
||||||
- users
|
```CREATE TABLE images ( id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, imagename VARCHAR(50) UNIQUE, alt VARCHAR(255), tags VARCHAR(255), alt VARCHAR(50), modified TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, upload TIMESTAMP DEFAULT CURRENT_TIMESTAMP );```
|
||||||
- tokens
|
#### Users
|
||||||
- logs
|
```CREATE TABLE users ( id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, usernname VARCHAR(50) NOT NULL UNIQUE, password VARCHAR(255) NOT NULL, admin bool, modified TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP );```
|
||||||
- bans
|
#### Tokens
|
||||||
|
```CREATE TABLE tokens ( id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, code VARCHAR(50) NOT NULL, used BOOL, used_at VARCHAR(50) NOT NULL );```
|
||||||
|
#### Logs
|
||||||
|
```CREATE TABLE logs ( id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, ipaddress VARCHAR(16) NOT NULL, action VARCHAR(255), time TIMESTAMP DEFAULT CURRENT_TIMESTAMP );```
|
||||||
|
#### Bans
|
||||||
|
```CREATE TABLE bans ( id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, ipaddress VARCHAR(16) NOT NULL, reason VARCHAR(255), time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, length VARCHAR(255) NOT NULL, permanent BOOL NOT NULL ); ```
|
||||||
|
|
||||||
|
### Manifest
|
||||||
|
In the ```app/settings/manifest.json``` you have a list of infomation about your website. You must change ```user_name``` to your prefered name, ```is_testing``` to false as that is used for development and ```upload_max``` to your prefered file size max in MBs.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
This project is under the GNU v3 License
|
This project is under the GNU v3 License
|
||||||
|
|
|
@ -125,11 +125,15 @@ if (isset($_POST['submit_login'])) {
|
||||||
<script>
|
<script>
|
||||||
sniffleAdd('O hi <?php echo $_SESSION["username"]; ?>', 'You are now logged in! You will be redirected in a few seconds', 'var(--green)', 'assets/icons/hand-waving.svg');
|
sniffleAdd('O hi <?php echo $_SESSION["username"]; ?>', 'You are now logged in! You will be redirected in a few seconds', 'var(--green)', 'assets/icons/hand-waving.svg');
|
||||||
setTimeout(function(){window.location.href = "index.php";}, 2000);
|
setTimeout(function(){window.location.href = "index.php";}, 2000);
|
||||||
//window.location.href = "../index.php?login=success";
|
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
mysqli_query($conn,"INSERT INTO logs (ipaddress, action) VALUES('$user_ip','New loggin to ".$_SESSION['username']."')");
|
mysqli_query($conn,"INSERT INTO logs (ipaddress, action) VALUES('$user_ip','New loggin to ".$_SESSION['username']."')");
|
||||||
|
|
||||||
|
// This is a terrible way of doing this, but is has to be done
|
||||||
|
if ($id == 1 && $user_info->is_admin($conn, $id) == false) {
|
||||||
|
mysqli_query($conn,"UPDATE users SET admin = 1 WHERE id = 1");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
?>
|
?>
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
*/
|
*/
|
||||||
require_once dirname(__DIR__)."/app/settings/settings.php";
|
require_once dirname(__DIR__)."/app/settings/settings.php";
|
||||||
|
|
||||||
ini_set('post_max_size', $user_settings['upload_max']);
|
ini_set('post_max_size', $user_settings['upload_max']."M");
|
||||||
ini_set('upload_max_filesize', ($user_settings['upload_max'] + 1));
|
ini_set('upload_max_filesize', ($user_settings['upload_max'] + 1)."M");
|
||||||
|
|
||||||
if ($user_settings['is_testing']) {
|
if ($user_settings['is_testing']) {
|
||||||
ini_set('display_errors', 1);
|
ini_set('display_errors', 1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue