Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
Hi,

Just imported a number of users from UBB - copying their Avatar URL's over to the picture field. All display - however all the images are 48x48 in aize and Threads insists on re-sizing them to 80x80 - I can change the maximum size to 48x48 and they will display okay - but I was under the impression that the size in themes.inc.php was a maximum and not a forced size.

Just wondered why threads is making all avatar images (pictures) the same maximum size?

Ian


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Sponsored Links
Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
I have had similiar "weird" occurances with avatars in threads. Seems as if some people upload avatars just fine, and if they are smaller they aren't resized. Yet some people's avatars get very stretched and distored while others don't. *shrug* Not sure why it happens. I just tell people to try and resize them theirself then re-upload, but unfortunately most of my users aren't very computer savvy

Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
I think it works like this:

The avatar dimensions only get stored in the database if the avatar is uploaded though My Home.

When the avatars are displayed, if the dimensions are present, they're used for the width and height attributes. Otherwise, the default dimensions from the theme settings are used for the width and height attributes.

The import script just stuffs the avatar URLs into the database. It doesn't set the dimensions.

You can use this query to see what's in the database:

SELECT U_Username,U_Picture,U_PicWidth,U_PicHeight
FROM w3t_Users
WHERE (U_Picture is not null and U_Picture <> '' and U_Picture <> 'http://')
OR (U_PicWidth is not null and U_PicWidth <> '')
OR (U_PicHeight is not null and U_PicHeight <> '')

Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
Thanks Dave - so basically as all the avatars are 48x48 all I need to do is to update all the width & heights to 48.

Any clues on the query required, as not all the users have images.

Ian


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
Do this first, and verify that the rows selected are the ones that you want to change:
SELECT U_Username,U_Picture,U_PicWidth,U_PicHeight
FROM w3t_Users
WHERE U_Picture is not null and U_Picture <> '' and U_Picture <> 'http://'

Then update them:
UPDATE w3t_Users
SET U_PicWidth = 48, U_PicHeight = 48
WHERE (U_Picture is not null and U_Picture <> '' and U_Picture <> 'http://')

Disclaimer: backup the database first.

Sponsored Links
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Try this query:

UPDATE w3t_Users
SET U_PicWidth = '48', U_PicHeight = '48'
WHERE U_Picture IS NOT NULL
AND U_Picture NOT LIKE 'http://'



Hope that works.

(back up that database as always)



Edit note: looks like Dave_L beat me to the punch.

Last edited by JustDave; 07/07/2002 11:16 AM.
Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
Thanks guys.

Worked a treat - does anyone know an idiots guide to these various SQL commands so that I can learn the various options?

Ian


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Joined: Jul 2002
Posts: 5
Lurker
Lurker
Offline
Joined: Jul 2002
Posts: 5
I'm having a slightly different problem...


My problem seems to be that the board is taking
code:
if ($picwidth && $picheight) {
$picsize = "width="$picwidth" height="$picheight"";
}
else {
$picsize = "width="{$theme['PictureWidth']}" height="{$theme['PictureHeight']}"";
}



in showflat.php and going to else everytime. My pic size in config is set to 65x75, but many users are uploading 50x50 pictures and the board is stretching them. It was working for a few days correctly, but now 'suddenly' they're all 65x75 including the ones added SINCE 'suddenly' occurred. I really don't know PHP or SQL very well, and am using very rusty coding skills to find the problem. Any suggestions?

My Board is here, if it helps.

Joined: Jul 2002
Posts: 5
Lurker
Lurker
Offline
Joined: Jul 2002
Posts: 5
Thanks for your help, Dave, but it's the on-site ones that I'm referring to.

Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
1) Try using one of the SELECT queries I posted above to see what's in the database.

2) Try inserting immediately before the "if":
code:
echo "Username='$Username',picwidth='$picwidth',picheight='$picheight'<br>\n";


Sponsored Links
Joined: Jul 2002
Posts: 5
Lurker
Lurker
Offline
Joined: Jul 2002
Posts: 5
Whoops. My husband was chatting in my ear and I ran the update one instead...

Sigh.

At least now there's a good reason why they are all 65x75. (The admin is an idiot.) I'll have them re-upload, and I'll watch if the problem occurs again.

Thanks anyway.

Joined: Jul 2002
Posts: 5
Lurker
Lurker
Offline
Joined: Jul 2002
Posts: 5
Alright then! The problem has continued, but this time I noticed that the user had just changed their sig, so I did some testing.

I have determined the behavior that causes the bug.

1. A user uploads a pic smaller than my default, 50x50 for example.

2. The pic shows correctly, 50x50.

3. The user then goes to their home later and changes anything else in the profile, but leaves the pic alone. They hit submit.

4. The database resets the pic size to my default (65x75).

How do I keep editbasic.php from resetting the pic size if the user has not modified it?

Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
Yep I am getting that as well - I resized all images to 48x48 as that was the size I imported all avatars over from UBB in.

Now some images have returned to 80x80 which is the size I have left the maximum at.



Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Joined: May 1999
Posts: 3,039
Guru
Guru
Offline
Joined: May 1999
Posts: 3,039
There were a variety of problems on this one. The next version will allow for either upload or linking to an image at the same time. With these changes it also fixes this bug.


UBB.threads Developer

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)