Welcome, Guest. Please Login or Register.
May 07, 2024, 04:55:43 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Completed mods  |  [DONE 1.5.2] UnDelete Mod 1.1 « previous next »
Pages: [1] 2 3 4 Reply Ignore Print
Author Topic: [DONE 1.5.2] UnDelete Mod 1.1  (Read 19133 times)
snYpir
Jr. Member
**
Posts: 65


I'm a llama!

[DONE 1.5.2] UnDelete Mod 1.1
« on: September 03, 2002, 07:16:23 AM »
Reply with quote

UnDelete Mod for YaBB SE 1.5.2, 1.5.1, 1.5 and 1.4.1

by snYpir ([email protected])

Version 1.1

This mod creates a 'recycle bin' for your YaBB SE board. Deleted topics and messages are stored in seperate tables in your YaBB database, and can be viewed and UnDeleted as required.

Features

  • A full-featured interface for viewing, sorting, clearing and undeleteing deleted topics and messages.

  • Has full support for attachments. Attachments are not deleted from the server until the parent message is cleared via the UnDelete interface.

  • The mod includes my 'View Summary' mod that is used to view the contents of deleted topics and messages.

  • The mod supports both singly deleted messages and deleted threads (topics).

    Compatibility

    May conflict on install with mods that make changes to either ModifyMessage.php or RemoveThread.php.

    Also, the mod copies data for messages and topics straight out of your messages and topics tables. If you have a mod installed that adds a new field to either of these tables, that new field will not be copied (and hence not restored when the message/topic is undeleted).

    History

    1.1 - Added: 'no deleted topics' and 'no deleted messages' if nothing has been deleted
    1.1 - Fixed: topics are correctly deleted after a period of time (if specified)
    1.1 - Fixed: a blank-page error in undelete_dbmod.php

    1.0 - Initial release

    Installation

  • Upload undelete_dbmod.php to your root YaBB SE directory and run it in your browser (ie www.mysite.com\yabbse\undelete_dbmod.php). It will give you the option to either install or uninstall the required database changes. If you are upgrading, this script will not make duplicate variables in your settings table (as some mods do).

  • Upload image files to your YaBBse\YaBBImages directory.

  • Use boardmod to install either undelete_152.mod, undelete_151.mod, undelete_15.mod or undelete_141.mod depending on your YaBB SE version. Upload the modified files, ViewSummary.php and UnDelete.php to your server.

    Upgrading

    To upgrade from 1.5.1 to 1.5.2, uninstall 1.5.1 and reinstall 1.5.2 using boardmod. No database changes required.

    Useage

    There are no changes at all to the normal deletion of threads and messages. Simply delete threads and messages as normal, and the UnDelete Mod will copy threads and messages to the undelete tables automatically.

    To view the deletions, go to 'Undelete Topics/Messages' in the admin center. Initially, the mod will display deleted topics (threads). You can click on the column headers to re-order the display. You can click on the subject title for each deletion to view a summary of that topic.

    Click on 'View Deleted Messages >>' to view singly deleted messages. The interface is almost the same.

    You have the option to 'Clear' (delete forever) or 'UnDelete' (re-insert into the database) selected messages. Check the 'Select' box for whatever messages you want to clear or undelete, and hit the appropriate button. You can select all messages by checking the 'All' check box.

    You can also set the number of undeleted messages or topics being displayed using the text boxes at the bottom of the interface. Enter in new values and hit 'Refresh' to re-display.

    'Mod Settings' Options

  • 'Enable Undelete Mod'

    Fairly self-explanatory. If unchecked, topics and messages will be deleted as normal.

  • 'UnDelete attachments (if unchecked attachments will be deleted as normal)'

    If you don't want attachments to be undeleted, leave this box unchecked.

  • 'Enable UnDelete for posts that are deleted by ordinary members (if unchecked only posts/topics deleted by mods/gmods/admins can be undeleted)'

    On our board people delete their own posts all the time. I didn't want to save these messages (most of which were simply stuff-ups on the part of the poster) so I added this option. Check this box to save ALL deleted messages. Leave unchecked to only save those deleted by the important dudes (mods/gmods/admins).

  • 'Automatically clear deleted topics/messages after # days (0 for never)'

    If you want to make the UnDelete mod automatically clear old deleted messages, this is the place to do it. Enter the number of days until a deleted topic or message gets cleared from the UnDelete tables. Note that this actual deletion occurs when the UnDelete page is accessed. The process of clearing old deleted messages is transparent to you.

    Download

    Download the mod here. View a screenshot here.

    Comments

    Initially, I built this mod so we could keep an eye on what our mods were deleteing (hence the 'deleted by' column in the table). However, it has been used all the time to simply correct accidental deletions which can be a real nightmare depending on the information content of the deleted thread.

    There is no 'maximum limit' for this mod - regardless of the size of a thread it will all be saved. Note, however, that if a single message has been deleted out of a given topic, and then that topic is deleted, the single message will automatically be cleared.

    I have left examples of how to insert extra fields into the mod in the code. If you have extra message fields, find the code below the two instances of the following (one in UnDelete.php and one in ModifyMessage.php) and uncomment and change as required:

    // insert extra message fields here

    If you have extra topic fields, find the code below the two instances of the following (one in UnDelete.php and one in ModifyMessage.php) and uncomment and change as required:

    // insert extra topic fields here

    Please let me know how you would like me to improve this mod, either graphically or feature-wise.

    Please make comments or suggestions here (preferred) or email me.

    This mod is now considered FINAL. ::)
« Last Edit: May 03, 2003, 06:37:34 AM by snYpir » Logged

Check out:
  • Enhanced Ban
  • Collapsable YaBB
  • UnDelete
  • View All
  • Topic Solved
  • Topic Summary
opus
Jr. Member
**
Posts: 59


I'm an opus!

ICQ - 16116986 WWW
Re:[Beta 1.4.1] UnDelete Mod 1.0
« Reply #1 on: September 03, 2002, 03:36:43 PM »
Reply with quote

This could be me.  But I can't seem for find the undelete function in the admin center.  I can see the new tables.. and I can see the messages being moved there.  And the mod_settings are there.  But I can't find the Undelete section.  Suggestions?
Logged

If I were two people I would still be busy.
snYpir
Jr. Member
**
Posts: 65


I'm a llama!

Re:[Beta 1.4.1] UnDelete Mod 1.0
« Reply #2 on: September 03, 2002, 09:13:38 PM »
Reply with quote

*snYpir gives himself an uppercut*

sorry dude... may fault... forgot to put the admin.php mod into the mod file :-\

i have fixed it now, plz either uninstall then reinstall the mod (i have updated the zip), or:

open admin.php in a text editor.

find:

<td width="340" bgcolor="$color[windowbg2]" height="21" class="windowbg2"><font size="2">

add after:

<a href="$cgi;action=undelete">$txt[undelete1]</a><BR>

and re-upload the admin.php.

sorry again :-*

for the record, the url to the undelete page is:

http://www.yoururl.com/yabbse/index.php?action=undelete
« Last Edit: September 03, 2002, 09:18:57 PM by snYpir » Logged

Check out:
  • Enhanced Ban
  • Collapsable YaBB
  • UnDelete
  • View All
  • Topic Solved
  • Topic Summary
Wiziwig
Sr. Member
****
Posts: 407


Programmer and Users Liason and Manager

WWW
Re:[Beta 1.4.1] UnDelete Mod 1.0
« Reply #3 on: September 05, 2002, 04:01:17 AM »
Reply with quote

Your mod hosed, and made a nightmare for me which I am still trying to dig through...

mod installed:

invalid sql statement line 506

unistall mod:

can't modify or remove. Gives errors such as missing subject line. modify and it does not change anything.

The offending changed file is ModifyMessage.php:


this:
         $request = mysql_query("UPDATE {$db_prefix}members SET posts=posts-1 WHERE (ID_MEMBER=$row[ID_MEMBER] && posts > 0) $doLimitOne");

      $request = mysql_query("DELETE FROM {$db_prefix}messages WHERE ID_MSG=$postid LIMIT 1");
      updateLastMessage($row['ID_BOARD']);
      #delete attachment, by Meriadoc
      if ($row['attachmentSize'] > 0)
         unlink($modSettings['attachmentUploadDir'] . "/" . $row['attachmentFilename']);
      }
   }
   else {

should be this:
         $request = mysql_query("UPDATE {$db_prefix}members SET posts=posts-1 WHERE (ID_MEMBER=$row[ID_MEMBER] && posts > 0) $doLimitOne");

      $request = mysql_query("DELETE FROM {$db_prefix}messages WHERE ID_MSG=$postid LIMIT 1");
      updateLastMessage($row['ID_BOARD']);
      #delete attachment, by Meriadoc
      if ($row['attachmentSize'] > 0)
         unlink($modSettings['attachmentUploadDir'] . "/" . $row['attachmentFilename']);
   }
   else {

This section is what made the change:

<search for>
         unlink($modSettings['attachmentUploadDir'] . "/" . $row['attachmentFilename']);
</search for>

<add after>
      }
</add after>

I'm still debugging as its still not right.. I haven't figured out what else you replaced or changed at this time.. I had to re-install the ModifyMessage.php changes for mods bugfixes, input amount, mute users, and topic summary because of this culprit. Good thing I used board mod to track down this offender and figured out what I had to do to rebuild.

« Last Edit: September 05, 2002, 04:38:13 AM by Wiziwig » Logged

snYpir
Jr. Member
**
Posts: 65


I'm a llama!

Re:[Beta 1.4.1] UnDelete Mod 1.0
« Reply #4 on: September 05, 2002, 12:01:29 PM »
Reply with quote

the mod doesn't make very many changes dude, to modifymessage or any other file.

it is not much to debug, all it is doing is adding a few lines in.

if u email me your modifymessage.php file i'll be able to work out what happened.

wierd that error on install, anyone else had any probs?

lesson learnt: backup before modding eh?

sorry the mod 'hosed' for u.

any feedback from anyone else?
Logged

Check out:
  • Enhanced Ban
  • Collapsable YaBB
  • UnDelete
  • View All
  • Topic Solved
  • Topic Summary
Surfy
Sr. Member
****
Posts: 458


I'm a llama!

Re:[Beta 1.4.1] UnDelete Mod 1.0
« Reply #5 on: September 05, 2002, 02:40:25 PM »
Reply with quote

After installing: if i try to delete a topic:

2: mysql_fetch_row(): supplied argument is not a valid MySQL result resource
(e:\inetpub\wwwroot\forumlokal\Sources\ModifyMessage.php ln 410)


Quote// topic solved mod
   list ($solved) = mysql_fetch_row( mysql_query("SELECT solved FROM {$db_prefix}topics WHERE ID_TOPIC=$threadid") );
   if ( $solved != '' ) $request = mysql_query("UPDATE {$db_prefix}undelete_topic SET solved=$solved WHERE ID_TOPIC=$threadid");




Logged
puntingzone
Noobie
*
Posts: 19


WWW
Re:[Beta 1.4.1] UnDelete Mod 1.0
« Reply #6 on: September 05, 2002, 06:59:18 PM »
Reply with quote

Yes I get the same message

2: Supplied argument is not a valid MySQL result resource
(/home/sites/site38/web/yabbse/Sources/ModifyMessage.php ln 410)   :'(

Other wise an excellent mod that I would like to have

www.puntingzone.com
Logged

When I'm right I'm right, but when I'm wrong, I really goof up
snYpir
Jr. Member
**
Posts: 65


I'm a llama!

Re:[Beta 1.4.1] UnDelete Mod 1.0
« Reply #7 on: September 05, 2002, 10:54:49 PM »
Reply with quote

problem fixed. the mod will now work, i think. all normal fields in the topics table are saved.

the zip in the first post has been updated.

either re-install the mod (and re-upload undelete.php) or simply re-upload undelete.php and open modifymessage.php in a text editor, and delete:

   // topic solved mod
   list ($solved) = mysql_fetch_row( mysql_query("SELECT solved FROM {$db_prefix}topics WHERE ID_TOPIC=$threadid") );
   if ( $solved != '' ) $request = mysql_query("UPDATE {$db_prefix}undelete_topic SET solved=$solved WHERE ID_TOPIC=$threadid");

then re-upload modifymessage.php.

Thanks for beta testing this for me guys, it is a rather complicated mod made all the more so because i tried to make minimum changes to core yabb se files.

 :-*
Logged

Check out:
  • Enhanced Ban
  • Collapsable YaBB
  • UnDelete
  • View All
  • Topic Solved
  • Topic Summary
Wiziwig
Sr. Member
****
Posts: 407


Programmer and Users Liason and Manager

WWW
Re:[Beta 1.4.1] UnDelete Mod 1.0
« Reply #8 on: September 05, 2002, 11:26:36 PM »
Reply with quote

Smooth as gold, thanks for the great mod! I didnt even have to change anything from the other mod setups! :)
Logged

puntingzone
Noobie
*
Posts: 19


WWW
Re:[Beta 1.4.1] UnDelete Mod 1.0
« Reply #9 on: September 06, 2002, 12:47:35 PM »
Reply with quote

Yep that got it thanks, installed OK & works a treat.

Thanks for a great mod

Logged

When I'm right I'm right, but when I'm wrong, I really goof up
opus
Jr. Member
**
Posts: 59


I'm an opus!

ICQ - 16116986 WWW
Re:[Beta 1.4.1] UnDelete Mod 1.0
« Reply #10 on: September 06, 2002, 11:01:12 PM »
Reply with quote

I finally got most of it to work with the latest changes.  However I can only undelete deleted threads  Messages that have been deleted I can't undelete.  Single posts do not show up in my Undelete control panel.  But they are in the table when I do a direct query on the (yabb)_undelete_message table.  If you need more information (and I am sure you will) please just ask.
Logged

If I were two people I would still be busy.
snYpir
Jr. Member
**
Posts: 65


I'm a llama!

Re:[Beta 1.4.1] UnDelete Mod 1.0
« Reply #11 on: September 08, 2002, 09:01:03 AM »
Reply with quote

QuoteMessages that have been deleted I can't undelete.

So what happens when you try and undelete them?

I assume you have clicked on 'View deleted messages >>' in the top right hand corner of the table, yeah? (see the screenshot in the download section of the first post)

That is something i've had a few emails about, i might have to make that point more obvious in the docos... ::)
« Last Edit: September 08, 2002, 09:03:49 AM by snYpir » Logged

Check out:
  • Enhanced Ban
  • Collapsable YaBB
  • UnDelete
  • View All
  • Topic Solved
  • Topic Summary
opus
Jr. Member
**
Posts: 59


I'm an opus!

ICQ - 16116986 WWW
Re:[Beta 1.4.1] UnDelete Mod 1.0
« Reply #12 on: September 09, 2002, 01:54:53 PM »
Reply with quote

If there is a topic that has been deleted it show up.  And the link to undelete posts is in the upper right hand corner, however when clicked it takes you to a blank page.  If there are not tpoics you just get a blank page.  

In addition to fixing what ever may be wrong.  May I suggest if there is nothing to undelete that a message saying so be displayed.
« Last Edit: September 10, 2002, 02:38:27 AM by opus » Logged

If I were two people I would still be busy.
snYpir
Jr. Member
**
Posts: 65


I'm a llama!

Re:[Beta 1.4.1] UnDelete Mod 1.0
« Reply #13 on: September 09, 2002, 10:33:03 PM »
Reply with quote

yeah, good point. i'll do that.

i'll upgrade UnDelete.php and post it here when it is done (in about 12 hours).

8)
Logged

Check out:
  • Enhanced Ban
  • Collapsable YaBB
  • UnDelete
  • View All
  • Topic Solved
  • Topic Summary
opus
Jr. Member
**
Posts: 59


I'm an opus!

ICQ - 16116986 WWW
Re:[Beta 1.4.1] UnDelete Mod 1.0
« Reply #14 on: September 19, 2002, 02:31:46 PM »
Reply with quote

I just thought of another feature that would be nice.  Allowing the person that deleted the post to give a reason as to why they deleted it.  
Logged

If I were two people I would still be busy.
Pages: [1] 2 3 4 Reply Ignore Print 
YaBB SE Community  |  Development  |  Completed mods  |  [DONE 1.5.2] UnDelete Mod 1.1 « 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.016 seconds with 19 queries.