Log in

View Full Version : Show Image in First Post by Member on Page but not Subsequent


zylstra
12-21-2005, 07:21 AM
To place an image in the first post of a particular member on a page but not any subsequent post I modified the template "postbit" to include<if condition="$post[userid] == 2 AND ## What should I put here? ##">
<phrase>$vbphrase[image_code]</phrase>
</if>Do I have to modify showthread.php somehow? Right now I'm just interested in getting it to work simply, so if it is easier for anyone to provide hard code that would be good enough.

Thank you!

merk
12-21-2005, 07:34 AM
You could do something like

<if condition="$post[userid] == 2 AND !$uniquevariablename AND $uniquevariablename = true">

zylstra
12-21-2005, 07:57 AM
I'm not sure I know what you mean. The code you specified would never be true because a variable can't both be false and true at the same time.

merk
12-21-2005, 09:01 AM
I used an assignment operator, not a comparision operator.

zylstra
12-21-2005, 04:09 PM
Yes, thank you, I see that now. And it seems like it should work, but it doesn't. Are you sure you can set variables and have them retain their value from a template? Perhaps some code in showthread.php may work?

merk
12-21-2005, 11:24 PM
Which template, the postbit template?

I thought it would work, but it might not now days.

Try using (for both)
$post['uniquevariable']
$threadinfo['uniquevariable']

or

!$GLOBALS['uniquevariable'] AND $uniquevariable = true (or $GLOBALS['uniquevariable'] for both)

Not sure of the variable scope unfortunatly. :(

zylstra
12-22-2005, 09:06 PM
merk, you're GREAT! $GLOBALS['uniquevariable'] for both worked!

Each one of the other suggestions had the result of creating the images in all posts by that member.

Thanks!

merk
12-22-2005, 09:37 PM
Its very interesting that the $GLOBALS one worked (i didnt think it would), I feel dirty using it though.

But if it works, it works hey :)