Welcome, Guest. Please Login or Register.
November 27, 2024, 02:35:37 AM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  Development  |  Completed mods  |  [Beta 1.5.4] Last Edit Time « previous next »
Pages: [1] Reply Ignore Print
Author Topic: [Beta 1.5.4] Last Edit Time  (Read 2993 times)
Scorpion
Noobie
*
Posts: 33


WWW
[Beta 1.5.4] Last Edit Time
« on: October 21, 2003, 11:14:33 PM »
Reply with quote

I got the idea of making this mod after I saw this feature on Invision Board Forums. What this does is add a checkbox when modifying a message. If it's checked it'll include the "last edit" line after the post. If not, it won't add the "last edit" line. It's best to use this mod with the Maximum Edit Time mod, so users can't change their posts after a long period of time, to make someone look stupid.

Edit File: Sources/ModifyMessage.php

Find:
                     <tr>
                        <td valign="top" align="right"><font size="2"><b>' . $txt[211] . ':</b></font></td>
                        <td><font size="2">' . $lastmodification . '</font></td>
                     </tr><tr>


Replace with:
                     <tr>
                        <td valign="top" align="right"><font size="2"><b>' . $txt[211] . ':</b></font></td>
                        <td><font size="2">' . $lastmodification . '</font></td>
                     </tr><tr>
                        <td valign="top" align="right"><font size="2"><b>Edit Options:</b></font></td>
                        <td><font size="2"><input type="checkbox" name="edit" value="0">Add the \'Last Edit\' line in this post?</font></td>
                     </tr><tr>


Find:
      $request = mysql_query("UPDATE {$db_prefix}messages SET subject='$subject',icon='$icon', body='$message', modifiedTime=" . time() . ", modifiedName='" . addslashes($realname) . "', smiliesEnabled=$smilies WHERE ID_MSG=$postid $doLimitOne;") or database_error(__FILE__, __LINE__);

Replace with:
       $edit = "$_POST[edit]";
       $request = mysql_query("UPDATE {$db_prefix}messages SET subject='$subject',icon='$icon', body='$message', " . ($edit == "0" ? "modifiedTime=" . time() . ", modifiedName='" . addslashes($realname) . "', " : '') . "smiliesEnabled=$smilies WHERE ID_MSG=$postid $doLimitOne;") or database_error(__FILE__, __LINE__);
« Last Edit: October 24, 2003, 07:01:23 PM by Scorpion » Logged
Surfy
Sr. Member
****
Posts: 458


I'm a llama!

Re:[Beta 1.5.4] Last Edit Time
« Reply #1 on: October 24, 2003, 06:20:55 AM »
Reply with quote


Great Mod!

How i get this to run, so that only Admins and Globalmods have this Option?

Surfy
Logged
FaSan
Jr. Member
**
Posts: 67


Re:[Beta 1.5.4] Last Edit Time
« Reply #2 on: October 24, 2003, 04:19:20 PM »
Reply with quote

...but... what file ?!?  ??? ???
Logged
Scorpion
Noobie
*
Posts: 33


WWW
Re:[Beta 1.5.4] Last Edit Time
« Reply #3 on: October 24, 2003, 04:29:19 PM »
Reply with quote

Quote from: FaSan on October 24, 2003, 04:19:20 PM
...but... what file ?!?  ??? ???
I'm always forgetting something :(. Edit Sources/ModifyMessage.php
Logged
FaSan
Jr. Member
**
Posts: 67


Re:[Beta 1.5.4] Last Edit Time
« Reply #4 on: October 24, 2003, 04:37:00 PM »
Reply with quote

Quote from: Scorpion on October 24, 2003, 04:29:19 PM
Quote from: FaSan on October 24, 2003, 04:19:20 PM
...but... what file ?!?  ??? ???
I'm always forgetting something :(. Edit Sources/ModifyMessage.php

Thanks !  8)
Logged
Scorpion
Noobie
*
Posts: 33


WWW
Re:[Beta 1.5.4] Last Edit Time
« Reply #5 on: October 24, 2003, 05:21:46 PM »
Reply with quote

Quote from: Surfy on October 24, 2003, 06:20:55 AM

Great Mod!

How i get this to run, so that only Admins and Globalmods have this Option?

Surfy

This will make it so if any user edits his/her message, it will show the last edit line. If any admin or global moderator edits the mesage, they have a choice whether to show the last edit line. Btw, this is on a clean version of ModifyMessage.php so if you plan to use this, don't use the mod above.

Edit File: Sources/ModifyMessage.php

Find:
   echo '
                     <tr>
                        <td valign="top" align="right"><font size="2"><b>' . $txt[211] . ':</b></font></td>
                        <td><font size="2">' . $lastmodification . '</font></td>
                     </tr><tr>
                        <td align="right"><font size="2"><b>' . $txt[276] . ':</b></font><br /><br /></td>
                        <td><font size="2"><input type="checkbox" name="ns" value="NS"' . $nosmiley . ' /></font>
                        <font size="1">' . $txt[277] . '</font><br /><br /></td>


Replace with:
   echo '
                     <tr>
                        <td valign="top" align="right"><font size="2"><b>' . $txt[211] . ':</b></font></td>
                        <td><font size="2">' . $lastmodification . '</font></td>
                     </tr>';
                        if ($settings[7] == 'Administrator' || $settings[7] == 'Global Moderator') {
                        echo '<tr>
                        <td valign="top" align="right"><font size="2"><b>Edit Options:</b></font></td>
                        <td><font size="2"><input type="checkbox" name="edit" value="0">Add the \'Edit by\' line in this post?</font></td>
                     </tr>'; }
                        echo '<tr>
                        <td align="right"><font size="2"><b>' . $txt[276] . ':</b></font><br /><br /></td>
                        <td><font size="2"><input type="checkbox" name="ns" value="NS"' . $nosmiley . ' /></font>
                        <font size="1">' . $txt[277] . '</font><br /><br /></td>


Find:
      $request = mysql_query("UPDATE {$db_prefix}messages SET subject='$subject',icon='$icon', body='$message', modifiedTime=" . time() . ", modifiedName='" . addslashes($realname) . "', smiliesEnabled=$smilies WHERE ID_MSG=$postid $doLimitOne;") or database_error(__FILE__, __LINE__);

Replace With:
       $edit = "$_POST[edit]";
       if ($username == "Administrator" || "Global Moderator") {
       $request = mysql_query("UPDATE {$db_prefix}messages SET subject='$subject',icon='$icon', body='$message', " . ($edit == "0" ? "modifiedTime=" . time() . ", modifiedName='" . addslashes($realname) . "', " : '') . "smiliesEnabled=$smilies WHERE ID_MSG=$postid $doLimitOne;") or database_error(__FILE__, __LINE__); }
       else { $request = mysql_query("UPDATE {$db_prefix}messages SET subject='$subject',icon='$icon', body='$message', modifiedTime=" . time() . ", modifiedName='" . addslashes($realname) . "', smiliesEnabled=$smilies WHERE ID_MSG=$postid $doLimitOne;") or database_error(__FILE__, __LINE__); }


That should work... let me know if you have any problems w/ it. 8)
« Last Edit: October 24, 2003, 07:01:03 PM by Scorpion » Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Completed mods  |  [Beta 1.5.4] Last Edit Time « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.056 seconds with 20 queries.