Jump to content

How can I add if member_id it's in array


rzda

Recommended Posts

4 minutes ago, Adriano Faria said:

$member->member_id

i got error 500

 

edit

{{if in_array($member->member_id,array(1))}}
{template="apverifiedgroup" group="plugins" location="global" app="core"}
{{endif}}

this is the code

and i got this error:

This site can’t be reached

The webpage at domain might be temporarily down or it may have moved permanently to a new web address.

ERR_CONTENT_DECODING_FAILED
 
245e05a4eff3d8740ca117fb055502b4.png
Link to comment
Share on other sites

20 minutes ago, Adriano Faria said:

If you want to show something to the user ID=1, just do {{if $member->member_id == 1}}. You don’t need an array there. Obviously $member needs to be a Member object. 

i want if the users' id is mentioned in array to show something

{$name} {{if in_array($member->member_id,array(1,3,4))}}[MOD]{{endif} and anyone to be able to see.

i hope you understand ?

also if you have another idea how can i make it to work, im glad to hear your idea

Link to comment
Share on other sites

1 hour ago, Aiwa said:

That's what GROUPS are for... Create a group to manage this....


{{if in_array($your_group_id,$member->groups )}}
Something to show only to this $your_group_id
{{endif}}

 

That's the point, i dont want something to appear just for some users.

I want to add a badge after the name of some users.

So i need to make an array to add their member_ids.

This must bee visible to everyone,

something like this

AoYdaUc.png

This should be visible by everyone, but to appear only to the members who have the id in the array.

 

Link to comment
Share on other sites

So, the code I gave you will do the same thing. 

I was assuming that $member was the logged in member.  If the scope is such that you're using it in the authorPane and $member is the poster, the same code will work and will show what you want to ALL users based on the author's group.

Link to comment
Share on other sites

10 hours ago, Aiwa said:

So, the code I gave you will do the same thing. 

I was assuming that $member was the logged in member.  If the scope is such that you're using it in the authorPane and $member is the poster, the same code will work and will show what you want to ALL users based on the author's group.

{{if in_array(4,5,6,$member->groups )}}
Something to show only to this $your_group_id
{{endif}}

i will use it like this?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...