Soft Delete

All new MODs released in our MOD-Database will be announced in here. All support for released MODs needs to take place in here.

Re: Soft Delete

Postby EXreaction » Fri Nov 20, 2009 4:29 am

The mod has already been updated, just get the latest version.
http://www.lithiumstudios.org/forum/viewforum.php?f=31
My phpBB3 Mods: Advertisement Management | Anti-Spam ACP | Auto Database Backup | Enable HTML | Advanced Subscriptions | Custom Profile Groups | From Author PM List | FAQ Manager | Forum Anniversary List | One Click Ban | Forum Sponsors | Smilies Categories | Drag 'n Drop Forum List | Soft Delete

Interested in becoming a Jr MOD Validator and helping out validation of mods? Apply here
User avatar
EXreaction
MOD Team Member
MOD Team Member
 
Posts: 3922
Joined: Sun Aug 21, 2005 9:31 pm
Location: Plymouth, WI

Re: Soft Delete

Postby ChekoSlovakia » Sun Nov 22, 2009 1:18 pm

how do i undelete a whole topic or more than one topic?
one of my moderators deleted all posts of a user. how do i get them back?
why you have not updated the mod to v1.0.15 here?
User avatar
ChekoSlovakia
Registered User
 
Posts: 119
Joined: Thu Aug 27, 2009 12:35 pm
Location: ZELONKA

Re: Soft Delete

Postby ChekoSlovakia » Sun Nov 22, 2009 1:56 pm

Bigwebmaster wrote:For those of you who want to be able to "Undelete Topics" I have made the necessary changes so that this works:

undelete.png


This allows you to undelete a topic and all of its posts instead of having to go through and undelete each and every post in that topic the way its currently setup.

There could be bugs, but I have done some tests and everything seems to work as expected for me at this point. Here are the changes:

Open language/en/mods/soft_delete.php

Find:
Code: Select all
));

?>


Before Add:

Code: Select all
   'TOPIC_NOT_DELETED'            => 'The topic is not deleted already.',
   'UNDELETE_TOPIC'            => 'Undelete Topic',
   'UNDELETE_TOPIC_CONFIRM'      => 'Undeleting a topic undeletes all posts too. Are you sure you want to undelete this topic?',



Open include/mods/soft_delete.php

Partial Find:
Code: Select all
   function handle_undelete($post_id


Replace entire function with this:

Code: Select all
   /**
   * Handles undeleting of an entire topic
   */
   function handle_undelete_topic($topic_ids)
   {
      global $db;
      
      if (!is_array($topic_ids))
      {
         $topic_ids = array($topic_ids);
      }         

      if (sizeof($topic_ids))
      {
         $sql = 'SELECT post_id FROM ' . POSTS_TABLE . ' WHERE ' . $db->sql_in_set('topic_id', $topic_ids);
         $result = $db->sql_query($sql);
         while ($row = $db->sql_fetchrow($result))
         {
            $post_ids[] = $row['post_id'];
         }
      }
      
      handle_undelete($post_ids, $topic_ids);
   }

   /**
   * Handles undeleting of posts/topics for posting.php
   */
   function handle_undelete($post_id, $topic_id = false)
   {
      global $user, $db, $auth, $phpbb_root_path, $phpEx;

      $user->setup('common');
      $user->add_lang('mods/soft_delete');

      if (!$post_id)
      {
         trigger_error('NO_POST');
      }

      if (!is_array($post_id))
      {
         $post_id = array($post_id);
      }

      if (!is_array($topic_id))
      {
         $topic_id = array($topic_id);
      }         
      
      include($phpbb_root_path . 'includes/mods/soft_delete_class.' . $phpEx);
      $delete = new delete();
      $delete->get_post_data($post_id);
      $delete->undelete_check($post_id, $topic_id);
      
      if($topic_id[0] && $delete->topic_data[$topic_id[0]]['topic_deleted'] == 0)
      {
         trigger_error('TOPIC_NOT_DELETED');      
      }

      if (!sizeof($delete->undelete['p']))
      {
         trigger_error('NO_AUTH_OPERATION');
      }

      if (confirm_box(true))
      {
         $delete->undelete_posts();

         $redirect_post = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$delete->post_data[$post_id[0]]['forum_id']}&t={$delete->post_data[$post_id[0]]['topic_id']}&p={$post_id[0]}#p$post_id[0]");
         $redirect_topic = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$delete->post_data[$post_id[0]]['forum_id']}&t={$delete->post_data[$post_id[0]]['topic_id']}");
         $redirect_forum = append_sid("{$phpbb_root_path}viewforum.$phpEx", "f={$delete->post_data[$post_id[0]]['forum_id']}");

         if (sizeof($delete->undelete['t']))
         {
            $message = $user->lang['TOPIC_UNDELETE_SUCCESS'] . '<br/><br/>';
         }
         else
         {
            $message = $user->lang['POST_UNDELETE_SUCCESS'] . '<br/><br/>';
            $message .= sprintf($user->lang['CLICK_RETURN_POST'], "<a href=\"{$redirect_post}\">", '</a><br/>');
         }

         $message .= sprintf($user->lang['CLICK_RETURN_TOPIC'], "<a href=\"{$redirect_topic}\">", '</a><br/>');
         $message .= sprintf($user->lang['CLICK_RETURN_FORUM'], "<a href=\"{$redirect_forum}\">", '</a><br/>');

         meta_refresh(3, $redirect_post);
         trigger_error($message);
      }
      else
      {
         if($topic_id[0])
         {
            $s_hidden_fields = build_hidden_fields(array(
               't'      => $topic_id[0],
               'mode'   => 'undelete',
               'action' => 'undelete_topic')
            );
            
            confirm_box(false, 'UNDELETE_TOPIC', $s_hidden_fields);            
         }
         else {
            $s_hidden_fields = build_hidden_fields(array(
               'p'      => $post_id[0],
               'mode'   => 'undelete')
            );   

            confirm_box(false, 'UNDELETE_POST', $s_hidden_fields);            
         }
      }

      redirect(append_sid("{$phpbb_root_path}viewtopic.$phpEx", "p=" . $post_id[0]) . "#p$post_id");
   }


Open: includes/mcp/mcp_main.php

Find:

Code: Select all
case 'delete_post':


Before Add:

Code: Select all
         case 'undelete_topic':
            $user->add_lang('viewtopic');

            $topic_ids = (!$quickmod) ? request_var('topic_id_list', array(0)) : array(request_var('t', 0));

            if (!sizeof($topic_ids))
            {
               trigger_error('NO_TOPIC_SELECTED');
            }
            
            include("{$phpbb_root_path}includes/mods/soft_delete.$phpEx");
            handle_undelete_topic($topic_ids);

         break;


Open posting.php

Find something like:
Code: Select all
include("{$phpbb_root_path}includes/mods/soft_delete.$phpEx");
if ($mode == 'undelete')
{
   handle_undelete($post_id); }
}
else if ($mode == 'delete')
{
   handle_delete($post_id);
}


Replace with:

Code: Select all
include("{$phpbb_root_path}includes/mods/soft_delete.$phpEx");
if ($mode == 'undelete')
{
   if($topic_id) {   handle_undelete_topic($topic_id); }
   else if($post_id) {   handle_undelete($post_id); }
}
else if ($mode == 'delete')
{
   handle_delete($post_id);
}


Open viewtopic.php

Find:

Code: Select all
$topic_mod .= (($auth->acl_get('m_harddelete', $forum_id) || $auth->acl_get('m_delete', $forum_id)) && !$topic_data['topic_deleted']) ? '<option value="delete_topic">' . $user->lang['DELETE_TOPIC'] . '</option>' : '';


Replace with:

Code: Select all
$topic_mod .= (($auth->acl_get('m_harddelete', $forum_id) || $auth->acl_get('m_delete', $forum_id)) && !$topic_data['topic_deleted']) ? '<option value="delete_topic">' . $user->lang['DELETE_TOPIC'] . '</option>' : '';
if (!isset($user->lang['UNDELETE_TOPIC']) && (($auth->acl_get('m_harddelete', $forum_id) || $auth->acl_get('m_delete', $forum_id)) && $topic_data['topic_deleted']))                                   
{                               
        $user->add_lang('mods/soft_delete');                                 
}      
$topic_mod .= (($auth->acl_get('m_harddelete', $forum_id) || $auth->acl_get('m_delete', $forum_id)) && $topic_data['topic_deleted']) ? '<option value="undelete_topic">' . $user->lang['UNDELETE_TOPIC'] . '</option>' : '';


