Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Addons/Mods Graveyard

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-14-2009, 09:28 PM
Bloodrun's Avatar
Bloodrun Bloodrun is offline
I am, who I am.
 
Join Date: Apr 2009
Posts: 532
Gender: Male
Credits: 28,702
Bloodrun
Send a message via Yahoo to Bloodrun
Default A quick Profile Add-on Modification

Like the title says, a quick Profile Add-on Modification.
What does that mean?
I will show you how to make a new profile add-on, and make it work ;)

Profile Add-on Includes:
  • How to add a new option in your account.php file
  • How to make it so it shows up in your profile.php

Will Include:
  • A more advanced looking account.php
  • A friends option
  • A 'customize' your own profile option.

Preview:]
(Image is too large for page.)
http://i43.tinypic.com/2s6sm5e.jpg

First things first, whatever you want to add to your profile/account file, you MUST add to your database, and to do that, all you need to do, is come up with a name, and place into your 'adopts_user' table.
For the sake of this tutorial, I will be showing you how to add a very simple 'about me' section to your profile.

So go ahead and add this to your 'adopts_user' table:

Code:
  `aboutme` varchar(5000) NOT NULL,
Next, 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 two things, in the appropriate groups:

PHP Code:
$aboutme=@mysql_result($result,$i,"ame"); 
PHP Code:
$ame stripslashes($ame); 
Then scroll down, to 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>

<form name='form1' method='post' action='accountpost.php'> 
And insert the following any where in that form:

PHP Code:
  <p>About Me: <br>
    <
textarea name='aboutme' type='text' id='aboutme' cols='40' rows='3'>".$ame."</textarea>
</
p
Now that's it for the account.php file.

Now go to your accountpost.php file, and find where it says:

PHP Code:
else if($act == "changesettings"){

// We are changing the settings

$newmsgnotify $_POST["newmsgnotify"];
$newmsgnotify preg_replace("/[^a-zA-Z0-9@._-]/"""$newmsgnotify);
$newmsgnotify secure($newmsgnotify); 
And place the following in that group:

PHP Code:
$aboutme $_POST["aboutme"];
$aboutme secure($aboutme); 
Then scroll down to where it says:

PHP Code:
// Run update queries...

$query "UPDATE ".$prefix."users SET newmessagenotify='".$newmsgnotify."' WHERE username='".$loggedinname."'";
mysql_query($query); 
And place the following in that group:

PHP Code:
$query "UPDATE ".$prefix."users SET aboutme='".$aboutme."' WHERE username='".$loggedinname."'";
mysql_query($query); 
Now before we do ANYTHING else, go to your register.php file, and find where it says:

PHP Code:

        mysql_query
("INSERT INTO ".$prefix."users VALUES ('', '$username', '$pass1', '$email', '3', '1', '$date', '0')"); 
And add this to the end:

Note: it is not a quotation mark, it is a double tick ' and '
PHP Code:
'' 
So it looks like this:

PHP Code:

        mysql_query
("INSERT INTO ".$prefix."users VALUES ('', '$username', '$pass1', '$email', '3', '1', '$date', '0', '')"); 
Now, to make this all show up on your profile page ;D

Go to your profile.php and find where it says:

PHP Code:
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) { 
And place the following in a that group:

PHP Code:
    $aboutme=@mysql_result($result,$i,"aboutme"); 
Now you can add the part where if a user hasn't entered anything in for the category, it will say something like "No information given" but, I'm going to show it.

Next scroll down to where it says:

PHP Code:
    // Show the user's profile page... 
And place the following within the '$article_content':

PHP Code:
<b>About Me:</b><br".$aboutme."<br
And your down. Don't be afraid to ask questions. I won't bite. =D
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A modification jcga1992 Questions and Supports 7 11-07-2011 02:31 PM
Modification Dictionary AlexC Mys v1.2.x Mods 2 07-05-2011 09:44 AM
Modification Directory Kaeliah Mys v1.1.x Mods 14 02-28-2011 05:14 PM
Custom Profile Modification Bloodrun Mys v1.1.x Mods 50 01-22-2011 09:17 PM
Modification Out-Dated New one will be added. Bloodrun Addons/Mods Graveyard 19 05-23-2009 01:52 AM


All times are GMT -5. The time now is 04:04 PM.

Currently Active Users: 9395 (0 members and 9395 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636