예제 #1
0
function getFieldCode($fieldNameIntern, $user)
{
    global $gPreferences, $g_root_path, $gCurrentUser, $gProfileFields, $gL10n;
    $html = array('label' => '', 'value' => '');
    $value = '';
    $msg_image = '';
    if (!$gCurrentUser->hasRightEditProfile($user) && $gProfileFields->getProperty($fieldNameIntern, 'usf_hidden') == 1) {
        return '';
    }
    // get value of field in html format
    $value = $user->getValue($fieldNameIntern, 'html');
    // if birthday then show age
    if ($gProfileFields->getProperty($fieldNameIntern, 'usf_name_intern') === 'BIRTHDAY') {
        $birthday = new DateTimeExtended($user->getValue($fieldNameIntern, 'Y.m.d'), 'Y.m.d');
        $value = $value . '   (' . $birthday->getAge() . ' ' . $gL10n->get('PRO_YEARS') . ')';
    } elseif (strlen($gProfileFields->getProperty($fieldNameIntern, 'usf_icon')) > 0) {
        $value = $gProfileFields->getProperty($fieldNameIntern, 'usf_icon') . '  ' . $value;
    }
    // show html of field, if user has a value for that field or it's a checkbox field
    if (strlen($user->getValue($fieldNameIntern)) > 0 || $gProfileFields->getProperty($fieldNameIntern, 'usf_type') === 'CHECKBOX') {
        $html['label'] = $gProfileFields->getProperty($fieldNameIntern, 'usf_name');
        $html['value'] = $value;
    }
    return $html;
}
예제 #2
0
function getFieldCode($fieldNameIntern, $user)
{
    global $gPreferences, $g_root_path, $gCurrentUser, $gProfileFields, $gL10n;
    $html = array('label' => '', 'value' => '');
    $value = '';
    $msg_image = '';
    if (!$gCurrentUser->hasRightEditProfile($user) && $gProfileFields->getProperty($fieldNameIntern, 'usf_hidden') == 1) {
        return '';
    }
    // get value of field in html format
    $value = $user->getValue($fieldNameIntern, 'html');
    // if birthday then show age
    if ($gProfileFields->getProperty($fieldNameIntern, 'usf_name_intern') === 'BIRTHDAY') {
        $birthday = new DateTimeExtended($user->getValue($fieldNameIntern, 'Y.m.d'), 'Y.m.d');
        $value = $value . '   (' . $birthday->getAge() . ' ' . $gL10n->get('PRO_YEARS') . ')';
    }
    // Icons der Messenger anzeigen
    if ($gProfileFields->getProperty($fieldNameIntern, 'usf_name_intern') === 'ICQ') {
        if (strlen($user->getValue($fieldNameIntern)) > 0) {
            // Sonderzeichen aus der ICQ-Nummer entfernen (damit kommt www.icq.com nicht zurecht)
            preg_match_all('/\\d+/', $user->getValue($fieldNameIntern), $matches);
            $icq_number = implode("", reset($matches));
            // ICQ Onlinestatus anzeigen
            $value = '
            <a class="admidio-icon-link" href="http://www.icq.com/people/cmd.php?uin=' . $icq_number . '&amp;action=add"><img
                src="http://status.icq.com/online.gif?icq=' . $icq_number . '&amp;img=5"
                alt="' . $gL10n->get('PRO_TO_ADD', $user->getValue($fieldNameIntern), $gProfileFields->getProperty($fieldNameIntern, 'usf_name')) . '"
                title="' . $gL10n->get('PRO_TO_ADD', $user->getValue($fieldNameIntern), $gProfileFields->getProperty($fieldNameIntern, 'usf_name')) . '" /></a> ' . $value;
        }
    } elseif ($gProfileFields->getProperty($fieldNameIntern, 'usf_name_intern') === 'SKYPE') {
        if (strlen($user->getValue($fieldNameIntern)) > 0) {
            // Skype Onlinestatus anzeigen
            $value = '<script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script>
            <a class="admidio-icon-link" href="skype:' . $user->getValue($fieldNameIntern) . '?add"><img
                src="http://mystatus.skype.com/smallicon/' . $user->getValue($fieldNameIntern) . '"
                title="' . $gL10n->get('PRO_TO_ADD', $user->getValue($fieldNameIntern), $gProfileFields->getProperty($fieldNameIntern, 'usf_name')) . '"
                alt="' . $gL10n->get('PRO_TO_ADD', $user->getValue($fieldNameIntern), $gProfileFields->getProperty($fieldNameIntern, 'usf_name')) . '" /></a> ' . $value;
        }
    } elseif (strlen($gProfileFields->getProperty($fieldNameIntern, 'usf_icon')) > 0) {
        $value = $gProfileFields->getProperty($fieldNameIntern, 'usf_icon') . '&nbsp;&nbsp;' . $value;
    }
    // show html of field, if user has a value for that field or it's a checkbox field
    if (strlen($user->getValue($fieldNameIntern)) > 0 || $gProfileFields->getProperty($fieldNameIntern, 'usf_type') === 'CHECKBOX') {
        $html['label'] = $gProfileFields->getProperty($fieldNameIntern, 'usf_name');
        $html['value'] = $value;
    }
    return $html;
}