Open mcp.php

Find:

Code: Select all
case 'delete_topic':


After add:

Code: Select all
case 'undelete_topic':


And I think that should do it. Hopefully I didn't miss anything. I also created additional modifications (not shown above) to be able to use search.php to find all deleted topics or deleted posts in case you have deleted topics hidden from the forums for moderators. I wanted that feature because I want the deleted topics to not be visible in the forums.

I plan to also create a modification to auto delete (prune) soft deleted topics/posts after a certain time period since they were soft deleted.


i am getting a error after installing this modification.

General Error
SQL ERROR [ mysql4 ]

Out of range value adjusted for column 'topic_deleted_reply_count' at row 1 [1264]

SQL

UPDATE phpbb_topics SET topic_deleted_reply_count = topic_deleted_reply_count - 1 WHERE topic_id = 48735

BACKTRACE

FILE: includes/db/mysql.php
LINE: 174
CALL: dbal->sql_error()

FILE: includes/mods/soft_delete_class.php
LINE: 470
CALL: dbal_mysql->sql_query()

FILE: includes/mods/soft_delete.php
LINE: 367
CALL: delete->undelete_posts()

FILE: includes/mods/soft_delete.php
LINE: 322
CALL: handle_undelete()

FILE: includes/mcp/mcp_main.php
LINE: 132
CALL: handle_undelete_topic()

FILE: includes/functions_module.php
LINE: 507
CALL: mcp_main->main()

FILE: includes/functions_module.php
LINE: 802
CALL: p_master->load_active()

FILE: mcp.php
LINE: 169
CALL: p_master->load()

please tell how to solve it.
User avatar
ChekoSlovakia
Registered User
 
Posts: 119
Joined: Thu Aug 27, 2009 12:35 pm
Location: ZELONKA

Re: Soft Delete

Postby Green Light » Mon Nov 23, 2009 4:00 am

This MOD looks like what I want.. I just want to know a few things..
I'd like to allow moderators to soft-delete but not hard-delete.. and to for admins to receive PM's when a soft-delete occurs. That way an admin could go ahead and hard-delete it if it breaks the rules. (that way no post gets deleted for the wrong reason)
Would this be possible?

Is there any notification in mod cp? Or different color topic row?

Thanks ;)
Image
Cosmic gate - Exploration of space
Hennes and Cold - The Second Trip
TRANCE.rock.punk.
User avatar
Green Light
Registered User
 
Posts: 197
Joined: Fri Jan 16, 2009 10:10 pm
Location: Above Sea Level.

Re: Soft Delete

Postby AcAs » Mon Nov 23, 2009 4:59 am

i want to uninstall this mod completely from my forum, what i want to do is reinstall a fresh copy of forum with old database but not install this mod again. but before doing this i want to undelete all the soft deleted posts using this mod.
User avatar
AcAs
Registered User
 
Posts: 43
Joined: Sun Sep 20, 2009 11:06 am
Location: Riponn

Re: Soft Delete

Postby wolfman24 » Mon Nov 23, 2009 4:57 pm

EXreaction wrote:The mod has already been updated, just get the latest version.
http://www.lithiumstudios.org/forum/viewforum.php?f=31

The 1014_to_1015.xml does not include any instructions, no copying and no editing. Is this correct or is there something missing?
wolfman24
Registered User
 
Posts: 189
Joined: Tue Mar 07, 2006 12:07 pm

Re: Soft Delete

Postby EXreaction » Mon Nov 23, 2009 5:56 pm

Hmm, no, that's not right, it should have you copying the new root files over.
My phpBB3 Mods: Advertisement Management | Anti-Spam ACP | Auto Database Backup | Enable HTML | Advanced Subscriptions | Custom Profile Groups | From Author PM List | FAQ Manager | Forum Anniversary List | One Click Ban | Forum Sponsors | Smilies Categories | Drag 'n Drop Forum List | Soft Delete

Interested in becoming a Jr MOD Validator and helping out validation of mods? Apply here
User avatar
EXreaction
MOD Team Member
MOD Team Member
 
Posts: 3922
Joined: Sun Aug 21, 2005 9:31 pm
Location: Plymouth, WI

Soft Delete

Postby DavidIQ » Tue Nov 24, 2009 3:45 pm

