vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=134)
-   -   [RC2] Hackless avatar on homepage (https://vborg.vbsupport.ru/showthread.php?t=88278)

Brad 01-08-2004 10:00 PM

[RC2] Hackless avatar on homepage
 
This is a update of my template modification for vB 2, with this modification installed your avatar will be displayed on index.php. This can be useful for welcome panels and other similar template modifications.

Yes im aware Tungsten as done for for vBulletin 3 beta, and this is no reflection on him but his code dose alot of database work to pull the avatar, mine will only run one query.

Credits:
Chen - vB 2 hack author and idea
Tungsten - updated this modification to vB 3 beta

O and me ;)

albibak 01-09-2004 10:08 AM

I've installed it, and it works, good :)

imported_Blackbeard 01-09-2004 05:16 PM

Any chance of a screenie in vb3

Zachery 01-12-2004 08:26 AM

might also want to make that


if (THIS_SCRIPT == 'index' AND $bbuserinfo[userid] != 0)

that way unregisted users wont run into it :)

Freddie Bingham 01-12-2004 01:43 PM

If you put this in config.php, you can do this with no added queries:

define('AVATAR_ON_NAVBAR', 1);

M1th 01-14-2004 08:02 PM

Quote:

Originally Posted by freddie
If you put this in config.php, you can do this with no added queries:

define('AVATAR_ON_NAVBAR', 1);


Hmm, how would you get the avatar to show up?

I've tried $userinfo[avatarurl] and $bbuserinfo[avatarurl], non seem to work for me. :/

M1th 01-15-2004 01:56 PM

Actually, nevermind.. figured it out (thanks to Kura):


Code:

<img src="image.php?$session[sessionurl]u=$bbuserinfo[userid]&amp;dateline=$bbuserinfo[avatardateline]" title="$bbuserinfo[username]'s Avatar" alt="Avatar" border="0" />

gmarik 02-03-2004 02:28 PM

good simple things

Brad 02-23-2004 08:55 PM

Quote:

Originally Posted by Faranth
might also want to make that


if (THIS_SCRIPT == 'index' AND $bbuserinfo[userid] != 0)

that way unregisted users wont run into it :)

This takes care of that:

PHP Code:

    if ($bbuserinfo['userid'])
    { 


Dan 02-23-2004 09:09 PM

Interesting mod I'm probably going to use this when I make a new welcome panel for my sites

Vb-Hispano 02-28-2004 06:41 PM

installed ;)

Vb-Hispano 02-29-2004 11:59 AM

Quote:

Originally Posted by M1th
Actually, nevermind.. figured it out (thanks to Kura):


Code:

<img src="image.php?$session[sessionurl]u=$bbuserinfo[userid]&amp;dateline=$bbuserinfo[avatardateline]" title="$bbuserinfo[username]'s Avatar" alt="Avatar" border="0" />

ADD

width="64" height="64"

Code:

<img src="image.php?$session[sessionurl]u=$bbuserinfo[userid]&amp;dateline=$bbuserinfo[avatardateline]" title="$bbuserinfo[username]'s Avatar" alt="Avatar" border="0" width="64" height="64" />
and with thist it will be better

64 x 64

Arkham 03-09-2004 10:35 PM

Hmmm...

I put it in the navbar template, but now it only shows up on forumhome. It's missing from deeper pages. Could someone suggest a way to fix this?

I added freddie's config.php suggestion, too.


EDIT - fixed

Great thanks to Vb-Hispano -- His replacement string solved the problem.


imported_kyrnel 03-22-2004 06:03 PM

Quote:

Originally Posted by freddie
If you put this in config.php, you can do this with no added queries:

define('AVATAR_ON_NAVBAR', 1);

How do you put htis code in config.php? Are you sure you didnt mean a different file?

I'm trying to reduce the number of queries being run for Forum Home. So I need to figure this one out. Thx

Arkham 03-22-2004 06:04 PM

Quote:

Originally Posted by kyrnel
How do you put htis code in config.php? Are you sure you didnt mean a different file?

I'm trying to reduce the number of queries being run for Forum Home. So I need to figure this one out. Thx

You have to (download then) edit config.php with a text editor and then re-upload the file to your server.

imported_kyrnel 03-22-2004 06:50 PM

Quote:

Originally Posted by Arkham
You have to (download then) edit config.php with a text editor and then re-upload the file to your server.

I'm sorry, what I meant was that I have never seen a hack that required you to edit that specific file (config.php). I was under the impression that you should never edit it.

