An authorized user clicked a button and the article did not appear to him again?

She would just be hiding for a certain user.

Algorithm:
1. A person visits the site
2. Authorized
3. See all the news on the site
4. Click on the "hide" button for a particular article. More article with this ID is not shown to him.

!!! For other users, the article is visible until they also hide it.

Help to implement this. I am sure a couple of lines of code are needed there. I can not navigate.

  • Pulled user ID and other data. But I can not find exactly how for him to hide an article with a specific ID. - Alexander
  • Not familiar with DLE, but I would implement something like this, add dontshowusernews table (user_id, news_id) and when requesting a list of articles I would filter articles of a particular user that are in this table - Denis Startsev

1 answer 1

I will give a general algorithm of actions.

  1. Sparse user ID through variable member_id
  2. Check with the base (well, or as you have done there). If you do not show, then make a wrapper from php, where to put the code with the display: none property.
  3. The same code, only output condition. If allowed, output the news code. If it is prohibited, then the same code, only with the display: none property.