Example #1
0
function get_people($filter)
{
    global $people;
    foreach ($people[$filter] as $p) {
        $str = "<div class=\"adressblock clearfix\">\n";
        $str .= "    <h3>" . get($p['title'], '') . " {$p['first']} {$p['last']}</h3>\n";
        #mind the space before first
        $str .= "    <img class=\"floatimg\" src=\"" . gett("people/", $p['foto'], "anon.jpg") . "\">\n";
        $str .= "    <p>";
        $str .= $p['func'] ? "({$p['func']})<br>" : "";
        $str .= $p['hp'] ? "<a href='{$p['hp']}'>Homepage</a><br>" : "";
        $str .= $p['mail'] ? "<a href='mailto:{$p['mail']}'>{$p['mail']}</a><br>" : "";
        #$str .= "Email: " . ( $p['mail'] ? "<a href='mailto:{$p['mail']}'>{$p['mail']}</a>" : "(none)" ) . "<br>";
        $str .= $p['buro'] ? "Office: {$p['buro']}<br>" : "";
        #$str .= gett("Office: ", $p['buro'], "(none)") . "<br>";
        $str .= $p['tel'] ? "Phone: {$p['tel']}<br>" : "";
        #$str .= gett("Tel: ", $p['tel'], "(none)");
        $str .= "</p>\n";
        $str .= "</div>\n";
        echo $str;
    }
}
function get_people($filter)
{
    global $people;
    foreach ($people[$filter] as $p) {
        $str = "<div class=\"adressblock clearfix\">\n";
        $str .= "    <h3>" . get($p['title'], '') . " {$p['first']} {$p['last']}</h3>\n";
        #mind the space before first
        $str .= "    <img class=\"floatimg\" src=\"" . gett("people/", $p['foto'], "anon.jpg") . "\">\n";
        $str .= "    <p>";
        $str .= $p['func'] ? "({$p['func']})<br>" : "";
        $str .= $p['hp'] ? "<a href='{$p['hp']}'>Homepage</a> " : "";
        if ($p['hp'] and $p['mail']) {
            $str .= " | ";
        }
        /* encrypt email adresses, let js decrypt them */
        $encr_adr = encrypt($p['mail'], 21);
        $str .= $p['mail'] ? "<a class='iimeil' href='mailto:someone@inter.net?body=Please enable javascript to decrypt email adresses. Alternativly you can try http://www.phonebook.uzh.ch/.' data-iimeil='{$encr_adr}' title='email address'>eMail</a><br>" : "";
        $str .= $p['buro'] ? "Office: {$p['buro']}<br>" : "";
        $str .= $p['tel'] ? "<a href='tel:" . preg_replace('/\\s+/', '', $p['tel']) . "'>Phone: {$p['tel']}</a><br>" : "";
        $str .= "</p>\n";
        $str .= "</div>\n";
        echo $str;
    }
}