Author Topic: Member area  (Read 7469 times)

0 Members and 1 Guest are viewing this topic.

Offline FireDart

  • Project Leader
  • Pro Member
  • *****
  • Posts: 406
  • Karma: 4
    • View Profile
    • FireDart
Re: Member area
« Reply #15 on: December 05, 2009, 09:00:32 PM »
Works great, thanks.

Offline winracer

  • Development Team
  • Pro Member
  • *******
  • Posts: 446
  • Karma: 3
    • View Profile
    • helpmewithperl.com
  • Script Version: 1.0+
Re: Member area
« Reply #16 on: December 06, 2009, 02:47:22 AM »
To delete form favorite :
Download delfavorite.php in the attachment.

In favorit.tpl add this line where you want to see the delete link :
Code: [Select]
<a href="delfavorite.php?g={$videos[mysec].id}&u={$user}">Delete form favorite</a>
I will try the two other suggestion

PS : Yours suggestion help me to add functionnality

Great work hilflo but can you tell me how do you have a page that you can only be viewed if logedin and if not logined in tell them to

winracer
myfunnypets.com
helpmewithperl.com
coosavalleyclassifieds.com
brownlows.net
myphpforum.com

Offline FireDart

  • Project Leader
  • Pro Member
  • *****
  • Posts: 406
  • Karma: 4
    • View Profile
    • FireDart
Re: Member area
« Reply #17 on: December 06, 2009, 03:54:54 AM »
winracer is right,
How can you make the avatar.php, and favorite.php redirect if your not logged-in?

Offline hilflo

  • Full phpd Member
  • ***
  • Posts: 98
  • Karma: 2
  • Sorry for my bad english
    • View Profile
    • Les félés
Re: Member area
« Reply #18 on: December 06, 2009, 08:35:23 AM »
This code redirect visitor if he is not connected:
Code: [Select]
if(!isset($_COOKIE["id"]))
{
     header("Location: index.php");
}

Offline hilflo

  • Full phpd Member
  • ***
  • Posts: 98
  • Karma: 2
  • Sorry for my bad english
    • View Profile
    • Les félés
Re: Member area
« Reply #19 on: December 06, 2009, 10:18:57 AM »
I have added a PM system and a user page.

Firedart I have send you a message on Play-online if you want to see.

You can download it here

Don't forget to do a backup of your files and database before updating.



Offline hilflo

  • Full phpd Member
  • ***
  • Posts: 98
  • Karma: 2
  • Sorry for my bad english
    • View Profile
    • Les félés
Re: Member area
« Reply #20 on: December 06, 2009, 10:29:35 AM »
Just a problem that I don't resolve.
 When the number of plays is updated, that don't add 1 plays but sometimes 2 or 3.

I think, it comes from the loading of the players.

Offline FireDart

  • Project Leader
  • Pro Member
  • *****
  • Posts: 406
  • Karma: 4
    • View Profile
    • FireDart
Re: Member area
« Reply #21 on: December 06, 2009, 04:18:39 PM »
Just tried the PM and CP, Works great.

I will added it to Version 3.0 as soon  as possible.

Offline winracer

  • Development Team
  • Pro Member
  • *******
  • Posts: 446
  • Karma: 3
    • View Profile
    • helpmewithperl.com
  • Script Version: 1.0+
Re: Member area
« Reply #22 on: December 06, 2009, 06:51:08 PM »
I have added a PM system and a user page.

Firedart I have send you a message on Play-online if you want to see.

You can download it here

Don't forget to do a backup of your files and database before updating.


hilflo

do you care if I add some update also. like making the password md5 and sending e-mail to user and admin.

adding other fields in user like date signed up admin or not and a reset password plus a user admiin to view and edit users.

also maybe mass e-mail to all users.
also tie to my upload script

does this tie into your comment script? and use the avatar also user must be login to post a comment.
winracer
myfunnypets.com
helpmewithperl.com
coosavalleyclassifieds.com
brownlows.net
myphpforum.com

