Publications

$value) {
if (strstr($value, ““)) $record++;
foreach ($items_array as $i => $value_items) {
$start = “<".$value_items.">“;
$end = ““;
$value_items_tmp = $value_items.”_”.$record;
if (strstr($value, $start)) $$value_items_tmp = substr($value, strpos($value, $start)+strlen($start), strpos($value, $end)-(strpos($value, $start)+strlen($start)));
}
}
foreach ($items_array as $i => $value_items) {
$tmp = $value_items.”_1″;
$$value_items = $tmp;
}

echo “

“.$$name_last.”, “.$$name_first.”

“;
$name = $$name_last.” “.$$name_first;
}
//****************************

$publication_author_id = $_REQUEST[‘publication_author_id’];
$user_no = $_REQUEST[‘user_no’];

$this_year = $_POST[‘this_year’];
if ($this_year!=”all”) settype($this_year, ‘integer’);
if (!$this_year)
$this_year = date(“Y”);

// Roky pre vyber – year select box
echo “

Select year reporting publications:

“;

//title pre rok publikaci
if ($this_year==”all”) echo “

All publications

“;
else echo “

Publications in “.$this_year.”:

“;

// odoslanie requestu na server
function SendReq($psReqUrl)
{
unset($next);
$max_repeat = 1;

//******************
FOR ($repeat=1;$repeat<=$max_repeat;$repeat++) { unset($start); $from = 1+$next; $to = 501+$next; $next=$next+501; $psReqUrl2 = $psReqUrl."&from=".urlencode($from)."&to=".urlencode($to); $ch = curl_init($psReqUrl2); curl_setopt($ch, CURLOPT_TIMEOUT, 15); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $out = curl_exec($ch); if($out === false) { echo "

Publications – error: (“.curl_error($ch).”)

“;
}
curl_close($ch);
$ans = explode(“\n”,$out);
$max_line = count($ans)-1;

foreach ($ans as $line_num => $line) {

//z riadku 3 dostaneme pocet zaznamov celkom, vydelime a zaokruhlime aby sme mohli prechadzat dalsie zaznamy nad 501
if ($line_num==3) $max_repeat = ceil(trim($line)/501);
//ak nacita 0 ako pocet zaznamov alebo nacita text namiesto cisla osetrime max_repeat
if (!$max_repeat OR $max_repeat==0 OR !is_numeric($max_repeat)) $max_repeat = 1;

//ak nahodou nacita zly max_repeat, nastavime pri hodnote nad 4 (2000zaznamov) na 1
if ($max_repeat>4) $max_repeat = 1;
if (strstr($line,”###”)) { $start=true; if (!$prvykrat) { $li=”

  • “; $prvykrat=1; } else $li=”
  • \n

  • “; }
    if (strstr($line,”Typ:”)) $type = str_replace(“Typ:”,” Typ: “,$line).”“;
    if (strstr($line,”Typ: “)) unset($type);

    if ($start AND !strstr($line,”Ohlasy:”) AND !strstr($line,”###”) AND ($line OR $line_num==$max_line) AND !strstr($line,”Typ:”))
    {
    if ($line_num==$max_line) { unset($li);unset($type); }
    $line = htmlspecialchars($line);
    $line = str_replace(“&#”,”&#”,$line);
    $line = str_replace(“<u>”,”“,$line);
    $line = str_replace(“</u>”,”
    “,$line);
    $vzor = $li.$line.$type;

    if ($start_cit)
    {
    $aaa++;
    $vys[$aaa] = str_replace(“[10]”,”[999]”,$vzor);
    $vys[$aaa] = str_replace(“[1]”,”[1.0]”,$vys[$aaa]);
    $vys[$aaa] = str_replace(“[2]”,”[2.0]”,$vys[$aaa]);
    }
    else
    {
    if ($vys[1])
    {
    asort($vys); $first_time=0;
    foreach ($vys as $key => $val)
    {
    $val = str_replace(“[999]”,”[10]”,$val);
    $val = str_replace(“[1.0]”,”[1]”,$val);
    $val = str_replace(“[2.0]”,”[2]”,$val);
    if ($first_time==”0″) $ohlasy_title=”Citations:
    “;
    else unset($ohlasy_title);
    $first_time++;
    $vysledok .= “

    “.$ohlasy_title.$val.”

    “;
    }
    $vysledok .= $vzor; unset($key); unset($aaa); $vys = array();
    }
    else $vysledok .= $vzor;
    }

    }

    if (strstr($line,”Ohlasy:”))
    {
    $start_cit=true;
    unset($type);
    unset($li);
    }
    if (strstr($line,”###”)) unset($start_cit);
    }
    } //FOR end

    return $vysledok;
    }
    // end funkcie

    //sortovanie, ak sa vypisuju vsetky roky sortuje podla roku, prveho mena 2466c (povodne podla 2001c) a typu, inak podla mena a typu 2461c
    if ($this_year != “all”) {$year_line = “@and @attr 1=2456 ‘”.$this_year.”‘”; $sort = “2466c i< 1=2461c i<";} else $sort = "2456c i< 1=2466c i< 1=2461c i<"; //ak ma user publication_author_id vyhladava podla neho inak podla mena if ($publication_author_id and $publication_author_id != "0000000") { $name_line = "@attr 1=1013 'sav_un_auth*".$publication_author_id."'"; } else { if (strstr($epca_code,"SAV")) $name_line = "@and @attr 4=1 @attr 1=2001 @or '".$name." ".$epca_code."' '".$name." ".$epca_code2."' @attr 1=2462 @or '".$epca_code."' '".$epca_code2."'"; else $name_line = "@and @attr 4=1 @attr 1=2001 '".$name." ".$epca_code2."' @attr 1=2462 '".$epca_code2."'"; } //hlavna query $query="@attr 98=2 $type_line $year_line $name_line"; $WSURL = "http://library.sk:8080/i2/i2.ws.cls"; $dbepca = "SavUnEpca"; $charset = "utf-8"; $fmt = "TEXT_EPCA_ISO_SAV_OH_WS"; $query = str_replace("\'","'",$query); $requrl=$WSURL."?". "method=search&". "db=".urlencode($dbepca)."&". //databaza v ktorej sa ma vyhladavat "query=".urlencode($query)."&". //otazka vo formate PQF "sort=1=".urlencode($sort)."&". //sort "charset=".urlencode($charset)."&". //znakova sada "fmt=".urlencode($fmt); //format vysledku if ($this_year) $publications = SendReq($requrl); if (!$publications) echo "

    No publications do not comply with this criterion.

    “;
    else echo “

      \n”.$publications.”

      \n

    \n”;
    ?>