Notify Admin on Registration

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
User avatar
RMcGirr83
Former Team Member
Posts: 21956
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: Notify Admin on Registration

Post by RMcGirr83 »

Try changing this

Code: Select all

date($config['default_dateformat'], $user_row['user_regdate']))
to this

Code: Select all

strftime("%a, %d %b, %G %H" , $user_row['user_regdate']))
That edit is done in includes/ucp/ucp_register.php
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beerImage
User avatar
Lisbon
Registered User
Posts: 831
Joined: Wed Jan 30, 2008 12:28 pm
Location: Zermatt

Re: Notify Admin on Registration

Post by Lisbon »

RMcGirr83 wrote:Try changing this

Code: Select all

date($config['default_dateformat'], $user_row['user_regdate']))
to this

Code: Select all

strftime("%a, %d %b, %G %H" , $user_row['user_regdate']))
That edit is done in includes/ucp/ucp_register.php
Not work :oops:
Image

Tks for help
mrshs
Registered User
Posts: 34
Joined: Thu Oct 01, 2009 12:54 pm

Re: Notify Admin on Registration

Post by mrshs »

mrshs wrote:
ISPY06 wrote:i used automod to install and it installed fine,but no email was sent to my admin email. any ideaS?
I have exactly the same problem. I get no e-mail. No nothing. I installed it with automod, and it installed without any error messages. What shall I do?
Is it possible to get some help?
iftitaj
Registered User
Posts: 638
Joined: Tue Jan 15, 2008 6:21 am
Location: Karachi, Pakistan

Re: Notify Admin on Registration

Post by iftitaj »

Is there this file in your forum's location:

Code: Select all

language/en/email/admin_notify_registered.txt
Also have you purged your cache, refresh template?
mrshs
Registered User
Posts: 34
Joined: Thu Oct 01, 2009 12:54 pm

Re: Notify Admin on Registration

Post by mrshs »

iftitaj wrote:Is there this file in your forum's location:

Code: Select all

language/en/email/admin_notify_registered.txt
Also have you purged your cache, refresh template?
Hi, thanks so much for your reply!

I did check for the .txt-file. It's there. I've also purged the cache several times- before and now again, just to make sure.
iftitaj
Registered User
Posts: 638
Joined: Tue Jan 15, 2008 6:21 am
Location: Karachi, Pakistan

Re: Notify Admin on Registration

Post by iftitaj »

Are you using english language on your forum?

Have you check manual edit from install.xml ? Maybe AutoMOD failed to edit properly.

Check this:

Open includes/ucp/ucp_register.php

Find:

Code: Select all

					// BEGIN "Notify admin on registration MOD" - most of the code borrowed from phpBB, thank you
					// Don't send e-mail if activation was sent, would only be duplicite
					if ($config['require_activation'] != USER_ACTIVATION_ADMIN) 
					{
						// Grab an array of user_id's with a_user permissions ... these users can activate a user
						$admin_ary = $auth->acl_get_list(false, 'a_user', false);
						$admin_ary = (!empty($admin_ary[0]['a_user'])) ? $admin_ary[0]['a_user'] : array();

						// Also include founders
						$where_sql = ' WHERE user_type = ' . USER_FOUNDER;

						if (sizeof($admin_ary))
						{
							$where_sql .= ' OR ' . $db->sql_in_set('user_id', $admin_ary);
						}

						$sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type
							FROM ' . USERS_TABLE . ' ' .
							$where_sql;
						$result = $db->sql_query($sql);
						
						while ($row = $db->sql_fetchrow($result))
						{
							$messenger->template('admin_notify_registered', $row['user_lang']);
							$messenger->to($row['user_email'], $row['username']);
							$messenger->im($row['user_jabber'], $row['username']);

							$messenger->assign_vars(array(
								'USERNAME'			=> htmlspecialchars_decode($data['username']),
								'USER_MAIL'			=> $data['email'],
								'USER_REGDATE'		=> date($config['default_dateformat'], $user_row['user_regdate']))
							);

							$messenger->send($row['user_notify_type']);
						}
						$db->sql_freeresult($result);										
					}
					// END "Notify admin on registration MOD"	
Let me know whether the above code is there and it should be exactly that (except starting spaces in lines, if any).
User avatar
Galilei
Registered User
Posts: 14
Joined: Sun Jun 21, 2009 2:24 am
Location: Spain (Marbella)

Re: Notify Admin on Registration

Post by Galilei »

Hi,

I have the same problem. My forum is in spanish language and date out in english. The code above message is correct. I did not use AutoMOD to install. I also happened in version 3.0.5, now using the 3.0.6

