Quote:
Originally Posted by tmhall
I'm trying to add something to the post popup menu that's conditional based on whether the user is on your buddylist. This is as close as I can guess, but it doesn't seem to work:
<if condition="in_array($post[userid], $bbuserinfo[buddylist])">
Any idea how to make that work?
Okay after many hours of poking around and trying different things, at this point I'm guessing my question above doesn't even make sense. I would think what I'm trying to do is very simple, but so far it doesn't seem to be. I want to put a conditional in the postbit template so that "Add {user} to your buddylist" becomes "Remove {user} from your buddylist" if they're already your buddy. At this point I think I have a better chance of building a car that gets 1000 miles to a gallon of water. 
|
Offa the top of me noggin (I'm not near a computer with testing capabilities right now)...
PHP Code:
$buddylist = array(); //initializes the variable $buddylist to be an array
$buddylist = explode(' ', $bbuserinfo['buddylist']); //This will put the buddylist id's into the array called $buddylist with $buddylist[0] being the first id in the array.
and then you can call the conditional:
Code:
<if condition="in_array($post[userid], $buddylist)">
Remove $post[username] from your buddylist<br />
<else />
Add $post[username] to your buddylist<br />
</if>
My thoughts right now (again, no test availability) would be to put the $buddylist php code in your ./global.php file.