Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Tutorials and Tips

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 08-07-2013, 12:22 PM
pachoofoosh's Avatar
pachoofoosh pachoofoosh is offline
Artist
 
Join Date: Dec 2012
Location: New York
Posts: 98
Gender: Unknown/Other
Credits: 18,365
pachoofoosh is on a distinguished road
Default (1.3.3) Automatically send new users welcome messages

This code will automatically send new users a welcome message when they register.

Step 1.) Open up register.php. Find the line that looks like the following:
PHP Code:
$document->addLangvar($mysidia->lang->success.$mysidia->input->post("username").$mysidia->lang->success2); 
Step 2.) Right under that line, paste this:
PHP Code:
$pm = new PrivateMessage(); // Send them a welcoming message
                
$pm->setsender('YourUsernameHere');
                
$pm->setrecipient(htmlentities(addslashes(trim($mysidia->input->post("username")))));
                
$pm->setmessage("the message title""put your welcoming message here");
                
$pm->post(); 

Last edited by pachoofoosh; 08-09-2013 at 11:13 AM. Reason: Correctin' spelling errors
Reply With Quote
  #2  
Old 08-07-2013, 02:46 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 490,866
Hall of Famer is on a distinguished road
Default

Looks good. Note there is no need to automatically load a class file, as the autoloader will attempt to find the appropriate class file for you.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #3  
Old 08-09-2013, 11:20 AM
pachoofoosh's Avatar
pachoofoosh pachoofoosh is offline
Artist
 
Join Date: Dec 2012
Location: New York
Posts: 98
Gender: Unknown/Other
Credits: 18,365
pachoofoosh is on a distinguished road
Default

Quote:
Originally Posted by Hall of Famer View Post
Looks good. Note there is no need to automatically load a class file, as the autoloader will attempt to find the appropriate class file for you.
Thanks! I've updated the code now.
Reply With Quote
  #4  
Old 08-10-2013, 11:33 AM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 490,866
Hall of Famer is on a distinguished road
Default

Great, this looks like it will help users a lot.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #5  
Old 04-19-2015, 10:58 PM
AndromedaKerova's Avatar
AndromedaKerova AndromedaKerova is offline
ChibiFur Queen
 
Join Date: Nov 2014
Location: England
Posts: 83
Gender: Female
Credits: 4,257
AndromedaKerova is on a distinguished road
Default

I assume this is incompatible with 1.3.4 because I can't see a $document thing in the register.php
__________________
Failing at being normal since 1990.
Reply With Quote
  #6  
Old 04-20-2015, 01:54 AM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 111,366
Kyttias is on a distinguished road
Default

I'm not in the best position to test this, but for v1.3.4, open up view/registerview.php, and find:

PHP Code:
if($mysidia->input->post("submit")){
    
$document->setTitle($this->lang->success_title);
    
$document->addLangvar($this->lang->success.$mysidia->input->post("username").$this->lang->success2);    
    return;

and replace it with:

PHP Code:
if($mysidia->input->post("submit")){
    
$document->setTitle($this->lang->success_title);
    
$document->addLangvar($this->lang->success.$mysidia->input->post("username").$this->lang->success2);

    
$pm = new PrivateMessage(); // Send them a welcoming message
    
$pm->setsender('YourUsernameHere');
    
$pm->setrecipient(htmlentities(addslashes(trim($mysidia->input->post("username")))));
    
$pm->setmessage("the message title""put your welcoming message here");
    
$pm->post();  
    
    return;

Could someone test this?
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.
Reply With Quote
  #7  
Old 04-20-2015, 02:11 AM
AndromedaKerova's Avatar
AndromedaKerova AndromedaKerova is offline
ChibiFur Queen
 
Join Date: Nov 2014
Location: England
Posts: 83
Gender: Female
Credits: 4,257
AndromedaKerova is on a distinguished road
Default

Tested and verified. Good work! Thank you Kyttias!
__________________
Failing at being normal since 1990.
Reply With Quote
  #8  
Old 04-20-2015, 02:15 AM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 111,366
Kyttias is on a distinguished road
Default

Oh cool! I was wondering how to send PMs to people with the system.
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.
Reply With Quote
  #9  
Old 07-16-2017, 01:18 PM
LUC1G07CH1's Avatar
LUC1G07CH1 LUC1G07CH1 is offline
Member
 
Join Date: Mar 2016
Location: Too distant for telling, but it's HUEBR
Posts: 158
Gender: Unknown/Other
Credits: 31,393
LUC1G07CH1 is on a distinguished road
Send a message via AIM to LUC1G07CH1 Send a message via Yahoo to LUC1G07CH1
Default

This is pretty old, but i have to say that it works 100% fine here.
Kyttias is just like...my heroine. Now i doesn't need to put the welcome code to random pages.
Reply With Quote
Reply

Tags
automatic, message, register, tutorial, welcoming


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ACP Has Odd Error Message squiggler Questions and Supports 3 01-12-2014 06:25 PM
PHP error message Vegetunks937 Questions and Supports 5 08-13-2013 01:58 PM
Pound Message GuardiansWish Questions and Supports 3 10-30-2012 12:05 PM
Send Email jcga Questions and Supports 3 08-18-2010 11:59 PM
levelup.php - Message if user owns pet they are leveled up/can't level up arlecchina Questions and Supports 6 07-28-2009 05:52 PM


All times are GMT -5. The time now is 06:04 PM.

Currently Active Users: 725 (0 members and 725 guests)
Threads: 4,081, Posts: 32,032, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636