Advertisement:

Author Topic: Reason For Editing Mod  (Read 227188 times)

Offline Teknomancer

  • Jr. Member
  • **
  • Posts: 117
  • Gender: Male
    • Toons & Comics
Re: Reason For Editing Mod
« Reply #20 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:

Code: [Select]
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:

Offline Harzem

  • SMF Hero
  • ******
  • Posts: 5,384
  • Gender: Male
  • I know, my avatar is nerve-wracking!
Re: Reason For Editing Mod
« Reply #21 on: May 27, 2006, 10:42:55 AM »
Instead of isset, you can use !empty, so there won't be that problem.

Offline winrules

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,085
  • Gender: Male
Re: Reason For Editing Mod
« Reply #22 on: May 27, 2006, 10:43:17 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:

Code: [Select]
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.
Code: [Select]
« <i>', $txt[211], ': ', $message['modified']['time'], ' ', $txt[525], ' ', $message['modified']['name'], isset($message['modified']['edit_reason']) ? ', Reason: ' . $message['modified']['edit_reason'] : '' , '  </i> »';
should be:
Code: [Select]
« <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.


Offline winrules

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,085
  • Gender: Male
Re: Reason For Editing Mod
« Reply #23 on: May 27, 2006, 11:32:03 AM »
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.


Offline geezmo

  • Full Member
  • ***
  • Posts: 441
Re: Reason For Editing Mod
« Reply #24 on: May 30, 2006, 03:02:47 AM »
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

Offline sbarnes

  • Jr. Member
  • **
  • Posts: 136
    • www.flashlight-torches.co.uk
Re: Reason For Editing Mod
« Reply #25 on: May 30, 2006, 05:32:39 AM »
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

Offline winrules

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,085
  • Gender: Male
Re: Reason For Editing Mod
« Reply #26 on: May 30, 2006, 04:56:09 PM »
Also there are some screenshots on the mod page.
winrules
SMF Developer
               My Mods
Please do not PM me for support.


Offline Dazzler

  • Semi-Newbie
  • *
  • Posts: 78
  • Gender: Male
    • The MiniDirectory Club Community
Re: Reason For Editing Mod
« Reply #27 on: June 01, 2006, 05:53:56 PM »
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

Offline ltdeta

  • Jr. Member
  • **
  • Posts: 141
  • Gender: Male
Re: Reason For Editing Mod
« Reply #28 on: June 02, 2006, 04:02:14 AM »
any chance to get it compatible with SMF 1.0.7 ?

Offline DivZero

  • Newbie
  • *
  • Posts: 1
Re: Reason For Editing Mod
« Reply #29 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 :)

Offline winrules

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,085
  • Gender: Male
Re: Reason For Editing Mod
« Reply #30 on: June 07, 2006, 03:54:17 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.


Offline littleone

  • Full Member
  • ***
  • Posts: 482
  • Gender: Male
Re: Reason For Editing Mod
« Reply #31 on: June 08, 2006, 11:08:14 PM »
I an getting an undefined index for edit_reason.  Anyway to resolve this?  Thanks

Offline winrules

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,085
  • Gender: Male
Re: Reason For Editing Mod
« Reply #32 on: June 09, 2006, 03:46:27 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.


Offline Vinspire

  • Sr. Member
  • ****
  • Posts: 852
  • Gender: Male
    • The Box Of Heart Forum
Re: Reason For Editing Mod
« Reply #33 on: June 10, 2006, 06:09:33 AM »
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

Code: [Select]
<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

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

and add

Code: [Select]
<![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 ?

Offline winrules

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,085
  • Gender: Male
Re: Reason For Editing Mod
« Reply #34 on: June 10, 2006, 09:37:54 AM »
If the file doesn't exist then skip it.
winrules
SMF Developer
               My Mods
Please do not PM me for support.


Offline littleone

  • Full Member
  • ***
  • Posts: 482
  • Gender: Male
Re: Reason For Editing Mod
« Reply #35 on: June 10, 2006, 11:40:18 AM »
Code: [Select]
8: Undefined index: edit_reason
File: /home/xxxxxxx/public_html/forum/Sources/Post.php
Line: 2263

Version 1.11

Offline winrules

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,085
  • Gender: Male
Re: Reason For Editing Mod
« Reply #36 on: June 10, 2006, 12:45:46 PM »
Can you post the lines around line 2263 in Post.php?
winrules
SMF Developer
               My Mods
Please do not PM me for support.


Offline Vinspire

  • Sr. Member
  • ****
  • Posts: 852
  • Gender: Male
    • The Box Of Heart Forum
Re: Reason For Editing Mod
« Reply #37 on: June 10, 2006, 01:30:30 PM »
If the file doesn't exist then skip it.

Okie. Then what about this ?

I open helios theme display.template.php

I find

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

Then where to add

Code: [Select]
<![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 ?

Offline winrules

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,085
  • Gender: Male
Re: Reason For Editing Mod
« Reply #38 on: June 10, 2006, 01:37:54 PM »
replace the 2nd one with the first one.
winrules
SMF Developer
               My Mods
Please do not PM me for support.


Offline littleone

  • Full Member
  • ***
  • Posts: 482
  • Gender: Male
Re: Reason For Editing Mod
« Reply #39 on: June 10, 2006, 02:06:09 PM »
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