View Full Version : Soft Deleted Archive v2.7
Revan
10-21-2004, 10:00 PM
Soft Deleted Archive v2.7
If you have a forum where you disallow your Moderators to Hard Delete posts, you might want to look over exactly what posts they have deleted, in case of disputes between staff and members. But running a huge forum with hundreds of threads, this task can get tiring.
This is where the Soft Deleted Archive comes in handy!
Features:
Seperate threads and posts
Name and link to forum of the thread/post
Username that posted the post
Username that deleted the post
Reason for deletion, if any were inputted
Date of thread/post deletion
For threads, link that takes you directly to the thread in question
For posts, link that takes you directly to the post in question, for manual managing
Limit the number of total entries to show per page
Ability to choose Sorting Order (Ascending or Descending)
Flagging Threads and Posts seperately
Fully phrased
Ability to Hard Delete selected threads/posts
Ability to Restore selected threads/posts
Screenshots attached.
They are abit outdated, but they present the gist of the hack.
If you use this mod,
https://vborg.vbsupport.ru/ (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=70878)
Click it!
nexialys
10-22-2004, 03:49 PM
cool, these days it seems that more and more features are added to the Moderation side... this is a good thing.. they were missing!
Great Job Revan ;)
Thanks
Xenon
10-22-2004, 03:57 PM
Looking good.
Definitelly a good idea.
Oblivion Knight
10-22-2004, 04:11 PM
Great! :)
Tigga did something similar to this a while ago, but it lacked options and hasn't been updated since it was released.. Thanks for sharing.
the Sandman
10-22-2004, 06:10 PM
Any information on compatability with earlier versions of vB3?
Surtain23
10-22-2004, 06:17 PM
Great hack! Installing.
assassingod
10-22-2004, 08:07 PM
Really nice idea!
Revan
10-22-2004, 08:23 PM
Any information on compatability with earlier versions of vB3?I cannot tell as I only tested it on 3.0.3
But as long as the table structure of the involved tables did not change (too much), then it does still work.
And thanks for all the nice feedback, people :)
very nice.
I've been using Tigga hack, now it's time to move on :)
https://vborg.vbsupport.ru/showthread.php?t=59807&highlight=Deleted+Post+Management
will take a look and install tonight
I'd like to have this information
- Forum(board) name that the post/thread belong to
- Thread title (already available)
- Deleted by: (already available)
- Date of deletion (need addon)
- Reason:
and also limit how many post/thread displayed per page? there may be too many post softdeleted.
Revan
10-22-2004, 10:52 PM
Ill get to work on adding the requested features tomorrow :)
About the limit, currently there's no limit, but I suppose I should add one lol. Thats gonna be a bish to test out tho, havnt got Inline Mod Tools installed on localhost :p
Logikos
10-23-2004, 03:00 AM
Nice work man
Revan
10-23-2004, 11:34 AM
v2 has been released, I fulfilled the feature requests of mtha.
The following features was added to the mod:
Name and link to forum of the thread/post
Reason for deletion, if any were inputted
Date of thread/post deletion
Limit the number of total entries to show per page
To upgrade, simply download the upgrade zip and follow the instructions there.
This zip will be deleted in 1 week, after that you will have to redo the file edits as described in the main zip readme.
Also, if you use this mod,
https://vborg.vbsupport.ru/ (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=70878)
Click it!
that's GREAT! Thank you very much.
you may want to consider adding a phrase "del_deleted_by" for Name?
Oblivion Knight
10-23-2004, 04:11 PM
Thanks for the update, running smooth.. :)
In your file,
$softdelposts = $DB_site->query("
SELECT
deletionlog.*,
deletionlog.primaryid AS postid,
deletionlog.type AS deltype,
deletionlog.userid AS userid,
post.*,
post.title AS posttitle,
post.threadid AS threadid,
thread.*,
thread.title AS threadtitle,
thread.forumid AS forumid,
forum.*,
forum.title AS forumtitle,
post.* also has the userid value, this will take over the deletionlog.userid I would bring that line deletionlog.userid AS userid to the end of serquence, and put a link to deletor's profile:
In thread section
<strong>". $vbphrase['soft_deleted_by'].":</strong> <a href='" . $vboptions['bburl'] . "/member.php?u=". $thread['userid'] . "' target='_blank'>" . stripslashes($thread['username']) . "</a><br>
In Post section
<strong>". $vbphrase['soft_deleted_by'].":</strong> <a href='" . $vboptions['bburl'] . "/member.php?u=". $post['userid'] . "' target='_blank'>" . stripslashes($post['username']) . "</a><br>
PS. I added a phrase called soft_deleted_by as GLOBAL with the text: Deleted by (instead of using "NAME" phrase).
adding
print_table_break();
on top of
print_table_header($vbphrase['soft_deleted_posts']);
would also seperate two sections.
also, showing the total of soft deleted posts/threads (and/or the current number of thread) would be nice
something like
Soft Deleted Threads (showing thread 16 to 30 in total of 82 threads)
Soft Deleted Posts (showing post 16 to 30 in total of 511 posts)
here's the code:
Look for:
$countlog = $DB_site->query_first("SELECT COUNT(*) AS total FROM " . TABLE_PREFIX . "deletionlog");
Add after
$countthreads = $DB_site->query_first("SELECT COUNT(*) AS total FROM " . TABLE_PREFIX . "deletionlog WHERE type = 'thread'");
$countposts = $DB_site->query_first("SELECT COUNT(*) AS total FROM " . TABLE_PREFIX . "deletionlog WHERE type = 'post'");
Look for (the first one)
print_table_header($vbphrase['soft_deleted_threads']);
while ($thread = $DB_site->fetch_array($softdelthreads))
Replace by
print_table_header("$vbphrase[soft_deleted_threads] (Total: $countthreads[total] threads)");
while ($thread = $DB_site->fetch_array($softdelthreads))
Look for
print_table_header($vbphrase['soft_deleted_posts]);
while ($post = $DB_site->fetch_array($softdelposts))
replace by
print_table_header("$vbphrase[soft_deleted_posts] (Total: $countposts[total] posts)");
while ($post = $DB_site->fetch_array($softdelposts))
Revan
10-23-2004, 11:48 PM
In your file,
$softdelposts = $DB_site->query("
SELECT
deletionlog.*,
deletionlog.primaryid AS postid,
deletionlog.type AS deltype,
deletionlog.userid AS userid,
post.*,
post.title AS posttitle,
post.threadid AS threadid,
thread.*,
thread.title AS threadtitle,
thread.forumid AS forumid,
forum.*,
forum.title AS forumtitle,
post.* also has the userid value, this will take over the deletionlog.userid I would bring that line deletionlog.userid AS userid to the end of serquence, and put a link to deletor's profile:
In thread section
<strong>". $vbphrase['soft_deleted_by'].":</strong> <a href='" . $vboptions['bburl'] . "/member.php?u=". $thread['userid'] . "' target='_blank'>" . stripslashes($thread['username']) . "</a><br>
In Post section
<strong>". $vbphrase['soft_deleted_by'].":</strong> <a href='" . $vboptions['bburl'] . "/member.php?u=". $post['userid'] . "' target='_blank'>" . stripslashes($post['username']) . "</a><br>
PS. I added a phrase called soft_deleted_by as GLOBAL with the text: Deleted by (instead of using "NAME" phrase).
adding
print_table_break();
on top of
print_table_header($vbphrase['soft_deleted_posts']);
would also seperate two sections.
also, showing the total of soft deleted posts/threads (and/or the current number of thread) would be nice
something like
Soft Deleted Threads (showing thread 16 to 30 in total of 82 threads)
Soft Deleted Posts (showing post 16 to 30 in total of 511 posts)
here's the code:
Look for:
$countlog = $DB_site->query_first("SELECT COUNT(*) AS total FROM " . TABLE_PREFIX . "deletionlog");
Add after
$countthreads = $DB_site->query_first("SELECT COUNT(*) AS total FROM " . TABLE_PREFIX . "deletionlog WHERE type = 'thread'");
$countposts = $DB_site->query_first("SELECT COUNT(*) AS total FROM " . TABLE_PREFIX . "deletionlog WHERE type = 'post'");
Look for (the first one)
print_table_header($vbphrase['soft_deleted_threads']);
while ($thread = $DB_site->fetch_array($softdelthreads))
Replace by
print_table_header("$vbphrase[soft_deleted_threads] (Total: $countthreads[total] threads)");
while ($thread = $DB_site->fetch_array($softdelthreads))
Look for
print_table_header($vbphrase['soft_deleted_posts]);
while ($post = $DB_site->fetch_array($softdelposts))
replace by
print_table_header("$vbphrase[soft_deleted_posts] (Total: $countposts[total] posts)");
while ($post = $DB_site->fetch_array($softdelposts))About the post.*, when I tested it on localhost it always showed the mod name that deleted it, regardless of who the post belonged to.
I am implementing your changes on localhost now, and gonna see if theres a way to optimise it some (I always try my best to keep my query count to an all time low). Thanks alot for your suggestions :) Users like you, that are able to come up with simple yet very useful suggestions (even writing them :p), is what makes hacks great and hack authors happy :)
//peace
Bug ... (that might come out from original version of vB)
If you has a "soft deleted thread" containing some "soft deleted posts"
If you "Hard delete" the thread, the co-responding "soft deleted posts" will be undefined ($post['postid'] will not exists, only $post['primaryid'] exists)
Check that out, and it might be a bug in vB.com too. I dont know if it is, or if it has beed reported over there.
Additional suggestion.
01: This migh not be functionally important, but has "management" cleaner.
Giving the option to manage the thread and post seperately.
Says if you have
/forum/admincp/softdeladmin.php?type=thread, it will only process the deleted threads
/forum/admincp/softdeladmin.php?type=post, it will only process the deleted posts
if no value given, do both (like what you already have)
02: CHECK ALL option. Can you make it to check all thread and check all post seperately?
03. Thread Name/Moderator Name/Thread Link phrase should be changed :) I dont think you need that phrase at all.
... development ...
I just check the moderatorlog table, and dateline information for any moderating action is recored in there (with postid and threadid if applicable).
However, for one post, there could be many record in the log, including editing, moving, deleting/undeleting many times. So I expect (guess) the latest date record for one post should be the deletion time
... well but this will introduce few more searching, sorting ... queries ...
dont know if we should use this one or just use a new date record, for convenient
(just look that back because the new deldate is only applicable for posts/threads that are deleted after this hack installed. ... or we should just update the value from moderatorlog to deletionlog ONCE)
we can also sort them by date (asc or des - dont even need to have deldate value) so all recent deletion log displayed first.
just ideas, I dont know if all of them are useful :D
Revan
10-24-2004, 01:37 AM
Bug ... (that might come out from original version of vB)
If you has a "soft deleted thread" containing some "soft deleted posts"
If you "Hard delete" the thread, the co-responding "soft deleted posts" will be undefined ($post['postid'] will not exists, only $post['primaryid'] exists)
Check that out, and it might be a bug in vB.com too. I dont know if it is, or if it has beed reported over there.
Additional suggestion.
01: This migh not be functionally important, but has "management" cleaner.
Giving the option to manage the thread and post seperately.
Says if you have
/forum/admincp/softdeladmin.php?type=thread, it will only process the deleted threads
/forum/admincp/softdeladmin.php?type=post, it will only process the deleted posts
if no value given, do both (like what you already have)
02: CHECK ALL option. Can you make it to check all thread and check all post seperately?
03. Thread Name/Moderator Name/Thread Link phrase should be changed :) I dont think you need that phrase at all.About that bug, I havnt really tried it. Do you mean if you hard delete a thread through this hack or vB itself?
Sug #1: This Ill do tomorrow. 4.30 AM here XD
Sug #2: Not poss as I am using vB internal JScript (I know no JS myself), and it checks all the elements in a form.
About that bug, I havnt really tried it. Do you mean if you hard delete a thread through this hack or vB itself?
Sug #1: This Ill do tomorrow. 4.30 AM here XD
Sug #2: Not poss as I am using vB internal JScript (I know no JS myself), and it checks all the elements in a form. I did the hard delete through this hack, and it (after deleting some threads) show up some post that are undeletable (throughj this hack) since there's no postid responding to it (dont need to delete it actually, but the records for soft delete posts in deletionlog are still exist)
I did not try in vB itself, that's why I said I thought it'd be vB bug since you use vB delete_thread and delete_post functions.
Will take some more look at that for you.
=================
update1. bing. I hit the right spot. it's vB bug, not removing post record in deletionlog if its thread is physically removed
... going to check vB bug list :P
update2. bing. actually I did report this in vB but getting no answer :D
http://www.vbulletin.com/forum/showthread.php?t=87426&highlight=delete+thread
----------------------
about #2, if you can do #1, then #2 will automatically be solved, you just go to manage post (or thread) alone and select all :P
ps. I add some more stuff on the post above.
This hack is very usefull for me.
I attempted to write (actually advance Tigga's hack), but didnt have time to do so. Now you make it real. Thank you very much :)
The bug was reported here. Can you confirm?
http://www.vbulletin.com/forum/bugs.php?do=view&bugid=3455
This bug hit directly to this hack, so I'd think we should urge vB.com to fix :D
Revan
10-25-2004, 04:58 PM
I will check it out later :)
Blam Forumz
10-25-2004, 06:09 PM
Revan! Stop releasing new hacks ¬¬ get back to work on RPG v3
anyway nice hack thanks
Revan
10-26-2004, 05:07 AM
XD which part of the middle section of my sig didnt you understand ;)
EDIT:
The bug was reported here. Can you confirm?
http://www.vbulletin.com/forum/bugs.php?do=view&bugid=3455
This bug hit directly to this hack, so I'd think we should urge vB.com to fix :DYes, I can confirm. I am posting a reply in this bug report as soon as I posted this :)
XD which part of the middle section of my sig didnt you understand ;)
EDIT:
Yes, I can confirm. I am posting a reply in this bug report as soon as I posted this :) Cool, the bug was fix by Freddie over vB.com
http://www.vbulletin.com/forum/bugs.php?do=view&bugid=3455
Now you can keep advancing the hack Revan
Bug. When hard deleting a thread, it doesnt come back to the deleted list. can anyone confirm?
If you want to update deldate from moderator log (if available), these two querries could help:
UPDATE deletionlog, moderatorlog SET deletionlog.deldate=moderatorlog.dateline
WHERE deletionlog.type = 'post' AND deletionlog.deldate=0 AND (moderatorlog.postid = deletionlog.primaryid) AND moderatorlog.action LIKE 'post %deleted%';
UPDATE deletionlog, moderatorlog SET deletionlog.deldate=moderatorlog.dateline
WHERE deletionlog.type = 'thread' AND deletionlog.deldate=0 AND (moderatorlog.threadid = deletionlog.primaryid) AND moderatorlog.action LIKE 'thread %deleted%';
Note: if you have prune your moderator log sometime, there will be some date missing in deldate (since you dont have the information in moderatorlog either)
Sort ASC by deldate:
Look for (2 places
LIMIT " . (($page - 1) * $perpage) . ", $perpage
Add after:
ORDER BY `deldate` ASC
Revan
10-28-2004, 10:33 AM
Bug. When hard deleting a thread, it doesnt come back to the deleted list. can anyone confirm?Ill look into this in a few.
If you want to update deldate from moderator log (if available), these two querries could help:
UPDATE deletionlog, moderatorlog SET deletionlog.deldate=moderatorlog.dateline
WHERE deletionlog.type = 'post' AND deletionlog.deldate=0 AND (moderatorlog.postid = deletionlog.primaryid) AND moderatorlog.action LIKE 'post %deleted%';
UPDATE deletionlog, moderatorlog SET deletionlog.deldate=moderatorlog.dateline
WHERE deletionlog.type = 'thread' AND deletionlog.deldate=0 AND (moderatorlog.threadid = deletionlog.primaryid) AND moderatorlog.action LIKE 'thread %deleted%';
Note: if you have prune your moderator log sometime, there will be some date missing in deldate (since you dont have the information in moderatorlog either)
Sort ASC by deldate:
Look for (2 places
LIMIT " . (($page - 1) * $perpage) . ", $perpage
Add after:
ORDER BY `deldate` ASCIm alittle confused... Whats the usage of this..? :rolleyes:
If you want to update deldate from moderator log (if available), these two querries could help:
UPDATE deletionlog, moderatorlog SET deletionlog.deldate=moderatorlog.dateline
WHERE deletionlog.type = 'post' AND deletionlog.deldate=0 AND (moderatorlog.postid = deletionlog.primaryid) AND moderatorlog.action LIKE 'post %deleted%';
UPDATE deletionlog, moderatorlog SET deletionlog.deldate=moderatorlog.dateline
WHERE deletionlog.type = 'thread' AND deletionlog.deldate=0 AND (moderatorlog.threadid = deletionlog.primaryid) AND moderatorlog.action LIKE 'thread %deleted%';
These are ONE TIME query, to get dateline information from moderatorlog and put into deldate in deletion log.
Assume that you have whole bunch of posts/threads deleted, and you just add a new field deldate (actually you should name it dateline for vB consistancy). the deldate value for all deleted posts/threads are ZERO.
However, when a moderator/admin delete a post/thread, the action will be record into moderator log (with dateline, and action = Post/Thread XXX Deleted)
The timeline in moderator log IS the time when the mod/admin delete a thread. I can just copy this value and put into deletionlog (if the deldate indeletionlog is missing (=0)
Sort ASC by deldate:
Look for (2 places
LIMIT " . (($page - 1) * $perpage) . ", $perpage
Add after:
ORDER BY `deldate` ASC
I want to sort the list by deldate, so that all the oldest deleted post are displayed first => I can take a look and hard-delete them first
teksigns
10-28-2004, 02:23 PM
Small Bug found ....
if i select a few deleted post and i forget to tick one of the radio buttons .....
your script undeletes them instead of giving a error !
can you fix this
Revan
10-29-2004, 07:05 AM
These are ONE TIME query, to get dateline information from moderatorlog and put into deldate in deletion log.
Assume that you have whole bunch of posts/threads deleted, and you just add a new field deldate (actually you should name it dateline for vB consistancy). the deldate value for all deleted posts/threads are ZERO.
However, when a moderator/admin delete a post/thread, the action will be record into moderator log (with dateline, and action = Post/Thread XXX Deleted)
The timeline in moderator log IS the time when the mod/admin delete a thread. I can just copy this value and put into deletionlog (if the deldate indeletionlog is missing (=0)You mean I could add these to the installer?
And I cant name it dateline because it interferes with other rows, which causes errors. Believe me I tried ;)
I want to sort the list by deldate, so that all the oldest deleted post are displayed first => I can take a look and hard-delete them firstIll add this :)
Small Bug found ....
if i select a few deleted post and i forget to tick one of the radio buttons .....
your script undeletes them instead of giving a error !
can you fix thisIll take a look at this when I get home, I promise :)
I got abit distracted yest cos I installed RPG Maker XP..... :p
Bozkurtum
10-29-2004, 09:23 AM
Very useful hack
Thanks ;)
I want to sort the list by deldate, so that all the oldest deleted post are displayed first => I can take a look and hard-delete them first
actually, being able to reverse order back and fort, or choose ASC or DESC when displaying is better. :) You can either add another link (to reverse order) or have another option to chose sorting direction :D
Revan
10-29-2004, 02:08 PM
v2.2 is released, implementing fixes of the bugs mentioned already, and mtha's feature requests.
To upgrade, simply replace softdeladmin.php with the one in the zip.
Thanks for installing this hack! :D
Oblivion Knight
10-29-2004, 03:21 PM
Updated.. Again.. Thanks ;)
msimplay
10-30-2004, 07:28 AM
i have the assign physical delete (https://vborg.vbsupport.ru/showthread.php?t=70149) hack installed and i seem to get errors with this one now
i'm getting error where i can't normally delete a post only physical delete and somehow people can delete there own threads
this is the error i get when i try to delete a post normally
Database error in vBulletin 3.0.0:
Invalid SQL:
REPLACE INTO deletionlog
(primaryid, type, userid, username, reason, deldate)
VALUES
(, 'post', 1, 'wAmbAm',
'', '1099124008')
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ' 'post', 1, 'wAmbAm',
'', '1099124008')' at line 4
mysql error number: 1064
Date: Saturday 30th of October 2004 01:13:29 AM
Script: http://www.wambam.net/vbulletin/editpost.php
Referer: http://www.wambam.net/vbulletin/editpost.php?do=editpost&p=4504
Username: wAmbAm
IP Address: 82.37.24.63
can anyone help me
i;ve disabled my forums until i can fix this
Revan
10-30-2004, 08:39 AM
I am using both hacks in perfect combination :)
Your problem is that whatever is assigning the primaryid seems to have broken.
msimplay
10-30-2004, 03:00 PM
I am using both hacks in perfect combination :)
Your problem is that whatever is assigning the primaryid seems to have broken.
i repaired the error by using repair tables however its weird that using the none physical delete seems to be now deleting threads
i repaired the error by using repair tables however its weird that using the none physical delete seems to be now deleting threads Total Entries: 1830
You've messed up with the counting part:
Page1:
Soft Deleted Threads (Showing thread 1 to 14, total: 14 threads)
Soft Deleted Posts (Showing post 1 to 15, total: 15 posts)
Page2
Soft Deleted Posts (Showing post 16 to 1830, total: 15 posts)
Page3:
Soft Deleted Posts (Showing post 31 to 1830, total: 15 posts)
also, here you have
$countlog = $DB_site->query_first("SELECT COUNT(*) AS total FROM " . TABLE_PREFIX . "deletionlog");
$numentries = &$countlog['total'];
$numpages = ceil($numentries / $perpage);
your $countlog is post+thread counts
$perpage is actually post perpage AND thread perpage.
=> $countlog / $perpage is NOT correct $numpages.
You have to get
$countpost and $countthread
if $countpost > $countthread => $numentries = $countpost, else $entries = $countthread
otherwise, if you have more than one page of thread and post deleted, the last pages will give empty results.
msimplay
10-31-2004, 09:22 PM
Total Entries: 1830
You've messed up with the counting part:
Page1:
Soft Deleted Threads (Showing thread 1 to 14, total: 14 threads)
Soft Deleted Posts (Showing post 1 to 15, total: 15 posts)
Page2
Soft Deleted Posts (Showing post 16 to 1830, total: 15 posts)
Page3:
Soft Deleted Posts (Showing post 31 to 1830, total: 15 posts)
also, here you have
$countlog = $DB_site->query_first("SELECT COUNT(*) AS total FROM " . TABLE_PREFIX . "deletionlog");
$numentries = &$countlog['total'];
$numpages = ceil($numentries / $perpage);
your $countlog is post+thread counts
$perpage is actually post perpage AND thread perpage.
=> $countlog / $perpage is NOT correct $numpages.
You have to get
$countpost and $countthread
if $countpost > $countthread => $numentries = $countpost, else $entries = $countthread
otherwise, if you have more than one page of thread and post deleted, the last pages will give empty results.
hmm dunno i seemed to have fixed it by rehacking my functions_databuild.php
i've left the rest untouched
sorry msimplay, I didnt mean to quote your post. I am talking about the whole hack.
Revan
Here's what I use, I think it'd be better
Look for (Line 114)
$countlog = $DB_site->query_first("SELECT COUNT(*) AS total FROM " . TABLE_PREFIX . "deletionlog");
Replaced by
// $countlog = $DB_site->query_first("SELECT COUNT(*) AS total FROM " . TABLE_PREFIX . "deletionlog");
$countthreads = $DB_site->query_first("SELECT COUNT(*) AS total FROM " . TABLE_PREFIX . "deletionlog WHERE type = 'thread'");
$countposts = $DB_site->query_first("SELECT COUNT(*) AS total FROM " . TABLE_PREFIX . "deletionlog WHERE type = 'post'");
$totalcount = ($countthreads['total'] + $countposts['total']);
if ($countthreads['total'] > $countposts['total']) {
$numentries = &$countthreads['total'];
}
else $numentries = &$countposts['total'];
line 171, look for
<td class="thead">' . $vbphrase['total_entries'] . ': ' . $numentries . '
replaced by
<td class="thead">' . $vbphrase['total_entries'] . ': ' . $totalcount . '
line 207. look for
$threads = $DB_site->query_first("SELECT COUNT(*) AS threads FROM " . TABLE_PREFIX . "deletionlog WHERE `type`='thread'");
$totalthreads = $threads['threads'];
$iifcalc = iif($page - 1 == 0, 1, (($page - 1) * $perpage) + 1);
$threadpage = $totalthreads - $iifcalc;
$threadpage = $threadpage + $iifcalc;
$threadpage = iif($page - 1 == 0, $numthreads * $page, $threadpage);
replaced by
$totalthreads = $countthreads['total'];
$iifcalc = iif($page - 1 == 0, 1, (($page - 1) * $perpage) + 1);
$threadpage = ($iifcalc + $perpage - 1);
if ($threadpage > $totalthreads) {$threadpage = $totalthreads;}
Line 269, look for
$totalposts = $numentries - $numthreads;
$iifcalc = iif($page - 1 == 0, 1, (($page - 1) * $perpage) + 1);
$postpage = $totalposts - $iifcalc;
$postpage = $postpage + $iifcalc;
$postpage = iif($page - 1 == 0, $numposts * $page, $postpage);
print_table_header("$vbphrase[soft_deleted_posts] (Showing post $iifcalc to $postpage, total: $numposts posts)");
replaced by
$totalposts = $countposts['total'];
$iifcalc = iif($page - 1 == 0, 1, (($page - 1) * $perpage) + 1);
$postpage = ($iifcalc + $perpage - 1);
if ($postpage > $totalposts) {$postpage = $totalposts;}
print_table_header("$vbphrase[soft_deleted_posts] (Showing post $iifcalc to $postpage, total: $totalposts posts)");
msimplay
11-01-2004, 12:16 AM
sorry msimplay, I didnt mean to quote your post. I am talking about the whole hack.
no problem is there any chance of posting your version of the soft delete file
no problem is there any chance of posting your version of the soft delete file
no, my version everything should be in Revan's release, plus the changes that I mentioned above.
This is his hack, so he will implement if any adition is good :> I'm not going to make an alias.
Bug.
I found that username/userid are displayed not correctly, since you have different values for them. I would call each value seperately:
look for the part for
$softdelposts = $DB_site->query("
replace the whole query by
$softdelposts = $DB_site->query("
SELECT
deletionlog.*,
deletionlog.primaryid AS postid,
deletionlog.type AS deltype,
deletionlog.userid AS userid,
post.postid, post.threadid,
post.username as postusername,
post.userid as postuserid,
post.title AS posttitle,
post.threadid AS threadid,
thread.threadid, thread.forumid,
thread.title AS threadtitle,
thread.forumid AS forumid,
forum.forumid,
forum.title AS forumtitle,
user.username
FROM " . TABLE_PREFIX . "deletionlog AS deletionlog
LEFT JOIN " . TABLE_PREFIX . "user AS user on user.userid=deletionlog.userid
LEFT JOIN " . TABLE_PREFIX . "post AS post ON post.postid=deletionlog.primaryid
LEFT JOIN " . TABLE_PREFIX . "thread AS thread ON thread.threadid=post.threadid
LEFT JOIN " . TABLE_PREFIX . "forum AS forum ON forum.forumid=thread.forumid
WHERE deletionlog.type = 'post'
ORDER BY `deldate` $sqlorder
LIMIT " . (($page - 1) * $perpage) . ", $perpage
");
I'd add another line for Posted by, showing thread/post owner too:
look for
$vbphrase['soft_deleted_by'] = 'Deleted by';
Add above
$vbphrase['soft_posted_by'] = 'Posted by';
look for
<strong>" . $vbphrase['soft_deleted_by'] . ":</strong> <a href='" . $vboptions['bburl'] . "/member.php?u=". $thread['userid'] . "' target='_blank'>" . stripslashes($thread['username']) . "</a>
add above
<strong>" . $vbphrase['soft_posted_by'] . ":</strong> <a href='" . $vboptions['bburl'] . "/member.php?u=". $thread['postuserid'] . "' target='_blank'>" . stripslashes($thread['postusername']) . "</a><br />
look for
<strong>" . $vbphrase['soft_deleted_by'] . ":</strong> <a href='" . $vboptions['bburl'] . "/member.php?u=". $post['userid'] . "' target='_blank'>" . stripslashes($post['username']) . "</a>
add above
<strong>" . $vbphrase['soft_posted_by'] . ":</strong> <a href='" . $vboptions['bburl'] . "/member.php?u=". $post['postuserid'] . "' target='_blank'>" . stripslashes($post['postusername']) . "</a><br />
Revan
11-01-2004, 07:02 AM
Whoah. This was lotta stuff XD
I cant remember, but I dont think I counted the threads and posts in a seperate query. I dont like this because I try my best to optimise my hacks, reducing query load as much as possible.
The counting worked when I tested it with multiple pages on my localhost, but my localhost is running low on posts from too much testing with this hack XD
Im gonna look into all of this when I get home :)
Whoah. This was lotta stuff XD
I cant remember, but I dont think I counted the threads and posts in a seperate query. I dont like this because I try my best to optimise my hacks, reducing query load as much as possible.
The counting worked when I tested it with multiple pages on my localhost, but my localhost is running low on posts from too much testing with this hack XD
Im gonna look into all of this when I get home :)
You counted all and counted threads. which use 2 querries.
I count thread and post, which also use 2 :)
Oblivion Knight
11-01-2004, 01:25 PM
I tried your suggestions mtha, and now no records are shown..
Unless I went wrong somewhere, but I don't think so.
Revan
11-01-2004, 03:27 PM
Ive implemented both fixes, and they work just fine.
Cheers :)
Updated to v2.5:
To upgrade, replace softdeladmin.php with the one in the zip.
Oblivion Knight
11-01-2004, 03:36 PM
Hmm.. The file in the zip worked, so it must have been something wrong that I did somewhere. My bad.. :disappointed:
4 of the threads listed have the date/time of 00:00, 1st Jan 1970.. Is there any explanation for this?
Revan
11-01-2004, 03:43 PM
Yes, they were deleted BEFORE this hack was installed. Try running this:
UPDATE deletionlog, moderatorlog SET deletionlog.deldate=moderatorlog.dateline
WHERE deletionlog.type = 'post' AND deletionlog.deldate=0 AND (moderatorlog.postid = deletionlog.primaryid) AND moderatorlog.action LIKE 'post %deleted%';
UPDATE deletionlog, moderatorlog SET deletionlog.deldate=moderatorlog.dateline
WHERE deletionlog.type = 'thread' AND deletionlog.deldate=0 AND (moderatorlog.threadid = deletionlog.primaryid) AND moderatorlog.action LIKE 'thread %deleted%';
(not tested by me, so take mtha's word for it ;))
Oblivion Knight
11-01-2004, 03:51 PM
That updated 1 of them, I still have 3 with that date.. :)
Revan
11-01-2004, 04:38 PM
Try running it several times?
Lol only thing I can think of
Oblivion Knight
11-01-2004, 04:51 PM
That query won't work on the other 3 because they weren't deleted by a moderator, so there's no record of them in the moderatorlog.. Is there any other way to get the timestamp?
That query won't work on the other 3 because they weren't deleted by a moderator, so there's no record of them in the moderatorlog.. Is there any other way to get the timestamp?
.. or your moderatorlog was pruned sometime before.
hehe, yes. Ask those who deleted it, when he/she did delete the post/thread and fill them in.
If you make up some number, it wouldnt be different from 00:00, 1st Jan 1970 right?
I dont know if there's any other place that record this timestamp, so for my forum, I just ... let it be, or try to ... hard delete them if they are worth to be deleted.
if you can find the place where this deletion time recorded, let me know
Ive implemented both fixes, and they work just fine.
Cheers :)
Updated to v2.5:
To upgrade, replace softdeladmin.php with the one in the zip.
I'd think that you should state what's new/fix for each version, easier to keep track of hack :)
Revan
11-02-2004, 05:09 AM
Hm okay lol :p
Fixes/Features for v2.5:
Fixed calculation of pages
Fixed calculation of threads/posts
Fixed broken redirect when hard deleting records
Added Posted By in the record view
I think thats about it :)
And @ the missing timestamps: Unless they are posts/threads that you want sticking around for usage as evidence against spammers, why not just remove them and be done with it ;)
And @ the missing timestamps: Unless they are posts/threads that you want sticking around for usage as evidence against spammers, why not just remove them and be done with it ;)
:) I have about 1000 softdeleted post timestamps missing :p. it'll take sometime to check and hard delete all of them :D
anyway, if post's owner want to delete a post, there's no reason for not delete them (unless it contains valuable information that you want to keep).
msimplay
11-02-2004, 05:50 PM
open includes/functions_databuild
_____________________________
Find (around line 401-407):
-----------------------------
$DB_site->query("
REPLACE INTO " . TABLE_PREFIX . "deletionlog
(primaryid, type, userid, username, reason)
VALUES
($postinfo[postid], 'post', $delinfo[userid], '" . addslashes($delinfo['username']) . "',
'" . addslashes(fetch_censored_text(htmlspecialchars_un i($delinfo['reason']))) . "')
");
Replace with:
-----------------------------
$DB_site->query("
REPLACE INTO " . TABLE_PREFIX . "deletionlog
(primaryid, type, userid, username, reason, deldate)
VALUES
($postinfo[postid], 'post', $delinfo[userid], '" . addslashes($delinfo['username']) . "',
'" . addslashes(fetch_censored_text(htmlspecialchars_un i($delinfo['reason']))) . "', '" . TIMENOW . "')
");
Find (around line 295-301):
-----------------------------
$DB_site->query("
REPLACE INTO " . TABLE_PREFIX . "deletionlog
(primaryid, type, userid, username, reason)
VALUES
($threadinfo[threadid], 'thread', $delinfo[userid], '" . addslashes($delinfo['username']) . "',
'" . addslashes(htmlspecialchars_uni(fetch_censored_tex t($delinfo['reason']))) . "')
");
Replace with:
-----------------------------
$DB_site->query("
REPLACE INTO " . TABLE_PREFIX . "deletionlog
(primaryid, type, userid, username, reason, deldate)
VALUES
($threadinfo[threadid], 'thread', $delinfo[userid], '" . addslashes($delinfo['username']) . "',
'" . addslashes(htmlspecialchars_uni(fetch_censored_tex t($delinfo['reason']))) . "', '" . TIMENOW . "')
");
just wanted to know if those file edits are absolutely neccessary as the hack seemed to work well even without those
the reason i know is because i had some trouble with my functions_databuild.php and i didn't do the file edits until i realised that they were meant to be there for this hack
Revan
11-02-2004, 07:41 PM
If you do not perform that edit, the date stamp of the deleted posts/threads will appear as "00:00, 1st Jan 1970" (in whatever default date format you have).
So if you dont care much for when they are deleted, and you wouldnt use the sorting feature anyways, then its not needed :)
msimplay
11-02-2004, 07:57 PM
If you do not perform that edit, the date stamp of the deleted posts/threads will appear as "00:00, 1st Jan 1970" (in whatever default date format you have).
So if you dont care much for when they are deleted, and you wouldnt use the sorting feature anyways, then its not needed :)
hmm i'm using version 3.0 and i didn't have to do those edits for the right time
Revan
11-03-2004, 01:29 PM
I am referring to future records ;)
If they dont get a date inserted, how will the script know what date they were deleted, hm? :p
I want to record the IP (and proxy IP) to deletionlog too.
Recently one of my member delete alot of his posts, without reason. checking IP migh tell some more information about the origine of the deletion.
This proxyIP detect can be used
https://vborg.vbsupport.ru/showthread.php?s=&threadid=61331
solution (assuming my proxyIP detector installed):
Run this query:
ALTER TABLE `deletionlog` ADD ipaddress VARCHAR(50) not null;
ALTER TABLE `deletionlog` ADD proxyip VARCHAR(50) not null;
In includes/functions_databuild.php:
- add ,ipaddress, proxyip after deldate added from previous hack (2 places)
- add ,'". IPADDRESS ."','". PROXYIP."' after " . TIMENOW . "' added from previous hack
Detail:
replace
$DB_site->query("
REPLACE INTO " . TABLE_PREFIX . "deletionlog
(primaryid, type, userid, username, reason, deldate)
VALUES
($postinfo[postid], 'post', $delinfo[userid], '" . addslashes($delinfo['username']) . "',
'" . addslashes(fetch_censored_text(htmlspecialchars_un i($delinfo['reason']))) . "', '" . TIMENOW . "')
");
by
$DB_site->query("
REPLACE INTO " . TABLE_PREFIX . "deletionlog
(primaryid, type, userid, username, reason, deldate, ipaddress, proxyip)
VALUES
($postinfo[postid], 'post', $delinfo[userid], '" . addslashes($delinfo['username']) . "',
'" . addslashes(fetch_censored_text(htmlspecialchars_un i($delinfo['reason']))) . "', '" . TIMENOW . "','". IPADDRESS ."','". PROXYIP."')
");
and replace
$DB_site->query("
REPLACE INTO " . TABLE_PREFIX . "deletionlog
(primaryid, type, userid, username, reason, deldate)
VALUES
($threadinfo[threadid], 'thread', $delinfo[userid], '" . addslashes($delinfo['username']) . "',
'" . addslashes(htmlspecialchars_uni(fetch_censored_tex t($delinfo['reason']))) . "', '" . TIMENOW . "')
");
by
$DB_site->query("
REPLACE INTO " . TABLE_PREFIX . "deletionlog
(primaryid, type, userid, username, reason, deldate, ipaddress, proxyip)
VALUES
($threadinfo[threadid], 'thread', $delinfo[userid], '" . addslashes($delinfo['username']) . "',
'" . addslashes(htmlspecialchars_uni(fetch_censored_tex t($delinfo['reason']))) . "', '" . TIMENOW . "','". IPADDRESS ."','". PROXYIP."')
");
This was tested working in vB3.0.3
If you dont want to add proxyIP address to the log, you have to remove all places saying proxyip :)
Then, in the softdeladmin.php, you can add some lines showing the proxys of the one who deleted thread/post next to his name.
Revan
11-09-2004, 04:17 PM
I dont like the thought of assuming other hacks are installed... else cool addition :)
I dont like the thought of assuming other hacks are installed... else cool addition :)
You are right, porting the get proxyIP part over here.
Anyone who already installed my proxyIP hack dont need to do this part.
in includes/init.php
look for:
{
define('ALT_IP', $_SERVER['REMOTE_ADDR']);
}
Add below
// ####################### HN getproxyip START########################
// establish client Proxy address (if it exists)
if ($_SERVER['HTTP_FORWARDED'] != '')
{
$proxyip = $_SERVER['HTTP_FORWARDED'];
}
else if ($_SERVER['HTTP_X_FORWARDED_FOR'] != '')
{
$proxyip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
else if ($_SERVER['HTTP_CLIENT_IP'] != '')
{
$proxyip = $_SERVER['HTTP_CLIENT_IP'];
}
else
{
$proxyip = '';
}
$proxyip = preg_replace('/javascript/i', 'java script', $proxyip);
$proxyip = str_replace('"', '"', $proxyip);
$proxyip = str_replace('<', '<', $proxyip);
define('PROXYIP', str_replace('>', '>', $proxyip));
unset($proxyip);
// ####################### HN getproxyip END ########################
02: CHECK ALL option. Can you make it to check all thread and check all post seperately?
Since I like being able to check posts and thread seperately, I did this one.
I now can select all post or all thread seperately
Look for
if ($numthreads)
{
print_label_row($vbphrase['thread_modname_link'], "<input type=\"checkbox\" name=\"allbox\" title=\"$vbphrase[check_all]\" onclick=\"js_check_all(this.form);\" />$vbphrase[check_all]", 'thead');
Add above
?>
<script type="text/javascript">
<!--
function check_all_group(checkobj, value)
{
formobj = checkobj.form;
for (var i = 0; i < formobj.elements.length; i++)
{
elm = formobj.elements[i];
if (elm.type == "checkbox" && elm.value == value)
{
elm.checked = checkobj.checked;
}
}
}
//-->
</script>
<?
look for
print_table_header("$vbphrase[soft_deleted_threads] (Showing thread $iifcalc to $threadpage, total: $totalthreads threads)");
Replace with
print_label_row("$vbphrase[soft_deleted_threads] (Showing thread $iifcalc to $threadpage, total: $totalthreads threads)", "<input type=\"checkbox\" name=\"allbox_thread\" title=\"$vbphrase[check_all_thread]\" onclick=\"check_all_group(this, '0_thread');\" />", 'thead');
Look for
print_table_header("$vbphrase[soft_deleted_posts] (Showing post $iifcalc to $postpage, total: $totalposts posts)");
Replace with
print_label_row("$vbphrase[soft_deleted_posts] (Showing post $iifcalc to $postpage, total: $totalposts posts)", "<input type=\"checkbox\" name=\"allbox_post\" title=\"$vbphrase[check_all_post]\" onclick=\"check_all_group(this, '0_post');\" />", 'thead');
Look for
", "managepost[$post[postid]]", false, $post['forumid'], $vbphrase['flag'], false);
}
Replace with
", "managepost[$post[postid]]", false, "0_post", $vbphrase['flag'], false);
}
Look for
", "managethread[$thread[threadid]]", false, $thread['threadid'], $vbphrase['flag'], false);
}
Replace with
", "managethread[$thread[threadid]]", false, "0_thread", $vbphrase['flag'], false);
}
Have fun
jb605
11-30-2004, 09:09 PM
What's the difference between this hack and "Deleted Post and Thread Management"
https://vborg.vbsupport.ru/showthread.php?t=59807
Revan
12-01-2004, 05:25 AM
What's the difference between this hack and "Deleted Post and Thread Management"
https://vborg.vbsupport.ru/showthread.php?t=59807Tigga did something similar to this a while ago, but it lacked options and hasn't been updated since it was released.. Thanks for sharing.
There ya have it mate :)
and @ the check all seperately: I'll add it to the zip once I get home, cheers mtha :)
When you add into your code, you might wanna check and find a good place for the javascript part. I added directly on my server, so I just break the php file, and add the html code in. it doesnt sound professional that way :D
I have many information displayed in the hack, so in my version, I also re-arrange the deleted post/thread table alittle bit
For each deleted post or thread, I display information into 2 columns,
Column 1: Thread title, Forum name, Original poster, Manage
Column2: Deleted By, Date (delete), Reason, IPs
it looks more organized to me :D
Revan
12-03-2004, 09:47 PM
Update to 2.7:
Update to 2.7:
___________________
File edits:
___________________
####################################
/clientscript/vbulletin_global.js:
####################################
#######
Find:
#######
js_toggle_all(formobj, "checkbox", '', exclude, formobj.allbox.checked);
}
##########
Add Below
##########
<!-- Soft Deleted Archive - Code by Mtha -->
function js_check_all_group(checkobj, value)
{
formobj = checkobj.form;
for (var i = 0; i < formobj.elements.length; i++)
{
elm = formobj.elements[i];
if (elm.type == "checkbox" && elm.value == value)
{
elm.checked = checkobj.checked;
}
}
}
<!-- Soft Deleted Archive - Code by Mtha -->
__________________________________________________ ________________
Done. Reupload softdeladmin.php if you have not done so already.
__________________________________________________ ________________
Update to 2.7:
- Revan, the js code is not belong to me. It belongs to vB, they have it in PM function, I just bring it over :D
- I think you forget to change the softdeladmin.php in your 2.7 zip file.
Revan
12-05-2004, 08:32 PM
Heh ok. Fixed zip.
Thanks :)
Installed, but face the following problems :
1) Flag threads and flag posts dont work but Check All Entries does.
2) Something is wrong with the navigation.
See below attachment :
( crop away the posts and threads though - these are just the headings ).
Notice the number of soft deleted threads and posts, shouldnt that give me navigation ?
Also how come it only shows the first 15 of both posts and threads , shouldnt it be 50 ?
Please help
This hack is VB 3.05 compatiable.
Oblivion Knight
01-16-2005, 11:05 PM
any help here ? :)Try uploading softdeladmin.php again..
The perpage is a settable option, and by default is set at 15.
This hack is VB 3.05 compatiable.
didnt install any new version since 3.0.3, but I dont see any reason why it wont work.
Give it a try mate
Revan,
do you have any plan on developing this hack?
some suggestions for you:
- Sort by delete user/poster/deletion date/post(thread) title (optional)
- Sort by forum (individually)
Search by: poster/delete user/reason/thread(post) name/forum ...
Revan
05-17-2005, 04:36 PM
Haven't looked at this in ages, since I have more skills now I might just be able to do those ;)
I'll see if I can get it done whenever I can be buggered to :p
Aurous
06-18-2005, 08:48 PM
I deleted over 1000 soft deleted posts, but I still see over 300 blank entries that dont get deleted for some reason! Any fix?
Using vB 3.0.7
screenshot attached.
Revan
06-18-2005, 11:58 PM
Check the deletionlog table, and tell me what the entries look like, and I will be able to give you a query to make them go away for good this time :p
And as for the further development, Im not gonna touch this for some time, I am way too busy porting the RPG over to 3.5. Once that is done, I will port this as well.
Megareus Rex
06-21-2005, 08:38 PM
Great hack, I love it!
Only one question though. The hack displays the post date of all of the deleted threads/posts as Dec 31 1969. Why?
yoyoyoyo
06-21-2005, 09:53 PM
thanks much!
Revan
06-22-2005, 11:45 AM
Great hack, I love it!
Only one question though. The hack displays the post date of all of the deleted threads/posts as Dec 31 1969. Why?Because the entries displayed were deleted before the hack started counting Post dates ;)
Christine
06-23-2005, 12:57 AM
Added this tonight. I can't wait to get my live site on 3.5 -- I have in the neighborhood of 500 soft-deleted posts that I have been too lazy with my current hack to open each one to review and get rid of.
:D
mkdevo
06-23-2005, 11:12 AM
installed. works great! thanks!
kadafi_alive
09-25-2005, 09:27 AM
I would warn others to stay away from this hack. Once you attempt to hard-delete soft-deleted posts or threads, it suddenly deletes random posts or threads that weren't soft-deleted in the first place
Revan
09-26-2005, 07:40 AM
This is highly impossible, not only because the hack cannot touch threads/posts not in the deletionlog table, but because no other user on the interweb has reported this issue. Does that not strike you as odd?
kadafi_alive
09-27-2005, 03:04 PM
Hi Revan
It did after running this code (provided by mtha) to remove the 1970 bug:
UPDATE deletionlog, moderatorlog SET deletionlog.deldate=moderatorlog.dateline
WHERE deletionlog.type = 'post' AND deletionlog.deldate=0 AND (moderatorlog.postid = deletionlog.primaryid) AND moderatorlog.action LIKE 'post %deleted%';
UPDATE deletionlog, moderatorlog SET deletionlog.deldate=moderatorlog.dateline
WHERE deletionlog.type = 'thread' AND deletionlog.deldate=0 AND (moderatorlog.threadid = deletionlog.primaryid) AND moderatorlog.action LIKE 'thread %deleted%';
After that, it randomely started deleting posts and threads. In fact, can someone tell me how to reverse that SQl query 'cause I keep getting database errors now such as:
Invalid SQL:
REPLACE INTO deletionlog
(primaryid, type, userid, username, reason, deldate)
VALUES
(85514, 'post', 193, 'user',
'', '1127836289')
mysql error: Unknown column 'deldate' in 'field list'
mysql error number: 1054
Revan
09-28-2005, 07:27 AM
for some reason the deldate column vanished, try running this:
ALTER TABLE deletionlog ADD deldate INT(10) UNSIGNED NOT NULL DEFAULT '0'
well, actually you tried to run the uninstall.php, and DID NOT remove the code that he edited.
please reverse ALL the file editing that mention in install.txt, or upload your original
admincp/index.php
includes/functions_databuild.php
clientscript/vbulletin_global.js
if you dont have any other hack (that require editing those files) installed
Hi,
Thank you for your reply.
The vbulletin.com staff said that deldate is not a default field of vbulletin, so how can I delete it altoghether since I uninstalled the hack (softdeletearchive)
Regards
remove ALL the code that you added related to the hack, i think you edited some code in showthread.php. or you can re-upload your original files
Hi,
I haven't edited anything regarding the hack. I only uploaded the softdeladmin.php in admincp and run softdel_install.php. When uninstalling, I ran softdel_uninstall.php and thats it.
Regards
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.