This is the None Premium Member Custom Profile Modification
Database changes:
In your adopts_users table insert the following:
Code:
`profilepic` varchar(200) NOT NULL,
`ame` varchar(5000) NOT NULL,
`location` varchar(50) NOT NULL,
`age` varchar(3) NOT NULL,
`occupation` varchar(50) NOT NULL,
`interests` varchar(200) NOT NULL,
`displayquote` varchar(200) NOT NULL,
`usercss` longtext NOT NULL,
Preview:
(Image is too large for page.)
http://i43.tinypic.com/2s6sm5e.jpg
Now in your
register.php file, make sure you add the (, '') needed for each new insert you put into your users table.
Okay, now go to your
account.php file and find where it says:
PHP Code:
// Get the user's account details from the database...
$query = "SELECT * FROM ".$prefix."users WHERE username='$loggedinname'";
$result = mysql_query($query);
$num = mysql_numrows($result);
//Loop out code
$i=0;
while ($i < 1) {
And place the following in that group:
PHP Code:
$ame=@mysql_result($result,$i,"ame");
$location=@mysql_result($result,$i,"location");
$age=@mysql_result($result,$i,"age");
$occupation=@mysql_result($result,$i,"occupation");
$interests=@mysql_result($result,$i,"interests");
$profilepic=@mysql_result($result,$i,"profilepic");
$displayquote=@mysql_result($result,$i,"displayquote");
$usercss=@mysql_result($result,$i,"usercss");
$ame = stripslashes($ame);
$location = stripslashes($location);
$age = stripslashes($age);
$occupation = stripslashes($occupation);
$interests = stripslashes($interests);
$profilepic = stripslashes($profilepic);
$displayquote = stripslashes($displayquote);
$usercss = stripslashes($usercss);
Then, where it says:
PHP Code:
// Show the form...
if($newmessagenotify == 1){
$box = "<input name='newmsgnotify' type='checkbox' id='newmsgnotify' value='1' checked>";
}
else{
$box = "<input name='newmsgnotify' type='checkbox' id='newmsgnotify' value='1'>";
}
$article_content = $article_content."<br><br><br><br><br>
Place the following within that form:
PHP Code:
<p>Profile Layout:
<textarea name='usercss' type='text' id='usercss' cols='80' rows='30'>".$usercss."</textarea>
</p>
</p>
<p>About Me: <br>
<textarea name='ame' type='text' id='ame' cols='40' rows='3'>".$ame."</textarea>
</p>
<p>Interests: <br>
<textarea name='interests' type='text' id='interests' cols='40' rows='3'>".$interests."</textarea>
</p>
<p>Location:
<input name='location' type='text' id='location' value='".$location."'>
</p>
<p>Age:
<input name='age' type='text' id='age' value='".$age."'>
</p>
<p>Display Picture:
<input name='profilepic' type='text' id='profilepic' value='".$profilepic."'>
</p>
<p>Favorite Quote:
<input name='displayquote' type='text' id='displayquote' value='".$displayquote."'>
</p>
<p>Occupation:
<input name='occupation' type='text' id='occupation' value='".$occupation."'>
<input name='act' type='hidden' id='act' value='changesettings'>
</p>
Then in your
accountpost.php file, find where it says:
PHP Code:
else if($act == "changesettings"){
// We are changing the settings
and insert the following:
PHP Code:
$ame = $_POST["ame"];
$ame = secure($ame);
$location = $_POST["location"];
$location = secure($location);
$age = $_POST["age"];
$age = secure($age);
$occupation = $_POST["occupation"];
$occupation = secure($occupation);
$interests = $_POST["interests"];
$interests = secure($interests);
$profilepic = $_POST["profilepic"];
$profilepic = secure($profilepic);
$displayquote = $_POST["displayquote"];
$displayquote = secure($displayquote);
$usercss = $_POST["usercss"];
$usercss = secure($usercss);
Then scroll down and insert:
PHP Code:
$query = "UPDATE ".$prefix."users SET ame='".$ame."' WHERE username='".$loggedinname."'";
mysql_query($query);
$query = "UPDATE ".$prefix."users SET location='".$location."' WHERE username='".$loggedinname."'";
mysql_query($query);
$query = "UPDATE ".$prefix."users SET age='".$age."' WHERE username='".$loggedinname."'";
mysql_query($query);
$query = "UPDATE ".$prefix."users SET occupation='".$occupation."' WHERE username='".$loggedinname."'";
mysql_query($query);
$query = "UPDATE ".$prefix."users SET interests='".$interests."' WHERE username='".$loggedinname."'";
mysql_query($query);
$query = "UPDATE ".$prefix."users SET profilepic='".$profilepic."' WHERE username='".$loggedinname."'";
mysql_query($query);
$query = "UPDATE ".$prefix."users SET displayquote='".$displayquote."' WHERE username='".$loggedinname."'";
mysql_query($query);
$query = "UPDATE ".$prefix."users SET usercss='".$usercss."' WHERE username='".$loggedinname."'";
mysql_query($query);
Now go to your
profile.php file, and find where it says:
PHP Code:
// This page handles user profiles and shows the site members...
$user = $_GET["user"];
$user = preg_replace("/[^a-zA-Z0-9\\040.]/", "", $user);
$user = secure($user);
$page = $_GET["page"];
$page = preg_replace("/[^a-zA-Z0-9\\040.]/", "", $page);
$page = secure($page);
if($user != ""){
// We have specified a specific user who we are showing a profile for...
// See if the user exists...
$query = "SELECT * FROM ".$prefix."users WHERE username = '".$user."'";
$result = mysql_query($query);
$num = mysql_numrows($result);
if($num > 0){
$i=0;
while ($i < 1) {
$usersname=@mysql_result($result,$i,"username");
$usersgroup=@mysql_result($result,$i,"usergroup");
$website=@mysql_result($result,$i,"website");
$aim=@mysql_result($result,$i,"aim");
$yahoo=@mysql_result($result,$i,"yahoo");
$msn=@mysql_result($result,$i,"msn");
$membersince=@mysql_result($result,$i,"membersince");
if($website == ""){
$website = "No Website Information Given";
}
else{
$website = "<a href='".$website."' target='_blank'>".$website."</a>";
}
if($msn == ""){
$msn = "No MSN Information Given";
}
if($aim == ""){
$aim = "No AIM Information Given";
}
if($yahoo == ""){
$yahoo = "No YIM Information Given";
}
$i++;
}
$query = "SELECT * FROM ".$prefix."owned_adoptables WHERE owner = '".$user."'";
$result = mysql_query($query);
$numpets = mysql_numrows($result);
// Show the user's profile page...
$ccstat = cancp($usersgroup);
if($ccstat == "yes"){
$userdisp = "<img src='templates/icons/star.gif'> ".$usersname."";
}
else{
$userdisp = $usersname;
}
$article_title = $userdisp."'s Profile:";
$article_content = "<b><u>".$lang_basic_info."".$usersname.":</u></b><br><br>
<img src='templates/icons/web.gif'> ".$website."<br>
<img src='templates/icons/aim.gif'> ".$aim."<br>
<img src='templates/icons/msn.gif'> ".$msn."<br>
<img src='templates/icons/yahoo.gif'> ".$yahoo."<br>
<img src='templates/icons/title.gif'> <a href='messages.php?act=newpm&user=".$usersname."'>Send ".$usersname." a Private Message</a><br>
<br><b><u>".$usersname."'s Stats:</b></u><br><br>
<b>Member Since:</b> ".$membersince."<br>
<b>Number Of Pets Owned:</b> ".$numpets."<br><br>
<b><u>".$usersname."'s Pets:</u></b><br><br>";
if($numpets > 0){
$i=0;
while ($i < $numpets) {
$aid=@mysql_result($result,$i,"aid");
$image = getcurrentimage($aid);
$article_content = $article_content."<a href='levelup.php?id=".$aid."'><img src='".$image."' border='0'></a>";
$i++;
}
}
else{
$article_content = $article_content."This user currently does not have any pets.";
}
}
else{
// User doesn't seem to exist, oh noes!
$article_title = "User Does Not Exist";
$article_content = "Sorry, but we could not find a user in the system with the name ".$user.".
Please make sure you have the username right. The user's account may also have been deleted by the system admin.";
}
}
Copy and delete that from the
profile.php file. Then make a new file, and call it
profile2.php (make sure you have the neccessary things for the theme and functions etc. within the page.
Save that file for now. and go back to your
profile.php and get rid of the first [else{}] bracket. and save the file.
Now go back to your
profile2.php file.
and find where ti says:
PHP Code:
// We have specified a specific user who we are showing a profile for...
// See if the user exists...
$query = "SELECT * FROM ".$prefix."users WHERE username = '".$user."'";
$result = mysql_query($query);
$num = mysql_numrows($result);
if($num > 0){
$i=0;
while ($i < 1) {
Place the following:
PHP Code:
$ame=@mysql_result($result,$i,"ame");
$location=@mysql_result($result,$i,"location");
$age=@mysql_result($result,$i,"age");
$occupation=@mysql_result($result,$i,"occupation");
$interests=@mysql_result($result,$i,"interests");
$profilepic=@mysql_result($result,$i,"profilepic");
$displayquote=@mysql_result($result,$i,"displayquote");
$usercss=@mysql_result($result,$i,"usercss");
Then scrol down and replace the 'article_title, and article content' with:
PHP Code:
$article_title = "".$usersname."'s Profile:";
$displaypic = "<img src='".$profilepic."'>";
$display_quote = "".$displayquote."<br>".$userdisp."<br>";
$aboutme = " <b>About Me:</b><br> ".$ame."<br> <b>Interests:</b><br> ".$interests."<br>";
$article_content = "
<b><u>".$lang_basic_info."".$usersname.":</u></b></a><br><br>
<img src='templates/icons/web.gif'> ".$website."<br>
<img src='templates/icons/aim.gif'> ".$aim."<br>
<img src='templates/icons/msn.gif'> ".$msn."<br>
<img src='templates/icons/yahoo.gif'> ".$yahoo."<br>
<img src='templates/icons/title.gif'> <a href='messages.php?act=newpm&user=".$usersname."'>Send ".$usersname." a Private Message</a><br><br>";
$article_stats = "
<b><u>".$usersname."'s Stats:</b></u></a><br><br>
<b>Member Since:</b> ".$membersince."<br><br>";
$article_about = "
<b><u>About ".$usersname.":</b></u></a><br><br>
<b>Location:</b> ".$location."<br>
<b>Age:</b> ".$age."<br>
<b>Occupation:</b> ".$occupation."<br>";
Make sure you change the profile2.php files theme url, to: $themeurl = "templates/default/usertemp.html";
And add the following to the Theme Definitions:
PHP Code:
$template = replace(':DISPLAYPIC:',$displaypic,$template);
$template = replace(':DISPLAYQUOTE:',$display_quote,$template);
$template = replace(':ARTICLESTATS:',$article_stats,$template);
$template = replace(':ARTICLEABOUT:',$article_about,$template);
$template = replace(':ARTICLEABOUTME:',$aboutme,$template);
$template = replace(':USERCSS:',$usercss,$template);
Now, go to your
register.php file and find where it says:
[first make sure that you place this in the configuration info part of the register file"
PHP Code:
include("inc/css.php");
Now, go to your
register.php file and find where it says
PHP Code:
else{
//Grab the post data from the form
and insert the following:
PHP Code:
$css2 = $_POST["css2"];
$css2 = secure($css2);
Then insert the folliwng into the form:
PHP Code:
<p><input name='css2' type='hidden' id='css2' value='".$css."'></p>
then scroll down, and
pay attention where the query is that insert the data into the users table,
add:
to it, but make sure that it is in the correct order as it is within the adopts_users table.
Now download the following three pages, and add them to your server:
The css.php file go in your 'inc' directory, and the other two go into your 'templates/default' directory:
[attachment=184][attachment=185][attachment=186]