Skip to content

Commit 7c0a46d

Browse files
authored
Merge pull request #1 from HATBE/dev
Rewriting...
2 parents 4708308 + c85e2b7 commit 7c0a46d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+2709
-680
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/config/config.php
1+
config/config.php

TODO.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# TODO
2+
3+
Prio / description
4+
5+
- 100 markdown -> parsedown
6+
- 40 Search system
7+
- 20 Searchbar
8+
- 5 installer

config/config.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
<?php
2+
// datanase
23
define('DB_HOST', 'localhost');
3-
define('DB_USER', 'user');
4-
define('DB_PASSWORD', 'password');
4+
define('DB_USER', '');
5+
define('DB_PASS', '');
56
define('DB_NAME', 'blog');
67

7-
define('ROOT_PATH', '/');
8+
// page settings
9+
define('ROOT_PATH', 'https://lixer.hatbe.ch/'); // domain (must end with a "/"!)
10+
define('DEFAULT_KEYWORDS', 'This, blog, does, not, have, keywords');
11+
define('DESCRIPTION', 'This blog does not have a description');
12+
define('PAGE_TITLE', 'HATBES BLOG');
13+
define('PAGE_SLOGAN', 'Blogging and stuff.');
814

9-
define('SITE_NAME', 'COOL BLOG');
15+
define('ITEMS_PER_PAGE', 4);

dump.sql

Lines changed: 0 additions & 40 deletions
This file was deleted.

public/assets/css/style.css

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1+
* {
2+
border-radius: 0 !important;
3+
outline: none !important;
4+
}
15
body {
2-
background-color: rgba(var(--bs-dark-rgb)) !important;
6+
background-color: #1c1c1c !important;
7+
color: white !important;
8+
}
9+
a {
10+
text-decoration: none !important;
311
}
412
.page-link {
513
background-color: rgba(var(--bs-secondary-rgb)) !important;
@@ -23,10 +31,4 @@ body {
2331
background-color: rgba(var(--bs-secondary-rgb)) !important;
2432
color: white;
2533
border: 1px solid rgba(0,0,0,.125);
26-
}
27-
.body-container {
28-
background-color: #a9a9a9 !important;
29-
}
30-
.nounderline {
31-
text-decoration: none !important
32-
}
34+
}

public/index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?php
2-
require_once(__DIR__ . '/../src/Core.php');
2+
require_once(__DIR__ . '/../src/classes/Core.php');
33

4-
$core = new Core();
4+
new Core();

src/Controller.php

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/Core.php

Lines changed: 0 additions & 46 deletions
This file was deleted.

src/Template.php

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/classes/Controller.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
abstract class Controller {
3+
protected $core;
4+
5+
protected function model($model) {
6+
$model = ucfirst(strtolower($model)) . 'Model';
7+
$path = __DIR__ . '/models/' . $model . '.php';
8+
if(file_exists($path)) {
9+
require_once($path);
10+
return new $model();
11+
}
12+
return null;
13+
}
14+
15+
protected function render($view, $data = []) {
16+
$path = __DIR__ . '/../views/' . $view . '.php';
17+
if(file_exists($path)) {
18+
require_once($path);
19+
} else {
20+
echo 'View not found';
21+
exit();
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)