[TYP-200] Add munch_groups($a, $b, $c) function

This commit is contained in:
saintly2k 2022-07-08 23:09:04 +02:00
parent 384a2c7c7d
commit a21ea379d7
2 changed files with 26 additions and 5 deletions

View File

@ -117,9 +117,9 @@ $latest_chapters = $conn->query("SELECT * FROM `chapters` ORDER BY `added` DESC"
<thead>
<th style="width:5%"><?= $lang["home"]["type"] ?></th>
<th style="width:5%"><?= $lang["home"]["chapter"] ?></th>
<th style="width:25%;"><?= $lang["home"]["chap_title"] ?></th>
<th style="width:25%"><?= $lang["home"]["title"] ?></th>
<th class="text-center" style="width:5%"><?= $lang["home"]["group"] ?></th>
<th style="width:20%;"><?= $lang["home"]["chap_title"] ?></th>
<th style="width:20%"><?= $lang["home"]["title"] ?></th>
<th class="text-center" style="width:15%"><?= $lang["home"]["group"] ?></th>
<th class="text-center" style="width:10%"><?= $lang["home"]["uploader"] ?></th>
<th class="text-right" style="width:20%"><?= $lang["home"]["added"] ?></th> <!-- IF ON OTHER LANGUAGES THAN ENGLISH, HERE IS AN OVERFLOW ON THE "added" TAB, IDK WHY, IF ANYONE KNOWS HOW TO FIX, PLS DO ON GITHUB.com/saintly2k/FoOlSlideX -->
</thead>

View File

@ -66,8 +66,29 @@ function bbconvert($text) {
return preg_replace($find,$replace,$text);
}
function munch_groups($a, $b, $c) {
return "YOLO";
function munch_groups($a, $b = "", $c = "", $html = true) {
require("../../config.php");
require("conn.php");
require("user.php");
$output = "";
if($a=="0") {
$output .= "No Group";
} else {
$a = $conn->query("SELECT * FROM `groups` WHERE `id`='$a' LIMIT 1")->fetch_assoc();
$output .= "<a href='".$config["url"]."group/".$a["slug"]."'>".$a["name"]."</a>";
}
if(!empty($b)) {
$b = $conn->query("SELECT * FROM `groups` WHERE `id`='$b' LIMIT 1")->fetch_assoc();
$output .= ", <a href='".$config["url"]."group/".$b["slug"]."'>".$b["name"]."</a>";
}
if(!empty($c)) {
$c = $conn->query("SELECT * FROM `groups` WHERE `id`='$c' LIMIT 1")->fetch_assoc();
$output .= ", <a href='".$config["url"]."group/".$c["slug"]."'>".$c["name"]."</a>";
}
return $output;
}
?>