Previous Thread
Next Thread
Print Thread
Rate Thread
#221545 07/23/2002 9:58 AM
Joined: Mar 2002
Posts: 305
Enthusiast
Enthusiast
Offline
Joined: Mar 2002
Posts: 305
Mod Name / Version: Email PM Hack v1.0.3
Description: This will allow users to email their PM's to their email address on file.
Working under: UBB.threads 6.0.2
Any pre-requisites: None
Author(s): written by JustDave, converted to v6 by Astaran, converted to v6.0.2 by Lisa_P
Credits: Not sure, this one was around before I found you guys!
Files Altered: (3) /languages/english/generic.php; /templates/viewmessages.tmpl; delete.php
Database Altered: No
New Files: none
Attachments
53036-emailpm1.0.3.txt (0 Bytes, 36 downloads)


[:"red"]Lisa[/]
Sponsored Links
JacquiL #221546 07/23/2002 6:54 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Credit JoshPet, he suggested the hack. I just obliged.

sjsaunders #221547 07/23/2002 8:56 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Thanks...
But anyone can think 'em up. You guys make it happen.

Daine #221548 07/23/2002 9:45 PM
Joined: Mar 2002
Posts: 305
Enthusiast
Enthusiast
Offline
Joined: Mar 2002
Posts: 305
I agree with Dave, if nobody asks for it, it usually doesn't get done!

Here is an updated attachment.
Attachments
53052-emailpm1.0.3.txt (0 Bytes, 35 downloads)


[:"red"]Lisa[/]
JacquiL #221549 07/23/2002 10:47 PM
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Thanks Lisa, you are becoming quite the developer yourself. Nice work.


- Allen wavey
- What Drives You?
Sponsored Links
SurfMinister #221550 07/23/2002 11:15 PM
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Awaiting email confirmation


- Allen wavey
- What Drives You?
SurfMinister #221551 07/23/2002 11:46 PM
Joined: Mar 2002
Posts: 305
Enthusiast
Enthusiast
Offline
Joined: Mar 2002
Posts: 305
If you're still waiting, I forgot something! We get the emails immediately. I was afraid of this, because it took so long for me to get it right. Lemme look . . . .


[:"red"]Lisa[/]
SurfMinister #221552 07/24/2002 1:27 AM
Joined: Mar 2002
Posts: 305
Enthusiast
Enthusiast
Offline
Joined: Mar 2002
Posts: 305
Ok, I think I found the problem. I forgot to add this change in delete.php:

Find:

$user = $userob -> authenticate();


And change it to:

$user = $userob -> authenticate(U_Email);

Updated (once again ) instructions attached. One of these days I'll get it right on the first try.
Attachments
53074-emailpm1.0.3.txt (0 Bytes, 43 downloads)


[:"red"]Lisa[/]
SurfMinister #221553 07/24/2002 2:14 AM
Joined: Mar 2002
Posts: 305
Enthusiast
Enthusiast
Offline
Joined: Mar 2002
Posts: 305
You fixed it, because I just emailed all my pm's from here to myself. Yay!


[:"red"]Lisa[/]
JacquiL #221554 07/27/2002 1:35 AM
Joined: Jan 2002
Posts: 218
Enthusiast
Enthusiast
Offline
Joined: Jan 2002
Posts: 218
Lisa:

Great job on this. I only had a couple of suggestions:

In viewmessages.tmpl, change this:

code:
{$ubbt_lang['TEXT_DELETE']}


To this:

code:
{$ubbt_lang['TEXT_SELECT']}


Then, in generic.php, add the following line:

code:
$ubbt_lang['TEXT_SELECT'] = "Select";


After this:

code:
$ubbt_lang['PM_EMAIL'] = "Email PM";


What this will do is to change the column header from "Delete" to "Select". I think this helps to avoid confusion since users might not figure out that they need to check the "Delete" box in order to email messages to themselves. Changing it to "Select" still works for the "Delete Checked" button, so it shouldn't be confusing at all.

Hope this helps...

Sponsored Links
SDS #221555 07/27/2002 3:44 PM
Joined: Mar 2002
Posts: 305
Enthusiast
Enthusiast
Offline
Joined: Mar 2002
Posts: 305
I think you're right WrÅith, I think it will make it much clearer for users.

I updated the file and attached it as v1.0.4 . Thanks!
Attachments
53238-6.0.2- PM_ Hack_1.0.4.txt (0 Bytes, 19 downloads)


[:"red"]Lisa[/]
JacquiL #221556 08/13/2002 9:11 PM
Joined: Feb 2002
Posts: 67
Power User
Power User
Offline
Joined: Feb 2002
Posts: 67
Hi Lisa,

you've forgot to add the "$user = $userob -> authenticate(U_Email);" - fix into the documentation of v1.04

Btw ... seems that this hack needs to be optimized against sending html-codes included into the pm's, right?

MRLefferts #221557 08/13/2002 10:01 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
For the most part I think that the <br /> tags need to be converted to control character breaks, \n or \r\n depending on the system I believe.

Other steps would need to be taken to display the emailed pm with the html content in working order too.

JacquiL #221558 08/14/2002 10:09 AM
Joined: Feb 2002
Posts: 67
Power User
Power User
Offline
Joined: Feb 2002
Posts: 67
Hmm ... after adding this hack correctly the deletion of private messages doesn't work anymore ... anyone tested this hack too?

MRLefferts #221559 08/14/2002 10:24 AM
Joined: Feb 2002
Posts: 67
Power User
Power User
Offline
Joined: Feb 2002
Posts: 67
Got it ...

[]
Find ~ line 35:
// -------------------------------
// Make sure they own this message
$Username_q = addslashes($Username);



should be:

[]
Find ~ line 39:
// ---------------------------------------------
// Track the total number of delete new messages
$Total = 0;




MRLefferts #221560 08/14/2002 10:55 AM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I haven't done anything with it since 5.5.1, I believe... lol

MRLefferts #221561 08/17/2002 2:14 PM
Joined: Jun 2002
Posts: 29
User
User
Offline
Joined: Jun 2002
Posts: 29
It still won't delete checked PM's when clicking the "Delete Checked" button. Did I miss something?

Last edited by mrnocal; 08/17/2002 2:19 PM.

-Marty
Club MOTS General Manager
Glazor #221562 08/18/2002 7:16 PM
Joined: Jun 2002
Posts: 29
User
User
Offline
Joined: Jun 2002
Posts: 29
I figured it out (worked for me anyway). In the viewmessages.tmpl file, the "Delete Checked" button is named "option", so in the delete.php, instead of inserting:

if ($deletecheck == "{$ubbt_lang['DELETE_CHECKED']}")

it should be:
if ($option == "{$ubbt_lang['DELETE_CHECKED']}")



-Marty
Club MOTS General Manager
Glazor #221563 08/18/2002 7:32 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Thanks for sharing!

I'll probably be putting this into my main site too at some point.

sjsaunders #221564 10/02/2002 1:56 PM
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
For 6.1 the table-prefix needs to be added.

Change:
code:
$query = "
SELECT M_Subject, M_Sender, M_Sent, M_Number, M_Message
FROM w3t_Messages
WHERE M_Username = '$Username_q'
$msgquery
";


to:
code:
$query = "
SELECT M_Subject, M_Sender, M_Sent, M_Number, M_Message
FROM {$config['tbprefix']}Messages
WHERE M_Username = '$Username_q'
$msgquery
";


Glazor #221565 10/03/2002 6:06 AM
Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
I installed this hack last night but did not work at all. Following the posts of this thread I managed to make it delete messages (as it used to) but not to send emails.

Following the logic of the problem, I think I found a possible solution (which works very well for me).

In the delete.php the logic applied by the hack is to check if any of the checkboxes are checked and then delete the messages and after that email them.

I moved the emailing code which starts with:
code:

// ----------------------------------------------------------------------------
// If they chose "Email PM" then we email the message instead of deleting it

if ($pmemail == "{$ubbt_lang['PM_EMAIL']}") {



in the instructions just below the line ~39
code:

$Total=0;



and after that block of code I changed the:
code:

if ($deletecheck == "{$ubbt_lang['DELETE_CHECKED']}")



to

code:

elseif ($option == "{$ubbt_lang['DELETE_CHECKED']}")



This way once you select messages and click on the Email PM button, the messages will be sent to you via email (provided that you have completed the rest of the steps outlined in the instructions of this hack).

Once you return back to the messages screen you will have to select back the ones you emailed and click delete to delete them.

This is a feature that I wanted for my users. If you want to select messages and by clicking Email PM them to be emailed and deleted you need to first change the:
code:

$ubbt_lang['PM_EMAIL'] = "Email PM";



to
code:

$ubbt_lang['PM_EMAIL'] = "Email and Delete checked";



and change the
code:

elseif ($option == "{$ubbt_lang['DELETE_CHECKED']}")



to

code:

if ($option == "{$ubbt_lang['DELETE_CHECKED']}")



Warm regards

Nikos


Nikos
JacquiL #221566 01/05/2003 4:05 PM
Joined: Oct 2002
Posts: 165
Member
Member
Offline
Joined: Oct 2002
Posts: 165
I would sure like to implement this hack on 6.2. Is anyone else interested? Maybe is there is, we can persuade someone knowledgeable to lend a hand

Seems like this would help me eliminate many of my own 500+ PMs that I want to archive for later use, never mind my users clearing their PMs.

alsalmicom #221567 01/05/2003 4:15 PM
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
I have this one on my toDo list for the next week. Especially my moderators find it pretty useful.

I'll post the updated instructions, when finished.

-Fusion- #221568 01/05/2003 4:18 PM
Joined: Oct 2002
Posts: 165
Member
Member
Offline
Joined: Oct 2002
Posts: 165
Astaran,

THANKS!

Haven't used it before, but it looks great.

-Fusion- #221569 01/05/2003 4:35 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I have it working here.

You an put the instructions up or I can.

sjsaunders #221570 01/05/2003 4:45 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Looks like I need to fine tune it a tad. Getting the user number as the name of the user that sent the pm.

lol but it works.

sjsaunders #221571 01/05/2003 5:04 PM
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
If you have it, do it
I haven't started working on it and have several hacks to convert to 6.2
Maybe i get my forum-management for moderators before a new version is released this time. ;-)

-Fusion- #221572 01/05/2003 5:28 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
hehe ok will do.

I'm working on allowing for sending the pm's in html based on the user's prefs. Have a glitch with the same pm being looped in a number of times. Working on it now.

sjsaunders #221573 01/05/2003 5:38 PM
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
i'm using this for 6.1
Code
 // E-Mail PM-Hack<br />//---------------<br />}<br />if ($email) {<br />   $Username_q = addslashes($Username);<br />   $g = 0;<br />   $msgquery = "AND (";<br />   for($i=0;$i<=$total;$i++){<br />      $name = "box$i";<br />      if("$HTTP_POST_VARS[$name]"){<br />         $number = "$HTTP_POST_VARS[$name]";<br />         $number = ereg_replace("-NEW","",$number);<br />             $g++;<br />                 if ($g > 1) {<br />                        $msgquery .= " OR ";<br />                 }<br />                 $msgquery .= "M_Number = '$number'";<br />          }<br />   }<br />   $msgquery .= ")";<br />       $newline = "\n";<br />       if (stristr(PHP_OS,"win")) {<br />          $newline = "\r\n";<br />       }<br />        $to = $user['U_Email'];<br />        $emailformat = $user['U_EmailFormat'];<br />        $Sender = "{$config['emailaddy']}";<br />        if ($g && $to) {<br />            $query = "<br />                    SELECT M_Subject, M_Sender, M_Sent, M_Number, M_Message<br />                    FROM   {$config['tbprefix']}Messages<br />                    WHERE  M_Username = '$Username_q'<br />                    $msgquery<br />            ";<br />            $sth = $dbh -> do_query($query);<br />                $html = new html;<br />                while ( list ($Msubject,$Msender,$Msent,$Mnumber,$Mmessage) = $dbh -> fetch_array($sth) ) {<br />                         $date = $html -> convert_time($Msent);<br />          		 $mailer = new mailer;<br />          		 $header = $mailer -> headers($emailformat);<br />          		 $subject ="Forum-PM: $Msubject";<br />                         $Mbody = "From: ".$Msender.$newline."Subject: ".$Msubject.$newline."Date: ".$date.$newline.$newline;<br />                         $Mbody .= "$Mmessage";<br />                         mail("$to","$subject","$Mbody","$header");<br />                }<br />                $dbh -> finish_sth($sth);<br />        }<br />} 

-Fusion- #221574 01/05/2003 5:40 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
heh I just got it working... lol

I'll post my instructions sometime here shortly.

-Fusion- #221575 01/05/2003 6:03 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273

sjsaunders #221576 01/05/2003 6:12 PM
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
Thx, JustDave!

-Fusion- #221577 01/05/2003 6:16 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Since this has been updated. I'll close this.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)