D
D
driverx182017-09-23 20:22:04
Bootstrap
driverx18, 2017-09-23 20:22:04

How is the process of hiding materials from certain users implemented?

Instagram has a mechanism like this: "hide story from", and you can hide your story from any user. You need to do the same thing on your site, as I understand it correctly, it is implemented like this:
Table hide_material :
id | user_id | hide_user_id
user_id is the id of the user who is hiding the history
hide_user_id is the Id of the user who is hiding from
That is, it is then selected in the code

SELECT hide_user_id from hide_material WHERE user_id = id пользователя какой загружает материал;

and this case is entered into the $hide_ids variable. And then the check is worth it, if the id is not included in $hide_ids, then you can show the material. Or is it better to implement it somehow differently?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
noeer, 2019-06-10
@MegaPuxapb

Can you do it like this

<div class="section">
  <div class="container">
    <div class="green"></div>
  </div>
</div>

.section{
  overflow: hidden;
}
.green{
  height: 100px;
  background: green;
  width: 100vw;
}

O
oh, 2017-09-23
well @AnneSmith

permissions are set for users depending on their role on the site, the
content is also divided into public and private, or some other categories, and when selecting content, the content flag and user access rights are checked
see how any cms is made with different access rights for the admin, user and content -manager

X
xmoonlight, 2017-09-23
@xmoonlight

Material:
id | material_id | ... | owner_user_id
id | object_table_name | object_id | set_for_user_id | permission_id | allow(bool) | deny(bool) | set_by_user_id
(allow(bool) | deny(bool) - for the simultaneous ability to work on the "white" and "black" list of rules with the ability to switch them;
object_table_name | object_id => (for example) 'material' | 1
)

id | object_table_name | permission_id | whitelist(bool) | set_by_user_id
id | permission | description
(examples:
1 | view | ability to view
2 | comment | ability to comment
3 | moderate | ability to moderate
)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question