Remove ''last edited'' message at the end of posts.

Started by faliro, August 08, 2017, 11:56:58 AM

Previous topic - Next topic

faliro

Just got a new theme and the thing is back and I cant remember what code I deleted to remove the thing in the first place! I have the mod that gives you the option to the remove it - but last time I was told what code to remove to get rid of it altogether.

Steve

DO NOT pm me for support!

faliro

Quote from: Steve on August 08, 2017, 12:11:23 PM
Why not use the mod? Just curious.

Just another button to push.. when no one in my forum wants that last edited message anyway.

I remember I deleted a very small section of code and it was gone.

Gary

Delete this code from Display.template.php

// Show "� Last Edit: Time by Person �" if this post was edited.
if ($settings['show_modify'] && !empty($message['modified']['name']))
echo '
&#171; <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '</em> &#187;';

Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

faliro

Quote from: Gary on August 08, 2017, 12:58:41 PM
Delete this code from Display.template.php

// Show "� Last Edit: Time by Person �" if this post was edited.
if ($settings['show_modify'] && !empty($message['modified']['name']))
echo '
&#171; <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '</em> &#187;';



All that is left now is double arrow that I highlighted in blue to show you. Any idea how to get rid of that?



Also i didn't have this on the end of the code: '</em> &#187;' - but deleted everything else that you pasted.


Shambles

What you highlighted is the &#187; »   (right angle quote, guillemotright)  which must be somewhere in that (or a subsequent) echo statement.

faliro

Quote from: Shambles on August 08, 2017, 01:46:22 PM
What you highlighted is the &#187; »   (right angle quote, guillemotright)  which must be somewhere in that (or a subsequent) echo statement.

I believe I deleted from somewhere in here, can't quite remember where. Does this look like the right region?

Quote{
         echo '
                           <a class="btn btn-default btn-sm" id="like_', $message['id'], '"', (!$message['can_dislike'] ? '' : ' style="display: none;"'), ' href="', $scripturl, '?action=like;topic=', $context['current_topic'], ';msg=', $message['id'], '"'.(!empty($modSettings['likes_with_ajax']) ? ' onclick="return like(' . $message['id'] . ', ' . $message['likes'] . ', false);"' : '').'>', $txt['likes_like'], '</a>';
         
         if (!empty($modSettings['likes_with_ajax']) && $context['browser']['is_ie'])
            echo '
               <script language="JavaScript" type="text/javascript">
                  // Rewrite the url :x so that internet explorer can not follow it
                  document.getElementById("like_' . $message['id'] . '").href = "#msg=' . $message['id'] . '";
               </script>';
               
         echo '
                           <a class="btn btn-default btn-sm" id="unlike_', $message['id'], '" ', ($message['can_dislike'] ? '' : 'style="display: none;"'), ' href="', $scripturl, '?action=like;topic=', $context['current_topic'], ';msg=', $message['id'], ';unlike"'.(!empty($modSettings['likes_with_ajax']) ? ' onclick="return like(' . $message['id'] . ', ' . $message['likes'] . ', true);"' : '').'>', $txt['likes_unlike'], '</a>';
      }

      // Maybe we can approve it, maybe we should?
      if ($message['can_approve'])
         echo '
                           <a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" class="btn btn-default btn-sm">', $txt['approve'], '</a>';

      // Can they reply? Have they turned on quick reply?
      if ($context['can_quote'] && !empty($options['display_quick_reply']))
         echo '
                           <a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" onclick="return oQuickReply.quote(', $message['id'], ');" class="btn btn-default btn-sm">', $txt['quote'], '</a>';

      // So... quick reply is off, but they *can* reply?
      elseif ($context['can_quote'])
         echo '
                           <a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" class="btn btn-default btn-sm">', $txt['quote'], '</a>';

      // Can the user modify the contents of this post?
      if ($message['can_modify'])
         echo '
                           <a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], '" class="btn btn-default btn-sm">', $txt['modify'], '</a>';
                           
                           
      // Quick Modify
      if ($message['can_modify'])
         echo '
                           <a href="javascript:void(0);" class="btn btn-default btn-sm" onclick="return oQuickModify.modifyMsg(\'', $message['id'], '\')"><i class="glyphicon glyphicon-pencil" style="line-height: inherit;" alt="', $txt['modify_msg'], '" title="', $txt['modify_msg'], '" id="modify_button_', $message['id'], '"></i></a>';

      // How about... even... remove it entirely?!
      if ($message['can_remove'])
         echo '
                           <a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['remove_message'], '?\');" class="btn btn-default btn-sm">', $txt['remove'], '</a>';
                        
      // Additional buttons
      if (($context['can_split'] && !empty($context['real_num_replies'])) || $context['can_restore_msg'] || $context['can_report_moderator'] || ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest']))
      {
         echo '   
         <div class="btn-group" role="group">
             <button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
               ', ucfirst($txt['more']), '
               <span class="caret"></span>
             </button>
             <ul class="dropdown-menu" role="menu">';

Gary

Quote from: Shambles on August 08, 2017, 01:46:22 PM
What you highlighted is the » »   (right angle quote, guillemotright)  which must be somewhere in that (or a subsequent) echo statement.

Indeed, that actually appears twice. Once for the time when a message was posted in general, and the other for when it was edited. This is why when searching for code it's better to Ctrl+F on the comments instead. :P
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

faliro

I think I sorted it finally. Thanks for all the help!

br360

Isn't there already an option to disable last edit notifications? Admin>>Configuration>>Current Theme

Then look for Show last modification date on modified posts: and make sure it is not checked

Steve

DO NOT pm me for support!

Advertisement: