Exemplo n.º 1
0
function display($block, $label, $value, $is_buddy = TRUE)
{
    global $GENERAL_displayed, $CONTACTS_AND_GROUPS_displayed, $CONTACT_DATA_displayed;
    if (empty($value)) {
        return;
    }
    if ($is_buddy && viewer_authorized($label)) {
        $c = $GLOBALS["content"];
        $c->setCurrentBlock("BLOCK_" . $block);
        $c->setVariable("LABEL_" . $block, secure_gettext($label));
        $c->setVariable("VALUE_" . $block, $value);
        $c->parse("BLOCK_" . $block);
        ${$block . '_displayed'} = true;
    }
}
Exemplo n.º 2
0
    if (!($group_authorization & PROFILE_DENY_ALLUSERS)) {
        return true;
    }
    if ($is_contact && !($group_authorization & PROFILE_DENY_CONTACTS)) {
        return true;
    }
    return false;
}
$current_user = lms_steam::get_current_user();
$cache = get_cache_function($login, 86400);
$portal->set_page_title($login);
$html_handler_profile = new koala_html_profile($user);
$html_handler_profile->set_context("groups");
$content = new HTML_TEMPLATE_IT();
$content->loadTemplateFile(PATH_TEMPLATES . "list_groups.template.html");
if (viewer_authorized($current_user, $user)) {
    $public = $user->get_id() != $current_user->get_id() ? TRUE : FALSE;
    $groups = $cache->call("lms_steam::user_get_groups", $login, $public);
    usort($groups, "sort_objects");
    $no_groups = count($groups);
    if ($no_groups > 0) {
        $content->setCurrentBlock("BLOCK_GROUP_LIST");
        $start = $portal->set_paginator($content, 10, $no_groups, "(" . gettext("%TOTAL groups in list") . ")");
        $end = $start + 10 > $no_groups ? $no_groups : $start + 10;
        if ($current_user->get_id() == $user->get_id()) {
            $content->setVariable("LABEL_GROUPS", gettext("Your groups") . " (" . str_replace(array("%a", "%z", "%s"), array($start + 1, $end, $no_groups), gettext("%a-%z out of %s")) . ")");
        } else {
            $content->setVariable("LABEL_GROUPS", str_replace("%NAME", $user->get_attribute("USER_FIRSTNAME") . " " . $user->get_attribute("USER_FULLNAME"), gettext("%NAME's groups")) . " (" . str_replace(array("%a", "%z", "%s"), array($start + 1, $end, $no_groups), gettext("%a-%z out of %s")) . ")");
        }
        // GROUPS
        $content->setVariable("LABEL_NAME_DESCRIPTION", gettext("Name, description"));