diff options
author | Anton Luka Šijanec <sijanecantonluka@gmail.com> | 2020-02-06 20:51:40 +0100 |
---|---|---|
committer | Anton Luka Šijanec <sijanecantonluka@gmail.com> | 2020-02-06 20:51:40 +0100 |
commit | 30439d324bb045225d06b7f00ef4b260f982bde2 (patch) | |
tree | 63b4ee0c0cd5bda87a2d4ec192ab54bdacc4a521 | |
parent | fix: json_decode v array in fetchocene sedaj podpira tudi popravne roke (diff) | |
download | gimsisextclient-30439d324bb045225d06b7f00ef4b260f982bde2.tar gimsisextclient-30439d324bb045225d06b7f00ef4b260f982bde2.tar.gz gimsisextclient-30439d324bb045225d06b7f00ef4b260f982bde2.tar.bz2 gimsisextclient-30439d324bb045225d06b7f00ef4b260f982bde2.tar.lz gimsisextclient-30439d324bb045225d06b7f00ef4b260f982bde2.tar.xz gimsisextclient-30439d324bb045225d06b7f00ef4b260f982bde2.tar.zst gimsisextclient-30439d324bb045225d06b7f00ef4b260f982bde2.zip |
-rw-r--r-- | main.php | 33 |
1 files changed, 23 insertions, 10 deletions
@@ -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, '(<span class="opr', '">')); $ura = intval(get_string_between($pr, '">', '</span>')); @@ -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; } |