Immediately ABOVE it (make sure you put it ABOVE the } ) put:
PHP Code:
if ($what=="download") {
if (is_array($privatemessage)) {
header("Content-disposition: filename=messages.txt");
header("Content-type: application/octet-stream");
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");
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" class="bginput2" name="download" value="Download" style="background-color:#606096;color:#FFF788;font-size:10px;font-weight:bold">
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
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
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....
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.
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.