This hack allows you to download the pm that you recieved to your disk to read later or print. the origional hack was for vbulletin by bira and that post can be seen at http://www.vbulletin.com/forum/showthread.php?s=&postid=100911 i modded it to work with w3t. you can see it in action at my forum http://www.extremeforums.org PM yourself and you will see a button that says download this post to disk click on it and it asks where you want to save the file to on your HD.
files moded: viewmessage.php and mess_handler.php
open up viewmessage.php and find the line that says:
echo " ";
change it so it looks like this:
echo " ";
done with viewmessage.php now open up mess_handler.php just above:
// #################################################################### // reply_mess function - Reply to this message
add:
// -------------------------------- // END OF THE DELETE_MESS FUNCTION
// #################################################################### // save_mess function - Save PM ot Disk // #################################################################### function save_mess($Username="",$Password="",$Number="",$Subject="",$Sendto="") { global $dbh, $config, $theme, $lang; $html = new html; $Username_q = addslashes($Username); $query = " SELECT M_Message,M_Sent FROM w3t_Messages WHERE M_Number = $Number AND M_Username = '$Username_q' "; $sth = $dbh -> do_query($query); list($Message,$When) = $dbh -> fetch_array($sth);
i don't know why but when i looked at the preview everything was a-okey, but i guess not, i must have been sleepy again. life has been to hard this past month. not thinking properly at all....i uploaded the readme for it
Sure you didn't skip a step? You have the button and the function, but I don't see the code that actually calls the function. This is the button:
< input type=submit name = option value = "Save This PM to Disk" class="buttons" >
Because the form = < form method=POST action = "$config[phpurl]/mess_handler.php" >
and because there are values, they should be passed to the mess_handler.php file. The mess_handler file loads, but nothing in there, that I see anyway, is telling the code to go to save_mess at all. Like I would be expecting a couple of lines like the following:
$html = new html; $html -> save_mess("info about the message like the message number in here");
Not sure if I'm doing something wrong or if a step was skipped. I can definitely see that it's a cool hack, just can't make it work on mine.
bleh bleh bleh, as you can see, i am no good at writing instructions on how to do anything..... i am just horrible! in mess_handler.php fin dthe line that says:
// -------------------------------------------------------- // If they selected reply to this message, execute that sub if($option == "$lang[REPLY_MESS]"){ reply_mess($Username,$Password,$Number,$Subject,$Sendto,$TextCols,$TextRows,$Pselected,$user); exit(); }
add this below it:
// -------------------------------------------------------- // If they selected save this message, execute that sub if($option == "Save This PM to Disk"){ save_mess($Username,$Password,$Number,$Subject,$Sendto); exit(); }
so it looks like this:
// -------------------------------------------------------- // If they selected reply to this message, execute that sub if($option == "$lang[REPLY_MESS]"){ reply_mess($Username,$Password,$Number,$Subject,$Sendto,$TextCols,$TextRows,$Pselected,$user); exit(); }
// -------------------------------------------------------- // If they selected save this message, execute that sub if($option == "Save This PM to Disk"){ save_mess($Username,$Password,$Number,$Subject,$Sendto); exit(); }
i am damn sure that is it, ahhh!!!! if you change the wording in viewmessage, make sure it the same in messhandler like above.
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.