Results 1 to 7 of 7

Thread: CabCon modding tutorials

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Quote Originally Posted by CabCon View Post
    Is it possible to edit the thread?
    Yea, you can edit it now. Back then I put a time limit of 120 minutes on posts, because people received an answer and then cleaned all of their posts, rendering whole threads useless.

    Well, I just had an idea and implemented it: just save the old version of the post to a file:

    editpost.php line 465, under // ### POST HAS NO ERRORS ###
    PHP Code:
        {
            
    $postid intval$postinfo['postid'] );
            
    $time time();
            
    //$currentmsg = $vbulletin->GPC['message'];
            
    $posts $vbulletin->db->query_read("
                SELECT pagetext 
                FROM " 
    TABLE_PREFIX "post 
                WHERE postid = 
    $postid
            "
    );
            
    $post $vbulletin->db->fetch_array($posts);
            
    $text $post['pagetext'];
            
    $rand rand(100999); // cba to generate a "incremental revision id" now, so just do timestamp+random value
            
    file_put_contents("some_super_secret_folder/{$postid}_{$time}_{$rand}.txt"$text);
        } 
    test
    So if somebody deletes all of his posts now, it's easy to restore them. If it would be many posts, I will just write a PHP import script for it. Ideas/better implementation is welcome
    timescale 0.01

  2. The Following User Says Thank You to kung foo man For This Useful Post:

    YuriJurek (9th November 2016)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •