The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
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. Code:
<a href="profile.php?{$session[sessionurl]}do=editavatar"><img src="/forum/image.php?u={$bbuserinfo['userid']}" width="30%" height="30%"></a> Code:
/image.php?u=45&height=30%&width=30% Matt |
#2
|
|||
|
|||
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.
|
#3
|
||||
|
||||
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. |
#4
|
|||
|
|||
Quote:
Try Code:
<table border="0" cellpadding="0" cellspacing="0"><tr><td><a href="profile.php?$session[sessionurl]do=editavatar"><img src="/forum/image.php?u=$bbuserinfo[userid]" width="30%" height="30%"></a></td></tr></table> Of course, this is working on the assumption that you already have the avatar displaying on forumhome without any resizing taking place. |
#5
|
|||
|
|||
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.
|
#6
|
|||
|
|||
Yes, they are but they still don't belong there in this case
|
#7
|
|||
|
|||
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.
|
#8
|
||||
|
||||
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? |
#9
|
|||
|
|||
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. |
#10
|
||||
|
||||
Yes here is the template. It is a modification of a welcome panel here on vb.org
Code:
<if condition="$vbulletin->options['onoff']"> <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center"> <tr> <td class="tcat" colspan="3" align="left"> <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_welcomepanel')"><img id="collapseimg_forumhome_welcomepanel" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_welcome_panel].gif" alt="" border="0" /></a> <phrase 1="{$bbuserinfo['username']}">$vbphrase[wp_welcomeback]</phrase> </td> </tr> <tbody id="collapseobj_forumhome_welcomepanel" style="$vbcollapse[collapseobj_forumhome_welcomepanel]"> <tr> <td class="alt1" align="center" width="1%"> <table border="0" cellpadding="0" cellspacing="0"><tr><td><a href="profile.php?$session[sessionurl]do=editavatar"><img src="/forum/image.php?u=$bbuserinfo[userid]" width="30%" height="30%"></a></td></tr></table> </td> <td width="50%" class="alt2" align="$stylevar[left]" valign="top"> <phrase 1="{$bbuserinfo['newposts']}" 2="{$bbuserinfo['newthreads']}" 3="{$bbuserinfo['lastvisit']}" 4="$timenow" 5="$datenow" 6="{$bbuserinfo['pmunread']}" 7="{$wp['newpostsplural']}" 8="{$wp['newthreadsplural']}">$vbphrase[wp_unread]</phrase> <if condition="$vbulletin->options['rules']"> <br /><br /> <phrase 1="$vboptions[ruleid]">$vbphrase[wp_rules]</phrase> </if> <if condition="$vbulletin->options['showlatestannouncement']"> <br /><if condition="!$vbulletin->options['rules']"><br /></if> <table border="0"><tr><td><img src="/forum/images/icons/icon4.gif"></td> <td> <phrase 1="$wp_forum_title" 2="$wp_latest_a_link" 3="$wp_latest_a_title">$vbphrase[wp_latestannouncement]</phrase> </td> </tr> </table> </if> </td> <td width="50%" class="alt1" align="$stylevar[left]" valign="top"> <phrase 1="{$bbuserinfo['posts']}" 2="$wp_user_thread_count" 3="{$bbuserinfo['postsperday']}" 4="{$bbuserinfo['postpercent']}">$vbphrase[wp_user_stats]</phrase> <if condition="$bbuserinfo[active]"> <b>»</b> $vbphrase[wp_activity] <a href="forumdisplay.php?{$session[sessionurl]}f={$bbuserinfo[active][0][forumid]}">{$bbuserinfo[active][0][title]}</a> $vbphrase[wp_activity2] <b>{$bbuserinfo[active][1]}</b> $vbphrase[wp_activity3].<br /> <else /> $vbphrase[wp_activity] <i>N/A</i><br /> </if> <!--BEGIN VB STATUS--> <if condition="$vbulletin->options['vbstatus_active']"> <if condition="$bbuserinfo[vbstatus_status]"> <font size="1">$bbuserinfo[musername] {$vbulletin->options['vbstatus_statusprefix']}</font> <em id="vbstatus_$bbuserinfo[userid]"> <font size="1"><i>$bbuserinfo[vbstatus_status]</i></font> <if condition="$bbuserinfo['userid']==$userinfo['userid'] OR is_member_of($bbuserinfo, 9, 10, 11)"> <a href="javascript:Att_Ajax('userid=$bbuserinfo[userid]&postid=$bbuserinfo[userid]','vbstatus/vbstatus_ajax.php')"><font size="1">Edit</font></a> </if> </em> <else /> <if condition="$bbuserinfo['userid']==$bbuserinfo['userid']"> <br /><br /><a href="javascript:Att_Ajax('userid=$bbuserinfo[userid]&postid=$bbuserinfo[userid]','vbstatus/vbstatus_ajax.php')"><font size="1">Add New Status</font></a> </if> </if> </if> <!--END VB STATUS--> <br /><br /> </td> </tr> </tbody> </table> <br /> </if> 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? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|