Hide the sentence "Last edited by..." on specific or all messages

Go down

Hide the sentence "Last edited by..." on specific or all messages

Post by Ange Tuteur on October 30th 2015, 11:35 am

Hide the sentence "Last edited by..." on specific or all messages


This trick allows your to hide the sentence "Last edited by..." when you edit your messages :


This modification is applicable to any forum version. Smile


Hide all edits on messages


Admin panel >> Display >> Templates >> General

Open the viewtopic_body template and search for the
Code:
{postrow.displayed.EDITED_MESSAGE}
variable. Edit

Delete this variable from your template and don't forget to save and publish the template when you're finished. Add


Hide edits only on specific messages


Admin panel >> Display >> Templates >> General

Open the viewtopic_body template and search for the
Code:
{postrow.displayed.EDITED_MESSAGE}
variable. Edit

Wrap the variable with a
Code:
<span>
tag that has the "edit" class :
Code:
<span class="edit">{postrow.displayed.EDITED_MESSAGE}</span>


Now, create a new javascript and select "in the topics" for the placement :
Admin panel >> Modules >> JavaScript codes management >> Create a new script

Paste the following code :
Code:
$(function(){
  $(".postbody").filter(function(){
    return-1!=$(this).html().indexOf("[hideedit]")&&$(this).html($(this).html().replace(/\[hideedit\]/g,""))
  }).parent().find("span.edit").remove()
});

Don't forget to submit!

Right now, to not have the sentence "Last edited by..." on a specific message, you have to add the following tag onto your message : [hideedit] !

For example :

Once posted :

avatar
Ange Tuteur
Forumaster

Male Posts : 13195
Reputation : 2910
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum