How to make published articles visible only to strangers?
Nine
Nine 2022-05-12 22:45:26
0
2
1184

Excuse me, how can I make my published articles visible only to strangers? I want to make a paginated article list. The articles published by everyone are on the same page, but the visibility permissions can be set for the articles published by everyone. Some articles are only visible to friends, some are visible to everyone, and some are only visible to strangers. Visible, for example, A and B are my friends, but C is not. I published an article that is only visible to friends. Then A and B can see the article when they enter the page. C cannot see it. I published an article that is only visible to friends. For articles that are visible to strangers, A and B will not be able to see them when they enter them, but C will be able to see them. How to implement this? It must be able to be paginated

Nine
Nine

reply all(1)
独孤影子

The simple design is a friend table, and the article table has publisher and permission (set who can see) fields.

For example, the query condition for A and B to enter the article page is where permission = all or (the publisher is his friend and the permission is visible to friends)

c enters where permission = all or (published) The person is not your friend and the permission is visible to strangers)

If the amount of data is large, you have to think again

  • reply If you follow your idea, simplify it a bit. The query condition for entering the article page is where permission = all or (permission = visible only to friends and the publisher is my friend) or (permission = visible only to strangers and the publisher is not my friend) or (permission = only visible to me and the publisher is myself), now my difficulty is, how do I know whether the publisher is my friend during mysql query?
    Nine author 2022-05-13 17:44:42
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template