Notify Modification Last Post

Started by M-DVD, January 06, 2009, 07:45:29 AM

Previous topic - Next topic

ltdeta

is it possible making this feature optional?

for example changing  the document state  to "topic closed" etc. will mark it as new or bump it.

in other cases changes shoud not shown as new or bumped topic but this is also impossible at the moment

@ngel

Here's the FRENCH translation:
Quote
$txt['ModifyLastPostMail'] = 'Autoriser la notification par e-mail si le dernier message a été édité';
$txt['ModifyLastPostMail_sub'] = 'Envoyer une notification aux utilisateurs qui ont souscrits au fil de discussion';
$txt['ModifyLastPostBump'] = 'Marquer le fil de discussion si le dernier message a été édité';
$txt['ModifyLastPostBump_sub'] = 'Cette option affiche également l\'icône (voir option suivante)';
$txt['ModifyLastPostIcon'] = 'Afficher l\'icône "Nouveau"';
$txt['ModifyLastPostIcon_sub'] = 'Afficher l\'icône "Nouveau" si le dernier message a été modifié.';
$txt['notification_modify_subject'] = 'Réponse modifiée: %s';
$txt['notification_modify'] = 'Le dernier message, d\'un fil de discussion que vous suivez, a été modifié par %s.' . "\n\n" . 'Pour voir la réponse, aller à: ';]]></add>

Quote
   $search = array ('Réponse au fil de discussion', 'Une réponse a été postée');
   $replace = array ('Réponse modifiée', 'Le dernier message a été modifié');

matiaz

I think that found a bug. When the mod it's activated, the second quick edit consecutive on the last post don't work.

FF/Opera don't show any error but the edit never gone and "Loading" ajax tooltip stay active on top of page. IE show an error on "scripts.js" file. Exactly on this line:
if (typeof(element.innerHTML) != 'undefined')

¿Any idea? Thanks for the mod M-DVD  ;)

Raffoz

MacOsX (last)
SMF 2.0.15 and 2.1.2 (different forums)
Chrome (last) or Safari (last)

Allusion

Version 1.3 should work fine on SMF 2.0 RC3. One file (Themes/default/scripts/xml_topic.js) is not found during installation, but otherwise there shouldn't be a problem, as far as I can see.

steve51184

hey anyone having the problem that when you edit a post it changed the topic/post id so if you edit a post and then save it to have to edit it again it'll say that post doesn't exist as it has changed the id

the only was round this is to refresh the page :(

Noiz

Quote from: robinrobin on July 30, 2009, 08:24:09 AM
Would this mod by any chance perhaps be able to be modified so that it bumps the FIRST post of a topic? That would be great for topics where the first post is updated often, like in developer update topics.

I don't see the point with bumping a topic just because the latest post was edited. The latest post of a topic is usually made by a regular member who has nothing to do with the topic itself, so why it would be important to bump the last posts edit is beyond my understanding.

Also, we need your help with the list of contributions in posts in the Contributions mod, M-DVD.  O:)

A little late to the party, and sorry to bump such an old topic, but this feature would be very useful for our office forum. Is M-DVD still around?

Veritas01

any plans to update this to 2.0 RC4?

Makar


Sorry for my english

Makar

Anybody home? by rc5 does not work

Sorry for my english

TheKillers

Quote from: Makar on March 10, 2011, 06:14:24 AM
Anybody home? by rc5 does not work
Similarly. I installed this mod 5 times, but it does not work on RC5.  :'(

Raffoz

MacOsX (last)
SMF 2.0.15 and 2.1.2 (different forums)
Chrome (last) or Safari (last)

FireDitto

Adding my desire to see a 2x version.
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

Sapozhnik

#53
For SMF 2.0.X was made some changes.
File is attached.

Attachment removed by Yoshi2889; the mods license does not permit the distribution of mod copies

NanoSector

Sapozhnik, I'm sorry to say that I had to remove your attachment. The mod license does not allow you to distribute copies of it, no matter if it is changed or not.
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."

WebAngel

#55
If you want to install this mod while using SMF 2.0.x, you might be interested in the following link:
Simple Machines Community Forum »    SMF Support »    SMF 2.0.x Support »    Topic: Edited post seen as a new post


edit by Kindred to add the contents of that post and by K@, to remove quotes.


Based on the latest available version (1.3)

Blue lines are new lines
Red lines are edited lines

install_1.php and install_1.xml and install_2.php are unchanged.

emaillang.xml:
I have added some french translations
Quote from:  file emaillang.xml
   <file name="$languagedir/EmailTemplates.french-utf8.php" error="skip">
      <operation>
         <search position="after"><![CDATA[
/*
   @additional_params: happy_birthday]]></search>
         <add><![CDATA[
//   MOD Notify Modification Last Post
   // Traslate this
   $search = array ('Réponse au fil de discussion', 'Une réponse a été postée');
   $replace = array ('Réponse modifiée', 'Le dernier message a été modifié');

   // Do not touch this
   $sub_type_arr = array ('', '_body', '_once', '_body_once');
   foreach ($sub_type_arr as $sub_type)
      $txt['emails']['notification_modify' . $sub_type] =
         str_replace($search, $replace, $txt['emails']['notification_reply' . $sub_type]);
]]></add>
      </operation>
   </file>
   

Applied changes from Sapozhnik for Russian language
Quote from:  file emaillang.xml
   </file>
   <file name="$languagedir/EmailTemplates.russian.php" error="skip">
      <operation>
         <search position="after"><![CDATA[
/*
   @additional_params: happy_birthday]]></search>
         <add><![CDATA[
//   MOD Notify Modification Last Post
   // Translate this
   $search = array ('Topic reply', 'Появился ответ от');
   $replace = array ('Reply modified', 'Сообщение было отредактировано пользователем');


   // Do not touch this
   $sub_type_arr = array ('', '_body', '_once', '_body_once');
   foreach ($sub_type_arr as $sub_type)
      $txt['emails']['notification_modify' . $sub_type] =
         str_replace($search, $replace, $txt['emails']['notification_reply' . $sub_type]);
]]></add>
      </operation>
   </file>
   <file name="$languagedir/EmailTemplates.russian-utf8.php" error="skip">
      <operation>
         <search position="after"><![CDATA[
/*
   @additional_params: happy_birthday]]></search>
         <add><![CDATA[
//   MOD Notify Modification Last Post
   // Translate this
   $search = array ('Topic reply', 'Появился ответ от');
   $replace = array ('Reply modified', 'Сообщение было отредактировано пользователем');


   // Do not touch this
   $sub_type_arr = array ('', '_body', '_once', '_body_once');
   foreach ($sub_type_arr as $sub_type)
      $txt['emails']['notification_modify' . $sub_type] =
         str_replace($search, $replace, $txt['emails']['notification_reply' . $sub_type]);
]]></add>
      </operation>
   </file>



install_2.xml:
The following changes are the ones making it compatible with SMF 2.0.x
Quote from:  file install_2.xml.xml
         <search position="after"><![CDATA[
      $flag = $smcFunc['db_affected_rows']() != 0;

      if (empty($flag))
]]></search>

         <add><![CDATA[

   if ($modSettings['ModifyLastPostMail'] || $modSettings['ModifyLastPostBump'] || $modSettings['ModifyLastPostIcon'])
      NotifyUpdateLastMessages($msgOptions, $topicOptions);
]]></add>
      </operation>
   </file>

   <file name="$themedir/scripts/topic.js">



language.xml:
Quote from:  file language.xml
   <file name="$languagedir/Modifications.french-utf8.php" error="skip">
      <operation>
         <search position="end" />
            <add><![CDATA[
//   MOD Notify Modification Last Post
$txt['ModifyLastPostMail'] = 'Autoriser la notification par e-mail si le dernier message a été édité';
$txt['ModifyLastPostMail_sub'] = 'Envoyer une notification aux utilisateurs qui ont souscrits au fil de discussion';
$txt['ModifyLastPostBump'] = 'Marquer le fil de discussion si le dernier message a été édité';
$txt['ModifyLastPostBump_sub'] = 'Cette option affiche également l\'icône (voir option suivante)';
$txt['ModifyLastPostIcon'] = 'Afficher l\'icône "Nouveau"';
$txt['ModifyLastPostIcon_sub'] = 'Afficher l\'icône "Nouveau" si le dernier message a été modifié.';
$txt['notification_modify_subject'] = 'Réponse modifiée: %s';
$txt['notification_modify'] = 'Le dernier message, d\'un fil de discussion que vous suivez, a été modifié par %s.' . "\n\n" . 'Pour voir la réponse, aller à: ';]]></add>
      </operation>
   </file>
   
Quote from:  file language.xml
   <file name="$languagedir/Modifications.russian.php" error="skip">
      <operation>
         <search position="end" />
            <add><![CDATA[
//   MOD Notify Modification Last Post - Translation by vika.vedy
$txt['ModifyLastPostMail'] = 'Включить email-уведомления при редактировании последнего сообщения';
$txt['ModifyLastPostMail_sub'] = 'Отправить уведомления пользователям, подписанным на тему';
$txt['ModifyLastPostBump'] = '"Поднять" тему после редактирования последнего сообщения';
$txt['ModifyLastPostBump_sub'] = 'Включение этой опции также позволяет показать соотв. иконку (см. следующую опцию)';
$txt['ModifyLastPostIcon'] = 'Показать иконку "Новое"';
$txt['ModifyLastPostIcon_sub'] = 'Показать иконку "Новое" для темы после редактирования последнего сообщения.';
$txt['notification_modify_subject'] = 'Ответ изменён: %s';
$txt['notification_modify'] = 'Последнее сообщение в теме, на которую Вы подписались, было изменено участником %s.' . "\n\n" . 'Посмотреть сообщение: ';]]></add>
      </operation>
   </file>
   <file name="$languagedir/Modifications.russian-utf8.php" error="skip">
      <operation>
         <search position="end" />
            <add><![CDATA[
//   MOD Notify Modification Last Post - Translation by vika.vedy
$txt['ModifyLastPostMail'] = 'Включить email-уведомления при редактировании последнего сообщения';
$txt['ModifyLastPostMail_sub'] = 'Отправить уведомления пользователям, подписанным на тему';
$txt['ModifyLastPostBump'] = '"Поднять" тему после редактирования последнего сообщения';
$txt['ModifyLastPostBump_sub'] = 'Включение этой опции также позволяет показать соотв. иконку (см. следующую опцию)';
$txt['ModifyLastPostIcon'] = 'Показать иконку "Новое"';
$txt['ModifyLastPostIcon_sub'] = 'Показать иконку "Новое" для темы после редактирования последнего сообщения.';
$txt['notification_modify_subject'] = 'Ответ изменён: %s';
$txt['notification_modify'] = 'Последнее сообщение в теме, на которую Вы подписались, было изменено участником %s.' . "\n\n" . 'Посмотреть сообщение: ';]]></add>
      </operation>
   </file>




package-info.xml:
Quote from:  file package-info.xml
   <version>2.0</version>

Quote from:  file package-info.xml
   <install for="2.0 - 2.99.99">
      <readme type="file" parsebbc="true">readme.txt</readme>
      <modification format="xml" type="file">install_2.xml</modification>
      <modification format="xml" type="file">languages.xml</modification>
      <modification format="xml" type="file">emaillang.xml</modification>
      <code type="file">install_2.php</code>
      <redirect url="index.php?action=admin;area=postsettings;sa=posts" timeout="10000">redirect.txt</redirect>
   </install>



readme.txt:
Watch out the website modifies the following lines automatically, just edit readme.txt accordingly.
Quote from:  file readme.txt
http://www.simplemachines.org Version 2.0
   ! Fix little bug in name of file JS and in russian lang.file
   + French-utf8 in the package
   o v.2.0  Compatible with SMF 1.1.X & SMF 2.0.X & SMF 2.0 RC(3-5) (!!! Not compatible with SMF 2.0 RC(1-2))


I hope it helps... and once more, many thanks to Sapozhnik.

petb

#56
Hi,

are yo sure with the search Position after Statement (shown in green)  ?

Quote from: WebAngel on July 08, 2013, 06:58:40 AM

install_2.xml:
The following changes are the ones making it compatible with SMF 2.0.x
Quote from:  file install_2.xml.xml
         <search position="after"><![CDATA[
      $flag = $smcFunc['db_affected_rows']() != 0;

      if (empty($flag))

]]></search>

         <add><![CDATA[

   if ($modSettings['ModifyLastPostMail'] || $modSettings['ModifyLastPostBump'] || $modSettings['ModifyLastPostIcon'])
      NotifyUpdateLastMessages($msgOptions, $topicOptions);
]]></add>
      </operation>
   </file>

   <file name="$themedir/scripts/topic.js">


I think there must be an } between.

Dont you think for 2.0.6 it should be like this ?
$flag = $smcFunc['db_affected_rows']() != 0;
}

if (empty($flag))

I believe this is in Section "// Mark inserted topic as read (only for the user calling this function)." which is previous used from the mod.
Or is it my personal difference in Subs-Post.php ?
Or am i false and it has to be in the Section "// Mark the edited post as read."
So realy have to use
$flag = $smcFunc['db_affected_rows']() != 0;

if (empty($flag)))

Koshmaar

Hello, could anyone confirm petb post?

Also it would be great if there was a zip with all the changed files for 2.0, to be downloaded.

petb

Did you try an install with the original Version ?

Koshmaar

Yes I tried, and it gave me an error in few files. I have SMF 2.02.

Advertisement: