The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
in_array condition problem. Not working as expected
I have created a new varchar field in the user table to hold a comma separated list of mailinglist ids (a bit like membergroupids). It stores what mailing lists people are subscribed to.
In a template, I want to display a subscribe or unsubscribe link depending upon which mailinglist ids are in their $bbuserinfo['mailinglists'] field. $bbuserinfo['mailinglists'] contains '1,2'. But Code:
<if condition="in_array(2,array($bbuserinfo['mailinglists']))">Unsubscribe</if> Any help much appreciated. Thanks --------------- Added [DATE]1341744427[/DATE] at [TIME]1341744427[/TIME] --------------- Solved it. I added a plugin - fetch_userinfo - $user['mailinglists'] = explode(',',$user['mailinglists']); turned $user['mailinglists'] into an array so that Code:
<if condition="in_array(2,$bbuserinfo['mailinglists'])">Unsubscribe</if> |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|