Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-05-2012, 06:18 PM
nBm nBm is offline
 
Join Date: Mar 2009
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Resize a image included in a raw

Hi guys,
I've got a problem. I uploaded in my forum a plugin for use the avatar variable ({vb:raw cus_avatar}) in headinclude template, but i want that the image will be resized in 100x100, whatever the size.
The script is this:
PHP Code:
if ($vbulletin->userinfo['userid']) 
{ 
    require_once('./includes/functions_user.php'); 
    $avatar_url = fetch_avatar_url($vbulletin->userinfo['userid']); 

  $avatar = $avatar_url[0]; 
  $cus_avatar = '<a href="profile.php?do=editavatar"><img src="'.$avatar.'" border="0" alt="" /></a>'; 

  $templater = vB_Template::create('headinclude'); 
  $templater->register('cus_avatar', $cus_avatar); 
  vB_Template::preRegister('headinclude',array('cus_avatar' => $cus_avatar)); 
  $templater->render(); 
} 
I tried to use spans or divs, but in vain.
There is a method for insert into the php code the image resizing?
Thanks
Reply With Quote
  #2  
Old 11-06-2012, 01:03 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Maybe try adding width="100" height="100" to the image tag.
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 01:07 AM.


Powered by vBulletin® Version 3.9.0
Copyright ©2000 - 2017, vBulletin Solutions Inc.