vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   extract avatar (https://vborg.vbsupport.ru/showthread.php?t=177020)

hrk 04-24-2008 10:26 AM

extract avatar
 
HI , i am running a joomla site . I would like to auto assign avatar for the user using Vb profile avatar. what is the complete code for me to use to call in these avatar?

i need this tol use this in all the other comp such as commenting system.

thanks you..

Dismounted 04-24-2008 11:16 AM

<a href="http://members.vbulletin.com/api/" target="_blank">http://members.vbulletin.com/api/</a>

See "fetch_avatar_url()".

hrk 04-26-2008 06:32 PM

thank you very much.

fetch_avatar_url (line 241)
void fetch_avatar_url (mixed $userid)

this is what it stated. how do i use it in joomla cms?
a sample or hint can help me alot to kickstart .

what i would like to add is a link to fetch the member avatar.

example : upload your images (upload box ) or click here to use your forum avatar.(once clicked avarat fetched)

this link help litlye
https://vborg.vbsupport.ru/showthread.php?t=98009

thank you.
sorry for nmake it complicated.

Dismounted 04-27-2008 05:10 AM

Include vBulletin's backend and use the function.

hrk 04-27-2008 05:28 AM

thanks for reply.

what you think like this.


PHP Code:

chdir('/home/site/public_html/forums');
require_once(
'./global.php');  

if (!
$vbulletin->userinfo['userid'])
{
       
print_no_permission();


// #### Fetch avatar ######################
        
if ($bbuserinfo['userid'])
            {
                
// Fetch Avatar from  Forum
                
require_once('./includes/functions_user.php');
                
$bbuseravatarurl fetch_avatar_url($bbuserinfo['userid']);
    
                if (!
$bbuseravatarurl
                    {
                        
$bbuseravatarurl $stylevar['imgdir_misc'] . '/noavatar.gif';
                    }
            } 

thanks

Dismounted 04-27-2008 07:13 AM

PHP Code:

$cwd getcwd();
chdir('/home/site/public_html/forums');
require_once(
'./global.php');

if (
$vbulletin->userinfo['userid'])
{
    require_once(
'./includes/functions_user.php');
    
$bbuseravatarurl fetch_avatar_url($vbulletin->userinfo['userid']);

    if (!
$bbuseravatarurl)
    {
        
$bbuseravatarurl $stylevar['imgdir_misc'] . '/noavatar.gif';
    }
}

chdir($cwd); 


hrk 04-27-2008 07:25 AM

Excellent somwhere there now

but how do i get it to fetch ?

my original code is

Code:

                <td align="center" style="width:150px; padding: 6px 3px 5px 5px;">
        <?php
        if ( $img != "")
            echo $img;
        else
//            echo "<img src='/images/150px.jpg' alt='Image' title='Image'/>";
echo $plugins["gallery"];

        ?>
                <br>
                <?php echo $ico; ?>
                </td>

thanks alot for your excellent support.
this shld be last step.

Dismounted 04-27-2008 07:29 AM

The variable, $bbuseravatarurl, contains the URL to the avatar.

hrk 04-27-2008 07:51 AM

Code:

<td align="center" style="width:150px; padding: 6px 3px 5px 5px;">
        <?php
$cwd = getcwd();
chdir('public_html/forum');
require_once('./global.php'); 
   
if ($vbulletin->userinfo['userid'])
{
    require_once('./includes/functions_user.php');
    $bbuseravatarurl = fetch_avatar_url($vbulletin->userinfo['userid']);

    if (!$bbuseravatarurl)
    {
        $bbuseravatarurl = $stylevar['imgdir_misc'] . '/noavatar.gif';
    }
}
chdir($cwd);
                <br>

                <?php echo $bbuseravatarurl; ?>

                </td>

Could not get it to display avatar.

few doubts ;

1.chdir('/home/site/public_html/forums'); need to include on top of within php , and the home/site for mycase is nothing. mysite.com/form is the path . unless its the cpanel dir name there need changes

2. <?php echo $bbuseravatarurl; ?> to fetch images ?

thanks alot.

Dismounted 04-27-2008 09:15 AM

Wait a sec, are you using vBulletin templates?

hrk 04-27-2008 09:21 AM

Quote:

Originally Posted by Dismounted (Post 1500562)
Wait a sec, are you using vBulletin templates?

No Sir.
I need to use this in Joomla.

thank you.

Dismounted 04-27-2008 09:37 AM

The bit of code I gave you needs to go at the top of the page, before any HTML code.

hrk 04-27-2008 09:40 AM

Quote:

Originally Posted by Dismounted (Post 1500568)
The bit of code I gave you needs to go at the top of the page, before any HTML code.

Its a php file.
so the code shld go before the file begin with <?php ?

then can i call it using the command

<?php echo $bbuseravatarurl; ?> in my field.

thanks again.

Dismounted 04-27-2008 10:01 AM

Basically, yes.

hrk 04-27-2008 12:59 PM

Thank you.
i will update to you on the progress.
Now halfway someother thing messed up.

talking abt tables in IE and FF arghhh:mad:

hrk 04-29-2008 08:23 AM

update this is the message i receive.

Fatal error: Call to a member function query_first_slave() on a non-object in /home/site/public_html/forum/includes/functions.php on line 1230

thanks

hrk 04-30-2008 03:23 PM

OK update.

got the code installed. tested but there is no error and not fetching avatar as well.

any help/guide on this pls.?

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

this is my updated code.

Code:

<?php
$cwd = getcwd();
chdir('/public_html/forum');
require_once('./global.php');

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

    if (!$bbuseravatarurl)
    {
        $bbuseravatarurl = $stylevar['imgdir_misc'] . '/noavatar.gif';
    }
}

chdir($cwd);
?>
<img src="<?php echo $bbuseravatarurl;?>" width="100px" height="50px" />


MoT3rror 04-30-2008 07:08 PM

Does the image src point to your forums correctly? I don't think that function adds on the $vbullet->option['bburl'].

hrk 04-30-2008 07:13 PM

hi thanks for sharing.

can u post the correct code

i am not coder, i am just self learner.

thank you.


All times are GMT. The time now is 10:56 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.01229 seconds
  • Memory Usage 1,767KB
  • 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
  • (3)bbcode_code_printable
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (19)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