Thanks
Ciencias Galilei - ver phpBB: 3.0.11 - Styles: X-Static
lovevoice
Registered User
Posts: 146
Joined: Mon Apr 20, 2009 1:52 am

Re: Notify Admin on Registration

Post by lovevoice »

hello ,
Great Mod , but i have a question .
i put to member as a founders then the notifications goes to those members not the admin ?
how can i make the message only for ADMIN which is name is ADMIN not founder ?
thanx
lovevoice
Registered User
Posts: 146
Joined: Mon Apr 20, 2009 1:52 am

Re: Notify Admin on Registration

Post by lovevoice »

up :cry:
lovevoice
Registered User
Posts: 146
Joined: Mon Apr 20, 2009 1:52 am

Re: Notify Admin on Registration

Post by lovevoice »

up again
User avatar
RMcGirr83
Former Team Member
Posts: 21956
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: Notify Admin on Registration

Post by RMcGirr83 »

If you don't want founders to get emails change this

Code: Select all

                  // Also include founders
                  $where_sql = ' WHERE user_type = ' . USER_FOUNDER;

                  if (sizeof($admin_ary))
                  {
                     $where_sql .= ' OR ' . $db->sql_in_set('user_id', $admin_ary);
                  }
to this

Code: Select all

                  // Also include founders
                  $where_sql = ' ';

                  if (sizeof($admin_ary))
                  {
                     $where_sql = 'WHERE ' . $db->sql_in_set('user_id', $admin_ary);
                  }
then only admins will get the notification.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beerImage
gonzo54
Registered User
Posts: 30
Joined: Sun Aug 02, 2009 9:18 am

Re: Notify Admin on Registration

Post by gonzo54 »

Hi, sounds like a nice little mod will this work on v 3.0.6. Thanks in advance
mrshs
Registered User
Posts: 34
Joined: Thu Oct 01, 2009 12:54 pm

Re: Notify Admin on Registration

Post by mrshs »

iftitaj wrote:Are you using english language on your forum?

Have you check manual edit from install.xml ? Maybe AutoMOD failed to edit properly.

Check this:

Open includes/ucp/ucp_register.php

Find:

Code: Select all

					// BEGIN "Notify admin on registration MOD" - most of the code borrowed from phpBB, thank you
					// Don't send e-mail if activation was sent, would only be duplicite
					if ($config['require_activation'] != USER_ACTIVATION_ADMIN) 
					{
						// Grab an array of user_id's with a_user permissions ... these users can activate a user
						$admin_ary = $auth->acl_get_list(false, 'a_user', false);
						$admin_ary = (!empty($admin_ary[0]['a_user'])) ? $admin_ary[0]['a_user'] : array();

						// Also include founders
						$where_sql = ' WHERE user_type = ' . USER_FOUNDER;

						if (sizeof($admin_ary))
						{
							$where_sql .= ' OR ' . $db->sql_in_set('user_id', $admin_ary);
						}

						$sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type
							FROM ' . USERS_TABLE . ' ' .
							$where_sql;
						$result = $db->sql_query($sql);
						
						while ($row = $db->sql_fetchrow($result))
						{
							$messenger->template('admin_notify_registered', $row['user_lang']);
							$messenger->to($row['user_email'], $row['username']);
							$messenger->im($row['user_jabber'], $row['username']);

							$messenger->assign_vars(array(
								'USERNAME'			=> htmlspecialchars_decode($data['username']),
								'USER_MAIL'			=> $data['email'],
								'USER_REGDATE'		=> date($config['default_dateformat'], $user_row['user_regdate']))
							);

							$messenger->send($row['user_notify_type']);
						}
						$db->sql_freeresult($result);										
					}
					// END "Notify admin on registration MOD"	
Let me know whether the above code is there and it should be exactly that (except starting spaces in lines, if any).
Sorry, for the late reply. I checked the file now, and yes, the whole code is there. :?
ameeck
Former Team Member
Posts: 6559
Joined: Mon Mar 21, 2005 6:57 pm

Re: Notify Admin on Registration

Post by ameeck »

If anyone wants to continue with this MOD, please PM me. I do not have enough time for it and I will gladly pass it to someone else.
iftitaj
Registered User
Posts: 638
Joined: Tue Jan 15, 2008 6:21 am
Location: Karachi, Pakistan

Re: Notify Admin on Registration

Post by iftitaj »

mrshs wrote:Sorry, for the late reply. I checked the file now, and yes, the whole code is there. :?
Sorry can't think of any other mistakes/error at your end. :|
Post Reply

Return to “[3.0.x] Abandoned MODs”