Firefox PHP

Module: Drop Edit Message

Posted by Maurice Makaay 
All files from this thread

File Name File Size   Posted by Date  
drop_editmessage-1.0.0.zip 2.5 KB open | download Maurice Makaay 02/21/2006 Read message
Module: Drop Edit Message
February 21, 2006 03:15PM
Module  : Drop Edit Message  
Version : 1.0.0
Author  : Maurice Makaay

This module will drop the "Edited [x] times..." message that is put below
a message after editing it. You can configure for which types of users to
do this (admins, moderators and users).

Install:
--------

- Unpack the archive;

- Move the directory "drop_editmessage" to the directory "mods"
  within your Phorum installation;

- Login as administrator in Phorum's administrative interface and
  go to the "Modules" section;

- Enable the module "Drop Edit Message".


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Attachments:
open | download - drop_editmessage-1.0.0.zip (2.5 KB)
Re: Module: Drop Edit Message
February 22, 2006 05:16AM
Hey, I was just thinkin about doing this for myself (to use with FAQ template).

Thanks Maurice

---
-=[ Panu ]=-
Re: Module: Drop Edit Message
March 21, 2006 04:23PM
Hello,

I've uploaded this mod just after i've made the upgrade to Phorum version 5.1.10
Then I've edited the settings in order to Drop edit message for administrators only, but when i look at my messages posted as admin - posted before the v.5.1.10 upgrade and edited several times before the v.5.1.10 upgrade - the "Edited x time(s).." is still there.

Is this mod compatible with Phorum 5.1.10?

Thanks so much,
tito

---

Be silent as to services you have rendered, but speak of favours you have received --Seneca--
Re: Module: Drop Edit Message
March 21, 2006 04:38PM
The edit info is dropped at post time, not at read time (I did not see a good way to handle this cleanly at read time). So you'll only see the effect with newly edited messages. To remove the edit message from an old post, simply edit and save it with the module enabled.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Drop Edit Message
March 21, 2006 05:04PM
I see, it works great now. Thank you Maurice

---

Be silent as to services you have rendered, but speak of favours you have received --Seneca--
Re: Module: Drop Edit Message
March 31, 2006 08:55AM
Hi,
in my Phorum 5.0.21 I use the following code in the read template to surround the edit message with <span> tags:

$editedMessage = "|(".preg_quote($PHORUM["DATA"]["LANG"]["EditedMessage"]).")$|m";
$editedMessage = str_replace("%count%", "([0-9]+)", $editedMessage);
$editedMessage = str_replace("%lastedit%", "([0-9 \.:]+)", $editedMessage);
$editedMessage = str_replace("%lastuser%", "(.+)", $editedMessage);
$body = preg_replace($editedMessage, "<span class=\"edited\">$1</span>", $PHORUM['TMP']['MESSAGES']['body']);

Maybe something similar could be done to remove the old messages at read time.

HTH,
Mensler

--
Clemens Weiß
Webplain.de
Re: Module: Drop Edit Message
March 31, 2006 09:33AM
Thanks for the suggestion.

I have tried the same kind of code too, but eventually went for the solution of dropping edit information at post time in the module. That solution is lighter, because no post-processing has to be done. Another reason for implementing the mod like I did now, was that removing the edit notice could easily be made conditional. If you want to only hide moderator edit actions at read time, you have to do user processing to find out whether the user is an administrator or not. At post time, I only have to find out once.

It is still a good solution, but not one I would fit the philosophy of my mod.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Drop Edit Message
January 03, 2008 03:06PM
Hi,

Installled this on Phorum 5.2.5, it seems to work but I get this message on the modules settings page:

Quote

One or more deprecated hook names were detected in the installed modules. Although the modules will still work, we advice you to update the hook names in the module info and/or contact the module author.
Deprecated hook(s):

* Mod drop_editmessage: rename "pre_edit"; to "before_edit"

--
Bert Garcia - When all you have is a keyboard
Re: Module: Drop Edit Message
January 03, 2008 03:23PM
Yes, it's not yet ported to 5.2. In 5.2, a few hook names were renamed for consistency. If you want, you can get rid of the warning by editing info.txt in the module's directory and changing the hook statement "hook: pre_edit|..." to "hook: before_edit|...".


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Drop Edit Message
January 03, 2008 03:34PM
Quote
mmakaay
If you want, you can get rid of the warning by editing info.txt in the module's directory and changing the hook statement "hook: pre_edit|..." to "hook: before_edit|...".

Done, no more message!

I was opening up the .php files and looking for the hook, but couldn't find it, never bothered to look in a .txt file. So it's the info.txt file that instructs the system what hooks the mod uses, which answers another question (must read docs).

Thanks.

--
Bert Garcia - When all you have is a keyboard
Sorry, only registered users may post in this forum.

Click here to login