Creating a character for your user

Forum
Last Post
Threads / Messages

GeneticAlpha

Loving Mysidia!
Member
Joined
May 24, 2020
Messages
289
Points
28
Age
31
Location
Tennessee
Mysidian Dollar
13,392
So, I don't really know php, but I did find a way you could add a character to a user's profile page that you manually set and create for your users while I wait to get something better lol. Basically, I will have a horse silhouette that is displayed on the new user's profile and after they give me the information I need I can create their character manually then update their profile in the database to have the new image.

So if you think this will work for you, then below is how I did it.
_____________

- Go to your PHPMyAdmin then to the adopts_users_profile
- You're going to make a new table called userimage

To set the table up you want to set it to type: VARCHAR 500 Collation: latin1_swedish_ci Null: Yes Default: This you set to be the image you want everyone to have upon registering
Then just hit "Go"

So, to change the image for your user you would just go to you the users and edit their table with the correct new image you want to set and update it and it'll change that person's image only.

Now, you'll want to go to your class_usersprofile to setup the image to show up from the database. Down in the same area as this:

$document->add(new Image($this->avatar, "avatar", 150));

you'll want to add your code to call your database image which is this:

$document->add(new Image($this->userimage, "userimage"));

and that's it! :] This is what my code looks like in that little bit area:

$document->add($title);
$document->add(new Image($this->avatar, "avatar", 150));
$document->add(new Comment(""));
$document->add(new Comment(""));
$document->add(new Image($this->userimage, "userimage"));
$document->add(new Comment($basicinfo));
$document->add(new Comment(""));

}
 
Thanks for this tutorial! I'll have to give it a go! :)
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,280
Messages
33,129
Members
1,603
Latest member
Monako
BETA

Latest Threads

Latest Posts

Top