Author Topic: Member area  (Read 7481 times)

0 Members and 1 Guest are viewing this topic.

Offline winracer

  • Development Team
  • Pro Member
  • *******
  • Posts: 446
  • Karma: 3
    • View Profile
    • helpmewithperl.com
  • Script Version: 1.0+
Re: Member area
« Reply #75 on: January 10, 2010, 04:26:09 AM »
have you downlaod the new 3.0 version at http://phpdirector.co.uk/index.php?id=2
it has it in it.. if not what version are you trying to modify?
winracer
myfunnypets.com
helpmewithperl.com
coosavalleyclassifieds.com
brownlows.net
myphpforum.com

Offline barrene

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
Re: Member area
« Reply #76 on: January 28, 2010, 10:18:51 AM »
Hi.. may someone teach me how to create "change password, forgot password and add user as friend" on this script.. Thanksss... suggest to add on those function.. thanks again.

Offline hilflo

  • Full phpd Member
  • ***
  • Posts: 98
  • Karma: 2
  • Sorry for my bad english
    • View Profile
    • Les félés
Re: Member area
« Reply #77 on: February 02, 2010, 12:53:41 AM »
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 :
Code: [Select]

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
Code: [Select]
<?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 :
Code: [Select]
<a href="addfriend.php?f={$id}">add to my friend</a>
Create a friend.php file
Code: [Select]
<?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_usmysql_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)
Code: [Select]
{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

Offline FireDart

  • Project Leader
  • Pro Member
  • *****
  • Posts: 406
  • Karma: 4
    • View Profile
    • FireDart
Re: Member area
« Reply #78 on: February 02, 2010, 01:13:42 AM »
Will implement "Friends" feature soon(Maybe tomorrow).

Offline hilflo

  • Full phpd Member
  • ***
  • Posts: 98
  • Karma: 2
  • Sorry for my bad english
    • View Profile
    • Les félés
Re: Member area
« Reply #79 on: February 02, 2010, 01:16:19 AM »
Not really test it. It may works

Offline winracer

  • Development Team
  • Pro Member
  • *******
  • Posts: 446
  • Karma: 3
    • View Profile
    • helpmewithperl.com
  • Script Version: 1.0+
Re: Member area
« Reply #80 on: February 02, 2010, 03:04:37 AM »
hilflo

looks great!
winracer
myfunnypets.com
helpmewithperl.com
coosavalleyclassifieds.com
brownlows.net
myphpforum.com