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

Reply
 
Thread Tools Display Modes
  #1  
Old 06-11-2008, 01:15 AM
Mum Mum is offline
 
Join Date: Jun 2006
Location: New Zealand
Posts: 660
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Code Question

What is wrong with this bit of code? I am trying to place it under the sig. But for some reason it's not working, and all the id numbers are correct, i've checked them a million times LOL

Code:
<if condition="in_array($post[membergroupids],array(82))">
<div class="vBadvertisement">Signature Sponsor
<br /><a href="$post[field24]">$post[field25]</a>
<br />$post[field26]
<br /><br />
<a href="/payments.php">Get a sig like this!</a>
</div>
</if>
Reply With Quote
  #2  
Old 06-11-2008, 01:32 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="$post[field24]">

for one.
Reply With Quote
  #3  
Old 06-11-2008, 01:38 AM
Mum Mum is offline
 
Join Date: Jun 2006
Location: New Zealand
Posts: 660
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That works fine Boofo - why is it a problem?

I can make this work so long as the primary group is 82, but it won't work if it's their secondary group. How can i fix this?
Reply With Quote
  #4  
Old 06-11-2008, 01:42 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You had one with quotes and one without.

Try is_member_of for the conditional.
Reply With Quote
  #5  
Old 06-11-2008, 01:45 AM
Mum Mum is offline
 
Join Date: Jun 2006
Location: New Zealand
Posts: 660
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, cos then it only SHOWS to that membergroup. What i want to do is IF they are a member of that membergroup then it shows to everyone.
Reply With Quote
  #6  
Old 06-11-2008, 01:50 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Now I'm confused. You want it to show to everyone or not?
Reply With Quote
  #7  
Old 06-11-2008, 02:49 AM
Mum Mum is offline
 
Join Date: Jun 2006
Location: New Zealand
Posts: 660
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I want to show it to everyone - group 82 that i've specified is a paid sponsor group - thye get to have a signature extra that they paid for. So i want all members to see it.

I have added user profile fields to be filled in. However as all members can see them, i don't want it to show just cos they filled those in. I only want it to show if they ahve paid - ie in group 82.

is that any clearer?
Reply With Quote
  #8  
Old 06-11-2008, 03:51 AM
calorie calorie is offline
 
Join Date: May 2003
Posts: 2,804
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Untested, but try the following...
  • Make them not required to get them off the register page.
  • Wrap the vB userfield_wrapper template with the following:
    Code:
    <if condition="!in_array($profilefield[profilefieldid], array(24, 25, 26)) OR is_member_of($bbuserinfo, 82)">
    
    </if>
  • Use the following under the signature:
    Code:
    <if condition="is_member_of($post, 82) AND $post[field24] AND $post[field25]">
    	<div class="vBadvertisement">
    		Signature Sponsor
    		<br /><a href="$post[field24]">$post[field25]</a>
    
    		<if condition="$post[field26]">
    			<br />$post[field26]
    		</if>
    
    		<br /><br /><a href="/payments.php">Get a sig like this!</a>
    	</div>
    </if>
Reply With Quote
  #9  
Old 06-11-2008, 07:18 AM
Mum Mum is offline
 
Join Date: Jun 2006
Location: New Zealand
Posts: 660
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you, i haven't tried this yet, but can you explain what it does when i put it ' Wrap the vB userfield_wrapper template with the following:' there?
Reply With Quote
  #10  
Old 06-16-2008, 05:13 PM
Mum Mum is offline
 
Join Date: Jun 2006
Location: New Zealand
Posts: 660
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you tell me please with this bit

<if condition="$post[field26]">
<br />$post[field26]
</if>
What is the conditional based on? Is it just if field26 exsists?

--------------- Added [DATE]1213640615[/DATE] at [TIME]1213640615[/TIME] ---------------

<if condition="!in_array($profilefield[profilefieldid], array(24, 25, 26)) OR is_member_of($bbuserinfo, 82)">

I don't get this bit. If not field 24,25,26 or in 82? It doesn't amke sense, can someone put it in English for me.

--------------- Added [DATE]1213642182[/DATE] at [TIME]1213642182[/TIME] ---------------

I'm trying to add a 2nd one in, but can't get the code working, can you help me please. It's if they are in group 83, they can either have a large image (field27) linked (field24), or a small image (field28) linked (field24) AND some text (field26). I have been through this a million times nad can't work out why it's wrong.

Code:
<if condition="is_member_of($post, 83) AND $post[field24] AND $post[field25]">
    <div class="vBadvertisement">
        ----- Signature Sponsor -----
        <if condition="$post[field27]">
        <br /><a href ="$post[field24]<img src="$post[field27]">
            <else />
                <if condition="$post[field28]">
                <br /><a href ="$post[field24]<img src="$post[field28]">
                    <if condition="$post[field26]">
                    $post[field26]
                    </if>
                </if>
            </if>
        </if>    
    </div>
</if>
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 06:37 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.04240 seconds
  • Memory Usage 2,253KB
  • 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
  • (4)bbcode_code
  • (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_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