• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

using an avatar from database

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
7 posts • Page 1 of 1

Postby BULLETPROOF123 » Thu Jun 28, 2012 2:22 pm

hello i would like to have a user image as an avatar IN The chat box

"avatar" Username - Message

i have the php code which is
<img src="memberFiles/<?php echo "$userid"; ?>/pic1.jpg" alt="AA" width="150" />

but where would i need to put it?
BULLETPROOF123
Member
 
Posts: 17
Joined: Thu Jun 14, 2012 6:11 am
Top

Postby BULLETPROOF123 » Sat Jun 30, 2012 9:59 pm

where is the support?
BULLETPROOF123
Member
 
Posts: 17
Joined: Thu Jun 14, 2012 6:11 am
Top

Postby OldWolf » Sun Jul 01, 2012 8:21 am

Viewing through your past posts, I have noticed a recurring pattern of impatience. Please realize that those of us offering support do so in our free time on a voluntary basis. As such, often times delays of 24-48 hours are expected, sometimes even longer. Generally speaking, re*s.t.a.r.s.*2 is the only person offering support at this time, voluntarily. As such, you may experience longer delays, or perhaps no answer at all if he simply doesn't have the answer. Give it time and he might have an answer, but it may be you just have to do some digging yourself.

Good luck
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top

Postby BULLETPROOF123 » Wed Jul 04, 2012 12:49 pm

ok sorry for coming across as impatient, website building can be very stressful at times, it pains me when something is stopping me from making progress as i like to get things done.

I'm normally very nice and polite, my apologies
BULLETPROOF123
Member
 
Posts: 17
Joined: Thu Jun 14, 2012 6:11 am
Top

Postby re*s.t.a.r.s.*2 » Wed Jul 04, 2012 3:18 pm

Hi,

Sorry for delay sometime I don't have enough time to response or my brain is not well put to do so..

For this feature the $params['nickmeta'] is the key that will make possible to have avatar in the nicklist:

Lets create a var that will hold the html img markup taking in account that we have just the img NAME from another variable called $from_img , that you have from your script....

Code: Select all
$my_avatar = $from_img != '' ? '<a target="_blank" href="./folder_img/'.$from_img.'"><img src="./folder_img/'.$from_img.'" alt="user avatar" /></a>' : '<img src="./themes/default/images/Chat-icon.png" alt="no image" />';

So we populated with the markup our var $my_avatar , if $from_img were to be empty a default image will be parsed..

now we use the nickmeta parameter and we create a avatar key :

Code: Select all
$params['nickmeta']['avatar'] = $my_avatar;

This code goes in the index.php , once we have this done make sure you rehash the chat...

So the full code should look like this:

Code: Select all
// set an inline code with the avatar img or a default if doesnt exist..
$my_avatar = $from_img != '' ? '<a target="_blank" href="./folder_img/'.$from_img.'"><img src="./folder_img/'.$from_img.'" alt="user avatar" /></a>' : '<img src="./themes/default/images/Chat-icon.png" alt="no image" />';

//  set our avatar paramerter
$params['nickmeta']['avatar'] = $my_avatar;

Make sure avatar path , folders are correctly set remember that this path in this example are for my installation...


regards.
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top

Postby BULLETPROOF123 » Thu Jul 05, 2012 2:45 pm

hello thanks for your reply re*s.t.a.r.s.*2 i'm not sure if thats what i'm looking for:/

here is a picture Image

the picture of the fish is what a user uploaded, i would like to have this displayed on the left next to the nickname

i use this code to display the fish image anywhere on my site
<img src="memberFiles/<?php echo "$userid"; ?>/pic1.jpg" alt="Ad" width="150" />
BULLETPROOF123
Member
 
Posts: 17
Joined: Thu Jun 14, 2012 6:11 am
Top

Postby re*s.t.a.r.s.*2 » Thu Jul 05, 2012 6:23 pm

Sorry,

Haven't code that , so I don't have an answer for it..

regards.
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top


Post a reply
7 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 52 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub