vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   I want the avatar url (https://vborg.vbsupport.ru/showthread.php?t=324036)

SilverBoy 12-17-2016 07:01 PM

I want the avatar url
 
Hi

I have a plugin which is grab the avatar url for CMS articles, I don't know why, the plugin give me the Thump link not the actual link, so what do you suggest?
here is the code

PHP Code:

require_once(DIR '/includes/functions_user.php');
$avatarurl fetch_avatar_url($view->authoridtrue);
if (
$avatarurl[0]) {
     
$avatarurl $avatarurl[0];
}
/* render template and register variables */

$view->avatarurl $avatarurl

Thanks in advance.

Lynne 12-17-2016 08:33 PM

You may want to have a link to the api - https://members.vbulletin.com/api/

According that that, you want to change true to false in the fetch_avatar_url function . True gives the thumbnail, false does not.

SilverBoy 12-17-2016 11:47 PM

Thank you Lynne
Actually I don't know how to use the api.
and in function fetch_avatar_url the default value for thump=false !!
btw I changed this line in this function
PHP Code:

$avatarurl[] = $vbulletin->options['avatarurl'] . ($thumb '/thumbs' '') . "/avatar{$userid}_{$avatarinfo['avatarrevision']}.gif"

by removing thump stuff !!
PHP Code:

$avatarurl[] = $vbulletin->options['avatarurl'] .  "/avatar{$userid}_{$avatarinfo['avatarrevision']}.gif"

Now it works like I want, but I'm worry if this change affect any avatar existing in the forum, because I want the full size only in the CMS articles.
Thanks.

Lynne 12-18-2016 04:41 PM

Quote:

Originally Posted by SilverBoy (Post 2579570)
Thank you Lynne
Actually I don't know how to use the api.
and in function fetch_avatar_url the default value for thump=false !!

I know it's default is false, but you set it to true here:
PHP Code:

$avatarurl fetch_avatar_url($view->authoridtrue); 

So, either set it to false or remove the comma and true and let it default to false.
PHP Code:

$avatarurl fetch_avatar_url($view->authorid); 


SilverBoy 12-18-2016 06:51 PM

Thank you, I will give it a try :)

--------------- Added [DATE]1482095034[/DATE] at [TIME]1482095034[/TIME] ---------------

It works great, thanks Lynne :)


All times are GMT. The time now is 05:11 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.00997 seconds
  • Memory Usage 1,732KB
  • 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_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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