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

Reply
 
Thread Tools Display Modes
  #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: 35,560
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
  #2  
Old 05-15-2009, 07:20 AM
rainbelly rainbelly is offline
Member
 
Join Date: May 2009
Posts: 5
Credits: 268
rainbelly
Default RE: A quick Profile Add-on Modification

Cool!

However, I am getting an error on the MySQL:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`aboutme` VARCHAR(5000) NOT NULL,' at line 2
Reply With Quote
  #3  
Old 05-15-2009, 02:21 PM
SJC SJC is offline
Member
 
Join Date: Apr 2009
Posts: 118
Credits: 10,080
SJC
Default RE: A quick Profile Add-on Modification

Quick question. Do you have to add another ,'' at the end of :
mysql_query("INSERT INTO ".$prefix."users VALUES ('', '$username', '$pass1', '$email', '3', '1', '$date', '0', '')");
if you wanted to insert another profile field?
Reply With Quote
  #4  
Old 05-15-2009, 03:01 PM
Bloodrun's Avatar
Bloodrun Bloodrun is offline
I am, who I am.
 
Join Date: Apr 2009
Posts: 532
Gender: Male
Credits: 35,560
Bloodrun
Send a message via Yahoo to Bloodrun
Default RE: A quick Profile Add-on Modification

Quote:
Originally Posted by rainbelly
Cool!

However, I am getting an error on the MySQL:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`aboutme` VARCHAR(5000) NOT NULL,' at line 2
That has to do with how you put it in your database. Each new line has to end with a comma.

Quote:
Originally Posted by SJC
Quick question. Do you have to add another ,'' at the end of :
mysql_query("INSERT INTO ".$prefix."users VALUES ('', '$username', '$pass1', '$email', '3', '1', '$date', '0', '')");
if you wanted to insert another profile field?
Yes you do, lol don't forget that. It will frustrate you beyond belief. ;)
Reply With Quote
  #5  
Old 05-15-2009, 03:07 PM
SJC SJC is offline
Member
 
Join Date: Apr 2009
Posts: 118
Credits: 10,080
SJC
Default RE: A quick Profile Add-on Modification

Okay, just wanted to make sure :).
Reply With Quote
  #6  
Old 05-15-2009, 03:08 PM
Bloodrun's Avatar
Bloodrun Bloodrun is offline
I am, who I am.
 
Join Date: Apr 2009
Posts: 532
Gender: Male
Credits: 35,560
Bloodrun
Send a message via Yahoo to Bloodrun
Default RE: A quick Profile Add-on Modification

Quote:
Originally Posted by SJC
Okay, just wanted to make sure :).
Lol okie dokie.
Oh, if you have any suggestions for new modifications, or want something made for your site. Just drop me a PM =D
Reply With Quote
  #7  
Old 05-16-2009, 07:05 AM
mapleblade mapleblade is offline
Epicness sausage
 
Join Date: May 2009
Posts: 180
Gender: Male
Credits: 24,698
mapleblade
Default RE: A quick Profile Add-on Modification

it works fine, but if i add something it only sais on profile "about me:"
after that nothing.
__________________
Need coding help? send me a PM! :)
Reply With Quote
  #8  
Old 05-16-2009, 02:28 PM
Bloodrun's Avatar
Bloodrun Bloodrun is offline
I am, who I am.
 
Join Date: Apr 2009
Posts: 532
Gender: Male
Credits: 35,560
Bloodrun
Send a message via Yahoo to Bloodrun
Default RE: A quick Profile Add-on Modification

Quote:
Originally Posted by mapleblade
it works fine, but if i add something it only sais on profile "about me:"
after that nothing.
Then it has to do with how your calling it on your profile page.
First check to make sure its even going into the database.
Reply With Quote
  #9  
Old 05-22-2009, 07:55 AM
12345 12345 is offline
Member
 
Join Date: Mar 2009
Posts: 54
Credits: 8,893
12345
Default RE: A quick Profile Add-on Modification

I have do everything in instructions but profile is not looking like this
http://i43.tinypic.com/2s6sm5e.jpg
And I already have this:
`aboutme` varchar(5000) NOT NULL,
from your other mod
Reply With Quote
  #10  
Old 05-22-2009, 08:16 AM
Bloodrun's Avatar
Bloodrun Bloodrun is offline
I am, who I am.
 
Join Date: Apr 2009
Posts: 532
Gender: Male
Credits: 35,560
Bloodrun
Send a message via Yahoo to Bloodrun
Default RE: A quick Profile Add-on Modification

Quote:
Originally Posted by 12345
I have do everything in instructions but profile is not looking like this
http://i43.tinypic.com/2s6sm5e.jpg
And I already have this:
`aboutme` varchar(5000) NOT NULL,
from your other mod
Are you sure you added the .html file for the users profile?
Because without that, the profile will not look like its suppose to.
Reply With Quote
Reply


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 12:29 AM.

Currently Active Users: 845 (0 members and 845 guests)
Threads: 4,081, Posts: 32,029, 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