Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Beta Releases

Reply
 
Thread Tools
Recycle Bin & Moderator Log Details »»
Recycle Bin & Moderator Log
Version: 1.00, by Sasq Sasq is offline
Developer Last Online: Jun 2013 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 01-06-2003 Last Update: Never Installs: 16
Is in Beta Stage  
No support by the author.

THIS IS A REAL BETA HACK, DO NOT INSTALL ON A LIVE BOARD

Ok, I brought up the idea over in this thread .

Here is a BETA hack for a recycle bin and mod logging system I've been working on.

It logs all mod activity for editing/deleting posts, moving threads etc. all admin selectable to log or not.
It creates a Forum (preferably hidden) to hold all the deleted threads - the logging function takes care of where they are from and who put them there.

It also dumps a copy of all user or mod (and admin) posts into an edited posts thread, also all deleted posts are dumped into a deleted posts thread.

Most of the logging is sorted, and configurable, I've probably forgotten something somewhere - which is why this is beta

The log info in the admin display is functional but still needs some work. I think the actual recycle logging functions themselves are up to scratch.

More (short ) notes in the readme.

I repeat do not install this hack on a live board

On the installer, this is probably more beta then the actual hack, thanks to firefly (Chen) for letting me borrow some of his hack installer code.

The installer works with a vanilla install of 2.2.9 but i have no idea what it will do with a hacked board, or different versions.

Also the hack itself is only tested on 2.2.9

The installer will (if you let it) install all of the forums, threads, templates and even do the file mod's. There is also a FTP function to ftp locally if you don't have chmod 777 set, failing direct file access or ftp, you can choose to download the hacked file without having to do all the edits by hand. (damn that took me some working)

The installer is still a little raw, I'll work on it more with some feed back.

Now what the hack actually does.

On the straight logging side.
How much and what is logged is selectable via the script in the admin CP
Code has been added to make an entry in the logdata table each time, a mod or user edits, deletes, opens, closes, sticks - basically everything.. a thread or a post.
(I think I have it logging all relevant information, but I may have missed something.)
You are then able to view the log history in the admin CP, also in the admin CP you can clear the logs, view stats, track down actions by a specific user.
I am working on a function to allow you to rebuild the thread and show edits/deletes as they happened in the timeline, but this part is not a high priority atm for me.

On the Recycle bin side.
-Uses the logging functions to keep track of the threads/posts.
The installer set up the recycle bin forum as a Posts do not count forum.
Most of the larger code inserts keep track of the posts/threads and provide undelete/full delete functions.
the main index.php has a small code insert to hide how many posts/threads are in the recycle bin forum from showing on the main page.
When a post/thread is deleted, the post count is still reduced form the users file, and the posts are unindexed from the search index.
If a thread/post is undeleted, the post counts are increased and the posts are re added to the search index.
If you 'return' an original post after editing, nothing changes with post counts etc.
The code also protects the Edited posts header post, and the Deleted posts header post. so while in the recycle bin, if you choose to 'full delete' either thread the main post and thread remains intact.

See this post for pics

I will try to dig up some older versions of vBB to check the installer with them..


Bugs....

Probably lots, but nothing really worrying that i can see

Todo
Better install instructions
Fix up the admin cp script so its pretty.
Make the Install script a little more stable.
Add anything that you think would be good, and won't take me another 10 solid days to program (I think the wife is going to leave me :speechless: )

Fixed:
Fixed - hopefully - the forum and post creation section on hacked forums

I'm looking forward to feed back etc

This hack is free, but I won't say no to paypal donations for a damn big beer

Dan

Edit, uploaded a new zip file due to a bug in the alternate download section of the installer.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #52  
Old 04-18-2003, 11:19 PM
Sasq's Avatar
Sasq Sasq is offline
 
Join Date: Mar 2002
Location: Japan
Posts: 71
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, my next question .... (probably for Sue) when you installed it, did you use the ftp update or the direct file update?

I'm not quite sure why it would have changed the permissions... I'll have to check, but the more info I can get on the install the better chance I have of makeing sure it never happens again.

Zzed if this hack is still installed, the only lines for index.php are related to keeping the postcount/threadcount from the bin hidden on the main page... two lines. I'm not at my main box atm so if you need them I'll have to drag them up later..

Dan
Reply With Quote
  #53  
Old 04-18-2003, 11:27 PM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am not sure how index.php got clubbered, or how the permissions on forumdisplay.php changed sonce Sue was the one who did the install.

I was just fortunate enough to have shell access and had installed some of my hacks for her and ended up with backup copies.

I may have to reinstall your hack for her again.

My guess is that the FTP program she used may have been the culprit here. I prefer to edit files on site.

P.S. I told Sue earlier that I was going to kill her. :laugh::banana: I was kidding of course.
Reply With Quote
  #54  
Old 04-18-2003, 11:40 PM
Sasq's Avatar
Sasq Sasq is offline
 
Join Date: Mar 2002
Location: Japan
Posts: 71
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hehe np, when you find out if you can let me know...

Thanks

Dan
Reply With Quote
  #55  
Old 04-19-2003, 04:20 PM
Radgam Radgam is offline
 
Join Date: Jan 2003
Location: Scotland! :)
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is a great hack! I'll be running it offline for a little while (until it's released as stable) and i'll report any bugs
Reply With Quote
  #56  
Old 04-28-2003, 10:15 AM
cinq's Avatar
cinq cinq is offline
 
Join Date: Oct 2002
Posts: 1,398
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How's progress on this ?
Reply With Quote
  #57  
Old 05-21-2003, 12:26 PM
Radgam Radgam is offline
 
Join Date: Jan 2003
Location: Scotland! :)
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installation Bugs ###############################
Quote:
------------------------------------------------
loginstall.php :: admin/functions.php :: Modification No.2

there are two modifications called Modification No.2. Doesn't bother me, but just thought i'd say.

------------------------------------------------
loginstall.php :: admin/functions.php :: Modification No.13

