Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by LanciaStratos LanciaStratos is offline
Developer Last Online: Oct 2013 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 12-13-2001 Last Update: Never Installs: 0
 
No support by the author.

I'm trying to create a hack which displays member's avatars in memberlist.php. So, in memberlist.php, where it says this...
PHP Code:
    if ($userinfo[receivepm]) {
      eval(
"\$userinfo[pmlink] = \"".gettemplate("postbit_sendpm")."\";");
    } else {
      
$userinfo[pmlink] = " ";
    }

    eval(
"\$userinfo[profile] = \"".gettemplate("postbit_profile")."\";"); 
...I changed it to this...
PHP Code:
    if ($userinfo[receivepm]) {
      eval(
"\$userinfo[pmlink] = \"".gettemplate("postbit_sendpm")."\";");
    } else {
      
$userinfo[pmlink] = " ";
    }

    if (
$userinfo[avatar]) {
      eval(
"\$userinfo[avatar] = \"".gettemplate("postbit_avatar")."\";");
    } else {
      
$userinfo[avatar] = " ";
    }

    eval(
"\$userinfo[profile] = \"".gettemplate("postbit_profile")."\";"); 
After I uploaded the new memberlist.php, I edited my memberlistbit template, and stuck $userinfo[avatar] where I wanted the avatar to show up. But, nothing happened! Can anyone show me what I did wrong here? :stupid:

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 12-14-2001, 10:38 AM
Gimp Gimp is offline
 
Join Date: Nov 2001
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm im not sure why but maybe try to use a variable w/o array
ie $avatar
and are u sure $userinfo[avatar] is actually the avatar?

try this:
PHP Code:
$theavatar=getavatarurl($bbuserinfo[userid]);

if (
$theavatar!='') {
      eval(
"\$userinfo[avatar] = \"".gettemplate("postbit_avatar")."\";");
    } else {
      
$theavatar " ";
    }

    eval(
"\$userinfo[profile] = \"".gettemplate("postbit_profile")."\";"); 
Reply With Quote
  #3  
Old 12-14-2001, 10:56 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
$[high]avatarurl[/high]=getavatarurl($[high]userinfo[/high][userid]);

if ($[high]avatarurl[/high]!='') {
      eval("\$userinfo[avatar] = \"".gettemplate("postbit_avatar")."\";");
    } else {
      $[high]userinfo[avatar][/high] = " ";
    }

    eval("\$userinfo[profile] = \"".gettemplate("postbit_profile")."\";");
$bbuserinfo is the info of the user viewing the page.

And [high]avatarurl[/high] because that's what postbit_avatar uses.
Reply With Quote
  #4  
Old 12-14-2001, 11:08 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Also using getavatarurl() adds an extra query whenever its run, so in a list with lots of members the page will really slow down.

Anyway, here's how you do it.
In memberlist.php, add this:
Code:
    if ($userinfo[avatarid]!=0) {
      $avatarurl=$userinfo[avatarpath];
    } else {
      if ($userinfo[hascustomavatar] and $avatarenabled) {
        $avatarurl="avatar.php?userid=$userinfo[userid]&dateline=$userinfo[avatardateline]";
      } else {
        $avatarurl="";
      }
    }
    if ($avatarurl=="" or ($bbuserinfo[userid]>0 and !($bbuserinfo[showavatars]))) {
      $userinfo[avatar]="";
    } else {
      eval("\$userinfo[avatar] = \"".gettemplate("postbit_avatar")."\";");
    }
right after this:
Code:
    if ($userinfo[homepage]!="" and $userinfo[homepage]!="http://") {
Now replace this:
Code:
  $users=$DB_site->query("SELECT *
                          FROM user,userfield
with this:
Code:
  $users=$DB_site->query("SELECT *,avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar,customavatar.dateline AS avatardateline
                          FROM user,userfield
						  LEFT JOIN avatar ON avatar.avatarid=user.avatarid
						  LEFT JOIN customavatar ON customavatar.userid=user.userid
And now place $userinfo[avatar] in the memberlist template.
Reply With Quote
  #5  
Old 12-15-2001, 02:58 PM
LanciaStratos's Avatar
LanciaStratos LanciaStratos is offline
 
Join Date: Oct 2001
Location: somewhere you're not
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh, that's perfect, FireFly! Thanks for helping out a PHP-newbie!
Reply With Quote
  #6  
Old 03-23-2002, 10:31 PM
HellRazor HellRazor is offline
 
Join Date: Mar 2002
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This doesn't seem to display custom avatars tho... can anyone post a mod that will allow this to show them?
Reply With Quote
  #7  
Old 03-23-2002, 10:41 PM
LanciaStratos's Avatar
LanciaStratos LanciaStratos is offline
 
Join Date: Oct 2001
Location: somewhere you're not
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[QUOTE]Originally posted by HellRazor
This doesn't seem to display custom avatars tho... can anyone post a mod that will allow this to show them?
Reply With Quote
  #8  
Old 04-06-2002, 12:09 AM
svoec svoec is offline
 
Join Date: Mar 2002
Location: KY
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, i'm probably going to get smacked down for asking a stupid question, but where do you put $userinfo[avatar] in the template???

Thanks :cheeky: h
Eric C
Reply With Quote
  #9  
Old 04-06-2002, 03:51 PM
LanciaStratos's Avatar
LanciaStratos LanciaStratos is offline
 
Join Date: Oct 2001
Location: somewhere you're not
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[QUOTE]Originally posted by svoec
OK, i'm probably going to get smacked down for asking a stupid question, but where do you put $userinfo[avatar] in the template???

Thanks :cheeky: h
Eric C
Reply With Quote
  #10  
Old 04-06-2002, 04:51 PM
svoec svoec is offline
 
Join Date: Mar 2002
Location: KY
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

that worked great, I was trying to edit the wrong template.

only problem is, it throws the columns off one row. Did I miss something?? or do I need to change another template??

Thanks again!
Eric C
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:37 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.04692 seconds
  • Memory Usage 2,306KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_code
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete