summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-04-19 20:48:00 +0500
committerilotterytea <iltsu@alright.party>2025-04-19 20:48:00 +0500
commita7e961bcd2f1e8d98f2ffbb5ff37c2e7f9b981d1 (patch)
treee5279f13563c7f923745990f48eedd89b396ae8d /src
parent7a66de9852d4683a7b5cdcedb8e88cfdc73f4b56 (diff)
feat: show emotes
Diffstat (limited to 'src')
-rw-r--r--src/emote.php36
-rw-r--r--src/emotes/multiple_page.php37
-rw-r--r--src/emotes/single_page.php82
3 files changed, 155 insertions, 0 deletions
diff --git a/src/emote.php b/src/emote.php
new file mode 100644
index 0000000..5d39e42
--- /dev/null
+++ b/src/emote.php
@@ -0,0 +1,36 @@
+<?php
+class Emote
+{
+ public string $id;
+ public string $code;
+ public string $ext;
+ public int $created_at;
+
+ function __construct($id, $code, $ext, $created_at)
+ {
+ $this->id = $id;
+ $this->code = $code;
+ $this->ext = $ext;
+ $this->created_at = $created_at;
+ }
+
+ function get_id()
+ {
+ return $this->id;
+ }
+
+ function get_code()
+ {
+ return $this->code;
+ }
+
+ function get_ext()
+ {
+ return $this->ext;
+ }
+
+ function get_created_at()
+ {
+ return $this->created_at;
+ }
+}
diff --git a/src/emotes/multiple_page.php b/src/emotes/multiple_page.php
new file mode 100644
index 0000000..e46c7ab
--- /dev/null
+++ b/src/emotes/multiple_page.php
@@ -0,0 +1,37 @@
+<html>
+
+<head>
+ <title>AlrightTV</title>
+ <link rel="stylesheet" href="/static/style.css">
+</head>
+
+<body>
+ <div class="container">
+ <div class="wrapper">
+ <main class="content">
+ <section class="box">
+ <div class="box navtab">
+ <?php echo isset($emotes) ? "Emotes" : "Emote" ?>
+ </div>
+ <div class="box content items">
+ <?php
+ if (isset($emotes)) {
+ foreach ($emotes as $e) {
+ echo "<a class=\"box emote\" href=\"/emotes/" . $e->get_id() . "\">";
+ echo "<img src=\"/static/userdata/emotes/" . $e->get_id() . "/2x." . $e->get_ext() . "\" alt=\"" . $e->get_code() . "\"/>";
+ echo "<p>" . $e->get_code() . "</p>";
+ echo "</a>";
+ }
+ } else {
+ // info
+ echo "";
+ }
+ ?>
+ </div>
+ </section>
+ </main>
+ </div>
+ </div>
+</body>
+
+</html> \ No newline at end of file
diff --git a/src/emotes/single_page.php b/src/emotes/single_page.php
new file mode 100644
index 0000000..254e0e9
--- /dev/null
+++ b/src/emotes/single_page.php
@@ -0,0 +1,82 @@
+<html>
+
+<head>
+ <title>AlrightTV</title>
+ <link rel="stylesheet" href="/static/style.css">
+</head>
+
+<body>
+ <div class="container">
+ <div class="wrapper">
+ <main class="content">
+ <section class="box">
+ <div class="box navtab">
+ Emote - <?php echo $emote->get_code() ?>
+ </div>
+ <div class="box content">
+ <div class="emote-showcase">
+ <img src="<?php echo '/static/userdata/emotes/' . $emote->get_id() . '/' . '1x.' . $emote->get_ext() ?>"
+ alt="<?php echo $emote->get_code() ?>">
+ <img src="<?php echo '/static/userdata/emotes/' . $emote->get_id() . '/' . '2x.' . $emote->get_ext() ?>"
+ alt="<?php echo $emote->get_code() ?>">
+ <img src="<?php echo '/static/userdata/emotes/' . $emote->get_id() . '/' . '3x.' . $emote->get_ext() ?>"
+ alt="<?php echo $emote->get_code() ?>">
+ </div>
+ </div>
+ </section>
+
+ <section class="box items row">
+ <div class="items row left full">
+ <form action="/emotes/add.php" method="POST">
+ <input type="text" name="id" value="<?php echo $emote->get_id() ?>" style="display: none;">
+ <button type="submit" class="green">Add to my channel</button>
+ </form>
+ </div>
+ <div class="items row right full">
+ <form action="/emotes/rate.php" method="POST">
+ <input type="text" name="id" value="<?php echo $emote->get_id() ?>" style="display: none;">
+ <input type="text" name="rate" value="5" style="display:none;">
+ <button type="submit" class="transparent">gem</button>
+ </form>
+ <form action="/emotes/rate.php" method="POST">
+ <input type="text" name="id" value="<?php echo $emote->get_id() ?>" style="display: none;">
+ <input type="text" name="rate" value="1" style="display:none;">
+ <button type="submit" class="transparent">coal</button>
+ </form>
+ <a class="button red" href="/emotes/report.php?id=<?php echo $emote->get_id() ?>">Report
+ emote</a>
+ </div>
+ </section>
+
+ <section class="box">
+ <table class="vertical">
+ <tr>
+ <th>Uploader</th>
+ <td><?php
+ echo '<a href="/users/' . "0" . '">' . "someone" . '</a>, ';
+ echo date("d M Y", $emote->get_created_at());
+ ?></td>
+ </tr>
+ <tr>
+ <th>Rating</th>
+ <td>Not rated</td>
+ </tr>
+ </table>
+ </section>
+
+ <section class="box">
+ <div class="content">
+ <p>Added in <?php echo 20 ?> channels</p>
+ <div class="items row">
+ <a href="/users/1">forsen</a>
+ <a href="/users/2">not_forsen</a>
+ <a href="/users/3">lidl_forsen</a>
+ </div>
+ </div>
+ </section>
+ </main>
+ </div>
+ </div>
+</body>
+
+</html> \ No newline at end of file