Results 1 to 15 of 26
Page 1 of 2
FirstFirst 1 2 ... LastLast

Thread: [re-release vb2.0] Download PMs to file

  1. #1
    Senior Member bira is on a distinguished road bira's Avatar
    Join Date
    May 2000
    Location
    2nd turn left
    Age
    42
    Posts
    1,501

    [re-release vb2.0] Download PMs to file

    Since I was asked to make this available, here's my hack for downloading Private Messages (as many as you select) at once into a local txt file.

    This is helpful if you need to clear out your PM folder(s) due to quota limitation, but don't want to lose those messages.

    In effect, it works like an e-mail RFC archive.

    Installation Instructions:

    1. Open private.php.

    Find:

    Code:
      if ($delete!="") {
        $what="delete";
      }
    Immediately AFTER it put:

    PHP Code:
      if ($download!="") {
        
    $what="download";
      } 
    Find:

    Code:
        eval("standardredirect(\"".gettemplate("redirect_pmdelete")."\",\"private.php?s=$session[sessionhash]&folderid=$thisfolder\");");
      }
    Immediately AFTER it put:

    PHP Code:
      if ($what=="download") {
          
        if (
    is_array($privatemessage)) {
            
    header("Content-disposition: filename=messages.txt");
            
    header("Content-type: application/octetstream");
            
    header("Pragma: no-cache");
            
    header("Expires: 0");

              while(list(
    $key,$val)=each($privatemessage)) {
                
    $downloads=$DB_site->query_first("SELECT touserid,fromuserid,dateline,title,message FROM privatemessage WHERE privatemessageid='$key' AND userid=$bbuserinfo[userid]");
                
    $tousername=$DB_site->query_first("SELECT username FROM user WHERE userid='$downloads[touserid]'");
                
    $fromusername=$DB_site->query_first("SELECT username FROM user WHERE userid='$downloads[fromuserid]'");
                
    $msgdt vbdate($dateformat,$downloads[dateline]);
                
    $msgtm vbdate($timeformat,$downloads[dateline]);
                
    $wordwrap wordwrap($downloads[message],75,"\r\n");
                
                print(
    "Date/Time Sent: $msgdt, $msgtm\r\n");
                print(
    "From: $fromusername[username]\r\n");
                print(
    "To: $tousername[username]\r\n");
                print(
    "Subject: $downloads[title]\r\n\r\n");
                print(
    "$wordwrap\r\n");
                print(
    "==========================================================================\r\n\r\n\r\n");

            } 
    //end while
        
        
    } else {
          eval(
    "standarderror(\"".gettemplate("error_pmnoselected")."\");");
          exit;
          }
      } 
    Note for Foreign Users: replace the words 'Date/Time Sent', 'From', 'To', 'Subject' in the above code with whatever wording in your language that suits you.

    Save file and upload.

    2. Edit template privfolder.

    Find:

    Code:
    $massforwardlink
    Immediately after OR before it (it does not matter), put:

    Code:
    or <input type="submit" name="download" value="Download">
    Note for Foreign Users: replace the word "or" and the value "Download" with whatever wording in your language that suits you.


    That's it!

    Usage: select one or more messages in one of your Private Messages folder and click on "Download". You will be prompted to save messages.txt on your hard drive (a Windows filename & folder selection dialogue will pop up).

    Cheers,

    Bira

     

  2. #2
    Member bokhalifa is on a distinguished road bokhalifa's Avatar
    Join Date
    Feb 2001
    Location
    u a e dubai
    Age
    33
    Posts
    99
    good hack min
    In Dubai every thing is different
     

  3. #3
    Senior Member conan is on a distinguished road
    Join Date
    Sep 2000
    Posts
    389
    Thanks a lot for the great hack!
     

  4. #4
    Member poil11 is on a distinguished road
    Join Date
    Aug 2000
    Location
    why is this max limit so large? a location should be 20-30 i live in transelvania, at least it wraps.
    Posts
    54
    Thanks for this great hack. i hope that you don't mind but i hacked it to work with wwwthreads. and i am going to use this in many many other things! good deal!

    instead of it being message.txt i made that the subject of the post....
    Last edited by poil11; Thu 3rd May '01 at 3:33pm.
    http://www.stillsucks.com
    and helping with
    http://www.extremeforums.org
     

  5. #5
    Senior Member The_Sisko is on a distinguished road The_Sisko's Avatar
    Join Date
    Jun 2000
    Location
    Hamburg, Germany
    Age
    31
    Posts
    382
    This is what a lot of my Users asked for!!!
    THANKS A LOT!
    The Sisko
    SciFi-Forum.de
     

  6. #6
    Senior Member bira is on a distinguished road bira's Avatar
    Join Date
    May 2000
    Location
    2nd turn left
    Age
    42
    Posts
    1,501
    thanks
     

  7. #7
    Senior Member Streicher has disabled reputation Streicher's Avatar
    Join Date
    Jan 2001
    Location
    Reinbek, Germany
    Posts
    383
    Very good hack. No problems to hack in vB.
    Streicher
     

  8. #8
    New Member smelialichu is on a distinguished road
    Join Date
    May 2001
    Posts
    21
    This is a great hack, just one problem though. When i click on download it displays the pm's in my browser and doesn't download it. i use IE 5.01 none of the other people on the board have reported the problem, ideas? I realise the problem is most likely at my end.
     

  9. #9
    Senior Member bira is on a distinguished road bira's Avatar
    Join Date
    May 2000
    Location
    2nd turn left
    Age
    42
    Posts
    1,501
    Originally posted by smelialichu
    This is a great hack, just one problem though. When i click on download it displays the pm's in my browser and doesn't download it. i use IE 5.01 none of the other people on the board have reported the problem, ideas? I realise the problem is most likely at my end.
    smelialichu, I'm not sure where to point you to, but it has to do with your system/browser setting. Instead of prompting you to choose between save file or open it, it goes right ahead and opens it without asking. I'm not sure how you solve that as I am not familiar with win32 registry stuff.

    You might want to check in your security settings (Tool -> Internet Options) that Download is enabled (general download, that is). Not sure about anything else.

    In any case, I'd recommend upgrading to IE 5.5, which is a much better, faster and less buggy browser.

    Cheers,

    bira
     

  10. #10
    Senior Member veedee is on a distinguished road
    Join Date
    Sep 2000
    Location
    Rotterdam
    Age
    27
    Posts
    325
    Great looking hack.

    I run about 7 styles on my website, does this mean i have to hack the templates 7 times ?

    ~veedee
    Talking loud but aint saying nothing.
     

  11. #11
    Senior Member bira is on a distinguished road bira's Avatar
    Join Date
    May 2000
    Location
    2nd turn left
    Age
    42
    Posts
    1,501
    Originally posted by veedee
    Great looking hack.

    I run about 7 styles on my website, does this mean i have to hack the templates 7 times ?

    ~veedee
    Do you actually have a different templateset for every style though?!?

    Run a search in the Control Panel -> Templates for $massforwardlink. If you have more than one template with it, you can do a search/replace of

    Code:
    Search for: $massforwardlink
    Replace with: $massforwardlinkor <input type="submit" name="download" value="Download">
    At your peril though
    Last edited by bira; Mon 14th May '01 at 3:51pm.
     

  12. #12
    Senior Member veedee is on a distinguished road
    Join Date
    Sep 2000
    Location
    Rotterdam
    Age
    27
    Posts
    325
    yeah different templates

    will do what you told me, cheers me dear
    Talking loud but aint saying nothing.
     

  13. #13
    New Member smelialichu is on a distinguished road
    Join Date
    May 2001
    Posts
    21
    Abyone got any ideas on how to solve my prob? i got it so the filename includes the date. i can tell you how if anyone's interested, iy's fairly simple. In fact very simple
     

  14. #14
    Senior Member bira is on a distinguished road bira's Avatar
    Join Date
    May 2000
    Location
    2nd turn left
    Age
    42
    Posts
    1,501
    Actually, wordwrap() is a built-in function in PHP.

    Perhaps, though, it's only in PHP4 or something.
     

  15. #15
    Member slip is on a distinguished road
    Join Date
    Jan 2001
    Posts
    66
    i installed everything exactly as it should be done, yet when i try to download some pm's, i just get a blank page (completely blank, no errors)

    any help?
     

Page 1 of 2
FirstFirst 1 2 ... LastLast

Similar Threads

  1. Who's online at bottom of page under PMs (VB2)
    By Bema Jinn in forum vBulletin Templates, Graphics & Styles
    Replies: 0
    Last Post: Sat 20th Sep '03, 3:26pm
  2. [FIXED] Download PMs as CSV isn't stripslashes()'d
    By Beorn in forum Resolved vB3 Bugs
    Replies: 2
    Last Post: Fri 21st Feb '03, 9:59pm
  3. [FIXED] Bug in Download all PMs?
    By DWZ in forum Resolved vB3 Bugs
    Replies: 2
    Last Post: Mon 25th Nov '02, 7:25pm
  4. [Release 2.0.3] Unlimited PMs for SuperModerators
    By rylin in forum Releases: Version 2.x
    Replies: 0
    Last Post: Sun 21st Oct '01, 8:40am

Bookmarks

Posting Permissions

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