Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)

Reply
 
Thread Tools Display Modes
  #1  
Old 02-16-2005, 02:45 PM
indie indie is offline
 
Join Date: Aug 2004
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default if statment for avatars?

Can I use an "if" statement, if the membergroup is not allowed to have avatars or profile pics, but they already uploaded them before the change, so they are showing in the postbit and view profile page, to let them show "if" in a usergroup that allows them.... or have them not show "if" in a usergroup without the permission.... if so, would someone be so kind as to tell me how to do that?
Thanks!
Reply With Quote
  #2  
Old 02-16-2005, 02:54 PM
Deaths Deaths is offline
 
Join Date: Oct 2004
Location: Europe, Belgium
Posts: 679
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Go to ACP-> Styles & Templates -> Edit Templates ->postbit ot postbit_legacy.

Now, find the code for the avatars.
In the postbit template it's this:

PHP Code:
<if condition="$show['avatar']"><td class="alt1"><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$avatarurlalt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></td></if> 
Now, replace that with:
PHP Code:
<if condition="$bbuserinfo[usergroupid]=X">
&
nbsp;
<else />
<if 
condition="$show['avatar']"><td class="alt1"><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$avatarurlalt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></td></if></if> 
Make sure you replace the X with the usergroup you wish to not allow.
Reply With Quote
  #3  
Old 02-16-2005, 03:01 PM
indie indie is offline
 
Join Date: Aug 2004
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great thanks!!
Can you post what the replacement is for postbit_legacy, it looks different than that...
And also, if you could if possible, post the replacement I could use on the profile page for the avatr and profile pic?

Thanks!
Reply With Quote
  #4  
Old 02-16-2005, 03:07 PM
Deaths Deaths is offline
 
Join Date: Oct 2004
Location: Europe, Belgium
Posts: 679
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In the postbit_legacy template it's this:

PHP Code:
<if condition="$show['avatar']">
                <
div class="smallfont">
                    &
nbsp;<br /><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$avatarurlalt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a>
                </
div>
            </if> 
Replace with:

PHP Code:
<if condition="in_array($post[usergroupid], array(X,X,X))">
&
nbsp
<else /> 
<if 
condition="$show['avatar']">
                <
div class="smallfont">
                    &
nbsp;<br /><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$avatarurlalt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a>
                </
div>
            </if></if> 
I'll look into the profile now, expect a reply in ~5 minutes.

Ok, mistake fixed.

Ok, edit template MEMBERINFO.

Find:
PHP Code:
<if condition="$show['profilepic']">
            <
td valign="top" align="$stylevar[right]rowspan="2">
                <
img src="image.php?u=$userinfo[userid]&amp;type=profile&amp;dateline=$userinfo[profilepicdateline]alt="<phrase 1="$userinfo[username]">$vbphrase[xs_picture]</phrase>" border="0" style="border:1px solid $stylevar[tborder_bgcolor]/>
            </
td>
            </if> 
Replace with:

PHP Code:
<if condition="in_array($userinfo[usergroupid], array(X,X,X))">
&
nbsp
<else />
<if 
condition="$show['profilepic']">
            <
td valign="top" align="$stylevar[right]rowspan="2">
                <
img src="image.php?u=$userinfo[userid]&amp;type=profile&amp;dateline=$userinfo[profilepicdateline]alt="<phrase 1="$userinfo[username]">$vbphrase[xs_picture]</phrase>" border="0" style="border:1px solid $stylevar[tborder_bgcolor]/>
            </
td>
            </if></if> 
Now, find
PHP Code:
<if condition="$show['avatar']">
                <
td><img src="$userinfo[avatarurl]alt="<phrase 1="$userinfo[username]">$vbphrase[xs_avatar]</phrase>" border="0" style="border:1px solid $stylevar[tborder_bgcolor]; border-top:none" /></td>
            <else />
                <
td>&nbsp;</td>
            </if> 
Replace with:

PHP Code:
<if condition="in_array($userinfo[usergroupid], array(X,X,X))">
&
nbsp
<else />
<if 
condition="$show['avatar']">
                <
td><img src="$userinfo[avatarurl]alt="<phrase 1="$userinfo[username]">$vbphrase[xs_avatar]</phrase>" border="0" style="border:1px solid $stylevar[tborder_bgcolor]; border-top:none" /></td>
            <else />
                <
td>&nbsp;</td>
            </if> 
I haven't tried this, but it should work.

Please let me know if it did work, or didn't
Reply With Quote
  #5  
Old 02-16-2005, 03:22 PM
indie indie is offline
 
Join Date: Aug 2004
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wow, you are awesome...

I'm going to try this now... THANKS!
Reply With Quote
  #6  
Old 02-16-2005, 03:22 PM
Deaths Deaths is offline
 
Join Date: Oct 2004
Location: Europe, Belgium
Posts: 679
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No problemo .

If it doesn't work, please tell me, and I will take a closer look at it.
Reply With Quote
  #7  
Old 02-16-2005, 03:23 PM
indie indie is offline
 
Join Date: Aug 2004
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PS, can usergroup(s) be separated by comma? (I will add banned members too, if so)
Reply With Quote
  #8  
Old 02-16-2005, 03:31 PM
Deaths Deaths is offline
 
Join Date: Oct 2004
Location: Europe, Belgium
Posts: 679
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have updated my post, now you can!
Just replace the X's with the usergroups you want, and if you wish you can add/remove more numbers!

Examples:
PHP Code:
<if condition="in_array($userinfo[usergroupid], array(4,5,6))"
PHP Code:
<if condition="in_array($userinfo[usergroupid], array(1,2))"
PHP Code:
<if condition="in_array($userinfo[usergroupid], array(1))"
PHP Code:
<if condition="in_array($userinfo[usergroupid], array(1,2,3,4))"
Reply With Quote
  #9  
Old 02-16-2005, 03:41 PM
indie indie is offline
 
Join Date: Aug 2004
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried what you gave me (original legacy postbit), and everyone's disappeared.
Reply With Quote
  #10  
Old 02-16-2005, 04:02 PM
Deaths Deaths is offline
 
Join Date: Oct 2004
Location: Europe, Belgium
Posts: 679
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you sure you added only the banned usergroup?

And the very first code is wrong, it will only display it to banned members.
Very wrong, heh.

Use the code from this post (ie my other post)
Reply With Quote
Reply

Thread Tools
Display Modes

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 02:59 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.04511 seconds
  • Memory Usage 2,307KB
  • Queries Executed 13 (?)
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
  • (12)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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_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
  • 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