__section__
default
__description__
Displays the three user boxes (fancybox's).

* useredit = user being viewed ("edit" is for historical reasons)
  (if not given, the standard "user" will be used)

__title__

__page__
misc
__lang__
en_US
__name__
userboxes
__template__
[%
    IF user.is_admin && stoid;
    story_info = "";
		IF hits;
			story_info = 'This story has been viewed ' _ hits _ ' times.<br><br>';
		END;
		IF constants.signoff_use;
   			admin = Slash.getObject("Slash::Admin");
   			IF admin;
   				story_info = story_info _ admin.showSignoffBox(story.stoid, { contents_only => 1, use_title_for_header => 1 } );
			END;
		END;
		IF story_info;
			Slash.sidebox("Story Info", story_info, "story_info", 1);
		END;
	END;

IF !useredit; useredit = user; END;

IF user.is_anon;

	# The user we're displaying this page for is not logged in.
	# Show the login block.

	title = "$constants.sitename Log In";
	IF form.sid;
		contents = BLOCK %]
			[% PROCESS userlogin
				return_url = "$gSkin.rootdir/article.pl?sid=$form.sid" %]
		[% END;
	ELSE;
		contents = BLOCK %]
			[% PROCESS userlogin %]
		[% END;
	END;
	Slash.sidebox(title, contents, "userlogin", 1);

END;

IF !useredit.is_anon;

	# First box:  general user info

	title = useredit.nickname | strip_literal;
	title = title _ " ($useredit.uid)";
	contents = BLOCK;
		'<a href="'; constants.real_rootdir; '/~';
			useredit.nickname | strip_paramattr; '/">';
                        useredit.nickname | strip_literal; '</a> ';
		PROCESS zoo_icons person=useredit.uid implied="";
		IF user.uid == useredit.uid OR user.is_admin;
			# Looking at ourselves; show our real name and email info.
			'<br>'; IF useredit.realname; useredit.realname | strip_literal; ELSE; '(no real name given)'; END;
			'<br><a href="mailto:';
				useredit.realemail | strip_paramattr; '">';
				Slash.ellipsify(Slash.strip_literal(useredit.realemail)); '</a>';
			'<br>&nbsp;&nbsp;';
			IF useredit.fakeemail;
				IF useredit.fakeemail == useredit.realemail;
					'(shown without obfuscation)';
				ELSE;
					'shown as <a href="mailto:';
					useredit.fakeemail | strip_paramattr; '">';
					Slash.ellipsify(Slash.strip_literal(useredit.fakeemail)); '</a>';
				END;
			ELSE;
				'(email not shown publicly)';
			END;
		ELSE;
			# Looking at someone else; show fake email info.
			'<br>&nbsp;&nbsp;';
			IF useredit.fakeemail;
				'<a href="mailto:';
					useredit.fakeemail | strip_paramattr; '">';
					Slash.ellipsify(Slash.strip_literal(useredit.fakeemail)); '</a>';
			ELSE;
				'(email not shown publicly)';
			END;
		END;

		IF useredit.homepage;
			'<br><a href="';
			useredit.homepage | strip_attribute;
			'"';
			IF useredit.karma <= constants.goodkarma;
				' rel="nofollow"';
			END;
			'>';
			Slash.ellipsify(Slash.strip_literal(useredit.homepage)); '</a>';
		END;

		IF user.uid == useredit.uid OR user.is_admin;
			'<br>Karma: ';
			PROCESS karma karma=useredit.karma admin_flag=user.is_admin;
		END;

		IF useredit.aim && !useredit.aimdisplay;
			'<br><b>AOL IM:</b> ';
			useredit.aim | strip_literal;
			' (<b><a href="aim:addbuddy?screenname=';
			useredit.aim | strip_attribute;
			'">Add Buddy</a>, ';
			'<a href="aim:goim?screenname=';
			useredit.aim | strip_attribute;
			'&amp;message=Greetings!">Send Message</a></b>)';
		END;

		IF useredit.yahoo;
			'<br><b>Yahoo! ID:</b> ';
			'<a href="http://profiles.yahoo.com/';
			useredit.yahoo | strip_attribute;
			'">';
			useredit.yahoo | strip_literal;
			'</a> (<b><a href="http://edit.yahoo.com/config/set_buddygrp?';
			'.src=&amp;.cmd=a&amp;.bg=Friends&amp;.bdl=';
			useredit.yahoo | strip_attribute;
			'">Add User</a>, ';
			'<a href="http://edit.yahoo.com/config/send_webmesg?.target=';
			useredit.yahoo | strip_attribute;
			'">Send Message</a></b>)';
		END;

		IF useredit.jabber;
			'<br><b>Jabber:</b> ';
			useredit.jabber | strip_literal;
		END;

		IF useredit.calendar_url;
			'<br><b>Public Calendar:</b> ';
			'<a href="webcal://';
			useredit.calendar_url | strip_attribute;
			'">Subscribe</a>, <a href="http://';
			useredit.calendar_url | strip_attribute;
			'">Download</a>';
		END;

                IF useredit.bio;
                        '<br><hr>';
			Slash.parseDomainTags(useredit.bio);
                END;

	END;
	Slash.sidebox(title, contents, "user-info", 1);

	# Second box:  info about moderation, if applicable
	# Note this applies to the current user, not the user
	# being examined.

	IF user.points || user.is_admin;
		title = "Moderation";
		contents = BLOCK %]
<a href="[% constants.real_rootdir %]/~[% user.nickname | strip_paramattr %]/">You</a>
have moderator access
[% IF user.is_admin %](because you're an admin)[% END %]
and <b>[% user.points %]</b> point[% user.points == 1 ? '' : 's' %]
[%- IF user.points && user.lastgranted %] (expire on [%
	hours = constants.mod_stir_hours || (constants.stir * 24);
	hours = hours * 3600;
	hours = hours + user.off_set;
	Slash.timeCalc(user.lastgranted, "%Y-%m-%d", hours); %])[% END %].
[% IF user.points > 0 %]
Welcome to those of you just joining: <b>please</b>
read the <a href="[% gSkin.rootdir %]/moderation.shtml">moderator guidelines</a>
for instructions.
<ul>
	<li>You can't post &amp; moderate the same discussion.</li>
	<li>Concentrate on promoting more than demoting.</li>
	<li>Browse at -1 to keep an eye out for abuses.</li>
	<li><a href="mailto:[% constants.adminmail | strip_attribute %]">Mail the admin</a> URLs showing abuse (the cid link please!).</li>
</ul>
[% END %]
		[% END;
		Slash.sidebox(title, contents, "moderation", 1);
	END;

	# Third box:  user space, if applicable
	# Again, this is for the current user, not the edited user.

	IF user.mylinks
		&& (!user.slashboxes || user.slashboxes.search("mysite"));
		title = "User Space";
		contents = user.mylinks;
		Slash.sidebox(title, contents, "mylinks", 1);
	END;
END %]


__seclev__
1000
__version__
$Id$