Offline hilflo

  • Full phpd Member
  • ***
  • Posts: 98
  • Karma: 2
  • Sorry for my bad english
    • View Profile
    • Les félés
Re: Member area
« Reply #23 on: December 06, 2009, 08:27:08 PM »
Naturally you can.

Password is already stores in md5

For the comment system replace old comment.tpl file with this
Code: [Select]
<div id="comment">
<h1>{$LAN_70}</h1>
{if isset($smarty.cookies.id)}
{$message}
<form method="post" action="games.php?id={$video[video].id}">
<input type="hidden" name="id" value="{$video[video].id}">
 <b>{$LAN_71}</b><br /><input type="text" name="nom" value="{$user}"><br />
<b>{$LAN_72}</b><br /><textarea name="comment" row="10" cols="60"></textarea><br />
<input type="submit" name="go" value="{$LAN_73}">
</form>
<br />
{else}
{$LAN_94}
{/if}
<table width="100%">
{section name=game_co loop=$game_co}
     <tr>
     <td width="60" align="left">
<img src="avatar/{$avatar}" width="50" height="50" align="left">
</td>
<td width="400" valign="top">{$LAN_16} <b>{$game_co[game_co].nom}</b><br />
  {$game_co[game_co].comment}</td><tr>
<br />
{/section}
</table>
</div>

In videos.php
Replace
Code: [Select]
$query_co = "SELECT * FROM pp_comment WHERE file_id='$_GET[id]' ORDER BY id DESC";
$result_co = mysql_query($query_co);
while ($row_co = mysql_fetch_assoc($result_co)){
   $game_co[] = $row_co;
}
$smarty->assign('game_co', $game_co);

By
Code: [Select]
$query_co = "SELECT * FROM pp_comment WHERE file_id='$_GET[id]' ORDER BY id DESC";
$result_co = mysql_query($query_co);
while ($row_co = mysql_fetch_assoc($result_co)){
   $game_co[] = $row_co;
 $q_av = "SELECT * FROM pp_user WHERE user='$row_co[nom]'";
$result_av = mysql_query($q_av);
$row_av = mysql_fetch_assoc($result_av); 
}
$smarty->assign('game_co', $game_co);

$smarty->assign('avatar', $row_av['avatar']);

So only member can post comment and the avatar is shown like here
« Last Edit: December 06, 2009, 08:49:27 PM by hilflo »

Offline winracer

  • Development Team
  • Pro Member
  • *******
  • Posts: 446
  • Karma: 3
    • View Profile
    • helpmewithperl.com
  • Script Version: 1.0+
Re: Member area
« Reply #24 on: December 07, 2009, 12:03:12 AM »
Naturally you can.

Password is already stores in md5

For the comment system replace old comment.tpl file with this
Code: [Select]
<div id="comment">
<h1>{$LAN_70}</h1>
{if isset($smarty.cookies.id)}
{$message}
<form method="post" action="games.php?id={$video[video].id}">
<input type="hidden" name="id" value="{$video[video].id}">
 <b>{$LAN_71}</b><br /><input type="text" name="nom" value="{$user}"><br />
<b>{$LAN_72}</b><br /><textarea name="comment" row="10" cols="60"></textarea><br />
<input type="submit" name="go" value="{$LAN_73}">
</form>
<br />
{else}
{$LAN_94}
{/if}
<table width="100%">
{section name=game_co loop=$game_co}
     <tr>
     <td width="60" align="left">
<img src="avatar/{$avatar}" width="50" height="50" align="left">
</td>
<td width="400" valign="top">{$LAN_16} <b>{$game_co[game_co].nom}</b><br />
  {$game_co[game_co].comment}</td><tr>
<br />
{/section}
</table>
</div>

In videos.php
Replace
Code: [Select]
$query_co = "SELECT * FROM pp_comment WHERE file_id='$_GET[id]' ORDER BY id DESC";
$result_co = mysql_query($query_co);
while ($row_co = mysql_fetch_assoc($result_co)){
   $game_co[] = $row_co;
}
$smarty->assign('game_co', $game_co);

By
Code: [Select]
$query_co = "SELECT * FROM pp_comment WHERE file_id='$_GET[id]' ORDER BY id DESC";
$result_co = mysql_query($query_co);
while ($row_co = mysql_fetch_assoc($result_co)){
   $game_co[] = $row_co;
 $q_av = "SELECT * FROM pp_user WHERE user='$row_co[nom]'";
$result_av = mysql_query($q_av);
$row_av = mysql_fetch_assoc($result_av); 
}
$smarty->assign('game_co', $game_co);

$smarty->assign('avatar', $row_av['avatar']);

So only member can post comment and the avatar is shown like here

thanks I will change.
« Last Edit: December 07, 2009, 12:09:58 AM by winracer »
winracer
myfunnypets.com
helpmewithperl.com
coosavalleyclassifieds.com
brownlows.net
myphpforum.com

Offline hilflo

  • Full phpd Member
  • ***
  • Posts: 98
  • Karma: 2
  • Sorry for my bad english
    • View Profile
    • Les félés
Re: Member area
« Reply #25 on: December 07, 2009, 12:12:53 AM »
If you look in register.php
$result = mysql_query("
                              INSERT INTO pp_user(user,pass,email,register)
                              VALUES('$_POST[TB_Nom_Utilisateur]','".md5($_POST['TB_Mot_de_Passe'])."','$_POST[TB_Adresse_Email]',CURRENT_DATE())
                         ");

Offline winracer

  • Development Team
  • Pro Member
  • *******
  • Posts: 446
  • Karma: 3
    • View Profile
    • helpmewithperl.com
  • Script Version: 1.0+
Re: Member area
« Reply #26 on: December 07, 2009, 12:52:01 AM »
If you look in register.php
$result = mysql_query("
                              INSERT INTO pp_user(user,pass,email,register)
                              VALUES('$_POST[TB_Nom_Utilisateur]','".md5($_POST['TB_Mot_de_Passe'])."','$_POST[TB_Adresse_Email]',CURRENT_DATE())
                         ");

yes sorry I see
winracer
myfunnypets.com
helpmewithperl.com
coosavalleyclassifieds.com
brownlows.net
myphpforum.com

Offline winracer

  • Development Team
  • Pro Member
  • *******
  • Posts: 446
  • Karma: 3
    • View Profile
    • helpmewithperl.com
  • Script Version: 1.0+
Re: Member area
« Reply #27 on: December 07, 2009, 12:53:27 AM »
I have create a member where member can :
- Register/login
- Upload an avatar
- Have a list of favorit videos.
- For those who used comment system, only member can post comment.

In future, I will try to add a PM system.

You can see it at http://www.play-online.bzh.be

You can download it here

Important, you will need to edit some files so try it in localhost before uploading to your webserver.


can you use something like
if($logged_in){


some code
}

on yours. what I mean is how would  place the login on other pages if loged in do this if not please login to view this page.

what I am using is something like this in the header.php

Code: [Select]

session_start ();
require_once("login.php");
if($logged_in){
         echo "Welcome <b>$_SESSION[username]</b>, you are logged in. <a href=\"logout.php\">Logout</a>";
 }
else


{

?>

<h1>Login</h1>
<form action="" method="post">
<tr><td>Username:</td><td><input type="text" name="user" maxlength="30"></td></tr>
<tr><td>Password:</td><td><input type="password" name="pass" maxlength="30"></td></tr>
<tr><td colspan="2" align="left"><input type="checkbox" name="remember">
<font size="2">Remember me next time</td></tr>
<tr><td colspan="2" align="right"><input type="submit" name="sublogin" value="Login"></td></tr>
<tr><font size="2"><td colspan="2" align="left"><a href="register.php">New Member Sign UP</a></td></tr>
<tr><font size="2"><td colspan="2" align="left"><a href=forgot-password.php>Forgot Password</a></td></tr>
</font>
</form>

<?

}



this

In menubar.tpl I use :
Code: [Select]
{if isset($smarty.cookies.id)}
<img src="avatar/{$avatar}" width="50" haigh="50" align="left">&nbsp;&nbsp;Hi <strong>{$user}</strong><br />
&nbsp;&nbsp;<a href="avatar.php">{$LAN_97}</a> - <a href="favorit.php">{$LAN_96}</a> - <a href="logout.php">{$LAN_92}</a>
{else}
<form action="login.php" method="post">
          {$LAN_89} : <input type="text" name="TB_Nom_Utilisateur" />
          {$LAN_90} : <input type="password" name="TB_Mot_de_Passe" />
          <input type="submit" name="BT_Envoyer" value="{$LAN_91}" />
<p><a href="register.php">{$LAN_93}</a></p>
</form>
{/if}

If you are connected, it show the member menu else, it show the login form whith a link to register

.


should the comments not be
Code: [Select]


<div id="comment">
<h1>{$LAN_70}</h1>
{if isset($smarty.cookies.id)}
{$message}
<form method="post" action="videos.php?id={$video[video].id}">
<input type="hidden" name="id" value="{$video[video].id}">
 <b>{$LAN_71}</b><br /><input type="text" name="nom" value="{$user}"><br />
<b>{$LAN_72}</b><br /><textarea name="comment" row="10" cols="60"></textarea><br />
<input type="submit" name="go" value="{$LAN_73}">
</form>
<br />
{else}
{$LAN_94}
{/if}
<table width="100%">
{section name=videos_co loop=$videos_co}
     <tr>
     <td width="60" align="left">
<img src="avatar/{$avatar}" width="50" height="50" align="left">
</td>
<td width="400" valign="top">{$LAN_16} <b>{$videos[videos_co].nom}</b><br />
  {$videos_co[videos_co].comment}</td><tr>
<br />
{/section}
</table>
</div>


should be videos and not games? also what are your lan names

thanks great work
winracer
myfunnypets.com
helpmewithperl.com
coosavalleyclassifieds.com
brownlows.net
myphpforum.com

Offline hilflo

  • Full phpd Member
  • ***
  • Posts: 98
  • Karma: 2
  • Sorry for my bad english
    • View Profile
    • Les félés
Re: Member area
« Reply #28 on: December 07, 2009, 01:01:36 AM »
Sorry for games.php.

I thought having changed all games.php link to videos.php

What is a lan names

Offline winracer

  • Development Team
  • Pro Member
  • *******
  • Posts: 446
  • Karma: 3
    • View Profile
    • helpmewithperl.com
  • Script Version: 1.0+
Re: Member area
« Reply #29 on: December 07, 2009, 01:22:45 AM »
Sorry for games.php.

I thought having changed all games.php link to videos.php

What is a lan names
sorry like {$LAN_16}


also for some reason my comments are not displayed after I post them. but it does show I have already posted


$smarty->assign('LAN_1', 'Error');
$smarty->assign('LAN_2', 'Featured');
$smarty->assign('LAN_3', 'All');
$smarty->assign('LAN_4', 'Images');
$smarty->assign('LAN_5', 'Submit');
$smarty->assign('LAN_6', 'admin');
$smarty->assign('LAN_7', 'Sort By');
$smarty->assign('LAN_8', 'Worst Rated Videos');
$smarty->assign('LAN_9', 'Best Rated Videos');
$smarty->assign('LAN_10', 'Least Viewed Videos');
$smarty->assign('LAN_11', 'Most Viewed Videos');
$smarty->assign('LAN_12', 'Least Recent Videos');
$smarty->assign('LAN_13', 'Most Recent Videos');
$smarty->assign('LAN_14', 'View');
$smarty->assign('LAN_15', 'Popup');
$smarty->assign('LAN_16', 'By');
$smarty->assign('LAN_17', 'Views');
$smarty->assign('LAN_18', 'Prev');
$smarty->assign('LAN_19', 'Next');
$smarty->assign('LAN_20', 'Good Video but no thanks, this is the example.');
$smarty->assign('LAN_21', 'No Link submited, would you like to submit a video?');
$smarty->assign('LAN_22', 'This video already exists.');
$smarty->assign('LAN_23', 'Please enter a valid link.');
$smarty->assign('LAN_24', 'Thanks for submitting ');
$smarty->assign('LAN_25', 'It will be reviewed shortly.');
$smarty->assign('LAN_26', 'Sorry this video has been rejected.');
$smarty->assign('LAN_27', 'This Video doesnt exist');
$smarty->assign('LAN_28', 'Please do not browse videos this way.');
$smarty->assign('LAN_29', 'Nothing to Display');
$smarty->assign('LAN_30', 'New way to browse Videos');
$smarty->assign('LAN_31', 'Rating');
$smarty->assign('LAN_32', 'Views');
$smarty->assign('LAN_33', 'Name');
$smarty->assign('LAN_34', 'Date');
$smarty->assign('LAN_35', 'Description');
$smarty->assign('LAN_36', 'Author');
$smarty->assign('LAN_37', 'Example');
$smarty->assign('LAN_38', 'Submit Another Video?');
$smarty->assign('LAN_39', 'Random');
$smarty->assign('LAN_40', 'Categories');
$smarty->assign('LAN_41', 'Home');
$smarty->assign('LAN_42', 'Logout');
$smarty->assign('LAN_43', 'List All');
$smarty->assign('LAN_44', 'Approve Video');
$smarty->assign('LAN_45', 'Feature Video');
$smarty->assign('LAN_46', 'Reject Video');
$smarty->assign('LAN_47', 'Easy Approve');
$smarty->assign('LAN_48', 'Options');
$smarty->assign('LAN_49', 'Video Name');
$smarty->assign('LAN_50', 'Description');
$smarty->assign('LAN_51', 'Action');
$smarty->assign('LAN_52', 'Approve');
$smarty->assign('LAN_53', 'Feature');
$smarty->assign('LAN_54', 'Reject');
$smarty->assign('LAN_55', 'or');
$smarty->assign('LAN_56', 'Delete');
$smarty->assign('LAN_57', 'Videos Per Page');
$smarty->assign('LAN_58', 'Language');
$smarty->assign('LAN_59', 'Everything is required, Nothing can be blank');
$smarty->assign('LAN_60', 'No Videos To Approve');
$smarty->assign('LAN_61', 'Welcome To Admin');
$smarty->assign('LAN_62', 'Username');
$smarty->assign('LAN_63', 'Password');
$smarty->assign('LAN_64', 'Add');
$smarty->assign('LAN_65', 'Edit');
$smarty->assign('LAN_66', 'You May need to click twice to update');
$smarty->assign('LAN_67', 'News');
$smarty->assign('LAN_68', 'Video');
$smarty->assign('LAN_69', 'Template');
$smarty->assign('LAN_70', 'Upload');
$smarty->assign('LAN_89', 'Login');
$smarty->assign('LAN_90', 'Pass');
$smarty->assign('LAN_91', 'Log in');
$smarty->assign('LAN_92', 'Log out');
$smarty->assign('LAN_93', 'Register for free');
$smarty->assign('LAN_94', 'You need to be register for comment this game.
<a href="register.php">Register for free[/url]');
$smarty->assign('LAN_95', 'Add to my favorite');
$smarty->assign('LAN_96', 'My favorite');
$smarty->assign('LAN_97', 'My avatar');
$smarty->assign('LAN_98', 'Use this form to update your avatar');
$smarty->assign('LAN_99', 'Upload your avatar');
$smarty->assign('LAN_100', 'My favorites games');
$smarty->assign('LAN_101', 'Your file will be less than 100 kb and have a size of 50X50');
$smarty->assign('LAN_102', 'Complete the form to become a member');
$smarty->assign('LAN_103', 'Confirm pass');
$smarty->assign('LAN_104', 'Email');
$smarty->assign('LAN_105', 'Register');
« Last Edit: December 07, 2009, 01:27:26 AM by winracer »
winracer
myfunnypets.com
helpmewithperl.com
coosavalleyclassifieds.com
brownlows.net
myphpforum.com