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)

Daky 08-27-2007 07:35 PM

I have a small problem.

Can somebody help me with this?

Firefox is ok, but not IE.

My code:
[PHP]// 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=\"45\" height=\"45\" 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=\ 45\" height=\"45\" border=\"0\" />";
}
else
{
// no avatar specified
$nouseavatarchecked = HTML_CHECKED;
$avatarchecked[0] = '';
$navbaravatar = "<img src=\"" . $vbulletin->options['homeurl'] . "/$stylevarhttps://vborg.vbsupport.ru/

IE7 Not ok:
https://vborg.vbsupport.ru/

sabret00the 08-28-2007 09:01 PM

Quote:

Originally Posted by Daky (Post 1326918)
I have a small problem.

Can somebody help me with this?

Firefox is ok, but not IE.

My code:
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=\"45\" height=\"45\" 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=\ 45\" height=\"45\" border=\"0\" />";
    } 
    else
    { 
        
// no avatar specified 
        
$nouseavatarchecked HTML_CHECKED
        
$avatarchecked[0] = ''
        
$navbaravatar "<img src=\"" $vbulletin->options['homeurl'] . "/$stylevar[imgdir_misc]/noavatar.gif\" alt=\"Avatar\" width=\"45\" height=\"45\" border=\"0\" />"// "<span class=\"smallfont\">Ne postoji Avatar<br/ >Specified</span>";
    


// Avatar In NavBar 


Firefox OK:
http://www.diskusije.net/svastara/fire2.jpg

IE7 Not ok:
http://www.diskusije.net/svastara/ie1.jpg

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=\"45\" height=\"45\" 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=\"45\" height=\"45\" border=\"0\" />";
    } 
    else
    { 
        
// no avatar specified 
        
$nouseavatarchecked HTML_CHECKED
        
$avatarchecked[0] = ''
        
$navbaravatar "<img src=\"" $vbulletin->options['homeurl'] . "/$stylevar[imgdir_misc]/noavatar.gif\" alt=\"Avatar\" width=\"45\" height=\"45\" border=\"0\" />"// "<span class=\"smallfont\">Ne postoji Avatar<br/ >Specified</span>";
    


// Avatar In NavBar 


Daky 08-28-2007 09:04 PM

Thank you!
Works :)

Alibi 08-29-2007 02:08 PM

how can i make it so the <--PM LOGIN INFO--> breadcrumb and avatar all are displayed to the left side of the navabar instead of the right?

Daky 10-13-2007 01:20 PM

Hi,

What should i do to make this working in vBadvanced?

vBadvanced CMPS v3.0 RC2 is what i am using.

Thank you!

sabret00the 10-15-2007 10:20 AM

Quote:

Originally Posted by Daky (Post 1358937)
Hi,

What should i do to make this working in vBadvanced?

vBadvanced CMPS v3.0 RC2 is what i am using.

Thank you!

vBadvanced 3 RC2 came out after this. so you'll have to ask them.

lasto 10-19-2007 07:30 PM

whats the condition if someone is logged out to not show it cause if i log out i get 2 white squares and it pushes the login box off the screen.

So if i had a conditional to add to say if logged in then show it would be fine

<td class="alt1"><a href="$vboptions[bburl]/profile.php?do=editavatar">$navbaravatar</a></td>

Ive fixed it - needed to add the code inbetween logged in statement

Dannyloski 11-19-2007 03:16 PM

Has anyone figured out the problem with the Avatar not displaying in the Header within the "No Search Result" page? BTW, working perfectly with vB 3.6.8 Patch 2

yeku 01-20-2008 09:53 PM

Installed with 3.6.7 and working perfectly

FF and IE 6, work well

thanks

smooth-c 01-21-2008 08:38 PM

Anyone got this working with 3.7?

Mark.B 01-21-2008 08:39 PM

Quote:

Originally Posted by smooth-c (Post 1426154)
Anyone got this working with 3.7?

It works for me on 3.7, all I had to do when I upgraded was to redo the template edits, apart from that it carried on working with no changes.

smooth-c 01-21-2008 11:39 PM

Template edits? elaborate dood!

Cobro 01-25-2008 10:33 PM

works on vbulletin 3.6.8 thx

odln018 02-26-2008 08:04 PM

There's a rather large border around my avatars, is there a way to lessen it?

DrKNickel 02-28-2008 09:02 AM

Me too!

How can i change the border around my avatar?

Greets :)

ME STUPID!

Just change the cellpadding in the table :)

Greets

odln018 02-28-2008 08:40 PM

Here's mine, what should I change?

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=\"Your Avatar\" height=\"50\" 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[avatarurl] . "/avatar$avatar[userid]_" . $vbulletin->userinfo[avatarrevision] . ".gif" : "" . $vbulletin->options[bburl] . "/image.php?u=" . $vbulletin->userinfo['userid'] . "&amp;dateline=" . $avatar['dateline'] . "";
                $navbaravatar = "<img src=\"$navbaravatarurl\" alt=\"Your Avatar\" height=\"50\" border=\"0\" />";
        }
        else
        {
                // no avatar specified
                $nouseavatarchecked = HTML_CHECKED;
                $avatarchecked[0] = '';
                $navbaravatar = "<img src=\"" . $vbulletin->options[bburl] . "/$stylevar[imgdir_misc]/noavatar.gif\" alt=\"Your Avatar\" height=\"50\" border=\"0\" />"; // "<span class=\"smallfont\">No Avatar<br/ >Specified</span>";
        }
}
// Avatar In NavBar


Mark.B 03-15-2008 03:41 PM

I can't honestly remember exactly what edits I made...and my navbar is a bit customised anyway....but the important things are that the functionality of this hack works fine in 3.7, all that needs to be done is to reapply the template edits after the upgrade and after reverting the templates.

The important thing to remember is that there are changes to the navbar template in 3.7 close to where this hack operates. Namely, the "your notifications" functionality. But the basics and the layout is still pretty much the same.

I don't have access to a 3.6 navbar template any more so I can't elaborate much more. But it relatively easy...I'm no coder and I did it quite easily.

StarShaper 03-16-2008 02:37 AM

Tested with vB 3.7 Beta 6.

It Works! However the code has some silly parts, which should be corrected into this.

PHP Code:

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=\"\" height=\"\" border=\"0\" />"
} else { 
    
// not using a predefined avatar, check for custom 
    
if ($avatar $db->query_first("SELECT dateline, width_thumb, height_thumb 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=\"" $avatar['width_thumb'] . "\" height=\"" $avatar['height_thumb'] . "\" border=\"0\" />";
    } else { 
        
// no avatar specified 
        
$navbaravatar "<img src=\"" $vbulletin->options['bburl'] . "/$stylevar[imgdir_misc]/emptyavatar.gif\" alt=\"No Avatar\" width=\"\" height=\"\" border=\"0\" />";
    } 



Feckie (Roger) 03-16-2008 07:56 AM

If you want this to show in ibproarcade, do the following.

1: In /arcade/functions/functions.php file..

find online 1241 approx ...
PHP Code:

global $header

Add after it
PHP Code:

 $navbaravatar

Save upload and enjoy....;)

Boofo 03-16-2008 08:49 AM

Quote:

Originally Posted by Feckie (Roger) (Post 1465933)
If you want this to show in ibproarcade, do the following.

1: In /arcade/functions/functions.php file..

find online 1241 approx ...
PHP Code:

global $header

Add after it
PHP Code:

 $navbaravatar

Save upload and enjoy....;)


Or you can do as i do am do a $vbphrase[whatever] = $navbaravatar;

and use the phrase.

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 :(

Boofo 03-29-2008 03:35 AM

Quote:

Originally Posted by StarShaper (Post 1467403)
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.


Any luck on this?

dancue 03-30-2008 05:08 AM

Quote:

Originally Posted by Boofo (Post 1465956)
Or you can do as i do am do a $vbphrase[whatever] = $navbaravatar;

and use the phrase.

Can you tell me how exactly you did that? Step by step preferrably?

I haven't really worked with phrases.

Boofo 03-30-2008 05:25 AM

Quote:

Originally Posted by dancue (Post 1478094)
Can you tell me how exactly you did that? Step by step preferrably?

I haven't really worked with phrases.

Actually, it is not a real phrase. But the arcade has $vbphrase globalized so it will pick it up without having the edit the arcade.php file. I have noticed that one of the error messages will not see the avatar without doing this also, although I can't remember which one.

At the end of the plugin just add:

Quote:

$vbphrase[navbaravatar] = $navbaravatar;
making sure to use $vbphrase[navbaravatar] in place of $navbaravatar in the template. You don't have to make that phrase, as you are just using the name to accomplish this.

dancue 03-30-2008 02:10 PM

Thanks a bunch!

I'll try that later today...

Boofo 03-30-2008 02:28 PM

Let me know how it goes.

odln018 05-02-2008 04:21 PM

Is this still supported?

ePrOmD 07-22-2008 04:00 PM

hi!
I´ve being using this for a long time. Currently with the 3.7gold version without any kind of problem

my query is:
Is there any way to leave a fix dimension set for avatars? rather than take real one?
for example. avatars of 150 px leaving 72 px?

greatings from argentina!

NAZIA 09-21-2008 08:06 AM

thanks...

DF08Said 09-27-2008 11:47 AM

m8 this Doesnt work for me... its Same shit as it Was before im using vBulletin® Version 3.7.3... can u help me please?

pewa 11-12-2008 06:24 PM

One small problem:

The image link is pointing to domain.com/customavatars/avatar3_4.gif[/url] when it should be domain.com/forum/customavatars/avatar3_4.gif

Where do I fix this? I assume I have to edit the plugin but dont know how. This is what the plugin say:

Code:

$navbaravatar = "<img src=\"" . $vbulletin->options[bburl] . "/$avatar[avatarpath]\" alt=\"Your Avatar\" border=\"0\" />";
Where do I add the "/forum" ?

Update: The avatar shows on the forum page but not on the start page, I'm using vbAdvanced.


All times are GMT. The time now is 07:50 PM.

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.01839 seconds
  • Memory Usage 1,925KB
  • 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
  • (6)bbcode_code_printable
  • (8)bbcode_php_printable
  • (16)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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