PDA

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



Jason Hung
Tue 17th Apr '01, 2:08am
I think that the private messages are missing the paging feature... perhaps add << < 1 2 ... > >> feature?

Kier
Tue 17th Apr '01, 2:19am
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
Tue 17th Apr '01, 3:49am
Time for a hack? :D

chrispadfield
Tue 17th Apr '01, 7:58am
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
Tue 17th Apr '01, 8:48am
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
Tue 17th Apr '01, 8:58am
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
Tue 17th Apr '01, 9:02am
Kier, why don't you take my proposal above here and improve it? I don't have your skills and knowledge

chrispadfield
Tue 17th Apr '01, 9:36am
than's bira, that is very useful.

cheers

bira
Tue 17th Apr '01, 9:42am
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
Tue 17th Apr '01, 10:11am
i am definitely interested, going to test it on your forum as well soon....

bira
Tue 17th Apr '01, 11:25am
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
Tue 17th Apr '01, 11:49am
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
Tue 17th Apr '01, 4:04pm
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.