the modification details say
PHP Code:
// ###################### Start delete post #######################
function deletepost($postid,$countposts=1,$threadid=0$stoplog=0) {
  global 
$DB_site$bbuserinfo;

  
// decrement user post count
  
if ($postinfo=getpostinfo($postid)) {
    if (
$countposts) {
      
$DB_site->query("UPDATE user SET posts=posts-1 WHERE userid='$postinfo[userid]'");
    }

//log mod 

However, you check later whether or not post counts should be updated so:

PHP Code:
// decrement user post count
  
if ($postinfo=getpostinfo($postid)) {
    if (
$countposts) {
      
$DB_site->query("UPDATE user SET posts=posts-1 WHERE userid='$postinfo[userid]'");
    } 
should be but highlighted in red (as it needs to be removed otherwise post counts are updated incorrectly)
There's also a problem related to this, see the editpost section
Quote:
------------------------------------------------
loginstall.php :: editpost.php :: Modification No.2 to 4

Modification No.2
PHP Code:
//delete just this post
$foruminfo=getforuminfo($threadinfo[forumid]);
deletepost($postid,$foruminfo[countposts],$threadinfo[threadid]);

$logperms=deletepost($postid,$foruminfo[countposts],$threadinfo[threadid]);
$threadreturn=$threadinfo[threadid];

updatethreadcount($threadinfo[threadid]);
updateforumcount($threadinfo[forumid]); 

Modification No.3
PHP Code:
updatethreadcount($threadinfo[threadid]);
updateforumcount($threadinfo[forumid]);

updatethreadcount($logperms[delpost]);//modlog
updateforumcount($logperms[recforumid]); //modlog

eval("standardredirect(\"".gettemplate("redirect_deletepost")."\",
\"showthread.php?s=
$session[sessionhash]&threadid=$threadinfo[threadid]\");"); 

Modification No.4
PHP Code:
$threadinfo[threadid]$threadreturn 

Just a couple of things i'd like to query here:

Modification No.2:
"$logperms=deletepost($postid,$foruminfo[countposts],$threadinfo[threadid]);
$threadreturn=$threadinfo[threadid];"

Those two added lines don't actually seem nessesary.
Firstly, you've already called the deletepost function on the line above so when i deleted the line
"$logperms=deletepost($postid,$foruminfo[countposts],$threadinfo[threadid]);" everything still worked fine.

Also, the variable $threadinfo[threadid] doesn't actually change at any point (as far as i can see) the line to copy it to a new variable isn't needed.

Point two means that Modification No.4 wouldn't be needed.
I think modification 2 and 4 can really be skipped

No issues would Modification No.3
Quote:
------------------------------------------------
loginstall.php :: showthread.php :: Modification No.3

PHP Code:
$viewattachedimages=0;
    }

    
$postbits getpostbit($post);

//modlog
// with rest of modlog code following here 
this line (the one just above //modlog):
PHP Code:
$postbits getpostbit($post); 
should be highlighted in red (it needs to be removed). Otherwise the postbit template appears twice per post

------------------------------------------------
loginstall.php :: showthread.php :: Modification No.7

PHP Code:
//$postbits .= getpostbit($post);
  
  //modlog
// with rest of modlog code following here 
this line (the one just above //modlog):
PHP Code:
$postbits .= getpostbit($post); 
should be highlighted in red (it needs to be removed). Otherwise the postbit template appears twice per post

------------------------------------------------
loginstall.php :: showthread.php :: Modification No.8

PHP Code:
eval("dooutput(\"".gettemplate("showthread")."\");");

//modlog
// with rest of modlog code following here 
this line (the one just above //modlog):
PHP Code:
//eval("dooutput(\"".gettemplate("showthread")."\");"); 
should be highlighted in red (it needs to be removed). If not, the script never gets to the //modlog code that follows (which also outputs the template anyway!)
Quote:
------------------------------------------------
logbit :: template :: -

Uploaded in the zip, minor changes.
Judging by the other templates, i don't think it's actually used!

------------------------------------------------
postbit_reedit :: template :: -

Uploaded in the zip, minor changes.

------------------------------------------------
postbit_recycle :: template :: -

Uploaded in the zip, minor changes.
################################################## ############

Notes:
Tested on vb2.2.9 | Don't know if it works on vb2.3.0, can't get it
Tried both automatic and manual installation options.

Find it works best if everything is done automatically, except for template changes.

Quote:
General Bugs ###############################

Problems when users have weird usernames. Here's my example one (the quotes are part of it):
"';:*->Test<-*:;'"

I think you need to use addslashes() when entering info into the logs table, i'll test this later.
=============

/* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Listed this problem already, check my earlier notes on editpost.php and admin/functions.php

If a user deletes their own post, their post count becomes 0. If they delete their own thread, the post count is updated correctly.

I think (really, not sure here) that this line in admin/functions.php
- just after function deletepost($postid,$countposts=1,$threadid=0, $stoplog=0) {:

Find:
PHP Code:
  // decrement user post count
  
if ($postinfo=getpostinfo($postid)) {
    if (
$countposts) {
      
$DB_site->query("UPDATE user SET posts=posts-1 WHERE userid='$postinfo[userid]'");
    } 
This needs to be changed to just:

PHP Code:
  // decrement user post count
  
if ($postinfo=getpostinfo($postid)) {
    
/*if ($countposts) {
      $DB_site->query("UPDATE user SET posts=posts-1 WHERE userid='$postinfo[userid]'");
    }*/ 
This is because you check later whether or not post counts should be updated (incase posts are being deleted from the log forum, etc).


The second modification (this time in edit.php):

Find:
PHP Code:
} else {
      
//delete just this post
      
$foruminfo=getforuminfo($threadinfo[forumid]);
      
deletepost($postid,$foruminfo[countposts],$threadinfo[threadid]);

      
$logperms=deletepost($postid,$foruminfo[countposts],$threadinfo[threadid]);
      
$threadreturn=$threadinfo[threadid]; 

Should become:

PHP Code:
} else {
      
//delete just this post
      
$foruminfo=getforuminfo($threadinfo[forumid]);
      
deletepost($postid,$foruminfo[countposts],$threadinfo[threadid]);

      
//$logperms=deletepost($postid,$foruminfo[countposts],$threadinfo[threadid]);
      
$threadreturn=$threadinfo[threadid]; 
otherwise, again, the post count seems to be done twice. It seems to work fine when that line is removed. Everything is still logged correctly.
=============
Listed this problem already
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
But that's it. This hack is absolutely brilliant!
Much thanks


[ mY edit note:
Corrected one or two things i wrote originally.
Listed a bit more details

If you're unsure what i'm on about with anything you can email me at
info@radgam.fsworld.co.uk ]
Reply With Quote
  #58  
Old 05-30-2003, 12:27 AM
Karbon Karbon is offline
 
Join Date: Mar 2003
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I succesfully installed this hack on 2.2.9, with no errors during the install. I went to the forum index page and recieved this error:

Fatal error: Call to undefined function: getlogset() in /....../httpdocs/forums/index.php on line 50

Any suggestions would be much appreciated, thank you for creating this hack (even though it isn't working for me yet )
Reply With Quote
  #59  
Old 05-30-2003, 09:04 AM
Radgam Radgam is offline
 
Join Date: Jan 2003
Location: Scotland! :)
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Check your email
Reply With Quote
  #60  
Old 05-31-2003, 07:22 PM
The Red Devil The Red Devil is offline
 
Join Date: Mar 2003
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I got the same error as Karbon. Ive installed it on 2.3.0. Didnt get any errors, but I noticed the admin commands dont appear either so it seems it havnt changed some files as it should.
Reply With Quote
  #61  
Old 05-31-2003, 07:48 PM
Radgam Radgam is offline
 
Join Date: Jan 2003
Location: Scotland! :)
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It seems to be a problem with the automated installer. It works best if you do the file mods by hand
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:12 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06092 seconds
  • Memory Usage 2,359KB
  • Queries Executed 27 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (15)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete