vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   How to redo your vBulletin 3.5.0 Navbar in Four Easy Steps! (https://vborg.vbsupport.ru/showthread.php?t=91624)

LWillmann 01-29-2006 09:02 PM

Cludrunner, thanks for this! I really like it.

I had an issue with the stock no_avatar.gif file being smaller than the size you specified in the .xml file, and it doesn't stretch very well, so I wrote something to work with avatars that are a different size.

This code change will resize the avatar proportionally if either dimension larger than the set size (I left it set to 100x100), or if it's equal to the set size or smaller, it will use the set size.

To adjust your script to make this work do this:

1) Go to your Admin Control Panel
2) Go to the Plugin manager
3) Choose to edit the Navbar Redux plugin.

Find this code:
PHP Code:

$av_url fetch_avatar_url($vbulletin->userinfo['userid']); 
    if (!
$av_url){ 
        
$av_url $stylevar['imgdir_misc'] . '/noavatar.gif'
    } else { 
        
$av_url $vbulletin->options['bburl'] . '/' $av_url[0]; 
    } 
    
$nav_av_image '<img width="100" height="100" src="'.$av_url.'" border="0">'

And replace it with this:
PHP Code:

$av_url fetch_avatar_url($vbulletin->userinfo['userid']); 
    if (!
$av_url){ 
        
$av_url $stylevar['imgdir_misc'] . '/noavatar.gif'
    } else { 
        
$av_url $vbulletin->options['bburl'] . '/' $av_url[0]; 
    } 
    
$av_size GetImageSize($av_url);
    
$max_av_disp_height '100';
    
$max_av_disp_width '100';
    if (
$max_av_disp_width $av_size[0])
    {
    
$av_disp_width $av_size[0]/$max_av_disp_width;
    
$av_disp_height $av_size[1]/$av_disp_width;
    }
    else 
    {
    
$av_disp_width $av_size[0];
    
$av_disp_height $av_size[1];
    }
    if (
$max_av_disp_height $av_size[0])
    {
    
$av_disp_height $av_size[1]/$max_av_disp_height;
    
$av_disp_width $av_size[0]/$av_disp_height;
    }
    else 
    {
    
$av_disp_width $av_size[0];
    
$av_disp_height $av_size[1];
    }
    
$nav_av_image '<img width="'.$av_disp_width.'" height="'.$av_disp_height.'" src="'.$av_url.'" border="0">'

This should make the avatar display better. Editing the NAVBAR template after this would allow you to specify that particular cell in the table to be horizontally and vertically centered so that the avatar was centered in the block opening if the Welcome panel is talled than the avatar.

Thanks again!

*Clicks Install


All times are GMT. The time now is 09:43 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01074 seconds
  • Memory Usage 1,731KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete