diff --git a/data/script/furatalog.lib.php b/data/script/furatalog.lib.php index 0b80bf2..6bf0827 100644 --- a/data/script/furatalog.lib.php +++ b/data/script/furatalog.lib.php @@ -22,8 +22,11 @@ class furatalogLib { private $secureGET; public $maxpages; + private $fs; + public function init() { - session_start(); + require_once("/var/www/furatalog/data/script/furatalog.sessions.php"); + $this->fs = new furatalogSessions(); //$cookieLifetime = 60 * 60 * 24 * 30; //session_set_cookie_params($cookieLifetime); @@ -32,9 +35,9 @@ class furatalogLib { if (isset($_GET["nsfw"])) { if ($_GET["nsfw"] == "0") { - $_SESSION["nsfw"] = false; + $this->fs->setSessionData("nsfw", false); } else if ($_GET["nsfw"] == "1") { - $_SESSION["nsfw"] = true; + $this->fs->setSessionData("nsfw", true); } $tempUrl = $_SERVER['REQUEST_URI']; @@ -176,7 +179,7 @@ class furatalogLib { " . $whereRequest . " AND (content.section LIKE \"%" . $section . "%\" - " . ((isset($_SESSION["nsfw"]) && $_SESSION["nsfw"]==true) ? '' : 'AND content.nsfw = 0') . ") + " . (($this->fs->issetSessionData("nsfw") && $this->fs->getSessionData("nsfw")==true) ? '' : 'AND content.nsfw = 0') . ") GROUP BY content.id @@ -216,7 +219,7 @@ class furatalogLib { " . $whereRequest . " AND (content.section LIKE \"%" . $section . "%\" - " . ((isset($_SESSION["nsfw"]) && $_SESSION["nsfw"]==true) ? '' : 'AND content.nsfw = 0') . ") + " . (($this->fs->issetSessionData("nsfw") && $this->fs->getSessionData("nsfw")==true) ? '' : 'AND content.nsfw = 0') . ") GROUP BY content.id "); @@ -303,9 +306,9 @@ class furatalogLib { } public function printNsfwCheck() { - if (isset($_SESSION["nsfw"]) && $_SESSION["nsfw"] == true) { + if ($this->fs->issetSessionData("nsfw") && $this->fs->getSessionData("nsfw") == true) { echo ''; - } else if (isset($_SESSION["nsfw"]) && $_SESSION['nsfw'] == false) { + } else if ($this->fs->issetSessionData("nsfw") && $this->fs->getSessionData("nsfw") == false) { echo ''; } else { // Base URL