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)
-   -   Avatar On Navbar (https://vborg.vbsupport.ru/showthread.php?t=99498)

Boofo 03-16-2008 09:13 AM

Quote:

Originally Posted by StarShaper (Post 1465810)
Tested with vB 3.7 Beta 6.

It Works! However a small change would be fine, since a fixed avatar size is not always the best.

PHP Code:

// Avatar In NavBar
if ($vbulletin->userinfo['avatarid']) 

    
// using a predefined avatar 
    
$avatar $db->query_first("SELECT avatarpath FROM " TABLE_PREFIX "avatar WHERE avatarid = " $vbulletin->userinfo[avatarid] . ""); 
    
$avatarid $avatar['avatarid']; 
    
$navbaravatar "<img src=\"" $vbulletin->options['bburl'] . "/$avatar[avatarpath]\" alt=\"Avatar\" width=\"$vbulletin->options['avwidth']\" height=\"$vbulletin->options['avheight']\" border=\"0\" />"

else 

    
// not using a predefined avatar, check for custom 
    
if ($avatar $db->query_first("SELECT dateline, userid FROM " TABLE_PREFIX "customavatar WHERE userid = " $vbulletin->userinfo[userid] . "")) 
    { 
        
// using a custom avatar 
        
$navbaravatarurl = ($vbulletin->options['usefileavatar']) ? "" $vbulletin->options['bburl'] . "/" $vbulletin->options['avatarurl'] . "/avatar$avatar[userid]_" $vbulletin->userinfo['avatarrevision'] . ".gif" "" $vbulletin->options['bburl'] . "/image.php?u=" $vbulletin->userinfo['userid'] . "&dateline=" $avatar['dateline'] . "";
        
$navbaravatar "<img src=\"$navbaravatarurl\" alt=\"Avatar\" width=\"$vbulletin->options['avwidth']\" height=\"$vbulletin->options['avheight']\" border=\"0\" />";
    } 
    else
    { 
        
// no avatar specified 
        
$nouseavatarchecked HTML_CHECKED
        
$avatarchecked[0] = ''
        
$navbaravatar "<img src=\"" $vbulletin->options['homeurl'] . "/$stylevar[imgdir_misc]/emptyavatar.gif\" alt=\"Avatar\" width=\"$vbulletin->options['avwidth']\" height=\"$vbulletin->options['avheight']\" border=\"0\" />"// "<span class=\"smallfont\">No Avatar<br/ >specified</span>";
    


// Avatar In NavBar 


Doesn't work with customavatars.

StarShaper 03-16-2008 03:10 PM

Quote:

Originally Posted by Boofo (Post 1465968)
Doesn't work with customavatars.

What do you mean with "customavatars"?

Boofo 03-16-2008 03:31 PM

Uploaded Avatars. But I found a better way to do it with the fetch_avatar_url and 2 lines of code. ;)

StarShaper 03-16-2008 05:03 PM

Quote:

Originally Posted by Boofo (Post 1466211)
Uploaded Avatars.

I don't get it. This plugin works with uploaded Avatars.

Boofo 03-16-2008 05:48 PM

Not for me it didn't.

HP10T 03-17-2008 03:45 AM

Hrmm can't seem to get it to work with 3.5. Added with plugin system and added code like instructions said but nothing even shows an error :/

StarShaper 03-17-2008 04:11 PM

Quote:

Originally Posted by Boofo (Post 1466328)
Not for me it didn't.

Where did you store your custom avatars? Filesystem or database?

Quote:

Originally Posted by HP10T (Post 1466721)
Hrmm can't seem to get it to work with 3.5. Added with plugin system and added code like instructions said but nothing even shows an error

I only tested it with vbulletin 3.7 Beta 6.

However it should work with 3.5 too. What is displayed in the html source? Please post the complete URL.

For example:

Code:

<a href="http://www.domain.com/forum/profile.php?do=editavatar"><img title="Avatar" src="http://www.domain.com/forum/image.php?u=1&amp;dateline=1205271990" alt="Avatar" border="0" height="80" width="80"></a>

Boofo 03-17-2008 09:24 PM

Quote:

Originally Posted by StarShaper (Post 1467115)
Where did you store your custom avatars? Filesystem or database?

Filesystem.

StarShaper 03-17-2008 09:49 PM

Quote:

Originally Posted by Boofo (Post 1467381)
Filesystem.

Ok, I already thought that it might has something to do with the storage. I'm using the database for avatars.

It's been a while since I looked through the vB Codebase. However, this line is not correct:

Code:

"" . $vbulletin->options['bburl'] . "/" . $vbulletin->options['avatarurl'] . "/avatar$avatar[userid]_" . $vbulletin->userinfo['avatarrevision'] . ".gif"
I will check this in the next days and post a correct solution.

HP10T 03-29-2008 03:22 AM

Quote:

Originally Posted by StarShaper (Post 1467115)
Where did you store your custom avatars? Filesystem or database?



I only tested it with vbulletin 3.7 Beta 6.

However it should work with 3.5 too. What is displayed in the html source? Please post the complete URL.

For example:

Code:

<a href="http://www.domain.com/forum/profile.php?do=editavatar"><img title="Avatar" src="http://www.domain.com/forum/image.php?u=1&amp;dateline=1205271990" alt="Avatar" border="0" height="80" width="80"></a>

What html source arey ou talking about? I am not sure where you got the above :(


All times are GMT. The time now is 11:47 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.01380 seconds
  • Memory Usage 1,767KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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