Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Tutorials and Tips

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 08-20-2012, 05:05 PM
Derpstra's Avatar
Derpstra Derpstra is offline
Seamstress!
 
Join Date: Aug 2012
Location: Seattle, WA/Charlotte, NC
Posts: 26
Gender: Female
Credits: 6,455
Derpstra is on a distinguished road
Default Easy way to put user's avatar on any page

Being a very lazy person, I like to make my scripts as simple as possible. Usually I achieve this by messing around with the functions. Today I made an easy one that allows you to put the user's avatar wherever you want!

First, add this function to the page functions/functions_users.php:
PHP Code:
function usernametoavatar($name){
    
$row $GLOBALS['adopts']->select("users_profile", array("username""avatar"), "username='{$name}'")->fetchObject();
    return 
$row->avatar;

Now, on whatever page you want to add their avatar to, paste this anywhere on the page before $article_title:
PHP Code:
$avatar usernametoavatar($username); 
Then, in your $article_content, place this wherever you want the avatar to show up:
PHP Code:
<img src='{$avatar}' /> 
Ta da! They will see their own avatar!
__________________
-
Reply With Quote
Reply

Tags
avatar, script


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
(How to...) Add user avatar to the sidebar with Mys v1.3.3 Hall of Famer Tutorials and Tips 3 12-28-2015 11:55 PM
How easy would it be to incorporate phpbb with mysida? LucasA33 Questions and Supports 7 04-03-2014 06:04 PM
Memberlist (user avatar) Alaric Questions and Supports 6 06-01-2012 03:28 AM
User name and avatar RoconzaArt Questions and Supports 8 03-15-2011 11:02 AM
Page that will display a user's pets (non layout destroying update) kisazeky Addons/Mods Graveyard 12 11-05-2009 09:27 PM


All times are GMT -5. The time now is 11:36 AM.

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