Page 1 of 1

I need your help please

Posted: Fri Feb 23, 2024 5:12 pm
by Hariph
I set my forum post to pending, so basically when anyone creates a post it automatically stays pending, but I want to hide the pending posts from users until it has been published by admin, I tried alot of code none of them worked both pending and published posts keeps on showing.. Please any ideas or help

Code: Select all

 {{(VALUE(%status%)@IFEQ() @THEN(pending)@ELSE@NULL)}} 
This is what I was using before, but wasn't working

Re: I need your help please

Posted: Fri Feb 23, 2024 9:09 pm
by francisco
In Post Lister you have a really cool setting called STATUS, but don't ask me why it's not documented hahaha
To accomplish what you want use the following in Enter Config:

Code: Select all

<STATUS>{{VAR(USER_ROLE)@IFMATCH(Admin)@THEN(All)@ELSE(Published)}}</STATUS>
With this, only posts with Published status will be displayed to common users and visitors.


However, if you wanted to continue using your own version of the code, the correct syntax would be:

Code: Select all

{{(VALUE(%status%)@IFEQ(Published)@THEN(%title% - %content% etc)@ELSE@NULL)}}

Re: I need your help please

Posted: Sat Feb 24, 2024 10:37 pm
by Hariph
Wow thanks so much

Re: I need your help please

Posted: Sun Feb 25, 2024 2:33 pm
by Hariph
francisco wrote: Fri Feb 23, 2024 9:09 pm In Post Lister you have a really cool setting called STATUS, but don't ask me why it's not documented hahaha
To accomplish what you want use the following in Enter Config:

Code: Select all

<STATUS>{{VAR(USER_ROLE)@IFMATCH(Admin)@THEN(All)@ELSE(Published)}}</STATUS>
With this, only posts with Published status will be displayed to common users and visitors.


However, if you wanted to continue using your own version of the code, the correct syntax would be:

Code: Select all

{{(VALUE(%status%)@IFEQ(Published)@THEN(%title% - %content% etc)@ELSE@NULL)}}
Is there also anyway or code show the total number of forum posts a user has made