Also, there is no code in that file that seems similar to the code he suggested adding. It only contains the basic variables for connecting to the mysql database.

I see Define() statements in index.php and global.php but not in config.php...

Arkham 03-22-2004 07:35 PM

Quote:

Originally Posted by kyrnel
I'm sorry, what I meant was that I have never seen a hack that required you to edit that specific file (config.php). I was under the impression that you should never edit it.

Also, there is no code in that file that seems similar to the code he suggested adding. It only contains the basic variables for connecting to the mysql database.

I see Define() statements in index.php and global.php but not in config.php...

I know what you mean. I had no idea, so I just added add Freddie's suggestion to the bottom of config.php.

LImburg 09-01-2004 07:41 PM

Quote:

Originally Posted by Arkham
Hmmm...

I put it in the navbar template, but now it only shows up on forumhome. It's missing from deeper pages. Could someone suggest a way to fix this?

I added freddie's config.php suggestion, too.


EDIT - fixed


[/color][/size]


Fixed?
How?

I've been trying to figure this out for a good day.. but I can't figure out how to get the avatar displayed on the deeper pages.

Just like it doesn't call the function.

I put the code in the phpinclude_start template

and the html in the header template...

Can anyone help me out?

Erwin 09-01-2004 11:50 PM

Quote:

Originally Posted by freddie
If you put this in config.php, you can do this with no added queries:

define('AVATAR_ON_NAVBAR', 1);

That's too cool.

Erwin 09-06-2004 07:19 AM

Good point - if you have avatars as files, what is the variable to use for the avatar to show up?

M1th 09-09-2004 01:49 PM

Quote:

Originally Posted by Erwin
Good point - if you have avatars as files, what is the variable to use for the avatar to show up?


Here's what I use on my site and it works. :)

HTML Code:

<if condition="$bbuserinfo['hascustomavatar']">
<a href="profile.php?do=editavatar">
<img src="$vboptions[avatarurl]/avatar$bbuserinfo[userid]_$bbuserinfo[avatarrevision].gif" title="$bbuserinfo[username]'s Avatar" alt="Avatar" border="0" /></a>
</if>


Erwin 09-10-2004 12:17 AM

I knew about that. :) What about if the person does not have a custom avatar though. Freddie's suggestion intrigued me...

Erwin 09-10-2004 12:43 AM

Post removed.

AngelGrove 10-04-2004 05:58 PM

I installed this, put it in the Right Sided Collum mod, working on a lil User Stats section, long way to go though, thanks for the mod. Clicks insatll

djjeffa 10-07-2004 02:11 AM

Quote:

Originally Posted by Vb-Hispano
ADD

width="64" height="64"

Code:

<img src="image.php?$session[sessionurl]u=$bbuserinfo[userid]&amp;dateline=$bbuserinfo[avatardateline]" title="$bbuserinfo[username]'s Avatar" alt="Avatar" border="0" width="64" height="64" />
and with thist it will be better

64 x 64

I am tring to put this where he did but im totaly clueless

peterska2 10-07-2004 07:30 AM

Thats in the NAVBAR template within the 'welcome panel'

djjeffa 10-07-2004 11:50 PM

got it to work but only on the home page is there any way to make it work on all?

djjeffa 11-01-2004 10:43 AM

Quote:

Originally Posted by djjeffa
got it to work but only on the home page is there any way to make it work on all?

bump!!!!

Brad 11-01-2004 12:04 PM

Change the code you added to phpinclude_start to this:

PHP Code:

// Brad's avatar on homepage modification
    
if ($bbuserinfo['userid'])
    {
    require_once(
'./includes/functions_user.php');
    
// note: the function below will run one query
    
$homepage_ava fetch_avatar_url($bbuserinfo['userid']);
    }
// end avatar modification 

Note this will run a query EVERY pageload.

Bison 12-10-2004 06:43 PM

Quote:

Originally Posted by Vb-Hispano
ADD

width="64" height="64"

Code:

<img src="image.php?$session[sessionurl]u=$bbuserinfo[userid]&amp;dateline=$bbuserinfo[avatardateline]" title="$bbuserinfo[username]'s Avatar" alt="Avatar" border="0" width="64" height="64" />
and with thist it will be better

64 x 64

What template did you edit to place that avatar where it is?


All times are GMT. The time now is 08:24 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.01294 seconds
  • Memory Usage 1,811KB
  • 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
  • (5)bbcode_code_printable
  • (1)bbcode_html_printable
  • (2)bbcode_php_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (30)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete