Showing Avatar?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • interfx
    Senior Member
    • Dec 2001
    • 737
    • 4.2.X

    Showing Avatar?

    I'm working on the main forum page (FORUMHOME), and am trying to have my user avatar to show, but keep getting a broken image...

    Here's what I'm using...

    Code:
    <a href="$vboptions[bburl]/profile.php?do=editavatar">
    <img src="$avatarurl" border="0" $avwidth $avheight alt="$vbphrase[edit_avatar]" />
    </a>
    Any ideas why I'm getting a broken image?

    Thanks -
    Last edited by interfx; Sun 25 Mar '07, 10:19am.
  • zappsan
    Senior Member
    • Sep 2004
    • 1143
    • 3.8.x

    #2
    The variable might not work in this template.
    I believe there is a hack on vB.org which will show a kind of "welcome Panel" to the user, aslo showing up the user's avatar.
    *Insert text here* :)

    Comment

    • feldon23
      Senior Member
      • Nov 2001
      • 11291
      • 3.7.x

      #3
      That code you've posted only works in postbit. Here's my code for FORUMHOME:

      Code:
      <if condition="$timestampnow = TIMENOW"></if>
      <img src="image.php?u=$bbuserinfo[userid]&amp;dateline=$timestampnow"
      alt="$vbphrase[avatar]" border="0" align="center" />
      The timestamp stuff is kinda crazy but necessary to always show the user's latest (rather than cached) avatar since the timestamp of the user's avatar is not available on FORUMHOME to my knowledge.

      You know what would be fantastic? A writeup of what's in $bbuserinfo (aka $vbulletin->userinfo).


      Here's my entire Welcome Panel. It's quite modified from the ones at vBulletin.org.

      Code:
      <!-- ######### Welcome Panel ######### -->
      
      <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
      <tr>
          <td class="tcat" colspan="3">
              <if condition="$bbuserinfo['userid']">Welcome back, $bbuserinfo[username]<else />Guest</if>
          </td>
      </tr>
      <tr>
          <td class="alt1Active" align="center">
          <if condition="$bbuserinfo['userid']">
          <if condition="$timestampnow = TIMENOW"></if>
          <div><img src="clear.gif" width="$permissions[avatarmaxwidth]" height="1" style="margin-left: 12px; margin-right: 12px;" /><br /><A href="usercp.php"><img src="image.php?u=$bbuserinfo[userid]&amp;dateline=$timestampnow" alt="$vbphrase[avatar]" border="0" align="center" /></a></div>
              <else />
              <img src="images/avatars/guestavatar.gif" alt="$vbphrase[guest] $vbphrase[avatar]" border="0">
              </if>
          </td>
          <td class="alt2Active" width="99%">
          <div class="smallfont">
          The time is now $timenow.<br />
          <if condition="$bbuserinfo['userid']">
              <phrase 1="$pmbox[lastvisitdate]" 2="$pmbox[lastvisittime]">$vbphrase[last_visited_x_at_y]</phrase><br />
      <if condition="empty($welcome_newposts)">No new posts<else />$welcome_newposts new posts in $welcome_newthreads topics</if> since your last visit! <if condition="!empty($welcome_newposts)">(<a href="search.php?do=getnew">View New Posts</a>)</if>
      
          </div>
              <br />You have <if condition="$bbuserinfo['pmunread']"><strong>$bbuserinfo[pmunread]</strong><else />no</if> unread <if condition="$show['pmstats']"><a href="private.php?$session[sessionurl]"> $vbphrase[private_messages]</a></if>
          </if>
      
          </td>
          <td class="alt1Active" style="white-space: nowrap;">
          <div class="smallfont">
          <div><strong>$vbphrase[threads]</strong>: $totalthreads, <strong>$vbphrase[posts]</strong>: $totalposts<br /><b>Registered Members</b>: $numbermembers</div>
          <div><phrase 1="member.php?$session[sessionurl]u=$newuserid" 2="$newusername">$vbphrase[welcome_to_our_newest_member_x]</phrase></div>
          </div>
          <div style="margin-top: 6px; margin-bottom: 6px;">Browsing Forum: <strong>$totalonline</strong></div>
      
          <if condition="$bbuserinfo['userid']">
          <!-- member logout -->
          <div class="smallfont"><if condition="!$show['guest']">
              <a href="login.php?$session[sessionurl]do=logout&amp;logouthash=$bbuserinfo[logouthash]" onclick="return log_out()">$vbphrase[log_out]</a> | 
          </if>
          <!-- end member logout -->
      
          <!-- mark forums read-->
          <a href="forumdisplay.php?$session[sessionurl]do=markread">$vbphrase[mark_forums_read]</a></div>
          <!-- end mark forums read -->
          
          <else />
              
              <!-- login form -->
              <form action="login.php" method="post" onsubmit="md5hash(vb_login_password,vb_login_md5password)">
              <script type="text/javascript" src="$vboptions[abspath]/clientscript/vbulletin_md5.js"></script>
              <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
              <tr>
                  <td class="smallfont">$vbphrase[username]</td>
                  <td><input type="text" class="button" name="vb_login_username" id="navbar_username" size="10" accesskey="u" tabindex="1" value="$vbphrase[username]" onfocus="if (this.value == '$vbphrase[username]') this.value = '';" /></td>
                  <td class="smallfont" colspan="2"><label for="cb_cookieuser_navbar" style="white-space:nowrap"><input type="checkbox" name="cookieuser" value="1" tabindex="3" id="cb_cookieuser_navbar" accesskey="c" checked="checked" />$vbphrase[remember_me]</label></td>
              </tr>
              <tr>
                  <td class="smallfont">$vbphrase[password]</td>
                  <td><input type="password" class="button" name="vb_login_password" size="10" accesskey="p" tabindex="2" /></td>
                  <td><input type="submit" class="button" value="$vbphrase[log_in]" tabindex="4" title="$vbphrase[enter_username_to_login_or_register]" accesskey="s" /></td>
              </tr>
              </table>
              <input type="hidden" name="s" value="$session[sessionhash]" />
              <input type="hidden" name="do" value="login" />
              <input type="hidden" name="forceredirect" value="1" />            
              <input type="hidden" name="vb_login_md5password" />
              </form>
              <!-- / login form -->
          </if>
      
          </td>
      </tr>
      </table><br />
      
      <!-- ######### end Welcome Panel ######### -->
      You need the Plugin to get New Posts in New Forums to work.
      Attached Files

      Comment

      • interfx
        Senior Member
        • Dec 2001
        • 737
        • 4.2.X

        #4
        That did it... The timestamp is less than obvious, but it worked just fine...

        Thanks again for your help!
        InterFX

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...