Jump to content


PHP Registration modifycation


15 replies to this topic

#1 ciraco

    Young Padawan

  • Members
  • Pip
  • 9 posts

Posted 07 September 2007 - 05:36 PM

Hello, I am looking for a way to setup my site so when a user registers on the site, it will submit the same username/password/email and other needed information to my PHPBB2 or PHPBB3 (3 preferred) database also, thus creating the same username with the same password and contact email on the forums (or the other way around, when they register on the forum, it sends to my usersystem database *whatever would be easier to do*)

I have not been able to find any topics on this and would like to know how I could do it.

Thanks!

#2 Demonslay

    P2L Jedi

  • Members
  • PipPipPip
  • 970 posts
  • Gender:Male
  • Location:A strange world where water falls out of the sky... for no reason.
  • Interests:Graphic Design, Coding, Splinter Cell, Cats

Posted 07 September 2007 - 05:55 PM

Well, for starters, if you are using PHPBB3, you can check out the documentation and use the login_box() function.

http://www.phpbb.com/mods/documentation/ph...index.php#login

From that, if you really needed to make your own form, you can study the source code of the function (located within includes/functions.php of your PHPBB3 path), and see how it logs you in when data is validated.
Check out lines 2088 to 2110 for the cleaning and validation of variables and the call to auth::login(), and then lines 2131 through 2218 for how the result of the auth::login() function is handled.

If you need any specific help, I'll be more than willing to help you some more.

#3 ciraco

    Young Padawan

  • Members
  • Pip
  • 9 posts

Posted 07 September 2007 - 06:14 PM

I am not so much looking to put the PHPBB login into my site, but rather when someone registers on the forum it will send the username/password/email and all that to another database for a separate custom user-system, thus making it so when a user registers on the forum they have the same account name on both the site and forum.

Edited by ciraco, 07 September 2007 - 06:16 PM.


#4 Demonslay

    P2L Jedi

  • Members
  • PipPipPip
  • 970 posts
  • Gender:Male
  • Location:A strange world where water falls out of the sky... for no reason.
  • Interests:Graphic Design, Coding, Splinter Cell, Cats

Posted 08 September 2007 - 12:05 PM

I would suggest you leave all user information and such as it is with PHPBB. You can simply make a new table in your database, and connect the tables by the user's ID, and use JOIN statements to collect your data. Same concept as using IPB's user system: why make your own member system, when your forum software has a superb system build-in at your disposal? You can just as easily append onto that system by creating your own tables for what information you need, and tying it all together.

You can once again track how PHPBB registers users by following the source code. In the ucp.php file, you'll notice it calls the method p_master::load(), passing it the name of the ucp class and 'register' name. Then, looking in includes/functions_module.php, you'll find that method, which then calls its own load_active() method. Looking at that method, you'll see this method essentially loads the file includes/ucp/ucp_register.php, and makes an instance of the ucp_register class. It then executes it by invoking the ucp_register::main() method, which is where we can see how it validates and enters information into the confirm table. It also adds user information via the user_add() function, which is found in includes/functions_user.php, starting on line 137. Now we have something!
The function should be self-explanatory in how it operates, validating the data passed to it, cleaning it, and then building it into a query to enter in to the users table. Ah, but there's one more trick! Users need to be activated!
Since this is probably a feature you'd want anyways, I would leave it there. But if you really wanted to take that out, you'd blend the queries for updating an activated account in the ucp_activate::main() method in includes/ucp/ucp_activate.php, with the queries used in user_add().

That's how you track code, and is something that you may need to master if you plan on using an open-source package and integrating with it.

Edited by Demonslay, 08 September 2007 - 12:08 PM.


#5 ciraco

    Young Padawan

  • Members
  • Pip
  • 9 posts

Posted 08 September 2007 - 01:32 PM

I dont want to use the PHPBB usersystem for my main site tho, it is far to hard to make mods for the PHPBB usersystem for me, and the code is over complexed and hard to follow.

It would be much easier for me to just find a way to submit the username/pass/email from when a user registers on the PHPBB forum to both the PHPBB database and also to another database, or have them both in the same database but on different tables (phpbb with prefix, main site without).

#6 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 08 September 2007 - 03:12 PM

What demonslay said, was to just leave the username, password, and e-mail in the phpBB database, and use a JOIN statement to get the data via an ID field. It's really a simple concept and would save a lot of time.

Not only would it allow you to keep what ever data you want seperated from phpBB, it would make maintence easier in that you won't have to worry about keeping 3 fields updated everytime the user decides he wants to change something.

#7 ciraco

    Young Padawan

  • Members
  • Pip
  • 9 posts

Posted 08 September 2007 - 03:43 PM

How exactly would this be done, I have never seen nor heard of a JOIN function.

Also I was thinking of maybe making a file that would be included on the activation page that would act kinda like a cronjob.

EX:
<?
include("config.php");
$q = mysql_query("SELECT * FROM phpbb_users ORDER BY user_id DESC"); // querys the database
if (mysql_num_rows($q) == "0") { // if there is nothing than we echo an error

	echo ("There are no users in the database!"); // opps nothing
}

while($r=mysql_fetch_array($q)){ // fetches array

	$bb_id = $r['user_id'];
	$bb_username = $r['username'];
	$bb_password = $r['user_password'];
	$bb_email = $r['user_email'];
	mysql_query("INSERT INTO `users` VALUES (, '$r[username]', '$r[user_password]', '$r[user_email]', 'Not Specified', 'Not Specified', 'Not Specified', 'Not Specified', '', 'user', 'Not Specified', 'Not Specified', 'Not Specified', 'Not Specified', 'Not Specified', 'Not Specified', 'Not Specified', 'Not Specified', 'Not Specified', 'Not Specified', 'http://', 'Not Specified', 'Not Specified', 'Not Specified', 'Not Specified', 'Not Specified', 'Not Specified', 'Not Specified', 'Not Specified', 'Not Specified', 'Not Specified', 'Not Specified', 'Not Specified', 'Not Specified', '', 'Not Specified', '1189120277', 1, '0'");
	}
?>

would this work, if not, could someone help me modify this code so it would work? (unless i can figure out the join function hes talking about)

Edited by ciraco, 08 September 2007 - 03:57 PM.


#8 Demonslay

    P2L Jedi

  • Members
  • PipPipPip
  • 970 posts
  • Gender:Male
  • Location:A strange world where water falls out of the sky... for no reason.
  • Interests:Graphic Design, Coding, Splinter Cell, Cats

Posted 08 September 2007 - 03:52 PM

The JOIN condition is used in SQL, which is what we are assuming you are using a member system.

http://dev.mysql.com/doc/refman/5.0/en/lef...timization.html

An example of how you'd use it could go like this.
SELECT u.user_id, u.username, u.user_email, g.user_score FROM phpbb_users u LEFT JOIN game_scores g ON(g.user_id = u.user_id)


#9 ciraco

    Young Padawan

  • Members
  • Pip
  • 9 posts

Posted 08 September 2007 - 04:17 PM

so basicly it would be like this for what im looking for:

SELECT u.user_id, u.username, u.user_email, u.user_password FROM phpbb_users u LEFT JOIN users g ON(g.id = u.user_id, g.username = u.username, g.email = u.user_email, g.password = u.user_password)

correct? Also how would I query this to make sure it updates when a new user registers on the forum?

Edited by ciraco, 08 September 2007 - 04:42 PM.


#10 Demonslay

    P2L Jedi

  • Members
  • PipPipPip
  • 970 posts
  • Gender:Male
  • Location:A strange world where water falls out of the sky... for no reason.
  • Interests:Graphic Design, Coding, Splinter Cell, Cats

Posted 08 September 2007 - 05:47 PM

Not exactly.
For one thing, if you have the ID matching the ID, you'll get the right results; there is no need to match the username, email, and password to get the data.

Try this.
SELECT u.user_id, u.username, u.user_email, u.user_password FROM phpbb_users u LEFT JOIN users g ON(g.id = u.user_id)

And because of this, there is no reason to have a username, password, or email column in your users table. That is the whole point of using the JOIN statement to grab that data from the phpbb_users table. With that being said, there is no 'updating' to do; its all tied in as one system. The PHPBB users table will contain all the major stuff that the forum needs, and that you need (username, password, and email in this case), while your individual users table has whatever it is you have. The two are connected by the user's ID column that both have the same of. Using the JOIN statements, we grab data from both tables.

I take it you are new to 'database theory' as you might call it (I can't remember the actual term to it).
Here's an illustration of an example of the two tables in question.

== Table 'phpbb_users' ==
-----------------------------------------------------------
|user_id | username | user_password | user_email|
-----------------------------------------------------------
|	1	 | Demonslay| arandompass   |u@me.com |
-----------------------------------------------------------

== Table 'users' ==
-----------------------------
| id | score | cool_factor |
-----------------------------
| 1 | 20000 |	 1337	 |
-----------------------------

(I'm no good at ASCII art on forums, lol.)

Notice how they both have the same id for the user. Using the following JOIN statement, we would get all the data for the user with ID 1.

SELECT u.user_id, u.username, u.user_email, m.score, m.cool_factor FROM phpbb_users u LEFT JOIN users m ON(m.id = u.user_id) WHERE u.user_id = 1


#11 ciraco

    Young Padawan

  • Members
  • Pip
  • 9 posts

Posted 08 September 2007 - 06:36 PM

I am using naresh's usersystem (if your familiar with that), being that the user_password is encrypted would i need to use the phpbb login form to log my users in on the main site also?

And if I wanted to display information out of the 'users' table (this is my members.php file for the usersystem) it would look like this?

<?
ob_start();
include("config.php");
include("bbcode.php");
include("flagcode.php");
if (!$_GET[user])
{
$getuser = mysql_query("SELECT u.user_id, u.username, u.user_email, u.user_password FROM phpbb_users u LEFT JOIN users g ON(g.id = u.user_id)");
while ($user = mysql_fetch_array($getuser))
{
// gets all the users information.
echo ("<a href=\"index.php?pid=members&user=$user[username]\">$user[username]</a><br />\n");
// links to a page to view the user's profile.
}
}
ELSE
{
$getuser = mysql_query("SELECT u.username FROM phpbb_users u LEFT JOIN users m ON(m.username = u.username) WHERE u.username = '$_GET[user]'");
$usernum = mysql_num_rows($getuser);
if ($usernum == 0)
{
echo ("User Not Found");
}
while($r=mysql_fetch_array($getuser)){ // fetches array

	$username = $r['username'];
	$email = $r['email'];
	$firstname = $r['firstname'];
	$lastname = $r['lastname'];
	$age = $r['age'];
	$sex = $r['sex'];
	$country = flagcode($r['country']);
	$status = $r['status'];
	$irc = $r['irc'];
	$ircnetwork = $r['ircnetwork'];
	$xfire = $r['xfire'];
	$msn = $r['msn'];
	$aim = $r['aim'];
	$website = $r['website'];
	$team = $r['team'];
	$favgame = $r['favgame'];
	$favweapon = $r['favweapon'];
	$favmap = $r['favmap'];
	$config = $r['config'];
	$manufacturer = $r['manufacturer'];
	$os = $r['os'];
	$cpu = $r['cpu'];
	$memory = $r['memory'];
	$harddrive = $r['harddrive'];
	$videocard = $r['videocard'];
	$soundcard = $r['soundcard'];
	$headphones = $r['headphones'];
	$monitor = $r['monitor'];
	$mouse = $r['mouse'];
	$mousepad = $r['mousepad'];
	$keyboard = $r['keyboard'];
	$avatar = $r['avatar'];
	$online = $r['online'];
	$profilehits = $r['profilehits'];
	$bio = bbcode($r['bio']);

echo ("<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='619'>
  <tr>
	<td width='100%'>
	<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='619'>
	  <tr>
		<td width='619' background='images/content-top.jpg' width='619' height='48'>
		<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='100%'>
		  <tr>
			<td width='2%'>&nbsp;</td>
			<td width='97%'><font color='#FFFFFF' size='1' face='Tahoma'><b>
			&nbsp;Welcome to <u>$username's</u> Profile
			</b>- </font>
			<font size='1' face='Tahoma' color='#808080'>Profile Hits: <u>$profilehits</u></font></td>
			<td width='1%'>&nbsp;</td>
		  </tr>
		</table>
		</td>
	  </tr>
	  <tr>
		<td valign='top' width='619' background='images/content.jpg' width='619' height='266'>
		<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='100%'>
		  <tr>
			<td width='1%'>&nbsp;</td>
			<td width='98%'>
			<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='100%'>
			  <tr>
				<td valign='top' width='72%'>
				<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='100%'>
				  <tr>");
				  
$offline = 5; //5 minutes
$current = time(); //gets the current time
$offline = ($current-$offline); //the cutoff time for being considered online
$getusers = mysql_query("SELECT * from users where username = '$_GET[user] AND online >= '$offline'");
//gets the users that are online
if ($online >= $offline)
{
echo ("<td width='100%' bgcolor='#F6F6F6'>&nbsp;<b><font size='2' face='Tahoma'>User Information:</font><font size='2' face='Tahoma' color='green'> ONLINE</font></b></td>");
}else{
echo ("<td width='100%' bgcolor='#F6F6F6'>&nbsp;<b><font size='2' face='Tahoma'>User Information:</font><font size='2' face='Tahoma' color='red'> OFFLINE</font></b></td>");
}
		   echo ("</tr>
				  <tr>
					<td valign='top' width='100%'>
					<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='100%'>
					  <tr>
						<td width='13%' align='left'>&nbsp; <b>
						<font size='1' face='Tahoma'>Name:</font></b></td>
						<td width='87%'><font size='1' face='Tahoma'>$firstname 
						&quot;<font color='#3366FF'>$username</font>&quot; $lastname</font></td>
					  </tr>
					  <tr>
						<td width='13%' align='left'>&nbsp; <b>
						<font size='1' face='Tahoma'>Age:</font></b></td>
						<td width='87%'><font face='Tahoma' size='1'>$age</font></td>
					  </tr>
					  <tr>
						<td width='13%' align='left'>&nbsp; <b>
						<font size='1' face='Tahoma'>Sex:</font></b></td>
						<td width='87%'><font face='Tahoma' size='1'>$sex</font></td>
					  </tr>
					  <tr>
						<td width='13%' align='left'>&nbsp; <b>
						<font size='1' face='Tahoma'>Country:</font></b></td>
						<td width='87%'><font face='Tahoma' size='1'>$country</font></td>
					  </tr>
					  <tr>
						<td width='13%' align='left'>&nbsp; <b>
						<font size='1' face='Tahoma'>Status:</font></b></td>
						<td width='87%'><font face='Tahoma' size='1'>$status</font></td>
					  </tr>
					</table>
					</td>
				  </tr>
				  <tr>
					<td width='100%' bgcolor='#F6F6F6'>&nbsp;<b><font size='2' face='Tahoma'>Contact 
					Information:</font></b></td>
				  </tr>
				  <tr>
					<td valign='top' width='100%'>
					<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='100%'>
					  <tr>
						<td width='13%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>IRC:</font></b></td>
						<td width='87%'><font face='Tahoma' size='1'>
						$irc (<u><b>$ircnetwork</b></u>)</font></td>
					  </tr>
					  <tr>
						<td width='13%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>Xfire:</font></b></td>
						<td width='87%'><font face='Tahoma' size='1'>$xfire</font></td>
					  </tr>
					  <tr>
						<td width='13%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>MSN:</font></b></td>
						<td width='87%'><font size='1' face='Tahoma'>$msn</font></td>
					  </tr>
					  <tr>
						<td width='13%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>AIM:</font></b></td>
						<td width='87%'><font face='Tahoma' size='1'>$aim</font></td>
					  </tr>
					  <tr>
						<td width='13%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>Website:</font></b></td>
						<td width='87%'><font face='Tahoma' size='1'>$website</font></td>
					  </tr>
					  <tr>
						<td width='13%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>Email:</font></b></td>
						<td width='87%'><font face='Tahoma' size='1'>$email</font></td>
					  </tr>
					</table>
					</td>
				  </tr>
				  <tr>
					<td width='100%' bgcolor='#F6F6F6'>&nbsp;<b><font size='2' face='Tahoma'>Gaming Information:</font></b></td>
				  </tr>
				  <tr>
					<td valign='top' width='100%'>
					<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='100%' height='93'>
					  <tr>
						<td width='23%' align='left' height='19'>&nbsp; <b>
						<font face='Tahoma' size='1'>Current Team:</font></b></td>
						<td width='77%' height='19'>
						<font face='Tahoma' size='1'>$team</font></td>
					  </tr>
					  <tr>
						<td width='23%' align='left' height='19'>&nbsp; <b>
						<font face='Tahoma' size='1'>Favorite Game:</font></b></td>
						<td width='77%' height='19'>
						<font face='Tahoma' size='1'>$favgame</font></td>
					  </tr>
					  <tr>
						<td width='23%' align='left' height='19'>&nbsp; <b>
						<font face='Tahoma' size='1'>Favorite Weapon:</font></b></td>
						<td width='77%' height='19'>
						<font face='Tahoma' size='1'>$favweapon</font></td>
					  </tr>
					  <tr>
						<td width='23%' align='left' height='17'>&nbsp; <b>
						<font face='Tahoma' size='1'>Favorite Map:</font></b></td>
						<td width='77%' height='17'>
						<font face='Tahoma' size='1'>$favmap</font></td>
					  </tr>
					  <tr>
						<td width='23%' align='left' height='19'>&nbsp; <b>
						<font face='Tahoma' size='1'>Config:</font></b></td>
						<td width='77%' height='19'>
						<a href='$config'><font face='Tahoma' size='1' color='#006600'><b>DOWNLOAD</font></b></a></td>
					  </tr>
					</table>
					</td>
				  </tr>
				  <tr>
					<td width='100%' bgcolor='#F6F6F6'>&nbsp;<b><font size='2' face='Tahoma'>Computer 
					Specifications: </font></b> </td>
				  </tr>
				  <tr>
					<td valign='top' width='100%'>
					<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='100%'>
					  <tr>
						<td width='20%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>Manufacturer:</font></b></td>
						<td width='80%'><font face='Tahoma' size='1'>
						$manufacturer</font></td>
					  </tr>
					  <tr>
						<td width='20%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>OS:</font></b></td>
						<td width='80%'><font face='Tahoma' size='1'>$os</font></td>
					  </tr>
					  <tr>
						<td width='20%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>CPU:</font></b></td>
						<td width='80%'><font face='Tahoma' size='1'>$cpu</font></td>
					  </tr>
					  <tr>
						<td width='20%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>Memory:</font></b></td>
						<td width='80%'><font face='Tahoma' size='1'>$memory</font></td>
					  </tr>
					  <tr>
						<td width='20%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>Harddrive:</font></b></td>
						<td width='80%'><font face='Tahoma' size='1'>$harddrive</font></td>
					  </tr>
					  <tr>
						<td width='20%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>Video Card:</font></b></td>
						<td width='80%'><font face='Tahoma' size='1'>$videocard</font></td>
					  </tr>
					  <tr>
						<td width='20%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>Sound Card:</font></b></td>
						<td width='80%'><font face='Tahoma' size='1'>$soundcard</font></td>
					  </tr>
					  <tr>
						<td width='20%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>Headphones:</font></b></td>
						<td width='80%'><font face='Tahoma' size='1'>$headphones</font></td>
					  </tr>
					  <tr>
						<td width='20%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>Monitor:</font></b></td>
						<td width='80%'><font face='Tahoma' size='1'>$monitor</font></td>
					  </tr>
					  <tr>
						<td width='20%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>Mouse:</font></b></td>
						<td width='80%'><font face='Tahoma' size='1'>$mouse</font></td>
					  </tr>
					  <tr>
						<td width='20%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>Mouse Pad:</font></b></td>
						<td width='80%'><font face='Tahoma' size='1'>$mousepad</font></td>
					  </tr>
					  <tr>
						<td width='20%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>Keyboard:</font></b></td>
						<td width='80%'><font face='Tahoma' size='1'>$keyboard</font></td>
					  </tr>
					</table>
					</td>
				  </tr>
				  <tr>
					<td width='100%' bgcolor='#F6F6F6'>&nbsp;<b><font face='Tahoma' size='2'>Biography:</font></b></td>
				  </tr>
				  <tr>
					<td valign='top' width='100%'><font face='Tahoma' size='1'>$bio</font></td>
				  </tr>
				</table>
				</td>
				<td valign='top' width='28%'>
				<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='100%'>
				  <tr>
					<td width='100%'>
					<p align='center'><img src='$avatar'></td>
				  </tr>
				  <tr>
					<td width='100%' bgcolor='#F6F6F6'>
					<p align='center'><b><font face='Tahoma' size='2'>$username's 
					Buddies (<font color='#3366FF'>");
$getmates = mysql_query("SELECT * FROM friends WHERE confirmed = 'True' and from_user = '$username'") or die(mysql_error());
$getmymates = mysql_query("SELECT * FROM friends WHERE confirmed = 'True' and to_user = '$username'") or die(mysql_error());

$numates = mysql_num_rows($getmates);
$numymuates = mysql_num_rows($getmymates);

$number = $numates + $numymuates;
			echo ("$number</font>)</font></b></td>
				  </tr>
				  <tr>
					<td valign='top' width='100%'>
					<p align='center'><u><b>
					<a href='friends.php?action=ask&mate=$username'><font face='Tahoma' size='1' color='#AF3132'>Buddy $username</font></a></b></u></td>
				  </tr>
				  <tr>
					<td valign='top' width='100%'>
					<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='100%'>");
					
$getmates = mysql_query("SELECT * FROM friends WHERE confirmed = 'True' and from_user = '$username'") or die(mysql_error());
$getmymates = mysql_query("SELECT * FROM friends WHERE confirmed = 'True' and to_user = '$username'") or die(mysql_error());

$numates = mysql_num_rows($getmates);
$numymuates = mysql_num_rows($getmymates);

$number = $numates + $numymuates;
//Checks see if they have any friends
if($number == 0) {
//If they have no friends lets take the mick
echo "  <tr>
	<td width='100%'>No current friends.</td>
  </tr>";
}
//If you got mates we loop them
while($mates = mysql_fetch_array($getmates)) 
{
//Lets display these losers 
echo "  <tr>
	<td width='100%'><center><a href='index.php?pid=members&user=$mates[to_user]'><font face='Tahoma' size='1' color='#808080'>$mates[to_user]</font></a></center></td>
  </tr>";
}
//This displays there mates to other person
while($mymates = mysql_fetch_array($getmymates)) 
{
//Lets display these losers 
echo "  <tr>
	<td width='100%'><center><a href='index.php?pid=members&user=$mymates[from_user]'><font face='Tahoma' size='1' color='#808080'>$mymates[from_user]</font></a></center></td>
  </tr>";
}
//got to be a good boy and end the table
	echo ("</table>
					</td>
				  </tr>
				</table>
				</td>
			  </tr>
			</table>
			</td>
			<td width='1%'>&nbsp;</td>
		  </tr>
		  <tr>
			<td width='1%'>&nbsp;</td>
			<td width='98%'>
			&nbsp;</td>
			<td width='1%'>&nbsp;</td>
		  </tr>
		  <tr>
			<td width='1%'>&nbsp;</td>
			<td width='98%'>");
	include("comments.php");
	$pc = new ProfileComments;//Starts the class

	$pc->uid = $_GET['user'];//Sends the userid to the script

	if($_POST['ac1'])
	{
		$author = $pc->GetAuthor();
		$author = $pc->author;
		$pc->AddComment($_POST['comment'], $author);//Sends the comment to the AddComment function!
	}

	$pc->GetComments();//Gets the comments

$add = mysql_query("SELECT u.username FROM phpbb_users u LEFT JOIN users m ON(m.username = u.username) WHERE u.username = '".$_GET[user]."'") or die(mysql_error());
$add = mysql_fetch_array($add) or die(mysql_error());

$hits = $add['profilehits'] + 1;
$update = mysql_query("UPDATE users SET profilehits = '".$hits."' WHERE username = '".$_GET[user]."'");
// in the above code, we display the user's information.
}
}
?>
<!--HTML FORM-->

<form method="POST" action="<?=$PHP_SELF?>">
	<textarea name="comment">Comment now!</textarea><br />
	<input type="submit" value="Add Comment" name="ac1" />
</form>
			</td>
			<td width='1%'>&nbsp;</td>
		  </tr>
		  </table>
		</td>
	  </tr>
	</table>
	</td>
  </tr>
</table>

correct? (just checking to see if I am understanding what needs to be done correctly. Sorry if im getting annoying :P

Edited by ciraco, 08 September 2007 - 06:59 PM.


#12 Demonslay

    P2L Jedi

  • Members
  • PipPipPip
  • 970 posts
  • Gender:Male
  • Location:A strange world where water falls out of the sky... for no reason.
  • Interests:Graphic Design, Coding, Splinter Cell, Cats

Posted 08 September 2007 - 07:02 PM

I think you're missing the point...
Why are you using a different user system? You shouldn't even need to... why have them logged into two different systems for the same site? Just doesn't make sense...

Anyways, that's not of my concern...

And erm, no I'm not familiar with 'that' user system, I build my own, or branch off of a forum software (like PHPBB).
Essentially, if you aren't going to use the forum's user system, then yes, you will have to log the user into both systems at once, which is really more of a hassle than its worth. Just so much easier to plug into the existing one than fussing with two of the same thing...

#13 ciraco

    Young Padawan

  • Members
  • Pip
  • 9 posts

Posted 08 September 2007 - 07:07 PM

View PostDemonslay, on Sep 8 2007, 06:02 PM, said:

I think you're missing the point...
Why are you using a different user system? You shouldn't even need to... why have them logged into two different systems for the same site? Just doesn't make sense...

Anyways, that's not of my concern...

And erm, no I'm not familiar with 'that' user system, I build my own, or branch off of a forum software (like PHPBB).
Essentially, if you aren't going to use the forum's user system, then yes, you will have to log the user into both systems at once, which is really more of a hassle than its worth. Just so much easier to plug into the existing one than fussing with two of the same thing...

Because I can't built what is needed for the user profiles in PHPBB, I need alot of fields and features on the user profile (as seen below).

I need to have a user profile with a lot of features and fields like the ones listed below.

Fields:

-User Information
first
last
age
sex
country
status

- Contact Info
irc
ircnetwork
xfire
msn
aim
website
email

- Favorites
game
clan
map
weapon
food
drink
movie
music
song
actor
car
sport

- Gaming Rig
cpu
mainboard
ram
monitor
graphics
soundcard
harddrive
internet
headset
keyboard
mouse
mousepad

- Clan Information
team
webpage
irc
ircnetwork
leagues

- Anti-Cheat Info
cs
css
cod
cod2
cod4
wic
moha
bf2

Features:
- Buddy List
- User Rating System
- User Stats
- Profile Comments
- Profile Hits Counter

I don't have the time needed to learn how to totally recode the PHPBB profile setup, then build all these addons for it. Thats why I just want to have the username/pass/email submitted into another table as well as submitting to the phpbb_users table so that users can login to the main site section without having to be logged into both at the same time...

#14 Demonslay

    P2L Jedi

  • Members
  • PipPipPip
  • 970 posts
  • Gender:Male
  • Location:A strange world where water falls out of the sky... for no reason.
  • Interests:Graphic Design, Coding, Splinter Cell, Cats

Posted 08 September 2007 - 08:05 PM

Still, you are contradicting yourself here.

You can still do this quite easily, as I have been telling you. Store all of that other data into their own tables, however you need, and simply link them to the user via the user_id. All logging in and such can be done through the phpbb_users table.

If you really still don't understand this, simply give use the database structure of all the tables of this system, and I can show you how they should look, and how your queries would look.
It really is a simple concept.

#15 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 08 September 2007 - 10:16 PM

View Postciraco, on Sep 8 2007, 06:07 PM, said:

I don't have the time needed to learn how to totally recode the PHPBB profile setup, then build all these addons for it. Thats why I just want to have the username/pass/email submitted into another table as well as submitting to the phpbb_users table so that users can login to the main site section without having to be logged into both at the same time...
I have 2 things to say:

1. The only thing you need to worry about in your custom tables is the user id. It will be used as a reference to the phpbb_users table, where you can select the 3 things you need from it. Take a minute to browse the phpBB database. You will notice everything has an id. A great example of the concept we're trying to illustrate are the "phpbb_topics," "phpbb_posts," and "phpbb_posts_text" tables (as named in phpBB2).
My site has a tutorial that shows how these tables are linked together in order to display recent posts from your forum on your site. You just match the id's in the tables and select the info from there. It's not that great of a tutorial, but the instructive portion to look at would be the query.

2. Also on my site is a tutorial for a phpBB login. It illustrates just how easy it is to botch a login system for phpBB. You can search the forums for "phpBB login" for more examples of this. It is possible, but the main point i am trying to make is that, if you are planning on working with any kind of membership system, specifically one that refers to phpBB, then time is something you're going to need.

#16 ciraco

    Young Padawan

  • Members
  • Pip
  • 9 posts

Posted 09 September 2007 - 08:47 AM

CREATE TABLE `users` (
`id` int(11) NOT NULL auto_increment,
`username` varchar(30) NOT NULL default '',
`password` varchar(255) NOT NULL default '',
`email` varchar(40) NOT NULL default '',
`firstname` varchar(250) NOT NULL default 'Not Specified',
`lastname` varchar(250) NOT NULL default 'Not Specified',
`age` varchar(250) NOT NULL default 'Not Specified',
`sex` varchar(250) NOT NULL default 'Not Specified',
`country` varchar(250) NOT NULL default '',
`status` varchar(250) NOT NULL default 'user',
`irc` varchar(250) NOT NULL default 'Not Specified',
`ircnetwork` varchar(250) NOT NULL default 'Not Specified',
`xfire` varchar(250) NOT NULL default 'Not Specified',
`msn` varchar(250) NOT NULL default 'Not Specified',
`aim` varchar(250) NOT NULL default 'Not Specified',
`website` varchar(250) NOT NULL default 'Not Specified',
`team` varchar(250) NOT NULL default 'Not Specified',
`teamsite` varchar(250) NOT NULL default 'http://',
`teamirc` varchar(250) NOT NULL default '#channel',
`teamircnet` varchar(250) NOT NULL default 'http://',
`league` varchar(250) NOT NULL default 'Not Specified',
`favgame` varchar(250) NOT NULL default 'Not Specified',
`favclan` varchar(250) NOT NULL default 'Not Specified',
`favmap` varchar(250) NOT NULL default 'Not Specified',
`favweapon` varchar(250) NOT NULL default 'Not Specified',
`favfood` varchar(250) NOT NULL default 'Not Specified',
`favdrink` varchar(250) NOT NULL default 'Not Specified',
`favmovie` varchar(250) NOT NULL default 'Not Specified',
`favsong` varchar(250) NOT NULL default 'Not Specified',
`favbook` varchar(250) NOT NULL default 'Not Specified',
`favactor` varchar(250) NOT NULL default 'Not Specified',
`favcar` varchar(250) NOT NULL default 'Not Specified',
`favsport` varchar(250) NOT NULL default 'Not Specified',
`cpu` varchar(250) NOT NULL default 'Not Specified',
`mainboard` varchar(250) NOT NULL default 'Not Specified',
`ram` varchar(250) NOT NULL default 'Not Specified',
`monitor` varchar(250) NOT NULL default 'Not Specified',
`graphics` varchar(250) NOT NULL default 'Not Specified',
`soundcard` varchar(250) NOT NULL default 'Not Specified',
`harddrive` varchar(250) NOT NULL default 'Not Specified',
`internet` varchar(250) NOT NULL default 'Not Specified',
`headset` varchar(250) NOT NULL default 'Not Specified',
`keyboard` varchar(250) NOT NULL default 'Not Specified',
`mouse` varchar(250) NOT NULL default 'Not Specified',
`mousepad` varchar(250) NOT NULL default 'Not Specified',
`avatar` varchar(250) NOT NULL default 'Not Specified',
`game` varchar(250) NOT NULL default '',
`bio` text NOT NULL,
PRIMARY KEY (`id`)
) TYPE=MyISAM;

is the user table for my usersystem.

<?
ob_start();
include("config.php");
include("bbcode.php");
include("flagcode.php");
if (!$_GET[user])
{
$getuser = mysql_query("SELECT * from users order by id asc");
while ($user = mysql_fetch_array($getuser))
{
// gets all the users information.
echo ("<a href=\"index.php?pid=members&user=$user[username]\">$user[username]</a><br />\n");
// links to a page to view the user's profile.
}
}
ELSE
{
$getuser = mysql_query("SELECT * from users where username = '$_GET[user]'");
$usernum = mysql_num_rows($getuser);
if ($usernum == 0)
{
echo ("User Not Found");
}
while($r=mysql_fetch_array($getuser)){ // fetches array

	$username = $r['username'];
	$email = $r['email'];
	$firstname = $r['firstname'];
	$lastname = $r['lastname'];
	$age = $r['age'];
	$sex = $r['sex'];
	$country = flagcode($r['country']);
	$status = $r['status'];
	$irc = $r['irc'];
	$ircnetwork = $r['ircnetwork'];
	$xfire = $r['xfire'];
	$msn = $r['msn'];
	$aim = $r['aim'];
	$website = $r['website'];
	$team = $r['team'];
	$favgame = $r['favgame'];
	$favweapon = $r['favweapon'];
	$favmap = $r['favmap'];
	$config = $r['config'];
	$manufacturer = $r['manufacturer'];
	$os = $r['os'];
	$cpu = $r['cpu'];
	$memory = $r['memory'];
	$harddrive = $r['harddrive'];
	$videocard = $r['videocard'];
	$soundcard = $r['soundcard'];
	$headphones = $r['headphones'];
	$monitor = $r['monitor'];
	$mouse = $r['mouse'];
	$mousepad = $r['mousepad'];
	$keyboard = $r['keyboard'];
	$avatar = $r['avatar'];
	$online = $r['online'];
	$profilehits = $r['profilehits'];
	$bio = bbcode($r['bio']);

echo ("<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='619'>
  <tr>
	<td width='100%'>
	<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='619'>
	  <tr>
		<td width='619' background='images/content-top.jpg' width='619' height='48'>
		<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='100%'>
		  <tr>
			<td width='2%'>&nbsp;</td>
			<td width='97%'><font color='#FFFFFF' size='1' face='Tahoma'><b>
			&nbsp;Welcome to <u>$username's</u> Profile
			</b>- </font>
			<font size='1' face='Tahoma' color='#808080'>Profile Hits: <u>$profilehits</u></font></td>
			<td width='1%'>&nbsp;</td>
		  </tr>
		</table>
		</td>
	  </tr>
	  <tr>
		<td valign='top' width='619' background='images/content.jpg' width='619' height='266'>
		<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='100%'>
		  <tr>
			<td width='1%'>&nbsp;</td>
			<td width='98%'>
			<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='100%'>
			  <tr>
				<td valign='top' width='72%'>
				<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='100%'>
				  <tr>");
				  
$offline = 5; //5 minutes
$current = time(); //gets the current time
$offline = ($current-$offline); //the cutoff time for being considered online
$getusers = mysql_query("SELECT * from users where username = '$_GET[user] AND online >= '$offline'");
//gets the users that are online
if ($online >= $offline)
{
echo ("<td width='100%' bgcolor='#F6F6F6'>&nbsp;<b><font size='2' face='Tahoma'>User Information:</font><font size='2' face='Tahoma' color='green'> ONLINE</font></b></td>");
}else{
echo ("<td width='100%' bgcolor='#F6F6F6'>&nbsp;<b><font size='2' face='Tahoma'>User Information:</font><font size='2' face='Tahoma' color='red'> OFFLINE</font></b></td>");
}
		   echo ("</tr>
				  <tr>
					<td valign='top' width='100%'>
					<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='100%'>
					  <tr>
						<td width='13%' align='left'>&nbsp; <b>
						<font size='1' face='Tahoma'>Name:</font></b></td>
						<td width='87%'><font size='1' face='Tahoma'>$firstname 
						&quot;<font color='#3366FF'>$username</font>&quot; $lastname</font></td>
					  </tr>
					  <tr>
						<td width='13%' align='left'>&nbsp; <b>
						<font size='1' face='Tahoma'>Age:</font></b></td>
						<td width='87%'><font face='Tahoma' size='1'>$age</font></td>
					  </tr>
					  <tr>
						<td width='13%' align='left'>&nbsp; <b>
						<font size='1' face='Tahoma'>Sex:</font></b></td>
						<td width='87%'><font face='Tahoma' size='1'>$sex</font></td>
					  </tr>
					  <tr>
						<td width='13%' align='left'>&nbsp; <b>
						<font size='1' face='Tahoma'>Country:</font></b></td>
						<td width='87%'><font face='Tahoma' size='1'>$country</font></td>
					  </tr>
					  <tr>
						<td width='13%' align='left'>&nbsp; <b>
						<font size='1' face='Tahoma'>Status:</font></b></td>
						<td width='87%'><font face='Tahoma' size='1'>$status</font></td>
					  </tr>
					</table>
					</td>
				  </tr>
				  <tr>
					<td width='100%' bgcolor='#F6F6F6'>&nbsp;<b><font size='2' face='Tahoma'>Contact 
					Information:</font></b></td>
				  </tr>
				  <tr>
					<td valign='top' width='100%'>
					<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='100%'>
					  <tr>
						<td width='13%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>IRC:</font></b></td>
						<td width='87%'><font face='Tahoma' size='1'>
						$irc (<u><b>$ircnetwork</b></u>)</font></td>
					  </tr>
					  <tr>
						<td width='13%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>Xfire:</font></b></td>
						<td width='87%'><font face='Tahoma' size='1'>$xfire</font></td>
					  </tr>
					  <tr>
						<td width='13%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>MSN:</font></b></td>
						<td width='87%'><font size='1' face='Tahoma'>$msn</font></td>
					  </tr>
					  <tr>
						<td width='13%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>AIM:</font></b></td>
						<td width='87%'><font face='Tahoma' size='1'>$aim</font></td>
					  </tr>
					  <tr>
						<td width='13%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>Website:</font></b></td>
						<td width='87%'><font face='Tahoma' size='1'>$website</font></td>
					  </tr>
					  <tr>
						<td width='13%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>Email:</font></b></td>
						<td width='87%'><font face='Tahoma' size='1'>$email</font></td>
					  </tr>
					</table>
					</td>
				  </tr>
				  <tr>
					<td width='100%' bgcolor='#F6F6F6'>&nbsp;<b><font size='2' face='Tahoma'>Gaming Information:</font></b></td>
				  </tr>
				  <tr>
					<td valign='top' width='100%'>
					<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='100%' height='93'>
					  <tr>
						<td width='23%' align='left' height='19'>&nbsp; <b>
						<font face='Tahoma' size='1'>Current Team:</font></b></td>
						<td width='77%' height='19'>
						<font face='Tahoma' size='1'>$team</font></td>
					  </tr>
					  <tr>
						<td width='23%' align='left' height='19'>&nbsp; <b>
						<font face='Tahoma' size='1'>Favorite Game:</font></b></td>
						<td width='77%' height='19'>
						<font face='Tahoma' size='1'>$favgame</font></td>
					  </tr>
					  <tr>
						<td width='23%' align='left' height='19'>&nbsp; <b>
						<font face='Tahoma' size='1'>Favorite Weapon:</font></b></td>
						<td width='77%' height='19'>
						<font face='Tahoma' size='1'>$favweapon</font></td>
					  </tr>
					  <tr>
						<td width='23%' align='left' height='17'>&nbsp; <b>
						<font face='Tahoma' size='1'>Favorite Map:</font></b></td>
						<td width='77%' height='17'>
						<font face='Tahoma' size='1'>$favmap</font></td>
					  </tr>
					  <tr>
						<td width='23%' align='left' height='19'>&nbsp; <b>
						<font face='Tahoma' size='1'>Config:</font></b></td>
						<td width='77%' height='19'>
						<a href='$config'><font face='Tahoma' size='1' color='#006600'><b>DOWNLOAD</font></b></a></td>
					  </tr>
					</table>
					</td>
				  </tr>
				  <tr>
					<td width='100%' bgcolor='#F6F6F6'>&nbsp;<b><font size='2' face='Tahoma'>Computer 
					Specifications: </font></b> </td>
				  </tr>
				  <tr>
					<td valign='top' width='100%'>
					<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='100%'>
					  <tr>
						<td width='20%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>Manufacturer:</font></b></td>
						<td width='80%'><font face='Tahoma' size='1'>
						$manufacturer</font></td>
					  </tr>
					  <tr>
						<td width='20%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>OS:</font></b></td>
						<td width='80%'><font face='Tahoma' size='1'>$os</font></td>
					  </tr>
					  <tr>
						<td width='20%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>CPU:</font></b></td>
						<td width='80%'><font face='Tahoma' size='1'>$cpu</font></td>
					  </tr>
					  <tr>
						<td width='20%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>Memory:</font></b></td>
						<td width='80%'><font face='Tahoma' size='1'>$memory</font></td>
					  </tr>
					  <tr>
						<td width='20%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>Harddrive:</font></b></td>
						<td width='80%'><font face='Tahoma' size='1'>$harddrive</font></td>
					  </tr>
					  <tr>
						<td width='20%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>Video Card:</font></b></td>
						<td width='80%'><font face='Tahoma' size='1'>$videocard</font></td>
					  </tr>
					  <tr>
						<td width='20%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>Sound Card:</font></b></td>
						<td width='80%'><font face='Tahoma' size='1'>$soundcard</font></td>
					  </tr>
					  <tr>
						<td width='20%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>Headphones:</font></b></td>
						<td width='80%'><font face='Tahoma' size='1'>$headphones</font></td>
					  </tr>
					  <tr>
						<td width='20%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>Monitor:</font></b></td>
						<td width='80%'><font face='Tahoma' size='1'>$monitor</font></td>
					  </tr>
					  <tr>
						<td width='20%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>Mouse:</font></b></td>
						<td width='80%'><font face='Tahoma' size='1'>$mouse</font></td>
					  </tr>
					  <tr>
						<td width='20%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>Mouse Pad:</font></b></td>
						<td width='80%'><font face='Tahoma' size='1'>$mousepad</font></td>
					  </tr>
					  <tr>
						<td width='20%' align='left'>&nbsp; <b>
						<font face='Tahoma' size='1'>Keyboard:</font></b></td>
						<td width='80%'><font face='Tahoma' size='1'>$keyboard</font></td>
					  </tr>
					</table>
					</td>
				  </tr>
				  <tr>
					<td width='100%' bgcolor='#F6F6F6'>&nbsp;<b><font face='Tahoma' size='2'>Biography:</font></b></td>
				  </tr>
				  <tr>
					<td valign='top' width='100%'><font face='Tahoma' size='1'>$bio</font></td>
				  </tr>
				</table>
				</td>
				<td valign='top' width='28%'>
				<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='100%'>
				  <tr>
					<td width='100%'>
					<p align='center'><img src='$avatar'></td>
				  </tr>
				  <tr>
					<td width='100%' bgcolor='#F6F6F6'>
					<p align='center'><b><font face='Tahoma' size='2'>$username's 
					Buddies (<font color='#3366FF'>");
$getmates = mysql_query("SELECT * FROM friends WHERE confirmed = 'True' and from_user = '$username'") or die(mysql_error());
$getmymates = mysql_query("SELECT * FROM friends WHERE confirmed = 'True' and to_user = '$username'") or die(mysql_error());

$numates = mysql_num_rows($getmates);
$numymuates = mysql_num_rows($getmymates);

$number = $numates + $numymuates;
			echo ("$number</font>)</font></b></td>
				  </tr>
				  <tr>
					<td valign='top' width='100%'>
					<p align='center'><u><b>
					<a href='friends.php?action=ask&mate=$username'><font face='Tahoma' size='1' color='#AF3132'>Buddy $username</font></a></b></u></td>
				  </tr>
				  <tr>
					<td valign='top' width='100%'>
					<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='100%'>");
					
$getmates = mysql_query("SELECT * FROM friends WHERE confirmed = 'True' and from_user = '$username'") or die(mysql_error());
$getmymates = mysql_query("SELECT * FROM friends WHERE confirmed = 'True' and to_user = '$username'") or die(mysql_error());

$numates = mysql_num_rows($getmates);
$numymuates = mysql_num_rows($getmymates);

$number = $numates + $numymuates;
//Checks see if they have any friends
if($number == 0) {
//If they have no friends lets take the mick
echo "  <tr>
	<td width='100%'>No current friends.</td>
  </tr>";
}
//If you got mates we loop them
while($mates = mysql_fetch_array($getmates)) 
{
//Lets display these losers 
echo "  <tr>
	<td width='100%'><center><a href='index.php?pid=members&user=$mates[to_user]'><font face='Tahoma' size='1' color='#808080'>$mates[to_user]</font></a></center></td>
  </tr>";
}
//This displays there mates to other person
while($mymates = mysql_fetch_array($getmymates)) 
{
//Lets display these losers 
echo "  <tr>
	<td width='100%'><center><a href='index.php?pid=members&user=$mymates[from_user]'><font face='Tahoma' size='1' color='#808080'>$mymates[from_user]</font></a></center></td>
  </tr>";
}
//got to be a good boy and end the table
	echo ("</table>
					</td>
				  </tr>
				</table>
				</td>
			  </tr>
			</table>
			</td>
			<td width='1%'>&nbsp;</td>
		  </tr>
		  <tr>
			<td width='1%'>&nbsp;</td>
			<td width='98%'>
			&nbsp;</td>
			<td width='1%'>&nbsp;</td>
		  </tr>
		  <tr>
			<td width='1%'>&nbsp;</td>
			<td width='98%'>");
	include("comments.php");
	$pc = new ProfileComments;//Starts the class

	$pc->uid = $_GET['user'];//Sends the userid to the script

	if($_POST['ac1'])
	{
		$author = $pc->GetAuthor();
		$author = $pc->author;
		$pc->AddComment($_POST['comment'], $author);//Sends the comment to the AddComment function!
	}

	$pc->GetComments();//Gets the comments

$add = mysql_query("SELECT * FROM users WHERE username = '".$_GET[user]."'") or die(mysql_error());
$add = mysql_fetch_array($add) or die(mysql_error());

$hits = $add['profilehits'] + 1;
$update = mysql_query("UPDATE users SET profilehits = '".$hits."' WHERE username = '".$_GET[user]."'");
// in the above code, we display the user's information.
}
}
?>
<!--HTML FORM-->

<form method="POST" action="<?=$PHP_SELF?>">
	<textarea name="comment">Comment now!</textarea><br />
	<input type="submit" value="Add Comment" name="ac1" />
</form>
			</td>
			<td width='1%'>&nbsp;</td>
		  </tr>
		  </table>
		</td>
	  </tr>
	</table>
	</td>
  </tr>
</table>

is my members.php page (displays user profile)

bump

Edited by rc69, 12 September 2007 - 11:14 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users