Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: tareko on March 30, 2019, 02:12:37 PM

Title: Arantor please help with how to do this
Post by: tareko on March 30, 2019, 02:12:37 PM
I want to remove this text that appears in a moderated post for one user only along with the red background color.

Note: This message is awaiting approval by a moderator.


Basically I do not want that member to know that his posts are being moderated.

Is it something like if user_info['id'] = 4? At what template? Please help me with this because it is very important to me.

And I do know that it is kind of pointless, but the user in question is not tech savvy and will not catch on. He is getting very irritating but I do not want to ban him outright as he is a long member of my forum.
Title: Re: Arantor please help with how to do this
Post by: vbgamer45 on March 30, 2019, 02:14:49 PM
In themes display.template.php


if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id'])
echo '
<div class="approve_post">
', $txt['post_awaiting_approval'], '
</div>';
Title: Re: Arantor please help with how to do this
Post by: tareko on March 30, 2019, 02:19:29 PM
Thanks mate. I do not see any condition for user_id 4 in that code. Checking the display.template.php file I see that that is the original code. How can I add the condition in there?
Title: Re: Arantor please help with how to do this
Post by: vbgamer45 on March 30, 2019, 02:26:35 PM
CHANGE TO

if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id']  && $message['member']['id'] != 4))
Title: Re: Arantor please help with how to do this
Post by: tareko on March 30, 2019, 02:34:30 PM
That is giving me an error.
Title: Re: Arantor please help with how to do this
Post by: vbgamer45 on March 30, 2019, 03:02:10 PM
change to

if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id']  && $message['member']['id'] != 4)
Title: Re: Arantor please help with how to do this
Post by: tareko on March 30, 2019, 05:26:45 PM
It is not working for me. I have an user at my forum who knows little php and he created a script that adds a new column in the members table called is_ignored. How can I add that to the conditional? I tried this but it did not work

if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id']  && $message['member']['id'] != $context['user']['is_ignored'])
Title: Re: Arantor please help with how to do this
Post by: Aleksi "Lex" Kilpinen on March 31, 2019, 07:22:52 AM
Just a quick note, pretty much never is it really a good idea to call out any specific member with a general support issue. It will work against you.
This includes but is not limited to mentioning a username in a title like in this case, and/or sending a pm/email/IM/smoke signals.
Title: Re: Arantor please help with how to do this
Post by: Doug Heffernan on March 31, 2019, 08:19:32 AM
Give this a try.


if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id'] && !$message['member']['is_ignored'])


It is untested, but it should work.
Title: Re: Arantor please help with how to do this
Post by: tareko on April 01, 2019, 09:10:17 AM
Quote from: Aleksi "Lex" Kilpinen on March 31, 2019, 07:22:52 AM
Just a quick note, pretty much never is it really a good idea to call out any specific member with a general support issue. It will work against you.
This includes but is not limited to mentioning a username in a title like in this case, and/or sending a pm/email/IM/smoke signals.

Why was it a bad idea? I meant it well. But from now on I will not call out any specific member.

Doug_ips thans mate. I will try it and let you know if it will work.
Title: Re: Arantor please help with how to do this
Post by: Aleksi "Lex" Kilpinen on April 01, 2019, 09:43:30 AM
Because everyone here volunteers their time, including the team, and it can seem demanding, even if not meant that way.
Title: Re: Lead Stableboy please help with how to do this
Post by: tareko on April 01, 2019, 05:46:06 PM
Quote from: Aleksi " Lex " Kilpinen on April 01, 2019, 09:43:30 AM
Because all the peoples here volunteers their time, including the team, and it can seem demanding, even if not meant that way.

I see. Well, I will not be doing it anymore in that case.

Doug_ips your code worked only partly. It removed the text that appears in a moderated post but it did not remove the pinkish background color. Please someone help.
Title: Re: Arantor please help with how to do this
Post by: Aleksi "Lex" Kilpinen on April 02, 2019, 12:07:38 AM
Thank you for understanding.