1
OldFriend
Enhanced PM notification.
  • 2006/11/24 13:19

  • OldFriend

  • Just popping in

  • Posts: 99

  • Since: 2005/10/28


On other forums that I visit, if someone PMs me, then I receive an email to my registered email address to tell me that I have a PM waiting for me.

This is extremely useful for sites that you don't visit every day and I think is something lacking in XOOPS PM module.

Are there any plans to add this feature?

2
aph3x
Re: Enhanced PM notification.
  • 2006/11/24 14:00

  • aph3x

  • Theme Designer

  • Posts: 834

  • Since: 2004/12/26


Till then...maybe THIS thread will help
Everything I'm not made me everything I am
The Themes

3
khuhner
Re: Enhanced PM notification.
  • 2006/11/24 14:08

  • khuhner

  • Quite a regular

  • Posts: 232

  • Since: 2006/1/6 3


Quote:

OldFriend wrote:
On other forums that I visit, if someone PMs me, then I receive an email to my registered email address to tell me that I have a PM waiting for me.

This is extremely useful for sites that you don't visit every day and I think is something lacking in XOOPS PM module.

Are there any plans to add this feature?


Also see this forum:

https://xoops.org/modules/newbb/viewtopic.php?topic_id=54353&forum=20&post_id=241873#forumpost241873

I downloaded the code and loaded it onto my site. It works as advertised. IF a user has email notification in their profile, THEN they will get an email when a PM arrives!

Good luck,
Kurt

4
khuhner
Re: Enhanced PM notification.
  • 2006/11/26 20:43

  • khuhner

  • Quite a regular

  • Posts: 232

  • Since: 2006/1/6 3


Here is my version of the php file; I have made a couple of changes for handling errors and redirecting users by providing the link again.

If you use this version in the php file, you need to replace "YOURDOMAIN" where applicable.Drop this into your XOOPS root directory. Then any user has selected "email notification", will be emailed when a new PM arrives.

You'll also need to drop in the other template files as shown in the readme.txt included with the download.

Kurt

PHP
### ======================================================
### [url=http://www.xoops.net.br/]XOOPS Brasil[/url] - A comunidade diferente!
### ======================================================
### Arquivo para reenvio de Link de Ativação
### Script for resend the activation link
### ======================================================
### Developer: Fernando Santos, fernando@zend.com.br
### Copyright: www.xoops.net.br © 2003-2004
### ------------------------------------------------------
### www.xoops.net.br
### ======================================================
### v.1.0, Sun Dec 19 15:33:59 BRST 2004
### ======================================================

$xoopsOption['pagetype'] = "user";
include 
"mainfile.php";
include 
'header.php';

// Doesn't matter GET or POST
$email = isset($HTTP_GET_VARS['email']) ? trim($HTTP_GET_VARS['email']) : '';
$email = isset($HTTP_POST_VARS['email']) ? trim($HTTP_POST_VARS['email']) : $email;

// If $email is empty, show form for link resend
if ($email == '') {
echo <<< TOPET05

  Resend activation link
  
Fill in the e-mail you registered with and we will resend the activation email.
  Be sure to check your "Spam" folder.

  $_SERVER[PHP_SELF]" method="post">
    Registered E-mail:   
  

TOPET05;
  
$email='';
// If $email is not empty, let's verify some things before sending the link
}else{
$myts =& MyTextSanitizer::getInstance();
$member_handler =& xoops_gethandler('member');
// The line below returns an array with all the users registered with the given e-mail, in our case it'll be only the $getuser[0]
$getuser =& $member_handler->getUsers(new Criteria('email'$myts->addSlashes($email)));

// If the e-mail doesn't exist in the database, $getuser returns array()...
if ($getuser == array() ) {
    echo 
"

E-mail " $email " doesn't appear to be registered in our databases!



Please click here to retry."
;
    include(
"footer.php");
    exit();
}

// If the e-mail doesn't exist in the database, $getuser returns empty...
if (empty($getuser)) {
echo 
"

The e-mail isn't registered in our databases!



Please click here to retry."
;
include(
"footer.php");
    exit();
}
//Verifying if the user is already active...
if($getuser[0]->isActive()){
echo 
"

The user ".$getuser[0]->getVar('uname').", registered with e-mail ".$getuser[0]->getVar('email')." is already active!



Please click here to retry."
;
include(
"footer.php");
    exit();    
}
//Sending it
$xoopsMailer =& getMailer();
$xoopsMailer->useMail();
$xoopsMailer->setTemplate('register.tpl');
$xoopsMailer->assign('SITENAME'$xoopsConfig['sitename']);
$xoopsMailer->assign('ADMINMAIL'$xoopsConfig['adminmail']);
$xoopsMailer->assign('SITEURL'XOOPS_URL."/");
$xoopsMailer->setToUsers($getuser[0]);
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
$xoopsMailer->setFromName($xoopsConfig['sitename']);
$xoopsMailer->setSubject(sprintf("- Resend - "._US_USERKEYFOR,$getuser[0]->getVar("uname")));
    if ( !
$xoopsMailer->send() ) {
    echo 
"

It could not be possible to resend the activation link for ".$getuser[0]->getVar('uname').". Contact the site administrators.



Or click here to retry."
;
    include(
"footer.php");
    exit();
    } else {
    echo 
"

The activation link for ".$getuser[0]->getVar('uname')." was resent. If you don't receive the e-mail in a few hours, try again or contact the site administrators

"
;
    }
}
include(
"footer.php");
reset ($HTTP_GET_VARS);
reset ($HTTP_POST_VARS);
?>

Login

Who's Online

247 user(s) are online (205 user(s) are browsing Support Forums)


Members: 0


Guests: 247


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits