لقد جربت هذا الكود في الرأس
document.addEventListener("DOMContentLoaded", function() {
setTimeout(() => {
let userTrustLevel = parseInt(Discourse.User.current().trust_level);
if (userTrustLevel < 4) {
document.querySelectorAll(".pin-topic, .unpin-topic").forEach(button => {
button.style.pointerEvents = "none";
button.style.opacity = "0.5";
button.title = "ليس لديك إذن لتثبيت المواضيع";
});
}
}, 1000); complet
});
وفي CSS
.d-header-icons .pin-topic,
.d-header-icons .unpin-topic,
.controls .pin-topic,
.controls .unpin-topic {
display: none !important;
}
ولكن يمكن للمستخدم البسيط ذي المستوى الثقة 1 أو 0 النقر على زر التثبيت ورؤيته.
إلغاء تثبيت المواضيع تلقائيًا عندما يصل المستخدم إلى الأسفل افتراضيًا. هذا معطل
إلغاء تثبيت المواضيع تلقائيًا عندما يصل المستخدم إلى الأسفل. هذا معطل


