Page 1 of 1
IF Statement code
PostPosted: 19 Oct 2022, 06:47
by jackal
Does anyone know an example of an "if" statement code?
Something like this that could work in Arrowchat?
<?php if: group_id = 5 >
Displays message A
<elseif: group_id = 1 >
Displays message B
?>
Re: IF Statement code
PostPosted: 19 Oct 2022, 09:19
by Jason
There isn't any support for that. Where are you trying to put it? In an HTML or JavaScript file?
Re: IF Statement code
PostPosted: 19 Oct 2022, 13:19
by jackal
If possible add it somewhere in the file /public/mobile/index.php
I am trying to display a message to my "free members" only (who are in group permission #9)
Any help would be nice.
Re: IF Statement code
PostPosted: 20 Oct 2022, 08:02
by Jason
If possible add it somewhere in the file /public/mobile/index.php
I am trying to display a message to my "free members" only (who are in group permission #9)
Any help would be nice.
That's a normal PHP file, so you can do anything. The user's groups are stored in $group_id (array).
Re: IF Statement code
PostPosted: 20 Oct 2022, 10:12
by jackal
That's a normal PHP file, so you can do anything. The user's groups are stored in $group_id (array).
I tried a lot of different codes but none work
<?php if ($group_id == 9) { ?>
Message to free members.
<?php } ?>
What am I doing wrong?
Re: IF Statement code
PostPosted: 21 Oct 2022, 14:40
by jackal
$group_id (array) ?? Alittle help?
<?php if $group_id == (9) { ?>
Message to free members.
<?php } ?>
el que no llora no mama.
Re: IF Statement code
PostPosted: 22 Oct 2022, 10:48
by Jason
if (in_array(9, $group_id))
That is what you're looking for. If you need to do other things with it, just search for info on PHP arrays.
Re: IF Statement code
PostPosted: 24 Oct 2022, 09:28
by jackal
if (in_array(9, $group_id))
That is what you're looking for. If you need to do other things with it, just search for info on PHP arrays.
That's exactly what I was looking for, thank you, sir !!!