Changed instead of Echoing doing a return

This commit is contained in:
2026-06-09 22:46:59 +02:00
parent 301722069d
commit d4491862bb
+43 -23
View File
@@ -236,12 +236,14 @@ class furatalogLib {
} }
function printScriptSec() { function printScriptSec() {
$returnContent = "";
$currentpage = (isset($_GET["p"]) ? $_GET["p"] : 1); $currentpage = (isset($_GET["p"]) ? $_GET["p"] : 1);
$search=isset($_GET["s"]) ? "&s=" . $_GET["s"] : ""; $search=isset($_GET["s"]) ? "&s=" . $_GET["s"] : "";
$nextpage=isset($_GET["p"]) ? $_GET["p"] : 1; $nextpage=isset($_GET["p"]) ? $_GET["p"] : 1;
$prevpage=isset($_GET["p"]) ? $_GET["p"] : 1; $prevpage=isset($_GET["p"]) ? $_GET["p"] : 1;
echo " $returnContent .= "
<script> <script>
var currentPage = \"" . $currentpage . "\"; var currentPage = \"" . $currentpage . "\";
var nextpage = \"?p=" . $nextpage+1 . $search . "\"; var nextpage = \"?p=" . $nextpage+1 . $search . "\";
@@ -250,28 +252,36 @@ class furatalogLib {
</script> </script>
<script src=\"/data/script/script.js\"></script> <script src=\"/data/script/script.js\"></script>
"; ";
return $returnContent;
} }
function printItemLists($section) { function printItemLists($section) {
echo "<div class=\"itemlist\">"; $returnContent = "";
$page = isset($_GET["p"]) ? $_GET["p"] : 1;
$this->printItemList($section, $page);
echo "</div>";
echo "<div class=\"itemlist itemlistnext\">"; $returnContent .= "<div class=\"itemlist\">";
$page = isset($_GET["p"]) ? $_GET["p"] : 1;
$returnContent .= $this->printItemList($section, $page);
$returnContent .= "</div>";
$returnContent .= "<div class=\"itemlist itemlistnext\">";
$page = isset($_GET["p"]) ? ((int)$_GET["p"] + 1) : 2; $page = isset($_GET["p"]) ? ((int)$_GET["p"] + 1) : 2;
$this->printItemList($section, $page); $returnContent .= $this->printItemList($section, $page);
echo "</div>"; $returnContent .= "</div>";
if (isset($_GET["p"]) && ((int)$_GET["p"]) >= 2) { if (isset($_GET["p"]) && ((int)$_GET["p"]) >= 2) {
echo "<div class=\"itemlist itemlistprev\">"; $returnContent .= "<div class=\"itemlist itemlistprev\">";
$page = isset($_GET["p"]) ? ((int)$_GET["p"] - 1) : 0; $page = isset($_GET["p"]) ? ((int)$_GET["p"] - 1) : 0;
$this->printItemList($section, $page); $returnContent .= $this->printItemList($section, $page);
echo "</div>"; $returnContent .= "</div>";
} }
return $returnContent;
} }
private function printItemList($section, $page) { private function printItemList($section, $page) {
$returnContent = "";
$items = $this->getItems($section, $page); $items = $this->getItems($section, $page);
foreach ($items as $item) { foreach ($items as $item) {
@@ -287,7 +297,7 @@ class furatalogLib {
$plattform = "https://jinxxy.com/icon.png"; $plattform = "https://jinxxy.com/icon.png";
} }
echo "<div class='item-container' style=\"background-image: url('". $item["content_image"] ."')\"> $returnContent .= "<div class='item-container' style=\"background-image: url('". $item["content_image"] ."')\">
<a href='". $item["content_url"] ."'><div class='item'> <a href='". $item["content_url"] ."'><div class='item'>
<img class='plattform' src='". $plattform ."'> <img class='plattform' src='". $plattform ."'>
<img class='preview' src='". $item["content_image"] ."'> <img class='preview' src='". $item["content_image"] ."'>
@@ -304,13 +314,17 @@ class furatalogLib {
</div></a> </div></a>
</div>"; </div>";
} }
return $returnContent;
} }
public function printNsfwCheck() { public function printNsfwCheck() {
$returnContent = "";
if ($this->fs->issetSessionData("nsfw") && $this->fs->getSessionData("nsfw") == true) { if ($this->fs->issetSessionData("nsfw") && $this->fs->getSessionData("nsfw") == true) {
echo ''; $returnContent .= '';
} else if ($this->fs->issetSessionData("nsfw") && $this->fs->getSessionData("nsfw") == false) { } else if ($this->fs->issetSessionData("nsfw") && $this->fs->getSessionData("nsfw") == false) {
echo ''; $returnContent .= '';
} else { } else {
// Base URL // Base URL
$url = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; $url = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
@@ -327,7 +341,7 @@ class furatalogLib {
$url .= '?' . $newParam; $url .= '?' . $newParam;
} }
echo ' $returnContent .= '
<div class="nsfwcheck"> <div class="nsfwcheck">
<span>Do you want to see NSFW content?</span> <span>Do you want to see NSFW content?</span>
<div class="answers"> <div class="answers">
@@ -337,9 +351,13 @@ class furatalogLib {
</div> </div>
'; ';
} }
return $returnContent;
} }
public function printPagerNumbers() { public function printPagerNumbers() {
$returnContent = "";
$currentpage = (isset($_GET["p"]) ? $_GET["p"] : 1); $currentpage = (isset($_GET["p"]) ? $_GET["p"] : 1);
$currentMaxPages = $this->maxpages; $currentMaxPages = $this->maxpages;
$search=isset($_GET["s"]) ? "&s=" . $_GET["s"] : ""; $search=isset($_GET["s"]) ? "&s=" . $_GET["s"] : "";
@@ -347,8 +365,8 @@ class furatalogLib {
$before = ""; $before = "";
if (!($currentpage <= 1)) { if (!($currentpage <= 1)) {
echo "<a class=\"prev\" href=\"?p=" . (1) . $search . "\"><<</a>"; $returnContent .= "<a class=\"prev\" href=\"?p=" . (1) . $search . "\"><<</a>";
echo "<a class=\"prev\" href=\"?p=" . ($currentpage-1) . $search . "\"><</a>"; $returnContent .= "<a class=\"prev\" href=\"?p=" . ($currentpage-1) . $search . "\"><</a>";
} }
for ($i = $currentpage-1; ($i > 0 && $i > ($currentpage-3)); $i--) { for ($i = $currentpage-1; ($i > 0 && $i > ($currentpage-3)); $i--) {
@@ -356,18 +374,20 @@ class furatalogLib {
$before = "<a class=\"number\" href=\"?p=" . $i . $search . "\">" . $i . "</a>" . $before; $before = "<a class=\"number\" href=\"?p=" . $i . $search . "\">" . $i . "</a>" . $before;
} }
echo $before; $returnContent .= $before;
echo "<a class=\"number current\">" . $currentpage . "</a>"; $returnContent .= "<a class=\"number current\">" . $currentpage . "</a>";
for ($i = $currentpage+1; ($i <= $currentMaxPages && $i < ($currentpage+3)); $i++) { for ($i = $currentpage+1; ($i <= $currentMaxPages && $i < ($currentpage+3)); $i++) {
if ($currentMaxPages == $currentpage) return; if ($currentMaxPages == $currentpage) return;
echo "<a class=\"number\" href=\"?p=" . $i . $search . "\">" . $i . "</a>"; $returnContent .= "<a class=\"number\" href=\"?p=" . $i . $search . "\">" . $i . "</a>";
} }
if (!($currentpage >= $currentMaxPages)) { if (!($currentpage >= $currentMaxPages)) {
echo "<a class=\"next\" href=\"?p=" . ($currentpage+1) . $search . "\">></a>"; $returnContent .= "<a class=\"next\" href=\"?p=" . ($currentpage+1) . $search . "\">></a>";
echo "<a class=\"next\" href=\"?p=" . ($currentMaxPages) . $search . "\">>></a>"; $returnContent .= "<a class=\"next\" href=\"?p=" . ($currentMaxPages) . $search . "\">>></a>";
} }
return $returnContent;
} }
} }