Zarkov
Sat 2nd Jun '01, 5:47am
I created this hack to email your PM's to your registered email address after installing the Download hack by Bira, users get no choice in email addresses, it just pulls the registered email address from the database.
This was done for security reasons.
here it is:-
PLEASE change the brackets [ & ] for { & } respectively
as the board here parses the variable and replaces the code with the boards own colour scheeme :)
in privfolder template
find
<input type="submit" class="bginput" name="move" value="Move" style="background-color:[categorybackcolor];color:[categoryfontcolor];font-size:10px;font-weight:bold">
$massforwardlink
and add after it
or <input type="submit" class="bginput" name="email" value="Email" style="background-color:[categorybackcolor];color:[categoryfontcolor];font-size:10px;font-weight:bold">
then in private.php
find the section start do stuff (move etc) and add in there after
if ($delete!="") {
$what="delete";
}
if ($email!="") {
$what="email";
}
Then below there find
eval("standardredirect(\"".gettemplate("redirect_pmdelete")."\",\"private.php?s=$session[sessionhash]&folderid=$thisfolder\");");
}
}
and add after it
if ($what=="email") {
if (is_array($privatemessage)) {
$emailaddr=$DB_site->query_first("SELECT email FROM user WHERE userid=$bbuserinfo[userid]");
while(list($key,$val)=each($privatemessage)) {
$email=$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='$email[touserid]'");
$fromusername=$DB_site->query_first("SELECT username FROM user WHERE userid='$email[fromuserid]'");
$msgdt = vbdate($dateformat,$email[dateline]);
$msgtm = vbdate($timeformat,$email[dateline]);
$wordwrap = wordwrap($email[message],75,"\r\n");
$emailmsg .= "Date/Time Sent: " .$msgdt ."," .$msgtm ."\r\n";
$emailmsg .= "From: " .$fromusername[username] ."\r\n";
$emailmsg .= "To: " .$tousername[username] ."\r\n";
$emailmsg .= "Subject: " .$email[title] ."\r\n\r\n";
$emailmsg .= $wordwrap ."\r\n";
$emailmsg .= "================================================== ========================\r\n\r\n\r\n";
} //end while
mail ($emailaddr[email],"Your Private Messages",$emailmsg,"From:enter your webmaster email address here");
eval("standardredirect(\"".gettemplate("redirect_sentpmemail")."\",\"private.php?s=$session[sessionhash]&folderid=$thisfolder\");");
} else {
eval("standarderror(\"".gettemplate("error_pmnoselected")."\");");
exit;
}
}
Then
create a new template called redirect_sentpmemail
and enter this into it
We have sent your private messages via email to $emailaddr
You will now be returned to the thread.
This will send all selected PM's to the email address as a message body in a plain text style.
Hope this is of use to someone :)
Please reply if you use it or can make any suggestions,comments,likes or dislikes
ps this works in rc3 & final
This was done for security reasons.
here it is:-
PLEASE change the brackets [ & ] for { & } respectively
as the board here parses the variable and replaces the code with the boards own colour scheeme :)
in privfolder template
find
<input type="submit" class="bginput" name="move" value="Move" style="background-color:[categorybackcolor];color:[categoryfontcolor];font-size:10px;font-weight:bold">
$massforwardlink
and add after it
or <input type="submit" class="bginput" name="email" value="Email" style="background-color:[categorybackcolor];color:[categoryfontcolor];font-size:10px;font-weight:bold">
then in private.php
find the section start do stuff (move etc) and add in there after
if ($delete!="") {
$what="delete";
}
if ($email!="") {
$what="email";
}
Then below there find
eval("standardredirect(\"".gettemplate("redirect_pmdelete")."\",\"private.php?s=$session[sessionhash]&folderid=$thisfolder\");");
}
}
and add after it
if ($what=="email") {
if (is_array($privatemessage)) {
$emailaddr=$DB_site->query_first("SELECT email FROM user WHERE userid=$bbuserinfo[userid]");
while(list($key,$val)=each($privatemessage)) {
$email=$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='$email[touserid]'");
$fromusername=$DB_site->query_first("SELECT username FROM user WHERE userid='$email[fromuserid]'");
$msgdt = vbdate($dateformat,$email[dateline]);
$msgtm = vbdate($timeformat,$email[dateline]);
$wordwrap = wordwrap($email[message],75,"\r\n");
$emailmsg .= "Date/Time Sent: " .$msgdt ."," .$msgtm ."\r\n";
$emailmsg .= "From: " .$fromusername[username] ."\r\n";
$emailmsg .= "To: " .$tousername[username] ."\r\n";
$emailmsg .= "Subject: " .$email[title] ."\r\n\r\n";
$emailmsg .= $wordwrap ."\r\n";
$emailmsg .= "================================================== ========================\r\n\r\n\r\n";
} //end while
mail ($emailaddr[email],"Your Private Messages",$emailmsg,"From:enter your webmaster email address here");
eval("standardredirect(\"".gettemplate("redirect_sentpmemail")."\",\"private.php?s=$session[sessionhash]&folderid=$thisfolder\");");
} else {
eval("standarderror(\"".gettemplate("error_pmnoselected")."\");");
exit;
}
}
Then
create a new template called redirect_sentpmemail
and enter this into it
We have sent your private messages via email to $emailaddr
You will now be returned to the thread.
This will send all selected PM's to the email address as a message body in a plain text style.
Hope this is of use to someone :)
Please reply if you use it or can make any suggestions,comments,likes or dislikes
ps this works in rc3 & final