Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 19 Jul 2012, 19:08
m002.p's Avatar
m002.p m002.p is offline
 
Join Date: Jan 2007
Real name: Matt
Avatar Resizing

Hi guys,

Have a weird one here but I want to resize an avatar displayed using %. However, when doing it with the below method the image does not display.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

So, if this cant be solved, I was hoping it could be done with an edit to image.php allowing the use of height & width. For example:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Any ideas how I can get either to work?

Matt
__________________
www.sog-team.co.uk
Reply With Quote
  #2  
Old 19 Jul 2012, 21:06
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
It seems to me like the first code you posted works. I'm not an html expert, but I think 30% could mean a different thing depending on where you put the code. Also, if a user has no avatar the image will be blank.
Reply With Quote
  #3  
Old 19 Jul 2012, 21:28
m002.p's Avatar
m002.p m002.p is offline
 
Join Date: Jan 2007
Real name: Matt
Hi,

Thanks for your reply.

The code is used in a template on the forumhome.

The image with the first code simply does not show whereas change it to a pixel ie. width="200" works. It seems to be a problem with the percentage for the img tag.
__________________
www.sog-team.co.uk
Reply With Quote
  #4  
Old 20 Jul 2012, 00:13
peterska2 peterska2 is offline
 
Join Date: Oct 2003
Real name: Kerry-Anne (really!)
Originally Posted by m002.p View Post
Hi guys,

Have a weird one here but I want to resize an avatar displayed using %. However, when doing it with the below method the image does not display.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

So, if this cant be solved, I was hoping it could be done with an edit to image.php allowing the use of height & width. For example:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Any ideas how I can get either to work?

Matt
I don't see any reason why the first one wouldn't work, but IIRC percentages and divs don't tend to play nice so might need to stick a single cell table in there. You shouldn't have { and } in vB3 templates either.

Try


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Should do the trick if memory serves me correctly

Of course, this is working on the assumption that you already have the avatar displaying on forumhome without any resizing taking place.
__________________
Kerry-Anne
Previously known as peterska2

My Sites: peterska2.co.uk Super Clickers World News Zone English Football League Popular Usenet Groups
Do NOT PM or email me for Support or Modification Requests - No Exceptions!!
I do NOT do custom requests. Do not ask for them. - No Exceptions!!
Reply With Quote
  #5  
Old 20 Jul 2012, 00:25
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Originally Posted by peterska2 View Post
...You shouldn't have { and } in vB3 templates either.
The curly braces are php "complex syntax", it allows you to use more "complex" variables in a string, like an array element with the key in quotes.
Reply With Quote
  #6  
Old 20 Jul 2012, 00:29
peterska2 peterska2 is offline
 
Join Date: Oct 2003
Real name: Kerry-Anne (really!)
Originally Posted by kh99 View Post
The curly braces are php "complex syntax", it allows you to use more "complex" variables in a string, like an array element with the key in quotes.
Yes, they are but they still don't belong there in this case
__________________
Kerry-Anne
Previously known as peterska2

My Sites: peterska2.co.uk Super Clickers World News Zone English Football League Popular Usenet Groups
Do NOT PM or email me for Support or Modification Requests - No Exceptions!!
I do NOT do custom requests. Do not ask for them. - No Exceptions!!
Reply With Quote
  #7  
Old 20 Jul 2012, 00:50
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Originally Posted by peterska2 View Post
Yes, they are but they still don't belong there in this case
Not to make a big deal out of it, but I disagree - they "belong" there in the original code because there are quotes around the array key and it wouldn't work without the curly braces. You can remove the quotes as you did, but it doesn't mean the original code was wrong. Also, there are some situations where there's no other way to insert a variable, such as a multi-dimension array, an object, or if adjacent characters in the string would cause ambiguity.
Reply With Quote
  #8  
Old 20 Jul 2012, 08:58
m002.p's Avatar
m002.p m002.p is offline
 
Join Date: Jan 2007
Real name: Matt
Sorry to say but that code doesnt work either. The avatar simply does not display...

Cant get my head round it... change the height & width to pixels and it works fine.

Furthermore, no. The avatar does not already display on the forumhome Peterska. I am adding a welcome tempate to the top of the forumhome in vb3.

My only option may be hard coding it into the image.php file?
__________________
www.sog-team.co.uk

Last edited by m002.p; 20 Jul 2012 at 09:53.
Reply With Quote
  #9  
Old 20 Jul 2012, 12:36
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Which browser are you using? Can you show us a little more of the code around where you're putting it?

I don't think changing image.php would work because it wouldn't have any way to know what "30%" meant, and even if it did you would need to call a funciton to resize the mage.
Reply With Quote
  #10  
Old 20 Jul 2012, 21:56
m002.p's Avatar
m002.p m002.p is offline
 
Join Date: Jan 2007
Real name: Matt
Yes here is the template. It is a modification of a welcome panel here on vb.org


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

You can see the code in question near the top.

Well it would sure be possible to send just the GET vars to the php file to then add the % in the variable outputs in the php code?
__________________
www.sog-team.co.uk
Reply With Quote
  #11  
Old 20 Jul 2012, 22:09
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Again, I'm not really an html person, but the <td> tag you have it inside has a width="1%", so wouldn't that make it very small? When you put in width="200" that might force it to be at least 200 pixels, but maybe the 30% of 1% is just too small to see anything?

Last edited by kh99; 20 Jul 2012 at 22:14.
Reply With Quote
  #12  
Old 20 Jul 2012, 22:37
m002.p's Avatar
m002.p m002.p is offline
 
Join Date: Jan 2007
Real name: Matt
You are absolutely right. I am so sorry..I feel like an idiot.

Thank you for your time & effort.
__________________
www.sog-team.co.uk
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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


New To Site? Need Help?

All times are GMT. The time now is 20:13.

Layout Options | Width: Wide Color: