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, 04:05 PM
Derpstra's Avatar
Derpstra Derpstra is offline
Seamstress!
 
Join Date: Aug 2012
Location: Seattle, WA/Charlotte, NC
Posts: 26
Gender: Female
Credits: 5,094
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

Thread Tools
Display Modes

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


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

Currently Active Users: 452 (0 members and 452 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