vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   $vbphrase question (https://vborg.vbsupport.ru/showthread.php?t=128412)

harmor19 10-10-2006 05:08 AM

Try this.

PHP Code:

<?php
require_once('./global.php');
include(
DIR '/includes/functions_user.php');

$avatar fetch_avatar_url($vbulletin->userinfo['userid'])

echo 
"<img src=$avatar alt='' border='0' />";

?>


andewy3k 10-10-2006 06:10 AM

no, this time no image shows at all.. not even a red x..

could it be because we are using php tags within html?

Adrian Schneider 10-10-2006 06:57 AM

It returns an array.... you'll need to use $avatar[0] to get the img src, and $avatar[1] (contains HTML) to get the width/height.

Code:

<img src="$avatar[0]"$avatar[1] alt="" />

andewy3k 10-10-2006 07:18 AM

still not working.. get red x

i tried

HTML Code:



<?php
require_once('./global.php');
include(DIR . '/includes/functions_user.php');

$avatar = fetch_avatar_url($vbulletin->
userinfo['userid'])

echo "<a href="usercp.php"><img src="$avatar[0]"$avatar[1] alt="Your Avatar" /></a>";

?>


then i tried


HTML Code:



<?php
require_once('./global.php');
include(DIR . '/includes/functions_user.php');

$avatar = fetch_avatar_url($vbulletin->
userinfo['userid'])

?>

<a href="usercp.php"><img src="$avatar[0]"$avatar[1] alt="Your Avatar" /></a>

any more ideas?

andewy3k 10-10-2006 07:20 AM

1 Attachment(s)
see, look at the attached image..

harmor19 10-10-2006 07:43 AM

When you say "front page" do you mean your forums' index?

andewy3k 10-10-2006 08:32 AM

yup, also known in the styles manager as "FORUMSHOME"

btw. im not using VBadvance or w/e that mod is called..

harmor19 10-10-2006 08:52 AM

1 Attachment(s)
Download the attachment and import it to your plugins.
Open up your "FORUMHOME" template and add $avatar anywhere you want.

andewy3k 10-10-2006 08:03 PM

WORKS GREAT!

but, I still need some kind of IF statement within the plugin or within the forumshome template

to check if the user has an avatar, if not .. to show a special image

if so

show their avatar..

any help is appreciated..

andewy3k 10-11-2006 08:32 PM

_______________________________________________

anyone? I need an if statement :)

Just like basically saying

If "user has avatar" then

code to pickup avatar and place within var $avatar

else

blank.gif (to show they dont have one)


All times are GMT. The time now is 06:30 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.01228 seconds
  • Memory Usage 1,737KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_html_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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