vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Custom Avatars as Files (updated for vBulletin 2.2.2) (https://vborg.vbsupport.ru/showthread.php?t=11760)

jucs 05-26-2001 12:45 AM

What does Read to re-tweak mean?

jucs 05-27-2001 12:46 PM

Answer Sven and my questions? Thanks.

Sven 05-27-2001 02:13 PM

So here's a bit of the problem:
admin/functions.php as per instructions:
PHP Code:

function getavatarurl($userid) {
  global 
$DB_site,$session;

  if (
$avatarinfo=$DB_site->query_first("SELECT user.avatarid,avatarpath,NOT ISNULL(avatardata) AS hascustom FROM user LEFT JOIN avatar ON avatar.avatarid=user.avatarid LEFT JOIN customavatar ON customavatar.userid=user.userid WHERE user.userid='$userid'")) {
    if (
$avatarinfo[avatarpath]!="") {
      return 
$avatarinfo[avatarpath];
    } else if (
$avatarinfo['hascustom']) {
      return 
"avatar.php?s=$session[sessionhash]&userid=$userid"


admin/functions.php in vB2.0.0 Final Release:
PHP Code:

function getavatarurl($userid) {
  global 
$DB_site,$session;

  if (
$avatarinfo=$DB_site->query_first("SELECT user.avatarid,avatarpath,NOT ISNULL(avatardata) AS hascustom,customavatar.dateline
                                         FROM user
                                         LEFT JOIN avatar ON avatar.avatarid=user.avatarid
                                         LEFT JOIN customavatar ON customavatar.userid=user.userid
                                         WHERE user.userid='
$userid'")) {
    if (
$avatarinfo[avatarpath]!="") {
      return 
$avatarinfo[avatarpath];
    } else if (
$avatarinfo['hascustom']) {
      return 
"avatar.php?userid=$userid&dateline=$avatarinfo[dateline]";
    } else {
      return 
'';
    }
  }


You see that tiny differences?
So is there anyone out there who could tell me what to do?

nuno 05-27-2001 02:59 PM

tx Kier
works with 2.0.0 release also

functions.php

find:

PHP Code:

function getavatarurl($userid) {
  global 
$DB_site,$session;

  if (
$avatarinfo=$DB_site->query_first("SELECT user.avatarid,avatarpath,NOT ISNULL(avatardata) AS hascustom,customavatar.dateline
                                         FROM user
                                         LEFT JOIN avatar ON avatar.avatarid=user.avatarid
                                         LEFT JOIN customavatar ON customavatar.userid=user.userid
                                         WHERE user.userid='
$userid'")) {
    if (
$avatarinfo[avatarpath]!="") {
      return 
$avatarinfo[avatarpath];
    } else if (
$avatarinfo['hascustom']) {
      return 
"avatar.php?userid=$userid&dateline=$avatarinfo[dateline]";
    } else {
      return 
'';
    }
  }


replace with:

PHP Code:

function getavatarurl($userid) {
  global 
$DB_site,$session,$usefileavatar;


  if (
$avatarinfo=$DB_site->query_first("SELECT user.avatarid,avatarpath,avatarrevision,NOT ISNULL(avatardata) AS hascustom,customavatar.dateline
                                         FROM user
                                         LEFT JOIN avatar ON avatar.avatarid=user.avatarid
                                         LEFT JOIN customavatar ON customavatar.userid=user.userid
                                         WHERE user.userid='
$userid'")) {
    if (
$avatarinfo[avatarpath]!="") {
      return 
$avatarinfo[avatarpath];
    if (
$usefileavatar) return "custom_avatars/avatar$userid"."_$avatarinfo[avatarrevision].gif";
            else return 
"avatar.php?userid=$userid";
    }
  }



Freddie Bingham 05-27-2001 03:01 PM

sven the code looks the same .. it just appears I got to it and broke the sql up into multiple lines which I have a habit of doing.

Wayne Luke 05-28-2001 05:10 AM

Quote:

Originally posted by freddie
sven the code looks the same .. it just appears I got to it and broke the sql up into multiple lines which I have a habit of doing.
Only because it is a lot easier to read and comprehend.

jucs 05-28-2001 03:26 PM

The code replace for announcement.php is incorrect?? I can only find this:

if ($post[hascustomavatar] and $avatarenabled) {
$avatarurl="avatar.php?userid=$post[userid]&dateline=$post[avatardateline]";

Note it is different from this in the instructions:

if ($post[hascustomavatar] and $avatarenabled) {
$avatarurl="avatar.php?s=$session[sessionhash]&userid=$post[userid]";

What gives? I have final 2.0.

Sven 05-28-2001 03:31 PM

Well, that's almost the same question I have.... what about the
&dateline=$post[avatardateline]" thing?
Do I have to add this at the appropriate places or is it not mandatory?

I got the Avatar_as_files option working on my local testinstallation with the replacements from the instructions but I'm not sure if I can use this on the production environment w/o causing bugs due to the changes.

jucs 05-28-2001 03:46 PM

I just started with that file...are there any more of these discrepencies?

Sven 05-28-2001 06:45 PM

@jucs:

I edited all of the files now to add the "dateline"...
It's in all files but member.php, in most of them you just need to add the
&dateline=$post[avatardateline]"

but in user.php it's different, take care of that one!

In my local installation it seems to work - after I changed the files ;)


All times are GMT. The time now is 01:03 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.01292 seconds
  • Memory Usage 1,766KB
  • 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
  • (4)bbcode_php_printable
  • (1)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