Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-25-2008, 04:04 AM
Jacob B Jacob B is offline
 
Join Date: Aug 2008
Location: Australia
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default fetch_avatar_url()

I'm looking for a way to fetch a users avatar to display inside a modification, a ticket support system. I've done a search and been through about 60+ pages of avatar modifications and can't find the actual code for it. I'm not exactly sure where I would need to insert the code into the PHP file, plus using the avatar conditional (<if condition="$show['avatar']">) doesn't seem to work on the modification.

Basically, this is how I've got it setup. This is the "ticket_display" template:

PHP Code:
<if condition="$issue[status]==0">

<
img src="$stylevar[imgdir_button]/threadclosed.gif" border="0" alt"" />

</if>
<
table border="0" cellpadding="0" cellspacing="0" width="100%">
<
tr>
<
td valign="top">

<
table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" style="border-bottom-width:0px">
<
tr align="left">
    <
th class="tcat" width="100%">
        
$issue[title]
    </
th>
<if 
condition="$show['member']">
    <
th class="vbmenu_control" id="issuetools" nowrap="nowrap">
        <
a href="$vbptions[bburl]/issue.php?$session[sessionurl]do=issuetools">Issue Tools</a>
        <
script type="text/javascript">vbmenu_register("issuetools");</script>
    </
th>
</if>
</
tr>
</
table>

<
table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%">
<
tr>
    <
td class="thead normal">
     
    <if 
condition="$show['can_delete_issues'] OR $show['can_delete_any_issues']">
    <
div style="float:right">
    [<
a href="$vboptions[bburl]/issue.php?$session[sessionurl]do=delete&amp;id=$_REQUEST[id]">Delete</a>]
    </
div>
    </if>
        
        <
img src="$stylevar[imgdir_statusicon]/post_new.gif" alt="#$_REQUEST[id]class="inlineimg" />
        
$ticket[datelogged]
    </
td>
</
tr>
<
tr valign="top">
    <
td class="alt2">
        <
table cellpadding="0" cellspacing="6" border="0" width="100%">
        <
tr>
            <
td class="alt2">
            <if 
condition="$show['avatar']">
            <
a href="$vboptions[bburl]/member.php?$session[sessionurl]u=$issue[ownerid]"><img src="$vboptions[bburl]/image.php?u=$issue[ownerid]alt="" border="0" />
</if>






</
td>
            <
td nowrap="nowrap" width="100%">

                <
div id="notemenu_68661">
            
                        <
class="bigusername" href="$vboptions[bburl]/member.php?$session[sessionurl]u=$issue[ownerid]">$issue[ownerusername]</a>
                        
                            
                            
                            
                        
                    
                </
div>
                <
div class="smallfont">Posted <span class="time">$issue[datelogged]</span></div>
            </
td>
        </
tr>
        </
table>
    </
td>
</
tr>
<
tr>
    <
td class="alt1" valign="top">
    
        <
div style="font-size:12pt">$issue[title]</div>
        <
div><strong></strong></div>
        <
hr style="border:0px; height:1px; color:#D1D1E1; background-color:#D1D1E1" />
        <
div>$issue[message]</div>
        
        <
div class="smallfont" align="right" style="margin-top:12px">
            <
div style="float:left" align="left">
                
                
                
            </
div>
            <if 
condition="$show['can_edit_issues'] OR $show['can_edit_any_issues']">
            <
a href="$vboptions[bburl]/issue.php?$session[sessionurl]do=edit&amp;id=$_REQUEST[id]"><img src="$stylevar[imgdir_button]/edit.gif" alt="Edit" border="0" /></a>
</if>
            
        </
div>
    
    </
td>
</
tr>


</
table>



</
td>
</
tr>
</
table>



<
br />
<
a name="comments"></a>
<
div style="font-size:12pt">Comments</div>
<
div style="height:3px">&nbsp;</div
For some reason using the 'avatar' conditional is hindering the ability to display the user's avatar. It simply doesn't show. I've never written the PHP code to fetch an avatar. I've tried this code only it results in a database error:

PHP Code:
require_once('./includes/init.php');
require_once(
'./includes/functions_user.php');
$issue['owner_avatar']=fetch_avatar_url($issue['ownerid']);
if (
$issue['owner_avatar']=='') ($bbuserinfo['owner_avatar']='images/misc/noavatar.gif'); 
$issue['owner_avatar']="<img src='$vboptions[bburl]/{$issue['owner_avatar']}' border='0'>";
$issue['owner_avatar']="<a href='$vboptions[bburl]/profile.php?{$session['sessionurl']}&do=editavatar'>{$issue['owner_avatar']}</a>";
$issue_avatar=$issue['owner_avatar']; 
How do I fetch the avatar? Sorry to ask guys, but this is driving me insane. I can't use $bbuserinfo because that will only display the avatar of the user browsing the actual modification.
Reply With Quote
 


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 09:41 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.04940 seconds
  • Memory Usage 2,537KB
  • Queries Executed 12 (?)
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
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)showthread_list
  • (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_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • 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_threaded
  • showthread_threaded_construct_link
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete