Reason For Editing Mod

Started by Nibogo, May 23, 2006, 12:44:11 AM

Previous topic - Next topic

Teknomancer

Actually i fixed it...

isset () is not working

it is always returning TRUE meaning even if NO reason was specified it was getting TRUE.

I changed it to this:


if ($message['modified']['edit_reason'] != '')
echo '<br />Reason: ' . $message['modified']['edit_reason'] . '</i> »';
else
echo '</i> »';


now it works perfectly!

Thanks wonderful mod.
My SMF Forum:

Harzem

Instead of isset, you can use !empty, so there won't be that problem.

winrules

Quote from: Teknomancer on May 27, 2006, 10:38:59 AM
Actually i fixed it...

isset () is not working

it is always returning TRUE meaning even if NO reason was specified it was getting TRUE.

I changed it to this:


if ($message['modified']['edit_reason'] != '')
echo '<br />Reason: ' . $message['modified']['edit_reason'] . '</i> »';
else
echo '</i> »';


now it works perfectly!

Thanks wonderful mod.

Oh, thats where I messed  up.

« <i>', $txt[211], ': ', $message['modified']['time'], ' ', $txt[525], ' ', $message['modified']['name'], isset($message['modified']['edit_reason']) ? ', Reason: ' . $message['modified']['edit_reason'] : '' , '  </i> »';

should be:

« <i>', $txt[211], ': ', $message['modified']['time'], ' ', $txt[525], ' ', $message['modified']['name'], !empty($message['modified']['edit_reason']) ? ', Reason: ' . $message['modified']['edit_reason'] : '' , '  </i> »';

I will release an update package later today.


edit: Harzem beat me to it :P


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


winrules

Version 1.11 has been released! This version fixes a bug with the mod displaying a reason when a reason isn't specified.


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


geezmo

Screenshot of how it actually looks in the board? Is it on the same line as "Edited On:..." in the post?

Or if there's anyone with a forum that uses this, let us take a look :D

sbarnes

I was going to post a pic for you to see but you may as well see it in action here:

http://www.pick-your-brains.co.uk/index.php/topic,102.msg678.html#msg678

winrules

Also there are some screenshots on the mod page.


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


Dazzler

This is now working perfect with the latest upload..

i am looking forward to any upgrades you may do to this with the likes of drop down box etc..

top class keep up the good work

SMF 1.1.3 + TP .983 + Copperminie

ltdeta

any chance to get it compatible with SMF 1.0.7 ?

DivZero

Hi,

Your mod seems great, and works perfectly on the default theme. But it doesnt display on the custom theme im using. Any code that I have to put in there? or should the mod have done that automaticly? Let me know :)

winrules

Quote from: DivZero on June 07, 2006, 01:09:25 PM
Hi,

Your mod seems great, and works perfectly on the default theme. But it doesnt display on the custom theme im using. Any code that I have to put in there? or should the mod have done that automaticly? Let me know :)
Look here: http://docs.simplemachines.org/index.php?topic=402


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


littleone

I an getting an undefined index for edit_reason.  Anyway to resolve this?  Thanks

winrules

Quote from: littleone on June 08, 2006, 11:08:14 PM
I an getting an undefined index for edit_reason.  Anyway to resolve this?  Thanks
What is the exact error you are getting, and what version of the mod are you running?


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


Vinspire

Winrules bro, I am using Helios Theme and want to get this mod working in the theme.

I've look into modification.xml and found this. I dont really understand.

Original code

<file name="$themedir/Display.template.php">
<operation>
<search position="replace"><![CDATA[
echo '
« <i>', $txt[211], ': ', $message['modified']['time'], ' ', $txt[525], ' ', $message['modified']['name'], '</i> »';
]]></search>
<add><![CDATA[
echo '
« <i>', $txt[211], ': ', $message['modified']['time'], ' ', $txt[525], ' ', $message['modified']['name'], !empty($message['modified']['edit_reason']) ? ', Reason: ' . $message['modified']['edit_reason'] : '' , '  </i> »';
]]></add>
</operation>

</file>


Edit display.template .... find

![CDATA[
echo '
« <i>', $txt[211], ': ', $message['modified']['time'], ' ', $txt[525], ' ', $message['modified']['name'], '</i> »';
]]


and add

<![CDATA[
echo '
« <i>', $txt[211], ': ', $message['modified']['time'], ' ', $txt[525], ' ', $message['modified']['name'], !empty($message['modified']['edit_reason']) ? ', Reason: ' . $message['modified']['edit_reason'] : '' , '  </i> »';
]]>


In Helios Theme there isn't post.template.php ... So, i need to create a file with that name or just leave it ?

winrules

If the file doesn't exist then skip it.


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


littleone

8: Undefined index: edit_reason
File: /home/xxxxxxx/public_html/forum/Sources/Post.php
Line: 2263


Version 1.11

winrules

Can you post the lines around line 2263 in Post.php?


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


Vinspire

Quote from: winrules on June 10, 2006, 09:37:54 AM
If the file doesn't exist then skip it.

Okie. Then what about this ?

I open helios theme display.template.php

I find

![CDATA[
echo '
« <i>', $txt[211], ': ', $message['modified']['time'], ' ', $txt[525], ' ', $message['modified']['name'], '</i> »';
]]


Then where to add

<![CDATA[
echo '
« <i>', $txt[211], ': ', $message['modified']['time'], ' ', $txt[525], ' ', $message['modified']['name'], !empty($message['modified']['edit_reason']) ? ', Reason: ' . $message['modified']['edit_reason'] : '' , '  </i> »';
]]>


Under it ?

winrules

replace the 2nd one with the first one.


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


littleone

Quote$posterOptions = array();

      if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
      {
         $msgOptions['modify_time'] = time();
         $msgOptions['modify_name'] = addslashes($user_info['name']);
      }
      $msgOptions['edit_reason'] = addslashes(strtr(htmlspecialchars($_POST['edit_reason']), array("\r" => '', "\n" => '', "\t" => '')));

      modifyPost($msgOptions, $topicOptions, $posterOptions);

      // Changing the first subject updates other subjects to 'Re: new_subject'.

The red line is 2263

Advertisement: