PDA

View Full Version : Email your PM's


zarkov
02 Jun 2001, 10:47
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

bira
02 Jun 2001, 18:24
Originally posted by Zarkov
I created this hack ...


Do you have no shame?

http://vbulletin.com/forum/showthread.php?s=&threadid=15859

:rolleyes:

Blue2000
02 Jun 2001, 20:19
there not the same

one of them e-mails and the other downloads.

Steve Machol
02 Jun 2001, 20:44
Is it possible that this borrows some code from bira's hack?

Besides it's 'they're' not 'there'! :D

nuno
02 Jun 2001, 21:00
yes
he should give the credit to Bira
something like:
Author: Bira
Tarted up by: Zarkov

zarkov
02 Jun 2001, 21:16
Yea sorry Bira it was a genuine mistake what i thought id wrote was
I created this hack to email your PM's to your registered email address after installing the download hack by bira,

If you look at the other hack i posted here that was an adaption of tubedogs post i said the same there.

I do not want to take anything away from you bira or try to hide the fact that it is not all my work.
I am learning php but gave up as i didnt have any real applicational uses for the test scripts i was writing.
Then someone asked me to be a mod on a vb board and when i realised it was php i came here and read what others where doing, I then asked for permission to the boards code to "Play with".
Now i am learning a great deal from you guys.

I am sorry for offending you Bira and my original post will be altered to the intented opening.

ps nuno i do not consider it "tarting up" it does a totaly different job.

nuno
02 Jun 2001, 21:25
ok ok
Original Author : Bira
New Version : Zarkov :D

zarkov
02 Jun 2001, 22:11
to be honest it was because i was so proud that i got it to work properly that i couldn wait to share it.
I had to edit the post 3 times to add in the bits i missed through my excitement and joy.

That not tarted up comment was not said nastily BTW, But thanks for the alteration and in future i will double check that any code i use from others hacks is clearly stated.

Learner29
04 May 2002, 04:14
Originally posted by bira

http://vbulletin.com/forum/showthread.php?s=&threadid=15859

:rolleyes:


Bira, or anyone else, can you please explain why I could not access that thread???

(i am registered with vb.com and entered my licence number in the form....... :confused: )

Steve Machol
04 May 2002, 05:08
Just change the 'com' to 'org'.

Learner29
04 May 2002, 05:20
thank you a million Steve.

I really appreciate it .

What is funny is that I just finished installing this hack (though I would wish and appreciate installing Bira's original work) on all 4 boards I work on.

Life is ridiculous.....

lol

Steve Machol
04 May 2002, 05:48
What happened was this thread was started on vbulletin.com before vb.org was available. When all the hacks threads were transferred to vb.org, some of the old links still pointed back to vb.com. If you run into this again, just try changing 'com' to 'org'.

Learner29
04 May 2002, 06:06
> What happened was this thread was started on vbulletin.com before vb.org
was available. When all the hacks threads were transferred to vb.org, some
of the old links still pointed back to vb.com. If you run into this again,
just try changing 'com' to 'org'.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

thank you so much Steve for the information.
I felt a little bit funny after your answer that I did not find that out
myself.
When I found that the link points back to vb.com, I thought, a hack on
vb.COM ???
well, maybe it was adopted or something by the guys of vb.com.....

Now I know why, and I even have some good knowledge of the history of
vbulletin.org!
thank ya buddy

Steve Machol
04 May 2002, 06:25
No problem! :)

David Bott
28 May 2002, 17:32
Problem Found...

Someone sent me a private message and then cancelled it before I got a chance to read it. Obviously, the intent of cancelling a PM is to prevent the recipient from reading it (if possible). This seemed to have been enforced fairly well but for one exception.... With this hack I was able to use the "email" button at the bottom of my PM Inbox to send myself a copy of the cancelled note.

I am also supprsed that VB does not just delete the cancelled message. E-gads!

Opps!

Learner29
24 Sep 2002, 06:01
Hi David,

Did you get any solution for this problem ???

you are right about a cancelled letter still being readable through this email feature....

David Bott
24 Sep 2002, 13:27
Hello... Nope...never had any word on it I am sorry to say.

Learner29
24 Sep 2002, 22:29
Okie Dave.....

thank you so much for your answer.....

if you still get an answer to this , or a work around so that the cancelled messages be ommitted in the email sent, please remember to come back here and post in this thread.

adriandaz
03 Nov 2002, 02:30
all worked for me :D Although... I have Chen's Pricate Attachments installed, and it doenst email the attachment, could some wizkid make this hack do that? That would be cool.

Thanks,

Adrian.