Changed instead of Echoing doing a return
This commit is contained in:
@@ -236,12 +236,14 @@ class furatalogLib {
|
||||
}
|
||||
|
||||
function printScriptSec() {
|
||||
$returnContent = "";
|
||||
|
||||
$currentpage = (isset($_GET["p"]) ? $_GET["p"] : 1);
|
||||
$search=isset($_GET["s"]) ? "&s=" . $_GET["s"] : "";
|
||||
$nextpage=isset($_GET["p"]) ? $_GET["p"] : 1;
|
||||
$prevpage=isset($_GET["p"]) ? $_GET["p"] : 1;
|
||||
|
||||
echo "
|
||||
$returnContent .= "
|
||||
<script>
|
||||
var currentPage = \"" . $currentpage . "\";
|
||||
var nextpage = \"?p=" . $nextpage+1 . $search . "\";
|
||||
@@ -250,28 +252,36 @@ class furatalogLib {
|
||||
</script>
|
||||
<script src=\"/data/script/script.js\"></script>
|
||||
";
|
||||
|
||||
return $returnContent;
|
||||
}
|
||||
|
||||
function printItemLists($section) {
|
||||
echo "<div class=\"itemlist\">";
|
||||
$returnContent = "";
|
||||
|
||||
$returnContent .= "<div class=\"itemlist\">";
|
||||
$page = isset($_GET["p"]) ? $_GET["p"] : 1;
|
||||
$this->printItemList($section, $page);
|
||||
echo "</div>";
|
||||
$returnContent .= $this->printItemList($section, $page);
|
||||
$returnContent .= "</div>";
|
||||
|
||||
echo "<div class=\"itemlist itemlistnext\">";
|
||||
$returnContent .= "<div class=\"itemlist itemlistnext\">";
|
||||
$page = isset($_GET["p"]) ? ((int)$_GET["p"] + 1) : 2;
|
||||
$this->printItemList($section, $page);
|
||||
echo "</div>";
|
||||
$returnContent .= $this->printItemList($section, $page);
|
||||
$returnContent .= "</div>";
|
||||
|
||||
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;
|
||||
$this->printItemList($section, $page);
|
||||
echo "</div>";
|
||||
$returnContent .= $this->printItemList($section, $page);
|
||||
$returnContent .= "</div>";
|
||||
}
|
||||
|
||||
return $returnContent;
|
||||
}
|
||||
|
||||
private function printItemList($section, $page) {
|
||||
$returnContent = "";
|
||||
|
||||
$items = $this->getItems($section, $page);
|
||||
|
||||
foreach ($items as $item) {
|
||||
@@ -287,7 +297,7 @@ class furatalogLib {
|
||||
$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'>
|
||||
<img class='plattform' src='". $plattform ."'>
|
||||
<img class='preview' src='". $item["content_image"] ."'>
|
||||
@@ -304,13 +314,17 @@ class furatalogLib {
|
||||
</div></a>
|
||||
</div>";
|
||||
}
|
||||
|
||||
return $returnContent;
|
||||
}
|
||||
|
||||
public function printNsfwCheck() {
|
||||
$returnContent = "";
|
||||
|
||||
if ($this->fs->issetSessionData("nsfw") && $this->fs->getSessionData("nsfw") == true) {
|
||||
echo '';
|
||||
$returnContent .= '';
|
||||
} else if ($this->fs->issetSessionData("nsfw") && $this->fs->getSessionData("nsfw") == false) {
|
||||
echo '';
|
||||
$returnContent .= '';
|
||||
} else {
|
||||
// Base URL
|
||||
$url = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
|
||||
@@ -327,7 +341,7 @@ class furatalogLib {
|
||||
$url .= '?' . $newParam;
|
||||
}
|
||||
|
||||
echo '
|
||||
$returnContent .= '
|
||||
<div class="nsfwcheck">
|
||||
<span>Do you want to see NSFW content?</span>
|
||||
<div class="answers">
|
||||
@@ -337,9 +351,13 @@ class furatalogLib {
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
||||
return $returnContent;
|
||||
}
|
||||
|
||||
public function printPagerNumbers() {
|
||||
$returnContent = "";
|
||||
|
||||
$currentpage = (isset($_GET["p"]) ? $_GET["p"] : 1);
|
||||
$currentMaxPages = $this->maxpages;
|
||||
$search=isset($_GET["s"]) ? "&s=" . $_GET["s"] : "";
|
||||
@@ -347,8 +365,8 @@ class furatalogLib {
|
||||
$before = "";
|
||||
|
||||
if (!($currentpage <= 1)) {
|
||||
echo "<a class=\"prev\" href=\"?p=" . (1) . $search . "\"><<</a>";
|
||||
echo "<a class=\"prev\" href=\"?p=" . ($currentpage-1) . $search . "\"><</a>";
|
||||
$returnContent .= "<a class=\"prev\" href=\"?p=" . (1) . $search . "\"><<</a>";
|
||||
$returnContent .= "<a class=\"prev\" href=\"?p=" . ($currentpage-1) . $search . "\"><</a>";
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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++) {
|
||||
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)) {
|
||||
echo "<a class=\"next\" href=\"?p=" . ($currentpage+1) . $search . "\">></a>";
|
||||
echo "<a class=\"next\" href=\"?p=" . ($currentMaxPages) . $search . "\">>></a>";
|
||||
$returnContent .= "<a class=\"next\" href=\"?p=" . ($currentpage+1) . $search . "\">></a>";
|
||||
$returnContent .= "<a class=\"next\" href=\"?p=" . ($currentMaxPages) . $search . "\">>></a>";
|
||||
}
|
||||
|
||||
return $returnContent;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user