TheJackal84 Posted September 20, 2017 Share Posted September 20, 2017 If I get a array of member id's how would I create the {{if}} statement for it?, for example {{if \IPS\Member::loggedIn()->member_id in_array ?????????????????????????}} and so on Link to comment Share on other sites More sharing options...
Ilya Hoilik Posted September 20, 2017 Share Posted September 20, 2017 {{if in_array( \IPS\Member::loggedIn()->member_id, array( id1, id2, id3 ) )}} {{endif}} Link to comment Share on other sites More sharing options...
TheJackal84 Posted September 20, 2017 Author Share Posted September 20, 2017 2 minutes ago, Ilya Hoilik said: {{if in_array( \IPS\Member::loggedIn()->member_id, array( id1, id2, id3 ) )}} {{endif}} Perfect thanks Link to comment Share on other sites More sharing options...
Ilya Hoilik Posted September 20, 2017 Share Posted September 20, 2017 Forgot about shortcut. You can use member instead of \IPS\Member::loggedIn(). It's more beautiful. {{if in_array( member.member_id, array( 1, 2, 3 ) )}} {{endif}} All the available shortcuts are described here. Link to comment Share on other sites More sharing options...
TheJackal84 Posted September 20, 2017 Author Share Posted September 20, 2017 1 minute ago, Ilya Hoilik said: Forgot about shortcut. You can use member instead of \IPS\Member::loggedIn(). It's more beautiful. {{if in_array( member.member_id, array( 1, 2, 3 ) )}} {{endif}} All the available shortcuts are described here. Yeah I have my own $member $member_id etc shortcuts already, I just typed it that so it was easier to understand, Thanks again Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.