From 30439d324bb045225d06b7f00ef4b260f982bde2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Thu, 6 Feb 2020 20:51:40 +0100 Subject: 0.9.3 --- main.php | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/main.php b/main.php index 5bd0a49..2d50611 100644 --- a/main.php +++ b/main.php @@ -54,7 +54,7 @@ Errors: class gimsisextClient { private $username; private $password; - public $version = array(0, 9, 2); + public $version = array(0, 9, 3); private $programname = "gimsisextclient"; private $programdomain = 'gimsisextclient.gimb.tk'; private $cookiedir; // set at runtime, ker je get_curerent_user, v login() @@ -685,7 +685,6 @@ Errors: case "3": $opravicenoopis = "ne šteje"; break; - } $opravicenostatus = intval(get_string_between($pr, '(')); $ura = intval(get_string_between($pr, '">', '')); @@ -771,18 +770,32 @@ Errors: "naslov" => str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $ocenjevanje))), "vrsta" => str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $vrsta))), "rok" => str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $rok))), - "ocena" => intval(str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $ocena)))), - "zacasna" => boolval(str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $zacasna)))) ); - if(sizeof($sn->getElementsByTagName("span")) > 1) { - $ocenaarray["novaocena"] = DOMinnerHTML($sn->getElementsByTagName("span")[1]); + if(sizeof($sn->getElementsByTagName("span")) > 1) { // v kolikor je nova ocena + $ocenaarray["ocena"] = DOMinnerHTML($sn->getElementsByTagName("span")[1]); if(explode(" ", $sn->getElementsByTagName("span")[1]->getAttribute("class"))[1] == "ocVmesna") { - $ocenaarray["novazacasna"] = 1; + $ocenaarray["zacasna"] = 1; } else { - $ocenaarray["novazacasna"] = 0; + $ocenaarray["zacasna"] = 0; } - $ocenaarray["novaocena"] = intval(str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $ocenaarray["novaocena"])))); - $ocenaarray["novazacasna"] = boolval(str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $ocenaarray["novazacasna"])))); + $ocenaarray["ocena"] = intval(str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $ocenaarray["ocena"])))); + $ocenaarray["zacasna"] = boolval(str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $ocenaarray["zacasna"])))); + // sedaj pa vpišemo še staro oceno + $ocenaarray["staraocena"] = intval(str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, DOMinnerHTML($sn->getElementsByTagName("span")[0]))))); + if(explode(" ", $sn->getElementsByTagName("span")[0]->getAttribute("class"))[1] == "ocVmesna") { + $zacasnn = true; + } else { + $zacasnn = false; + } + $ocenaarray["starazacasna"] = boolval(str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $zacasnn)))); + } else { // v kolikor ni nove ocene + $ocenaarray["ocena"] = intval(str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, DOMinnerHTML($sn->getElementsByTagName("span")[0]))))); + if(explode(" ", $sn->getElementsByTagName("span")[0]->getAttribute("class"))[1] == "ocVmesna") { + $zacasnn = true; + } else { + $zacasnn = false; + } + $ocenaarray["zacasna"] = boolval(str_replace("\n", null, str_replace("\r", null, str_replace(" ", null, $zacasnn)))); } $ocene[] = $ocenaarray; } -- cgit v1.2.3