{"id":117,"date":"2018-09-14T16:59:26","date_gmt":"2018-09-14T14:59:26","guid":{"rendered":"http:\/\/websrv.saske.sk\/uef\/en\/?page_id=117"},"modified":"2019-02-11T07:48:46","modified_gmt":"2019-02-11T06:48:46","slug":"scientific-outputs","status":"publish","type":"page","link":"https:\/\/websrv.saske.sk\/uef\/en\/research\/scientific-outputs\/","title":{"rendered":"Scientific Outputs"},"content":{"rendered":"<p><?php\n$epca_code2 = \"SAVEXFYZ\";\n$this_year = $_POST['this_year'];\nsettype($this_year, 'integer');\nif (!$this_year) $this_year = date(\"Y\");\n\necho \"\n\n<h3>Publications in &#8220;.$this_year.&#8221;<\/h3>\n<p>Publications containing information from an online database of the Central Library of SAS.&#8221;;<\/p>\n<p>\/\/ Roky pre vyber &#8211; this_year select box<br \/>\necho &#8220;<\/p>\n<form method='post' action='\/uef\/en\/research\/scientific-outputs\/'>\n<div>Select year reporting publications: <select name='this_year' onchange='this.form.submit()'>&#8220;;<br \/>\nfor ($rok=date(&#8220;Y&#8221;);$rok>=&#8221;1980&#8243;;$rok&#8211;)<br \/>\n{<br \/>\nif ($this_year==$rok) $selected=&#8221;selected=&#8217;selected'&#8221;; else $selected=&#8221;&#8221;;<br \/>\necho &#8220;<option value='\".$rok.\"' \".$selected.\">&#8220;.$rok.&#8221;<\/option>&#8220;;<br \/>\n}<br \/>\necho &#8220;<\/select><\/div>\n<\/form>\n<p>&#8220;;<\/p>\n<p>\/\/ odoslanie requestu na server<br \/>\n  function SendReq($psReqUrl)<br \/>\n  {<br \/>\n    unset($next);<br \/>\n    $max_repeat = 1;<\/p>\n<p>     for ($repeat=1;$repeat<=$max_repeat;$repeat++) {\n     unset($start);\n      $from = 1+$next;\n      $to = 501+$next;\n      $next=$next+501;\n      $psReqUrl2 = $psReqUrl.\"&#038;from=\".urlencode($from).\"&#038;to=\".urlencode($to);\n    \n    $ch = curl_init($psReqUrl2);\n    curl_setopt($ch, CURLOPT_TIMEOUT, 15); \n    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n    $out = curl_exec($ch);\n    if($out === false)\n      {\n        echo \"\n\n<div class=brown>Publications &#8211; error: (&#8220;.curl_error($ch).&#8221;)<\/div>\n<p>&#8220;;<br \/>\n      }<br \/>\n    curl_close($ch);<br \/>\n    $ans = explode(&#8220;\\n&#8221;,$out);<br \/>\n    $max_line = count($ans)-1;<\/p>\n<p>    foreach ($ans as $line_num => $line) {<br \/>\n      \/\/z riadku 3 dostaneme pocet zaznamov celkom, vydelime a zaokruhlime aby sme mohli prechadzat dalsie zaznamy nad 501<br \/>\n      if ($line_num==3) $max_repeat = ceil(trim($line)\/501);<br \/>\n      \/\/ak nacita 0 ako pocet zaznamov, alebo nacita text namiesto cisla osetrime max_repeat<br \/>\n      if (!$max_repeat OR $max_repeat==0 OR !is_numeric($max_repeat)) $max_repeat = 1;<\/p>\n<p>      \/\/ak nahodou nacita zly max_repeat, nastavime pri hodnote nad 4 (viac ako 2000 zaznamov) na 1<br \/>\n      if ($max_repeat>4) $max_repeat = 1;    <\/p>\n<p>      if (strstr($line,&#8221;###&#8221;)) { $start=true; if (!$prvykrat) { $li=&#8221;<\/p>\n<li>&#8220;; $prvykrat=1; } else $li=&#8221;<\/li>\n<p>\\n<\/p>\n<li>&#8220;; }<br \/>\n      if (strstr($line,&#8221;Typ:&#8221;)) $type = str_replace(&#8220;Typ:&#8221;,&#8221; Typ: <b>&#8220;,$line).&#8221;<\/b>&#8220;;<br \/>\n      if (strstr($line,&#8221;Typ: &#8220;)) unset($type);<\/p>\n<p>      if ($start AND !strstr($line,&#8221;Ohlasy:&#8221;) AND !strstr($line,&#8221;###&#8221;) AND ($line OR $line_num==$max_line) AND !strstr($line,&#8221;Typ:&#8221;))<br \/>\n      {<br \/>\n        if ($line_num==$max_line) { unset($li);unset($type); }<br \/>\n      $line = htmlspecialchars($line);<br \/>\n      $line = str_replace(&#8220;&amp;#&#8221;,&#8221;&#038;#&#8221;,$line);<br \/>\n      $line = str_replace(&#8220;&lt;u&gt;&#8221;,&#8221;<u>&#8220;,$line);<br \/>\n      $line = str_replace(&#8220;&lt;\/u&gt;&#8221;,&#8221;<\/u>&#8220;,$line);<br \/>\n      $vzor = $li.$line.$type; <\/p>\n<p>      if ($start_cit)<br \/>\n      {<br \/>\n      $aaa++;<br \/>\n      $vys[$aaa] = str_replace(&#8220;[10]&#8221;,&#8221;[999]&#8221;,$vzor);<br \/>\n      $vys[$aaa] = str_replace(&#8220;[1]&#8221;,&#8221;[1.0]&#8221;,$vys[$aaa]);<br \/>\n      $vys[$aaa] = str_replace(&#8220;[2]&#8221;,&#8221;[2.0]&#8221;,$vys[$aaa]);<br \/>\n      }<br \/>\n      else<br \/>\n      {<br \/>\n        if ($vys[1])<br \/>\n        {<br \/>\n          asort($vys); $first_time=0;<br \/>\n          foreach ($vys as $key => $val)<br \/>\n            {<br \/>\n             $val = str_replace(&#8220;[999]&#8221;,&#8221;[10]&#8221;,$val);<br \/>\n             $val = str_replace(&#8220;[1.0]&#8221;,&#8221;[1]&#8221;,$val);<br \/>\n             $val = str_replace(&#8220;[2.0]&#8221;,&#8221;[2]&#8221;,$val);<br \/>\n              if ($first_time==&#8221;0&#8243;) $ohlasy_title=&#8221;<b>Citations:<\/b><br \/>&#8220;;<br \/>\n              else unset($ohlasy_title);<br \/>\n              $first_time++;<br \/>\n              $vysledok .= &#8220;<\/p>\n<p style='padding-left: 20px; width: 93%; color: #883b31;'>&#8220;.$ohlasy_title.$val.&#8221;<\/p>\n<p>&#8220;;<br \/>\n            }<br \/>\n          $vysledok .= $vzor; unset($key); unset($aaa); $vys = array();<br \/>\n        }<br \/>\n        else $vysledok .= $vzor;<br \/>\n      }<br \/>\n      }<\/p>\n<p>      if (strstr($line,&#8221;Ohlasy:&#8221;))<br \/>\n        {<br \/>\n        $start_cit=true;<br \/>\n        unset($type);<br \/>\n        unset($li);<br \/>\n        }<\/p>\n<p>      if (strstr($line,&#8221;###&#8221;)) unset($start_cit);<br \/>\n      }<br \/>\n    } \/\/for end<\/p>\n<p>    return $vysledok;<br \/>\n  }<br \/>\n\/\/ end funkcie<\/p>\n<p>  if ($type) $type_line = &#8220;@and @attr 1=2461 &#8216;$type'&#8221;;<br \/>\n  if (strstr($epca_code,&#8221;SAV&#8221;)) $or = &#8220;@or &#8216;&#8221;.$epca_code.&#8221;&#8216;&#8221;;<\/p>\n<p>\/*  $query=&#8221;@attr 98=2 $type_line @and @attr 1=2456 &#8216;&#8221;.$this_year.&#8221;&#8216; @attr 1=2462 $or &#8216;&#8221;.$epca_code2.&#8221;&#8216;&#8221;;*\/<br \/>\n$query=&#8221;@attr 98=2 $type_line @and @and @attr 1=2456 &#8216;&#8221;.$this_year.&#8221;&#8216; @attr 1=2462 $or &#8216;&#8221;.$epca_code2.&#8221;&#8216; @attr 1=2461 @or @or @or @or @or @or @or &#8216;AAA&#8217; &#8216;AAB&#8217; &#8216;ABC&#8217; &#8216;ABD&#8217; &#8216;ADCA&#8217; &#8216;ADCB&#8217; &#8216;ADDA&#8217; &#8216;ADDB'&#8221;;<\/p>\n<p>  $WSURL = &#8220;http:\/\/library.sk:8080\/i2\/i2.ws.cls&#8221;;<br \/>\n  $dbepca = &#8220;SavUnEpca&#8221;;<br \/>\n  $charset = &#8220;utf-8&#8221;;<br \/>\n  $sort = &#8220;1=2466c i< 1=2461c i<\"; \/\/sort podla prveho mena 2466c a typu publ.\n  $fmt = \"TEXT_EPCA_ISO_SAV_OH_WS\";\n  $query = str_replace(\"\\'\",\"'\",$query);\n\n  $requrl=$WSURL.\"?\".\n          \"method=search&#038;\".\n          \"db=\".urlencode($dbepca).\"&#038;\".                \/\/databaza v ktorej sa ma vyhladavat\n          \"query=\".urlencode($query).\"&#038;\".          \/\/otazka vo formate PQF\n          \"sort=\".urlencode($sort).\"&#038;\".      \/\/sort\n          \"charset=\".urlencode($charset).\"&#038;\".      \/\/znakova sada\n          \"fmt=\".urlencode($fmt);                  \/\/format vysledku\n\n  if ($this_year AND $epca_code2) $publications = SendReq($requrl);\n  \n  if (!$publications) echo \"\n\n<div class='italic padd_top10'>No publications do not comply with this criterion.<\/div>\n<p>&#8220;;<br \/>\n  else echo &#8220;<\/p>\n<ul class='list'>\\n&#8221;.$publications.&#8221;<\/li>\n<p>\\n<\/ul>\n<p>\\n&#8221;;<br \/>\n?><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":722,"menu_order":10,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-117","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/websrv.saske.sk\/uef\/en\/wp-json\/wp\/v2\/pages\/117","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/websrv.saske.sk\/uef\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/websrv.saske.sk\/uef\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/websrv.saske.sk\/uef\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/websrv.saske.sk\/uef\/en\/wp-json\/wp\/v2\/comments?post=117"}],"version-history":[{"count":6,"href":"https:\/\/websrv.saske.sk\/uef\/en\/wp-json\/wp\/v2\/pages\/117\/revisions"}],"predecessor-version":[{"id":935,"href":"https:\/\/websrv.saske.sk\/uef\/en\/wp-json\/wp\/v2\/pages\/117\/revisions\/935"}],"up":[{"embeddable":true,"href":"https:\/\/websrv.saske.sk\/uef\/en\/wp-json\/wp\/v2\/pages\/722"}],"wp:attachment":[{"href":"https:\/\/websrv.saske.sk\/uef\/en\/wp-json\/wp\/v2\/media?parent=117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}