<?php
!defined('M_P') && exit('Forbidden');
!$winduid && Showmsg('not_login');
InitGP(array('u','hash','app'));
$u = (int)$u;
!$u && Showmsg('undefined_action');
$thisbase = $basename."q=invite&";

if($winduid) {
	if (getOneFriend($u)) {
		Showmsg('mode_o_is_friend');
	}
}

$friend = $db->get_one("SELECT m.uid,m.username,m.icon as face,m.honor,md.f_num FROM pw_members m LEFT JOIN pw_memberdata md ON m.uid=md.uid WHERE m.uid=".pwEscape($u));
!$friend && Showmsg('undefined_action');
if ($hash != appkey($u,$app)) {
	Showmsg('mode_o_invite_hash_error');
} else {
	if (!$winduid) {
		Cookie('o_invite',"$u\t$hash\t$app");
	}
}

require_once(R_P.'require/showimg.php');
list($friend['face']) = showfacedesign($friend['face'],1);
if ($friend['f_num']) {
	$friends = getFriends($u,0,6,'',1);
}
require_once(R_P.'require/header.php');
require_once PrintEot('m_invite');
footer();
?>