Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 PM to New Users
Shemo Offline
Member
***
Posts: 184
Joined: Jan 2008
Post: #11
RE: PM to New Users
Are you able to make it so it sends it to other user groups other than just admins?  I have a custom user groups  I'd like it to send the info to:
new user, ip, email, etc.


Also, where do we input the code to displaying the ip and email?
01-30-2008 03:54 PM
Find all posts by this user
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #12
RE: PM to New Users
Shemo Wrote:Are you able to make it so it sends it to other user groups other than just admins?  I have a custom user groups  I'd like it to send the info to:
new user, ip, email, etc.
It will never send PMs to a usergroup.
This will send PMs to a specified user (replace <UID> with the user ID)
Find:

PHP Code:
		'toid' => $user_info['uid'],
		'fromid' => intval($mybb->settings['pmregister_fromuid']),


Replace with:

PHP Code:
		'fromid' => $user_info['uid'],
		'toid' => <UID>,




Shemo Wrote:Also, where do we input the code to displaying the ip and email?
AdminCP -> Board Settings -> Change.
Figure the rest out from there...

My Blog
01-30-2008 06:24 PM
Find all posts by this user
Shemo Offline
Member
***
Posts: 184
Joined: Jan 2008
Post: #13
RE: PM to New Users
Zinga, it's working, but question for you...

When you had me make the last edit so I specify which user the PM gets sent to when a new user registers, is it supposed to PM the new registered user too or what?  I made a testtest account to try this plugin and it sent me, Shemo, the email and not the new registered user.  Now, can I use your plugin to send an admin a PM when a new user registers with the users IP and Email, but use the plugin from DennisTT to PM the actual new user; or..can I do both with just yours???

Might be confusing you, but let me know...

Thanks,
Shemo
01-31-2008 03:07 PM
Find all posts by this user
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #14
RE: PM to New Users
If you want to send a PM to both you and the end user, find:

PHP Code:
	$pmh->admin_override = true;
	$pmh->set_data($pm);
	// it _should_ validate... - if not (ie PMs disabled), we'll ignore it
	if($pmh->validate_pm())
		$pmh->insert_pm();

Add below:

PHP Code:
	$pm['toid'] = intval($mybb->settings['pmregister_fromuid']);
	$pm['fromid'] = $user_info['uid'];
	$pmh->set_data($pm);
	if($pmh->validate_pm())
		$pmh->insert_pm();


My Blog
01-31-2008 10:33 PM
Find all posts by this user
Shemo Offline
Member
***
Posts: 184
Joined: Jan 2008
Post: #15
RE: PM to New Users
Is there a way to make it so the new user receives the message format that you can edit in the adminCP settings and the admin receives 1 with a certain format like:

New user:XXX
Email address:XXX
IP:XXX
Age: XXX

etc...

Thanks a bunch,
-Shemo
02-01-2008 02:27 AM
Find all posts by this user
Shemo Offline
Member
***
Posts: 184
Joined: Jan 2008
Post: #16
RE: PM to New Users
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/at19029/public_html/forums/inc/plugins/pmregister.php on line 97

Is the error I'm receiving after doing your last edit, but it was working at first..hmn.  I didn't change anything except for what you listed.

When it was working, neither the new user nor me, the admin received a new PM. =(
02-01-2008 02:30 AM
Find all posts by this user
Shemo Offline
Member
***
Posts: 184
Joined: Jan 2008
Post: #17
RE: PM to New Users
Meh, don't worry about the 2 separate PMs with different information..I just kept your default message to new users and added this to the bottom of it.  You're a great person for helping us as it is..don't wanna make extra work. =P
-----------------------------------
Admin Section:
{username}
{regip}
{email}


Is there a way to get it to show their age and location too?

Also, I'm still getting that parse error.  =(
02-02-2008 01:55 AM
Find all posts by this user
Shemo Offline
Member
***
Posts: 184
Joined: Jan 2008
Post: #18
RE: PM to New Users
Zinga, I got it working to my liking..I'm using your mod to send PMs to me about new users and DennisTT's mod to PM the new users.

Now, when I specify the UID to have the PM sent to, it's not sending it to another 1 of the admins UID, which is 22.  He's in-charge of all the players on the forums and of my guild, so he needs to be up-to-date with this information.  I also tried his GID, but that didn't work either.  This is how I have it listed in your plugin:

Code:
1
2
3
4
5
6
7
$pm = array(
		'username' => $user_info['username'],
		'fromid' => $user_info['uid'],
		'toid' => 4,22,
		'subject' => $mybb->settings['pmregister_subject'],
		'message' => $message,
		'options' => array(


4 is me, and 14/22 is him, 14 being his GID and 22 being his UID.

02-02-2008 05:22 PM
Find all posts by this user
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #19
RE: PM to New Users
Sorry for the late reply - I haven't exactly been in the mood to look at this lately.

You can't specify a list in that code, because it only accepts a single integer.

You'll have to get it to send two PMs.
Make a second copy of the following code:

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
	$pm = array(
		'username' => $user_info['username'],
		'toid' => $user_info['uid'],
		'fromid' => intval($mybb->settings['pmregister_fromuid']),
		'subject' => $mybb->settings['pmregister_subject'],
		'message' => $message,
		'options' => array(
			'signature' => 'no',
			'disablesmilies' => 'no',
			'savecopy' => 'no',
			'readreceipt' => 'no'
		)
	);
		
	$pmh->admin_override = true;
	$pmh->set_data($pm);
	// it _should_ validate... - if not (ie PMs disabled), we'll ignore it
	if($pmh->validate_pm())
		$pmh->insert_pm();

Directly under the code for sending the first PM (note, this is important, you need to put it before unset($pmh);).


My Blog
02-02-2008 07:29 PM
Find all posts by this user
Shemo Offline
Member
***
Posts: 184
Joined: Jan 2008
Post: #20
RE: PM to New Users
PERFECT!  This is why we come to you Zinga, your stuff works.  We don't come to you for help because we don't like your work or it doesn't work.  We want you in the community and we need you to be there!!!

Thanks again and keep up the great work.
-Shemo
02-03-2008 04:36 AM
Find all posts by this user

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: