vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Staff Avatar Background (https://vborg.vbsupport.ru/showthread.php?t=120582)

Allan 07-13-2006 09:11 PM

Quote:

Originally Posted by Wired1
small problem with that code is that someone isn't in that group, it won't go through <if condition="$show['avatar']> by itself.

here's what I was messing with:

Code:


<if condition="$show['avatar'] AND $vbulletin->userinfo[usergroupid]=79">

      <td class="alt2">
        <table cellpadding="5" cellspacing="0" border="0" width="124" height="82" align="center">
            <tr>
              <td background="./images/test_badge.png" nowrap="nowrap" no-repeat><img src="$post[avatarurl]" height="64" width="59" align="right"></td>
            </tr>
        </table>
      </td>

</if>

<if condition="$show['avatar'] AND $vbulletin->userinfo[usergroupid]!=79">
  <td class="alt2">
      <a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a>
  </td>
</if>


Yes, it work, but there are one problem, every members have the backgroup now (all usergroup) :p

Quote:

Originally Posted by peterska2
Code:

<if condition="$show['avatar']">
<if condition="$vbulletin->userinfo[usergroupid]=6">
<td class="alt2">
  <table cellpadding="5" cellspacing="0" border="0" width="124" height="82" align="center">
      <tr>
        <td background="$stylevar[imgdir_misc]/badge.png" nowrap="nowrap" no-repeat><img src="$post[avatarurl]" height="64" width="59" align="right"></td>
      </tr>
  </table>
</td>
<else />
  <td class="alt2">
      <a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a>
  </td>
</if>
</if>


Work also, but even problem as my post before

peterska2 07-13-2006 09:42 PM

Ok, I got it :)

Code:

<if condition="$show['avatar']">
<!-- check for admin -->
<if condition="$post[usergroupid]==6">
<!-- I am an admin so do this -->
<td class="alt2">
  <table cellpadding="5" cellspacing="0" border="0" width="124" height="82" align="center">
      <tr>
        <td background="$stylevar[imgdir_misc]/badge.png" nowrap="nowrap" no-repeat><img src="$post[avatarurl]" height="64" width="59" align="right"></td>
      </tr>
  </table>
</td>
<else />
<!-- I am not an admin so do this -->
  <td class="alt2">
      <a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a>
  </td>
</if>
</if>


Allan 07-13-2006 09:49 PM

Quote:

Originally Posted by peterska2
Ok, I got it :)

Code:

<if condition="$show['avatar']">
<!-- check for admin -->
<if condition="$post[usergroupid]==6">
<!-- I am an admin so do this -->
<td class="alt2">
  <table cellpadding="5" cellspacing="0" border="0" width="124" height="82" align="center">
      <tr>
        <td background="$stylevar[imgdir_misc]/badge.png" nowrap="nowrap" no-repeat><img src="$post[avatarurl]" height="64" width="59" align="right"></td>
      </tr>
  </table>
</td>
<else />
<!-- I am not an admin so do this -->
  <td class="alt2">
      <a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a>
  </td>
</if>
</if>


Yesss, it work perfectly, thank Peterska2 ;)

But, if i want add other images for other usergroup, How may I make ?

peterska2 07-13-2006 09:52 PM

As many as you want. You can nest the if statements by having it in the format:

if admin
else if super mod
else if mod
else if custom group
else normal
end if
end if
end if
end if

Basically just keep nesting them.

If you want two or more groups to use the same image, then you can use an array in the conditional to specify which groups that conditional applies to.

Wired1 07-13-2006 09:53 PM

Schweet :) Going to try tweaking it w/ standard vBulletin code so that if different usergroups have different avatar dimensions the hole will stretch. currently it'll smush the avatar.

Example:

http://www.houseofhelp.com/forums/sh...ad.php?t=52133

peterska2 07-13-2006 09:54 PM

you can do that by using conditional nesting and using different dimensions in the code from there

slappy 07-13-2006 10:01 PM

Something like this?

Code:

<if condition="$show['avatar']">
<!-- check for admin -->
<if condition="$post[usergroupid]==6">
<!-- I am an admin so do this -->
<td class="alt2">
  <table cellpadding="5" cellspacing="0" border="0" width="124" height="82" align="center">
      <tr>
        <td background="$stylevar[imgdir_misc]/badge.png" nowrap="nowrap" no-repeat><img src="$post[avatarurl]" height="64" width="59" align="right"></td>
      </tr>
  </table>
</td>
<else />
<if condition="$post[usergroupid]==X">
<!-- I am in this usergroup so do this -->
<td class="alt2">
  <table cellpadding="5" cellspacing="0" border="0" width="124" height="82" align="center">
      <tr>
        <td background="$stylevar[imgdir_misc]/badge2.png" nowrap="nowrap" no-repeat><img src="$post[avatarurl]" height="64" width="59" align="right"></td>
      </tr>
  </table>
</td>
<else />
<!-- I am not in either of those groups so do this -->
  <td class="alt2">
      <a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a>
  </td>
</if>
</if>
</if>

Oops. Look like the else needs to be else/if .

peterska2 07-13-2006 10:04 PM

Quote:

Originally Posted by slappy
Something like this?

Code:

<if condition="$show['avatar']">
<!-- check for admin -->
<if condition="$post[usergroupid]==6">
<!-- I am an admin so do this -->
<td class="alt2">
  <table cellpadding="5" cellspacing="0" border="0" width="124" height="82" align="center">
      <tr>
        <td background="$stylevar[imgdir_misc]/badge.png" nowrap="nowrap" no-repeat><img src="$post[avatarurl]" height="64" width="59" align="right"></td>
      </tr>
  </table>
</td>
<else />
<if condition="$post[usergroupid]==X ">
<!-- I am in this usergroup so do this -->
<td class="alt2">
  <table cellpadding="5" cellspacing="0" border="0" width="124" height="82" align="center">
      <tr>
        <td background="$stylevar[imgdir_misc]/badge2.png" nowrap="nowrap" no-repeat><img src="$post[avatarurl]" height="64" width="59" align="right"></td>
      </tr>
  </table>
</td>
<else />
<!-- I am not in either of those groups so do this -->
  <td class="alt2">
      <a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a>
  </td>
</if>
</if>

Oops. Look like the else needs to be else/if .

Nope, you just need another </if> on the end :)

slappy 07-13-2006 10:09 PM

Yep. I was adding it while you were correcting my omission. :cool:

Thanks.

Is the use of the else / if considered better formatting?

Regards,

SkyCatcher 07-13-2006 10:11 PM

lol I love it, total chaos!

How many designers and coders does it take to come up with a tiny piece of functional code lol.

It's really starting to shape up, but I thought about having the small avatar in behind the background image as was mentioned... it's frying my brain....

you have a table
--------------------------table--------------------------|
tablerow top---------------------------------------TR-| |
|............................columntop -------------------TD|.| |
|...........................................|..... ........................|.| |
|...........................................|..... ........................|.| |
|...........................................|---------------------|.| |
tablerowbottom-----------------------------------</tr>| |
--------------------------table--------------------------|

How the hell would you be able to pull it off? I mean, you can't have the column without a table to hold it and you can't add a table because then the 2nd table will not overlap the 1st but instead be to the right or below it....

BRAIN FRYING!


All times are GMT. The time now is 02:33 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.01108 seconds
  • Memory Usage 1,768KB
  • 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
  • (6)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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