SmartFAQ is developed by The SmartFactory (https://www.smartfactory.ca), a division of InBox Solutions (https://www.inboxsolutions.net)

How can I automatically send a welcome PM (Private Message) to my new members?
Xoops 2.0.X Open /**Xoopsinstallation**/register.php

Find:
(XOOPS_GROUP_USERS, $newid)) { echo _US_REGISTERNG; include 'footer.php'; exit(); }


Xoops 2.2.X Open /**Xoopsinstallation**/modules/profile/register.php

Find:
 $newid = $newuser->getVar('uid'); if (!$member_handler->addUserToGroup(XOOPS_GROUP_USERS, $newid)) { echo _PROFILE_MA_REGISTERNG; break; }


Add After:
//Welcome PM Hack start //Yeah,already defined above^^ // $newid = $newuser->getVar('uid'); $pm_handler =& xoops_gethandler('privmessage'); $pm =& $pm_handler->create(); $pm->setVar("subject", "Add the subject here"); $pm->setVar("msg_text", "Add your message text here!!!!!!!"); //Newuser's id $pm->setVar("to_userid", $newid); // Admin's id,1 in my case $pm->setVar("from_userid", 1); if (!$pm_handler->insert($pm)) { // echo "Failed to send Welcome Private Message!!"; // No need to echo this failure-message here,I think so!!...Just optional^^ } //Welcome PM Hack end


The comments are owned by the author. We aren't responsible for their content.
user

 Auto PM to new members hack


Thanks Bluenova for a very usefil FAQ

 
user

 Re: Auto PM to new members hack


This is really useful!
I suggest this should be included in the next XOOPS also, if we can make is databasable it is very more useful as well.Please use this on Xoops.org!

 
user

 Re: Auto PM to new members hack


Quote:

This is really useful!I suggest this should be included in the next XOOPS also,



In that case i suggest [size=x-small]someone[/size] puts it into the feature request tracker on the sourceforge.net core development site so it doesn´t go unnoticed.

 
user

 Re: Auto PM to new members hack


Unfortuanately it seems that, the features requested at the feature tracker will not be read, since it is about one month that I have posted a feature there and nobody even botherd to look at it and comment on it! So what I think is that feature tracker is useless.

 
user

 Re: Auto PM to new members hack


I think it is checked by Mith and phppp but niether of them have been around much recently. As we all know real life has to come first every now and again I have added it, as I'm sure it will be looked at for 2.4

 
user

 Re: Auto PM to new members hack


Hi,

Can this be done in XOOPS 2.2.3?

Thanks.

 
user

 Re: Auto PM to new members hack


I havn't tested it, but I think it should?

 
user

 Re: Auto PM to new members hack


sorry to be a pain, but I just cannot find the code that need to be changed, I am using the latest version of xoop.


could you please point out the exact path to register.php

Thank you

 
user

 Re: Auto PM to new members hack


register.php is in the root of your XOOPS installation. i.e.

/home/yourusername/xoops/register.php or
/home/yourusername/register.php

(if you're using linux)

 
user

 Re: Auto PM to new members hack


Thank you bluenova for your reply, but all I have in register.php is the following code

include 'mainfile.php';
$parsed_url = parse_url($_SERVER['REQUEST_URI']);
$url = "modules/profile/register.php";
header('location: '.$url);
//this file is deprecated
?>

 
user

 Re: Auto PM to new members hack


register.php in 2.2.X can be found in:

/**Xoopsinstallation**/modules/profile/register.php

 
user

 Re: Auto PM to new members hack


I am using 2.2.4 and I dont see the line mentioned that we are supposed to look for

 
user

 Re: Auto PM to new members hack


I havn't tested it, but I think it can go after:

$newid $newuser->getVar('uid');
        if (!
$member_handler->addUserToGroup(XOOPS_GROUP_USERS$newid)) {
            echo 
_PROFILE_MA_REGISTERNG;
            break;
        }

Can you post back if it works?

cheers
Bluenova

 
user

 Re: Auto PM to new members hack


ok so far I tested it on 2.2.3 final but not 2.2.4 but it worked fine. Now if someone wants to jump on http://www.shotokansite.com and register to test it out and let us know how it went then we will know if it is viable for 2.2.4 as well.

 
user

 Re: Auto PM to new members hack


A brilliant hack. I've added it to all 3 of my sites in one global sweep!

 
user

 Re: Auto PM to new members hack


I've just installed it on XOOPS 2.2.4...tested and worked fine :)

 
user

 Re: Auto PM to new members hack


This is such a cool little hack. I'm using 2.0.13.2 and it works fine.
It would be nice though if it were part of the system module or some area of the administration preferences instead of a hack - it would make future upgrades much easier.

 
user

 Re: Auto PM to new members hack


thanks for this great hack...working perfectly in 20132

 
user

 Auto PM to new members hack only if activated?


Great. But how should I go about if I would like the PM to be sent only if the user clicks on the activation link, or the admin activates manually the userprofile?

 
user

 Re: Auto PM to new members hack only if activated?


I tried that in a separate file (i just called it testpm.php) and it would not send and it error, but for the reason for the error, it printed nothing.

How would i make it work in an another file? Not the register file.

 
user

 auto welcome pm msg


GREAT HACK! love it.

now if I could get the script for deleted old pm's to delete ALL of them I would be all set. :)

 
user

 welcome pm hack


i just notice that this hack continue working in my site although i remove this hack long time ago

after some investigation i found out the hack is stored in the database and not in registerform.php/register.php and it is automatically send new pm to newly registered users..
i nver touch my database
..i don't know why the hack is stored in database

I'm using XOOPS 2.0181..i deleted it from phpmyadmin and now everything is ok..

p/s:i noticed that this feature is integrated in the 2.3 core ..great

 
user

 re: nice hack


very nice hack, i has look this for a long time.

thanks

 


Login

Who's Online

257 user(s) are online (3 user(s) are browsing XOOPS FAQ)


Members: 0


Guests: 257


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!

Did you know ?

If you are trying to edit the theme.html in your themes folder and nothing seems to be changed, be sure that you set "Update module template .html files from themes/your theme/templates directory?" to "YES" in General Settings!!

Random question

What is a Quote?