News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Change "Last edit"

Started by heartbreakers, March 20, 2013, 11:12:58 PM

Previous topic - Next topic

heartbreakers

I want to change the look of the "last edit" stamp that shows up. I'd like for it to not be italicized and to simple say "Last edited: [Insert date and time]." I'd also like to change the color to a slightly lighter color than the dark gray/blackish color I have set for the actual post. How can I do this?

shadow82x

In ../Themes/{your_theme}/Display.template.php
Code (Find) Select
if ($settings['show_modify'] && !empty($message['modified']['name']))
echo '
« <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '</em> »';


Code (Replace With) Select
if ($settings['show_modify'] && !empty($message['modified']['name']))
echo '
« ', $txt['last_edit'], ': ', $message['modified']['time'], ' »';


And to adjust the style of it go to ../Themes/{your_theme}/css/index.css
Code (Find) Select
#forumposts .modified
{
float: left;
}

Code (Replace) Select
#forumposts .modified
{
float: left;
color: #444;
}
Colin B
Former Spammer, Customize, & Support Team Member

heartbreakers

If I want to get rid of    « », I can just remove then too right?

shadow82x

Yup you can just remove them directly from the code
' $txt['last_edit'], ': ', $message['modified']['time'], '';
Colin B
Former Spammer, Customize, & Support Team Member

thearmykid

You could always use this mod http://custom.simplemachines.org/mods/index.php?mod=3361 if you just want to disable the last edit for the admins.

Kindred

he doesn't want to disable it, he wants to change the displayed text....
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

heartbreakers


heartbreakers

Just one more question: The mod that I used to use to remove last edits when I would need to make the OP look nicer depending on the member that posted a news (or whatever else) topic doesn't work now that I edited the original code. Is there a way to fix this? I use the "Remove 'Last Edit' Mod."

This is how my code looks now:
echo '
                        ', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '';

      echo '


I also don't want to use the other mod linked in this thread, because I do need to utilize the last edit stamp if I ever change a rule or anything official.

shadow82x

Assuming you have the "Remove Last Edit Mod Installed"

You should could use the following code:

echo '
', $txt['last_edit'], ': ', $message['modified']['time'];

// Dirty yet beautiful edits.
if ($settings['show_modify'] && !empty($message['modified']['name']) && $message['can_rlem'])
echo '; <a href="', $scripturl, '?action=unsetedittime;post=', $message['id'], '">', $txt['remove_edit_sign'], '</a>';

if ($settings['show_modify'] && !empty($message['modified']['name']))
Colin B
Former Spammer, Customize, & Support Team Member

heartbreakers

I uninstalled it before I edited the display.template file. I tried reinstalling, but it says the test failed for the display.template file (since I edited it). So should I still go ahead with the installation and then just manually edit the display.template file?

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

heartbreakers

This is what I have so far:

if ($settings['show_modify'] && !empty($message['modified']['name']))
         echo '
                        ', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '';

      echo '
                     </div>


Should I include the if ($settings['show_modify'] && !empty($message['modified']['name'])) code twice? It's already there in the code I listed first.

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

heartbreakers

This is what I tried to do:

// Show "� Last Edit: Time by Person �" if this post was edited.
      if ($settings['show_modify'] && !empty($message['modified']['name']))
                  echo '
                         ', $txt['last_edit'], ': ', $message['modified']['time'];
     
      // Dirty yet beautiful edits.
      if ($settings['show_modify'] && !empty($message['modified']['name']) && $message['can_rlem'])
         echo '; <a href="', $scripturl, '?action=unsetedittime;post=', $message['id'], '">', $txt['remove_edit_sign'], '</a>';
     
                     </div>


And I got the following error: Parse error: syntax error, unexpected '<' in Display.template.php on line 564

Kindred

you need ot put

echo '


in front of that <div>
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

heartbreakers

Okay, so it fixed that error. When I went to remove one of the edit stamps, I got the following error:

Quote
An Error Has Occurred!
Invalid action call.

Kindred

ok....   at this point, I have no idea what you have done or what you are trying to do.

You made some manual edits, then decided to apply a mod and make more edits....
So who knows what state your code is in at this point....
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

heartbreakers

I only edited the display.template file. Nothing else has been altered. I only removed << >> and the italics from the display.template. There were no other edits.

shadow82x

Could you attach that entire Display.template.php file here? I had the mod working with the edits I mentioned earlier without any errors. So I'm assuming some code on your end is wrong.
Colin B
Former Spammer, Customize, & Support Team Member

heartbreakers


shadow82x

You didn't paste the full code I posted earlier. You were missing
if ($settings['show_modify'] && !empty($message['modified']['name']))

Try the attached file
Colin B
Former Spammer, Customize, & Support Team Member

NanoSector

Can you copy the last bit of the link from one of the buttons, here? The bit before index.php can be left out.

The mod shouldn't act like this, when there is ;post=### in the URL.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

heartbreakers

Quote from: Shadow82x on March 22, 2013, 04:18:24 PM
You didn't paste the full code I posted earlier. You were missing
if ($settings['show_modify'] && !empty($message['modified']['name']))

Try the attached file

I still get the same error of "Invalid action call."

Quote from: Yoshi2889 on March 22, 2013, 04:20:01 PM
Can you copy the last bit of the link from one of the buttons, here? The bit before index.php can be left out.

The mod shouldn't act like this, when there is ;post=### in the URL.

Sure. This is how it looks: /index.php?action=unsetedittime;post=111

NanoSector

In Sources/Subs-RemoveLastEditMod.php, change:

Find:
if (empty($_REQUEST['post']))

Replace:
if (empty($_GET['post']))

and see if it works.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Advertisement: