Skip to content

Commit

Permalink
Nicer UI for private profiles.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jul 5, 2010
1 parent df41d93 commit 2a92f7a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 3 deletions.
24 changes: 23 additions & 1 deletion index.html
Expand Up @@ -86,15 +86,22 @@
function process_steam_profile(xml)
{
var prof = $(xml).find('profile');
if (prof.find('steamid').text() == '0')
var steamid = prof.find('steamid').text();
if (steamid == '0')
{
$('img.avatar').hide();
popover('#loginpopover');
return null;
} // if

if (prof.find('valid').text() != '1')
{
$('img.avatar').hide();
var url = 'http://steamcommunity.com/profiles/' + steamid + '/edit/settings';
$('a#privpage').attr('href', url);
popover('#privateprofilepopover');
return null;
} // if

var retval = {
nickname: prof.find('nickname').text(),
Expand Down Expand Up @@ -443,6 +450,21 @@
Click here to log in through steamcommunity.com</a></p>
</center>
</div>

<div id='privateprofilepopover'>
<center>
<p>Your Steam Community profile appears to be set to private.</p>
<br/>
<p>You need to change your Steam Community settings to access this page.</p>
<p>The "profile status" must be set to "public."</p>
<p>Please note that this will let everyone see your information!</p>
<p>Unfortunately, it's the only way this site can see it, too.</p>
<br/>
<p><a id='privpage' style='text-decoration: underline;' href='xxx'>
Click here to go to your steamcommunity.com settings.</a></p>
</center>
</div>

<div id='backgroundpopover'></div>
</body>
</html>
Expand Down
5 changes: 3 additions & 2 deletions steamprofile.php
Expand Up @@ -33,11 +33,12 @@ function dump_array_as_xml($name, $a)
exit(0);
} // if

$profile = load_steam_profile($_SESSION['steamid']);
$steamid = $_SESSION['steamid'];
$profile = load_steam_profile($steamid);

if ($profile == NULL)
{
print('<profile><valid>0</valid></profile>');
print("<profile><steamid>$steamid</steamid><valid>0</valid></profile>");
exit(0);
} // if

Expand Down
13 changes: 13 additions & 0 deletions style.css
Expand Up @@ -116,6 +116,19 @@ img.avatar {
font-size:13px;
}

#privateprofilepopover {
display:none;
position:fixed;
_position:absolute; /* hack for internet explorer 6*/
width:408px;
background:#FF0000;
color:#FFFFFF;
border:2px solid #cecece;
z-index:2;
padding:12px;
font-size:13px;
}

div.taglist {
display: inline;
}
Expand Down

0 comments on commit 2a92f7a

Please sign in to comment.