You can't resend the password because the password is encrypted in the database.
The easisest way :
You create a new password for the use and you send it via E-mail
To add a user as friend you need to create a new sql table like :
CREATE TABLE IF NOT EXISTS `pp_friend` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`friend_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
A file called addfriend.php
<?php
include 'header.php';
// Redirige l'utilisateur s'il n'est pas identifié
if(empty($_COOKIE["id"]))
{
header("Location: index.php");
}
else
{
$result = mysql_query("
INSERT INTO pp_friend (user_id,firend_id) VALUES ($_COOKIE[id],'$_GET[f]')
");
header('Location: ' . $_SERVER['HTTP_REFERER'] );
}
?>
In user.tpl place this link where You want :
<a href="addfriend.php?f={$id}">add to my friend</a>
Create a friend.php file
<?php
/*
+ ----------------------------------------------------------------------------+
| PHPDirector.
| $License: GPL General Public License
| $Website: phpdirector.co.uk
| $Author: Ben Swanson
| $Contributors - Dennis Berko and Monte Ohrt (Monte Ohrt)
+----------------------------------------------------------------------------+
*/
require('header.php');
if(!isset($_COOKIE["id"]))
{
header("Location: index.php");
}
else
{
$result_us= mysql_query("SELECT * FROM pp_friend WHERE user_id='$_COOKIE[id]'") or die(mysql_error());
while($row_us = mysql_fetch_assoc($result_us))
{
if(!empty($row_us))
{
$query_fv = "SELECT * FROM pp_user WHERE id = $row_us[friend_id]";
$result_fv = mysql_query($query_fv);
while ($row_fv = mysql_fetch_assoc($result_fv))
{
$friend[] = $row_fv;
}
}
else
{
$smarty->assign('error', 'You have no friend');
}
}
}
$smarty->assign('friend', $friend);
$smarty->display('friend.tpl');
?>
And a friend.tpl file (to place in template folder)
{include file="header.tpl"}
<div class="fullwrapper roundedcorner">
<div class="content">
<h2>{$LAN_110}</h2>
<hr />
<div align="left">
{$error}
<table border="0" cellspacing="13px" >
<tr valign="top" >
{section name=friend loop=$friend}
<td width="160px">
<h5 style="height: 40px;"><a href="user.php?u={$friend[friend].user}">{$friend[friend].user}</a></h5><br />
</td>
{/section}
</tr>
</table>
</div>
</div>
</div>
{include file="footer.tpl"}
Now, You have just to put a link to friend.php to see your list of friends.
Hope this can help you