Log in

View Full Version : [not a bug] Private Messages Clutter--


Jason Hung
04-17-2001, 04:08 AM
I think that the private messages are missing the paging feature... perhaps add << < 1 2 ... > >> feature?

Kier
04-17-2001, 04:19 AM
Most administrators won't allow you to have more than 50-100 private messages, which is why the multipage nav feature is not currently implemented.

Jason Hung
04-17-2001, 05:49 AM
Time for a hack? :D

chrispadfield
04-17-2001, 09:58 AM
yeah please, i would like it as an admin as i stored lots of pms myself and hate waiting for 200 to load.... until a "download pm thing" comes along..

bira
04-17-2001, 10:48 AM
Chris,

Here's a simple and dirty download hack for you. I've had this running on my BB since 1.1.3:

1) Open private.php. Find:


if ($delete!="") {
$what="delete";
}


Immediately under it put:


if ($download!="") {
$what="download";
}


Find:


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


immediately under it put:


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 = mysql_query("SELECT * FROM privatemessage WHERE privatemessageid='$key' AND userid=$bbuserinfo[userid]");
$mydownload = mysql_fetch_array($downloads);
$tousername = mysql_query("SELECT username FROM user WHERE userid='$mydownload[touserid]'");
$mytousername = mysql_fetch_array($tousername);
$fromusername = mysql_query("SELECT username FROM user WHERE userid='$mydownload[fromuserid]'");
$myfromusername = mysql_fetch_array($fromusername);
$msgdt = vbdate($dateformat,$mydownload[dateline]);
$msgtm = vbdate($timeformat,$mydownload[dateline]);


print("Date/Time Sent: $msgdt, $msgtm\r\n");
printf("From: %s\r\n", $myfromusername["username"]);
printf("To: %s\r\n", $mytousername["username"]);
printf("Subject: %s\r\n\r\n", $mydownload["title"]);
printf("%s\r\n", $mydownload["message"]);
print("================================================== =====================\r\n\r\n\r\n");


} //end while

} else {
eval("standarderror(\"".gettemplate("error_pmnoselected")."\");");
exit;
}
}


Upload to server.

2. Open template privfolder. Find:


<input type="submit" class="bginput" name="move" value="Move" style="background-color:#6C6081;color:#F5D300;font-size:10px;font-weight:bold">
$massforwardlink
or <input type="submit" class="bginput" name="delete" value="Delete" style="background-color:#6C6081;color:#F5D300;font-size:10px;font-weight:bold">


change to (change in red):


<input type="submit" class="bginput" name="move" value="Move" style="background-color:#6C6081;color:#F5D300;font-size:10px;font-weight:bold">
or <input type="submit" class="bginput" name="download" value="Download" style="background-color:#6C6081;color:#F5D300;font-size:10px;font-weight:bold">
$massforwardlink
or <input type="submit" class="bginput" name="delete" value="Delete" style="background-color:#6C6081;color:#F5D300;font-size:10px;font-weight:bold">


That's it. Now, upon selecting message(s) and clicking on "Download", you will be prompted to save the file with the selected messages in it, sorted by descending chronological order. You can then save the file under any name you like.


This can be tested on my Bulletin Board.

Cheers,

Bira

Kier
04-17-2001, 10:58 AM
I've moved this thread out of the vB2 Bug reports forum, as it has turned into more of a hacks thread than a bug report.

bira
04-17-2001, 11:02 AM
Kier, why don't you take my proposal above here and improve it? I don't have your skills and knowledge

chrispadfield
04-17-2001, 11:36 AM
than's bira, that is very useful.

cheers

bira
04-17-2001, 11:42 AM
if people are interested in this, I can improve this code to use a template (rather than hard-coded format) and a little less code lines.

Let me know if you are.

chrispadfield
04-17-2001, 12:11 PM
i am definitely interested, going to test it on your forum as well soon....

bira
04-17-2001, 01:25 PM
I cleaned the code abit in the above post. The only other change I could probably make is to use a template for the "to:, from:, subject" lines and I don't really know how to use templates I'm afraid :D

So This is all I have to offer. All I can say is that it works - it's been working on my BB for over 6 months.

Kier
04-17-2001, 01:49 PM
bira: I'm actually planning to implement an email-backup system for private messages in 2.1, so this hack can stay your baby :)

Flare
04-17-2001, 06:04 PM
I have a bunch of packrats as users ... I would defintely like to see some way to organize huge lists of PMs. Currently, my max PMs are set to 400 per user... and I have users complaining that's too few.

I realize I may be in the minority, but it's something that can't really hurt and can only help... at least for the customers. I know it might be a pain to code though :)

Therei s a market for it though! :D

I wonder about an email import/export function for PMs. My users are, more and more, utilizing PMs instead of Email (IE - using PMs as a web based email) .. go figure. Might be an area to explore in the future.