vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Defining Avatars for different user ids for memberinfo (https://vborg.vbsupport.ru/showthread.php?t=316186)

DJ-Dez 12-24-2014 12:23 AM

Defining Avatars for different user ids for memberinfo
 
Hey guys,

Merry Christmas everyone.

UPDATE:

Trying a different way. In MEMBERINFO I'm using:

<img src="{vb:raw avatarurl}">

In Plugin Manager I'm using:

Quote:

require_once('./includes/functions_user.php');
$avatarurl = fetch_avatar_url($vbulletin->userinfo['userid']);

vB_Template::preRegister('MEMBERINFO', array('avatarurl' => $avatarurl[0]));
But this only shows my avatar on everyones profile page. How can I define it so when I go to another users profile page it will pick their avatar up and not mine?

Still needing help please!

RichieBoy67 12-24-2014 02:11 AM

I am not sure what you mean but did you go into usergroup settings and user registration options?

MarkFL 12-24-2014 02:19 AM

Are your avatars stored in your database or in your file system?

RichieBoy67 12-24-2014 03:10 AM

Do you mean avatar instead of profile picture or neither of them show up? Did you check use reg options to enable and also usergroup permissions?

Be sure to go into maintenance and update counters after you change settings for the users.

DJ-Dez 12-24-2014 03:19 AM

Quote:

Originally Posted by MarkFL (Post 2528574)
Are your avatars stored in your database or in your file system?

file system.

I need a code to put in MEMBERINFO to take the avatar and not the profile picture, but when it does take the avatar it does it by thumbnail

MarkFL 12-24-2014 03:40 AM

A down and dirty fix would be to go to your "memberinfo_block_ministats" template, and near the bottom locate:

HTML Code:

<img src="{vb:raw prepared.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw prepared.username}}"  {vb:raw prepared.avatarsize} id="user_avatar" />
and replace it with:

HTML Code:

<img src="{vb:raw prepared.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw prepared.username}}" id="user_avatar" onload="this.src = this.src.replace(/\/thumbs/,'');" />
This will replace the src attribute of the avatar with the URL of the full-sized avatar.

DJ-Dez 12-24-2014 04:33 AM

How would I display block ministats in memberinfo?

{vb:raw blocks.ministats}

Thank you Mark and Merry Christmas :)

MarkFL 12-24-2014 04:58 AM

Quote:

Originally Posted by DJ-Dez (Post 2528581)
How would I display block ministats in memberinfo?

{vb:raw blocks.ministats}

Thank you Mark and Merry Christmas :)

I'm not real sure yet exactly what you are trying to do here. It is my understanding that the set of memberinfo templates all work together.

I am under the impression that you want a user's avatar to display on their profile page full size rather than the thumbnail version. A better solution than the one I quickly offered would be to write a plugin to fetch the user's avatar URL, and define a variable to contain it, and then register it in the correct template.

Can you elaborate on exactly what you are wanting to accomplish? :)

DJ-Dez 12-24-2014 05:19 AM

Trying a different way. In MEMBERINFO I'm using:

<img src="{vb:raw avatarurl}">

In Plugin Manager I'm using:

Quote:

require_once('./includes/functions_user.php');
$avatarurl = fetch_avatar_url($vbulletin->userinfo['userid']);

vB_Template::preRegister('MEMBERINFO', array('avatarurl' => $avatarurl[0]));
But this only shows my avatar on everyones profile page. How can I define it so when I go to another users profile page it will pick their avatar up and not mine?

Thank you

MarkFL 12-24-2014 06:30 AM

Yeah, I faced a similar issue recently but was able to hack an existing plugin which already had the userids I needed defined.

I will be interested to see how this can be done, as I am still really inexperienced with writing plugins and am trying to learn from the masters here.

One suggestion I would make to aid you in getting help more promptly would be to edit the first post, and change the title so that it briefly describes your question. ;)


All times are GMT. The time now is 04:10 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.01793 seconds
  • Memory Usage 1,739KB
  • 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
  • (2)bbcode_html_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (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