MOD Updated to version 1.0.15
See first post for Download Link
User avatar
DavidIQ
MOD Team Member
MOD Team Member
 
Posts: 9565
Joined: Thu Jan 06, 2005 1:30 pm
Location: Clearwater, FL

Re: Soft Delete

Postby AcAs » Tue Nov 24, 2009 4:29 pm

-
User avatar
AcAs
Registered User
 
Posts: 43
Joined: Sun Sep 20, 2009 11:06 am
Location: Riponn

Re: Soft Delete

Postby AcAs » Wed Nov 25, 2009 8:50 pm

i want to uninstall this mod completely from my forum, what i want to do is reinstall a fresh copy of forum with old database but not install this mod again. but before doing this i want to undelete all the soft deleted posts using this mod.
User avatar
AcAs
Registered User
 
Posts: 43
Joined: Sun Sep 20, 2009 11:06 am
Location: Riponn

Re: Soft Delete

Postby Neoxxx » Thu Nov 26, 2009 12:20 am

Hello...i have installed version 1.0.14 on phpbb 3.0.5

Now i have update phpbb on version 3.0.6, i see that is out soft delete 1.0.5 but in file of update there isn't instruction:

Title:

Soft Delete 1.0.14 to 1.0.15 upgrade
Description:

Changes the current hard delete scheme to all soft deleting for posts and topics.
Also includes the option to undelete posts and topics after they have been soft deleted.
New permissions give the option to allow administrators and/or moderators to hard delete posts/topics after they have already been soft deleted.
Version:

1.0.15
Installation level:

Easy
Installation time:

~0 minutes
Author notes:

Please ask for support at my website if you need any: http://www.lithiumstudios.org. Soft deleting of Private Messages is not included in this modification.

Author

Username:
EXreaction
Email:
exreaction@lithiumstudios.org
Name:
Nathan Guse
WWW:
http://www.lithiumstudios.org

Included files

No files have been included with this MOD.



How I can do update from 1.0.14 to 1.0.15?

Thanks
Neoxxx
Registered User
 
Posts: 83
Joined: Wed Mar 18, 2009 12:18 pm

Re: Soft Delete

Postby EXreaction » Thu Nov 26, 2009 1:01 am

Just copy the files from the root directory to your server.
My phpBB3 Mods: Advertisement Management | Anti-Spam ACP | Auto Database Backup | Enable HTML | Advanced Subscriptions | Custom Profile Groups | From Author PM List | FAQ Manager | Forum Anniversary List | One Click Ban | Forum Sponsors | Smilies Categories | Drag 'n Drop Forum List | Soft Delete

Interested in becoming a Jr MOD Validator and helping out validation of mods? Apply here
User avatar
EXreaction
MOD Team Member
MOD Team Member
 
Posts: 3922
Joined: Sun Aug 21, 2005 9:31 pm
Location: Plymouth, WI

Soft Delete

Postby DavidIQ » Thu Nov 26, 2009 3:46 am

MOD Updated to version 1.0.15
See first post for Download Link
User avatar
DavidIQ
MOD Team Member
MOD Team Member
 
Posts: 9565
Joined: Thu Jan 06, 2005 1:30 pm
Location: Clearwater, FL

Re: Soft Delete

Postby CMA » Thu Nov 26, 2009 3:56 pm

i suggest to add list of soft delete... or did i miss?

i mean it would be easy to track some soft deleted topics and or threads then hard delete it for user with permission...
CMA
Registered User
 
Posts: 328
Joined: Mon Jun 02, 2003 4:15 pm
Location: Vancouver BC Canada

Re: Soft Delete

Postby AcAs » Fri Nov 27, 2009 9:04 pm

i want to uninstall this mod completely from my forum, what i want to do is reinstall a fresh copy of forum with old database but not install this mod again. but before doing this i want to undelete all the soft deleted posts using this mod.
User avatar
AcAs
Registered User
 
Posts: 43
Joined: Sun Sep 20, 2009 11:06 am
Location: Riponn

PreviousNext

Return to [3.0.x] MOD Database Releases

Who is online

Users browsing this forum: bet-winners, codfather, FladeX, iWisdom, klone, moonlightkisu, MSNbot Media, Redy, RMcGirr83, Twiceler [Bot], WolfSoul, Xtracker! and 44 guests