Advertisement:

Author Topic: About PersonalMessage.template.php scripting help  (Read 866 times)

Offline Mick.

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,986
  • Gender: Male
    • idesignSMF on Facebook
    • @idesign360 on Twitter
    • idesignSMF.com
About PersonalMessage.template.php scripting help
« on: May 17, 2019, 10:37:53 AM »
PersonalMessage.template.php is a file i've never ventured in before. Let me pick your brain for a sec, lately i've been getting PM's by folks that want support and we all know we ignore them since that's why we have support boards. I've been wanting to add a warning message when users want to send me (admin, user#1) PM. Some simple text like: "Please do not PM for support, blah blah blah".

Question is, i can't use if ($context['user']['is_admin']) i would be the only who reads it. Then i thought using member id but that too confuses me. How would i go about the message i want to display is towards me and me only when users want to PM me?

Any help much appreciated, M.

Offline Mick.

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,986
  • Gender: Male
    • idesignSMF on Facebook
    • @idesign360 on Twitter
    • idesignSMF.com
Re: About PersonalMessage.template.php scripting help
« Reply #1 on: May 17, 2019, 10:44:13 AM »
The easiest way would be in here.... adding a simple text but everyone would read it when they message each other. Which is not so bad either. Please do not contact author for support, use article system blah blah

Code: [Select]
// Main message editing box.
echo '
<div class="cat_bar">
<h3 class="catbg">
<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/im_newmsg.gif" alt="', $txt['new_message'], '" title="', $txt['new_message'], '" />&nbsp;', $txt['new_message'], '</span>
</h3>

<div>Some warning text can be placed here</div>
</div>';

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,368
    • StoryBB/StoryBB on GitHub
Re: About PersonalMessage.template.php scripting help
« Reply #2 on: May 17, 2019, 10:44:28 AM »
The question becomes displaying something if not admin, right?

if (!$context['user']['is_admin']) {
   // stuff goes here for non admins
}
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,119
Re: About PersonalMessage.template.php scripting help
« Reply #3 on: May 17, 2019, 10:50:44 AM »
he wants if the to line has the admin user then it shows x message.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,368
    • StoryBB/StoryBB on GitHub
Re: About PersonalMessage.template.php scripting help
« Reply #4 on: May 17, 2019, 11:04:35 AM »
Ooh, good luck with that, that’s basically hell to implement.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Mick.

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,986
  • Gender: Male
    • idesignSMF on Facebook
    • @idesign360 on Twitter
    • idesignSMF.com
Re: About PersonalMessage.template.php scripting help
« Reply #5 on: May 17, 2019, 11:07:49 AM »
Thank you guys... I went with something much simpler. At first i wanted the message when people PM me, not each other.  But now i have it where everyone reads the message regardless who are they PMing.

Find:
Code: [Select]
echo '
<dl id="post_header">';

Add after:
Code: [Select]
        echo '
                                <div class="pm-warning">Please, do not contact the author for support. Instead, reply to articles so others can also find the answer. Regards, The idesignSMF team.</div>';

The CSS
Code: [Select]
.pm-warning {
   background-color: #2ecc71;
   width: 100%;
   color: #ffffff;
   font-size: 18px;
   line-height: 22px;
   text-align: center;
   padding: 15px;
   display: block;
   margin-bottom: 20px;
}
« Last Edit: May 17, 2019, 11:27:30 AM by Mick. »

Offline Mick.

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,986
  • Gender: Male
    • idesignSMF on Facebook
    • @idesign360 on Twitter
    • idesignSMF.com
Re: About PersonalMessage.template.php scripting help
« Reply #6 on: May 17, 2019, 11:08:19 AM »
Ooh, good luck with that, that’s basically hell to implement.
hahhaa that's what i thought. No worries brother, I went the easy way.