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.
Then it must be something to do with the hack, either your doing something wrong or possibly your using PHP 3 and it maybe it doesnt work with 3 ( that is only a guess as i have never tried it on 3).
Originally posted by slip 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?
can anyone help me?
I'm using PHP4 and I did everything like I should have..
I found that the code in the hack worked in IE 5 but not 5.5, I had to do a little digging around,But i assume its to do with http versions, IE 5 being http 1.0 complient and 5.5 being http 1.1 compliant.
I did work out and get it to work in IE.5.5 and netscape 4.7, but at the moment im at work and dont have access to the code, but ill post the changes later for anyone to use.
Please note that from mmy playing you can have it work in IE 5 or 5.5 but not both
I had the same error as Norritt (Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in e:\apache\apache\nsdocs\forum\private.php on line 695), and it wasn't my fault, after a while I found out the error. I had to modify the last EVAL() in this way:
PHP Code:
// Original code by Bira
eval("standarderror(\"".gettemplate("error_pmnoselected")."");");
exit;
}
// My modification
eval("standarderror(\"".gettemplate("error_pmnoselected")."\");");
exit;
}
One other thing: I use IE 5.5 and the hack works greatly without applying Zarkov's modifications.