diff --git a/docs/comment.php b/docs/comment.php index 4b2c20e..1abcdda 100644 --- a/docs/comment.php +++ b/docs/comment.php @@ -4,6 +4,8 @@ require(__DIR__ . "/../libs/page.php"); require(__DIR__ . "/../libs/form.php"); require(__DIR__ . "/../libs/comment.php"); +$ref = 1732684297; + page_header(); comments("comment", $_GET['id']); page_footer(); diff --git a/docs/css/main.css b/docs/css/main.css index 22955cf..99edeba 100755 --- a/docs/css/main.css +++ b/docs/css/main.css @@ -202,10 +202,6 @@ iframe { justify-content: center; } -.header a.leave { - margin-left: auto; -} - .clickie { width: min-content; margin-top: 40px; diff --git a/docs/index.php b/docs/index.php index 1ea5085..2c12284 100644 --- a/docs/index.php +++ b/docs/index.php @@ -4,17 +4,25 @@ require(__DIR__ . "/../libs/form.php"); require(__DIR__ . "/../libs/comment.php"); page_header(); -if (!($_GET['page'] > 0) && is_null($username)) { ?> +if (!is_null($username)) { + //comments("root","root"); +} +if (!($_GET['page'] > 0)) { ?> diff --git a/docs/meta.php b/docs/meta.php index cddee71..ba9c6f2 100644 --- a/docs/meta.php +++ b/docs/meta.php @@ -50,13 +50,28 @@ function get_handler() $followers = $stmt->fetchAll(PDO::FETCH_DEFAULT); } get_handler(); +//todo: rewrite ?>

Following

+
+
+ +
+
+ + + + +
+
+
+
+ @@ -64,7 +79,23 @@ get_handler(); +
+
+ +
+
+ + + + +
+
+
+
+ + diff --git a/docs/notif.php b/docs/notif.php index 0e8a2cc..e96fee3 100644 --- a/docs/notif.php +++ b/docs/notif.php @@ -6,16 +6,6 @@ require(__DIR__ . "/../libs/comment.php"); $ref = 1732684297; -$stmt = $db->prepare("DELETE FROM main.read WHERE username = ?"); -$stmt->execute([$username]); - -$stmt = $db->prepare("SELECT * FROM comment WHERE targetType = ? AND targetId = ? ORDER BY date"); -$stmt->execute(["notification",$username]); -$counter = $stmt->fetchAll(PDO::FETCH_DEFAULT); - -$stmt = $db->prepare("INSERT INTO main.read (username, msgs) VALUES (?, ?)"); -$stmt->execute([$username, count($counter)]); - page_header(); comments("notification", $username, true); page_footer(); diff --git a/docs/register.php b/docs/register.php index 004c402..d99c4ed 100755 --- a/docs/register.php +++ b/docs/register.php @@ -44,12 +44,6 @@ function post_handler() $stmt = $db->prepare("INSERT INTO main.auth (username, password) VALUES (?, ?)"); $stmt->execute([$user,$hashed]); - $token = bin2hex(random_bytes(32)); - $stmt = $db->prepare("INSERT INTO main.token (username, token) VALUES (?, ?)"); - $stmt->execute([$user,$token]); - - setcookie("token", $token, time() + 3600 * 24); - header("Location: /"); die(); } diff --git a/docs/stats.php b/docs/stats.php index cdf0f09..0edcbf2 100755 --- a/docs/stats.php +++ b/docs/stats.php @@ -27,9 +27,22 @@ function get_handler() $api = file_get_contents($node_backend . "/top?ref=" . $_GET['username']); $pr = json_decode($api); - foreach ($pr as $usern => $rr) { - user_block($usern, $rr, "Popularity"); - } + foreach ($pr as $usern => $rr) { ?> +
+
+ +
+
+ + + + +
+
+
+
Power:
+
+ + +
+ Everyone + Following +
0) { ?> Previous diff --git a/libs/markdown.php b/libs/markdown.php index 28a7656..eec5fd0 100755 --- a/libs/markdown.php +++ b/libs/markdown.php @@ -2,24 +2,40 @@ function markdown($text) { $search = array( - '~(https://[^.]+\.dervland\.net/[^\s<]+\.(png|jpg|jpeg|gif))~i', - '~(https://[^.]+\.dervland\.net/[^\s<]+\.(mp3|wav))~i', - '~(https://[^.]+\.dervland\.net/[^\s<]+\.(webm|mp4))~i', - //'~(https://studio\.penguinmod\.com/[^\s
$1
', - '
$1
', - '
$1
', - //'https://studio.penguinmod.com/?#$2', - //'
$1
', - '$0', - '@$1', - ); + '
$1
', + '
$1
', + '
$1
', + //'https://studio.penguinmod.com/?#$2', + //'
$1
', + '$0', + '@$1', + '$2', + '$2', + '$2', + '', + '
  • $2
  • ', + '

    $2

    ', + '$4', + '$2' + ); $text = preg_replace($search, $replace, $text); diff --git a/libs/page.php b/libs/page.php index 40d74d8..81f7494 100755 --- a/libs/page.php +++ b/libs/page.php @@ -7,66 +7,39 @@ function page_header() global $username; $stmt = $db->prepare("SELECT * FROM comment WHERE targetType = ? AND targetId = ? ORDER BY date DESC"); $stmt->execute([ - "notification", - $username, + "notification", + $username, ]); $posts2 = $stmt->fetchAll(PDO::FETCH_DEFAULT); - - $stmt = $db->prepare("SELECT * FROM main.read WHERE username = ?"); - $stmt->execute([ - $username - ]); - - $counter = $stmt->fetchAll(PDO::FETCH_DEFAULT); - - $edge = count($posts2) - $counter[0]['msgs']; + $edge = count($posts2); ?> - - - - BiglyChat - - - - - -
    - BiglyChat - - Feed - Wall - Users - Mail - Leave - - Join - Users - -
    - - - + + + + BiglyChat + + + + + +
    + BiglyChat + + Wall + Mail + Users + Leave + + Join +Users -
    -
    - -
    - - - - - + ?>
    -
    - $tag: $meta"; ?> -
    +function page_footer() +{ ?> + + + diff --git a/scripts/init.php b/scripts/init.php index 855440a..7d27613 100755 --- a/scripts/init.php +++ b/scripts/init.php @@ -4,7 +4,7 @@ require(__DIR__ . "/../libs/test_secret.php"); global $db; -$sql = file_get_contents(__DIR__ .'/../scripts/init.sql', true); +$sql = file_get_contents('../scripts/init.sql', true); $db->exec($sql); diff --git a/scripts/init.sql b/scripts/init.sql index c3885bd..ad101b5 100755 --- a/scripts/init.sql +++ b/scripts/init.sql @@ -4,5 +4,4 @@ CREATE TABLE IF NOT EXISTS main.user (username TEXT, bio TEXT); CREATE TABLE IF NOT EXISTS main.role (username TEXT, role TEXT); CREATE TABLE IF NOT EXISTS main.follow (username TEXT, target TEXT); CREATE TABLE IF NOT EXISTS main.ban (username TEXT, reason TEXT); -CREATE TABLE IF NOT EXISTS main.read (username TEXT, msgs REAL); CREATE TABLE IF NOT EXISTS main.comment (username TEXT, targetType TEXT, targetId TEXT, date REAL, content TEXT, id TEXT);