Previous Thread
Next Thread
Print Thread
Hop To
Joined: Feb 2006
Posts: 10
J
stranger
stranger
J Offline
Joined: Feb 2006
Posts: 10
Is it possible to turn on a default avatar image?
So that when a user hasn't uploaded his individual avatar yet, that there is a standard picture for everyone who hasn't done so?

Thanks for your help.

Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Probably the easiest way would be to alter the defaults for a few values in the w3t_Users table. I'd suggest doing a database backup before doing this:

ALTER TABLE w3t_Users
CHANGE U_Picture U_Picture varchar(150) not null default '#url_to_image#',
CHANGE U_PicWidth U_PicWidth int(4) not null default '#width#',
CHANGE U_PicHeight U_PicHeight int(4) not null default '#height#'

You'd need to replace #url_to_image# with the full url to the image. Also change #width# and #height# to the actual number of pixels of the image. This should make it so anyone without a pic right now, gets one, and any new members will get it as well.

Like I said, make sure you do a backup first, at least of the w3t_Users table that is getting altered.

Joined: Feb 2006
Posts: 10
J
stranger
stranger
J Offline
Joined: Feb 2006
Posts: 10
Ok, I'll try to do this later.

But this would not overwrite people's individuals avatars (if they HAVE already uploaded their own avatar), would it? Because that's not what I want... only for people who have not uploaded their own image.

Also, do I write the full path like this

CHANGE U_Picture U_Picture varchar(150) not null default '#http://www.something.com/image.gif#', - is this correct?

Thanks for your help!

Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Anyone that has an existing avatar wouldn't be changed, only those that don't have one. You're correct on your change, just leave out the # signs. I put them in just to designate what needs to be changed <img src="https://www.ubbcentral.com/boards/images/graemlins/wink.gif" alt="" />

Joined: Feb 2006
Posts: 10
J
stranger
stranger
J Offline
Joined: Feb 2006
Posts: 10
Ah, thank you so much. I will try it later.
Thanks a million times.

Joined: Feb 2006
Posts: 10
J
stranger
stranger
J Offline
Joined: Feb 2006
Posts: 10
[]Probably the easiest way would be to alter the defaults for a few values in the w3t_Users table. [/]

Eh, I'm sorry but where exactly do I find this table? I assumed it would be in my MySQL database. The prefixes for UBBthreads are ubb_threads and the only table I can find that I could imagine would suit, is this one: ubb_threads_Users

But where exactly is the w3t_Users table? I am really no very familiar with MySQL. Sorry.

Joined: Jun 2006
Posts: 182
A
member
member
A Offline
Joined: Jun 2006
Posts: 182
On your system, ubb_threads_Users is the w3t_Users table, since your table prefix is ubb_threads_ instead of the default w3t_.

Joined: Feb 2006
Posts: 10
J
stranger
stranger
J Offline
Joined: Feb 2006
Posts: 10
I am so sorry for being such an amateur but I have to ask another question. I know all these "Beginner questions" can be annoying but this would be really helpful for me.

I located the table now and opened it with mysqladmin (because that's the only way I know) and the screen looks like this (please see attachment).

Now I'm quite confused where I need to enter the URL for the picture.

Or do I need to get there in a different mode.
I'm really sorry for all these questions but I don't know anything about MySQL.

Thanks for your help. It is very much appreciated.
Attachments
43702-mysql.gif.zip (0 Bytes, 79 downloads)

Last edited by jamiestevens; 03/29/2006 3:04 PM.
Joined: Jun 2006
Posts: 346
J
enthusiast
enthusiast
J Offline
Joined: Jun 2006
Posts: 346
Wouldn't a simple if/then/else be an easier way in the showflat.tmpl?


--
Website Development and Management
www.jcswebdev.com
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
The simplest way is to go into the Control Panel on the forums. Click the Database Tools link in the menu, then go to the SQL command tab, then you'd enter the sql commands in that box.

Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
JC, that wouldn't cover when looking at his profile or showthreaded. Didn't want to have him editing any code, so the sql command above would cover every instance where the avatarr is shown.


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Version 7.7.5 Images suddenly not displaying
by Stovebolt - 05/04/2024 11:19 AM
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Who's Online Now
2 members (Geoff, 1 invisible), 692 guests, and 171 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240506)