PDA

View Full Version : Code Question


Mum
06-11-2008, 01:15 AM
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

<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>

Boofo
06-11-2008, 01:32 AM
<a href="$post[field24]">

for one.

Mum
06-11-2008, 01:38 AM
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?

Boofo
06-11-2008, 01:42 AM
You had one with quotes and one without.

Try is_member_of for the conditional.

Mum
06-11-2008, 01:45 AM
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.

Boofo
06-11-2008, 01:50 AM
Now I'm confused. You want it to show to everyone or not?

Mum
06-11-2008, 02:49 AM
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?

calorie
06-11-2008, 03:51 AM
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:

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

</if>


Use the following under the signature:

<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>

Mum
06-11-2008, 07:18 AM
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?

Mum
06-16-2008, 05:13 PM
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 1213640615 at 1213640615 ---------------

<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 1213642182 at 1213642182 ---------------

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.

<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>

Mum
06-18-2008, 09:43 PM
Just bumping it up in case someone can help.

Mum
06-21-2008, 12:42 AM
I've tried changing it a bit to <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]">
<br />$post[field26]
</if>
</if>
</if>
</div>
</if> but still can't get it to work, i hope someone might be able to help?

Boofo
06-21-2008, 03:12 AM
I guess I'm not understanding what it is you are trying to do still. Didn't Calorie's code work for you?

Michael Biddle
06-21-2008, 06:04 AM
I see quite a bit wrong, but try this:

<if condition="is_member_of($post, 83) AND $post[field24] AND $post[field25]">
<div class="vBadvertisement">
<if condition="$post[field27]">
<br />
<a href="$post[field24]"><img src="$post[field27]" alt="" /></a>
<else />
<if condition="$post[field28]">
<br />
<a href="$post[field24]"><img src="$post[field28]" alt="" /></a>
<br />
$post[field26]
</if>
</if>
</div>
</if>

Mum
06-24-2008, 10:30 PM
Thanks Mike :)