<?
# Slashster: Open Source Friend of a Friend Software
# Copyright 2004 Mark El-Wakil
# Contact: hide@address.com
# http://seventhcycle.net
#
# This file is part of Slashster.
#
# Slashster is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Slashster is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Slashster; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import_request_variables("gPc");
require_once("PageClass.php");
$mpage = new PageClass("authonly");
$mpage->MembersOnly();
$mpage->VerifiedOnly();
$sql = "select * from UserTable where Id = \"$id\" ";
$r = $mpage->DoQuery($sql,1);
if (!sizeof($r))
{
$mpage->Initialize("authremainder");
echo "No such user";
$mpage->ClosePage();
}
$r = $r[0];
$sql = "select * from FriendRequest where Start = $mpage->IdNum
AND End = \"$id\" ";
$t = $mpage->DoQuery($sql);
if ($submit && !sizeof($t))
{
$mpage->FriendRequest($mpage->IdNum, $id);
}
if (sizeof($t) || $submit)
{
$mpage->Initialize("authremainder"); ?>
<P>Thank You</p>
<P>Your request to be this person's friend has been sent and is now pending.
<? $mpage->ClosePage();
}
$mpage->Initialize("authremainder");
?>
<BR>
<table width=700 border=0>
<tr><td width=700 valign=top>
<form method=post>
<b>Add Friend</b>
<br><BR>
<table border=1 cellspacing=0>
<tr><td width=100 valign=middle align=center>
<img src="userpics/<?= $mpage->PicPr($r[PicDefault], $r[Id]) ?>-b.jpg" width=80 height=60>
</td><td>
You are about to add <B><?= $r[Fname] ?> <?= substr($r[Lname], 0, 1) ?>.</b> as a friend.
<P><B><?= $r[Fname] ?></b> will be notified, and will have to confirm that you are friends. Your full
name and email address will be sent to <B><?= $r[Fname] ?></b> for identification purposes if you
proceed.
<P style="color:red;"><B>Continue only if you really are friends with <?= $r[Fname] ?></b>.</p>
</tr>
</table>
<P>
<table width=100%>
<tr><td width=200>
<table class="submit"><tr><td>
<a href="user.php?id=<?= $r[Id] ?>">Cancel</a>
</td></tr>
</table>
</td><td>
<input type="submit" class="submit" name="submit" value="Add <?= $r[Fname] ?> as your Friend">
</td></tr>
</table>
</td></tr>
</table>
<? $mpage->ClosePage(); ?>