Beispiel #1
0
function sut_authors()
{
    global $campi, $sep;
    $ret = "";
    $aay = array('', '', '', '', '', '');
    $xx = explode('/', $campi['Title']);
    $at = explode(';', $xx[1]);
    // per il momento gestisco solo un autore principale,nonostantel' "esplosione" :-)
    $x = $campi['Authors'];
    if (strpos($x, $sep) > 0) {
        $ax = explode($sep, $x);
    } else {
        $ax = array($x);
    }
    $ax[0] = trim($ax[0]);
    // invece gli autori secondari li "esplodiamo" dal campo nomi
    $y = $campi['Names'];
    $pattern = "/ (\\#\\{)([^\\}]+)(\\}) /";
    $y = preg_replace($pattern, "|", $y);
    //se gli autori principali sono nel campo Names li togliamo
    $pattern = "/" . $ax[0] . "\\|/";
    $y = preg_replace($pattern, "", $y);
    $ay = explode($sep, $y);
    //mettiamo i primi 6 autori secondari in $aay
    for ($k = 0; $k < count($ay); $k++) {
        $aay[$k] = $ay[$k];
    }
    //search respons.functions and redefinition of resp.levels
    $i = 0;
    $axy = array('', '', '', '', '', '', '', '', '');
    $afn = array('', '', '', '', '', '', '', '', '');
    $axy[0] = $ax[0];
    for ($k = 0; $k < 6; $k++) {
        $a = explode(',', $aay[$k]);
        $fn = "";
        if ($a[0] != '') {
            $fn = sut_autfn($a, $at);
        }
        //search for author's function
        $axy[$k + 2] = $ay[$k];
        $afn[$k + 2] = $fn;
    }
    for ($k = 0; $k < 9; $k++) {
        $a = explode(',', $axy[$k]);
        $ret .= $a[0] . $sep . $a[1] . $sep . $afn[$k] . $sep;
    }
    return $ret;
}
Beispiel #2
0
function sut_authors()
{
    global $campi, $sep;
    $max_n_aut = 9;
    //numero massimo di autori
    $first_sec_aut = 3;
    //ndx del primo autore secondario
    $xaa = array('', '', '', '', '', '', '', '', '');
    //lista vuota campi autore (9)
    $ret = "";
    $aax = $xaa;
    $xx = explode('/', $campi['Title']);
    $at = explode(';', $xx[1]);
    $x = $campi['Authors'];
    if (strpos($x, $sep) > 0) {
        $ax = explode($sep, $x);
    } else {
        $ax = array($x);
    }
    if (count($ax) > $first_sec_aut) {
        $i = $first_sec_aut;
    } else {
        $i = 0;
    }
    for ($k = 0; $k < count($ax); $k++) {
        $aax[$i] = $ax[$k];
        $i++;
    }
    //search respons.functions and redefinition of resp.levels
    $i = 0;
    $axx = $xaa;
    $afn = $xaa;
    for ($k = 0; $k < $max_n_aut; $k++) {
        $a = explode(',', $aax[$k]);
        $fn = "";
        if ($a[0] != '') {
            $fn = sut_autfn($a, $at);
        }
        //search for author's function
        if ($fn != '' and $k < $first_sec_aut and $i < $first_sec_aut) {
            $i = $first_sec_aut;
            //$a[0|1|2] is a 702
        }
        $axx[$i] = $aax[$k];
        $afn[$i] = $fn;
        $i++;
    }
    for ($k = 0; $k < $max_n_aut; $k++) {
        $a = explode(',', $axx[$k]);
        $ret .= $a[0] . $sep . $a[1] . $sep . $afn[$k] . $sep;
    }
    return $ret;
}