Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #31  
Old 07-13-2006, 09:11 PM
Allan's Avatar
Allan Allan is offline
 
Join Date: Jun 2003
Location: France
Posts: 1,513
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)

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
Reply With Quote
  #32  
Old 07-13-2006, 09:42 PM
peterska2 peterska2 is offline
 
Join Date: Oct 2003
Location: Manchester, UK
Posts: 6,504
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
  #33  
Old 07-13-2006, 09:49 PM
Allan's Avatar
Allan Allan is offline
 
Join Date: Jun 2003
Location: France
Posts: 1,513
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 ?
Reply With Quote
  #34  
Old 07-13-2006, 09:52 PM
peterska2 peterska2 is offline
 
Join Date: Oct 2003
Location: Manchester, UK
Posts: 6,504
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #35  
Old 07-13-2006, 09:53 PM
Wired1's Avatar
Wired1 Wired1 is offline
 
Join Date: Nov 2003
Location: Orlando, FL, USA
Posts: 1,361
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #36  
Old 07-13-2006, 09:54 PM
peterska2 peterska2 is offline
 
Join Date: Oct 2003
Location: Manchester, UK
Posts: 6,504
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you can do that by using conditional nesting and using different dimensions in the code from there
Reply With Quote
  #37  
Old 07-13-2006, 10:01 PM
slappy slappy is offline
 
Join Date: Apr 2003
Posts: 97
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 .
Reply With Quote
  #38  
Old 07-13-2006, 10:04 PM
peterska2 peterska2 is offline
 
Join Date: Oct 2003
Location: Manchester, UK
Posts: 6,504
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #39  
Old 07-13-2006, 10:09 PM
slappy slappy is offline
 
Join Date: Apr 2003
Posts: 97
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Thanks.

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

Regards,
Reply With Quote
  #40  
Old 07-13-2006, 10:11 PM
SkyCatcher's Avatar
SkyCatcher SkyCatcher is offline
 
Join Date: Feb 2003
Location: Germany
Posts: 310
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
Reply


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 11: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.05711 seconds
  • Memory Usage 2,291KB
  • 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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (6)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (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_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete