Ejemplo n.º 1
0
            break;
        }
    }
    return $str;
}
$spaceurl = '';
if (!empty($_GET['grant'])) {
    $str = getGrantNum($_GET['grant']);
    $spaceurl = $siteurl . 'space.php?u=' . $str;
} else {
    $spaceurl = $siteurl . 'space.php?u=' . $_SGLOBAL['supe_uid'];
}
$mailvar = array();
if (!empty($_GET['grant'])) {
    $num = getGrantNum($_GET['grant']);
    $str = getGrantString($_GET['grant']);
    array_push($mailvar, "<a href=\"{$spaceurl}\"><div class='round_avatar'>" . avatar($num, 'big', False, 2) . "</div></a><div class='Left_mainname' style='margin-top:10px;'>" . $_SN[$num] . '</div>', $str, $_SCONFIG['sitename'], '', '', $spaceurl, '');
} else {
    array_push($mailvar, "<a href=\"{$spaceurl}\"><div class='round_avatar'>" . avatar($space['uid'], 'big', False, 2) . "</div></a><div class='Left_mainname' style='margin-top:10px;'>" . $_SN[$space['uid']] . "</div>", $_SN[$space['uid']], $_SCONFIG['sitename'], '', '', $spaceurl, '');
}
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('space') . " WHERE caninvite=1 and uid=" . $_SGLOBAL['supe_uid']);
$row = $_SGLOBAL['db']->fetch_array($query);
if (empty($row)) {
    //该用户不是通过授权得到邀请好友功能的
    $_SCONFIG['isgranted'] = 0;
} else {
    $_SCONFIG['isgranted'] = 1;
    $query = $_SGLOBAL['db']->query("SELECT public_uid FROM " . tname('grantinvite') . " WHERE uid=" . $_SGLOBAL['supe_uid']);
    $space['grantlist'] = array();
    $str = getGrantNum($_GET['grant']);
    while ($row = $_SGLOBAL['db']->fetch_array($query)) {
Ejemplo n.º 2
0
    function DisplayGrants(&$grantslist, $type, $grey = false)
    {
        global $AR, $ARCurrent;
        if ($grantslist[$type] && is_array($grantslist[$type])) {
            ksort($grantslist[$type]);
            while (list($id, $grants) = each($grantslist[$type])) {
                // path was login en is weer login
                $grant_string = "";
                if (!$ARCurrent->donelist[$type][$id]) {
                    $ARCurrent->donelist[$type][$id] = true;
                    $row_id = "grants-{$type}-{$id}";
                    $row_class = getClass($grey);
                    $path = getPathByType($type, $id);
                    $grant_strings = getGrantString($id, $type, $grants, $grey);
                    $grant_string = $grant_strings[0];
                    $grant_html = $grant_strings[1];
                    $icon = $AR->dir->images . "icons/small/" . $type . ".png";
                    ?>
						<script type="text/javascript">
							id2path['<?php 
                    echo $type;
                    ?>
']['<?php 
                    echo $id;
                    ?>
'] = '<?php 
                    echo $path;
                    ?>
';
							grant_strings['<?php 
                    echo $type;
                    ?>
']['<?php 
                    echo $id;
                    ?>
']='<?php 
                    echo $grant_string;
                    ?>
';
						</script>
						<tr class='<?php 
                    echo $row_class;
                    ?>
' id="<?php 
                    echo $row_id;
                    ?>
">
							<td>
								<img alt="<?php 
                    echo $type;
                    ?>
" src="<?php 
                    echo $icon;
                    ?>
">
							</td>
							<td>
								<a href="javascript:loadUser('<?php 
                    echo $type;
                    ?>
', '<?php 
                    echo $id;
                    ?>
');"><?php 
                    echo $id;
                    ?>
</a>
							</td>
							<td>
								<?php 
                    echo $grant_html;
                    ?>
							</td>
						</tr>
						<?php 
                }
            }
        }
    }