Forums FAQForums FAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin 

Avatar size mod
 
This topic is locked you cannot edit posts or make replies    DDR Freak Forum Index -> Site Feedback
View previous topic :: View next topic  
Author Message
Kilgamayan
Trick Member
Trick Member


Joined: 04 May 2005
Location: lol internet
0. PostPosted: Mon Jun 13, 2005 8:18 pm    Post subject: Avatar size mod Reply with quote

Spectere and I have access to the phpBB mod that resizes avatars if they're beyond a certain size, but we're looking for the one that prevents people from linking to said oversized avatars entirely.

I remembered you guys have the mod we're looking for. Where can we get it?
_________________
Back to top
View users profile Send private message Visit posters website AOL Instant Messenger
sherl0k
Maniac Member
Maniac Member


Joined: 27 Jan 2002
Location: the internet
1. PostPosted: Mon Jun 13, 2005 8:32 pm    Post subject: Reply with quote

Custom-coded by Cutriss, I believe.
_________________


[quote:ed1f6848c5=\\\"jaeness\\\"]get your change from obama, he apparently has tons of it.[/quote]
Back to top
View users profile Send private message Visit posters website AOL Instant Messenger
Cutriss
Staff Member
Staff Member


Joined: 24 Jan 2002
2. PostPosted: Tue Jun 14, 2005 4:20 am    Post subject: Reply with quote

Resizing avatars is easy. You just adjust the assignment of the $poster_avatar variable in viewtopic.php by changing the <img> tag to add height and width attributes. You can set it statically here, or add to the previous SQL query to fetch configuration values out of the database. Of course, the trick is if you want to resize *only* the oversized avatars. And if that's the case (which is probably what this mod you're talking about deals with), then you would have to do server-side storage and manipulation of the avatars on a case-by-case basis (IE - if the image is greater than 64x64, resize it and substitute in the stored version, but if not, then just link it). That's entirely too much of a headache, so we just block everything that's too big.

To block stuff you have to add some extra validation lines in includes/usercp_avatar.php which fetch the image, check its dimensions/filesize, and then act accordingly. If you're nice, you'll probably also need to add some additional error messages to your lang_main.php file so that you can tell the user more about why you're rejecting his/her avatar.
_________________

Sentient Mode is capable...
Back to top
View users profile Send private message Visit posters website AOL Instant Messenger Xbox Live Gamertag
Kilgamayan
Trick Member
Trick Member


Joined: 04 May 2005
Location: lol internet
3. PostPosted: Tue Jun 14, 2005 12:46 pm    Post subject: Reply with quote

Can we use that same coding idea to block certain file sizes as well?
_________________
Back to top
View users profile Send private message Visit posters website AOL Instant Messenger
Cutriss
Staff Member
Staff Member


Joined: 24 Jan 2002
4. PostPosted: Tue Jun 14, 2005 3:48 pm    Post subject: Reply with quote

Pretty much.

Assuming you're familiar enough with PHP to muck around with the code yourself, I think there's a fairly straight-forward piece of code when you look up the fsockopen and fgets methods which illustrates how to do it.

EDIT: Ah - here's the page I was thinking of, I think.

What I did was to "borrow" the phpBB config variable which controls the maximum filesize for uploaded avatars. Since we have no plan to ever host user avatars via phpBB, and even if we did, I'm sure the filesize restrictions would be the same, I can safely use that as a dynamic control to dictate the filesize restriction, instead of hardcoding a particular size in the routine in usercp_avatar.php.
_________________

Sentient Mode is capable...
Back to top
View users profile Send private message Visit posters website AOL Instant Messenger Xbox Live Gamertag
Spectere
Trick Member
Trick Member


Joined: 23 Jan 2004
5. PostPosted: Tue Jun 14, 2005 8:58 pm    Post subject: Reply with quote

Thanks for the run-down, Cutriss. I'll give coding that a shot...if I have any problems you can count on me being back to bug you guys again. XD
Back to top
View users profile Send private message
Display posts from previous:   
This topic is locked you cannot edit posts or make replies    DDR Freak Forum Index -> Site Feedback All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2 © 2001, 2002 phpBB Group