FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


problem with registration notify mod





Lord Klorel
Hello everyone,

I have recently installed a mod that will send an notify to the admin or the moderator when a new member is registered.

The only problem is that when i choose a notify and when i go check again this function is turned off.

I have done everything from the instruction, only the db_update.php isn't done because i understand that it's enough to insert all this items.

I someone can tell me what i have done wrong, tell me. I dislike the configuration settings of php, because i doesn't want to destroy my entire database because of one stupid fault.
leos4h
Whats the name of the script your using?
Lord Klorel
admin_registration_notify

Here is the install text:
Quote:
##############################################################
## MOD Title: Admin Registration Notify [2.0.15]
## MOD Author: mosymuis < mods@mosymuis.nl > (Rens van Dongen) http://mods.mosymuis.nl
##
## MOD Description: This mod will send a notification email to
## all admins when a new user has joined the forum.
## This can be turned off in the admincp.
##
## MOD Version: 1.0.0
##
## Installation Level: (Easy)
## Installation Time: 5 Minutes
## Files To Edit: (Cool
## - admin/admin_board.php
## - includes/constants.php
## - includes/usercp_register.php
## - templates/subSilver/admin/board_config_body.tpl
## - language/lang_english/lang_main.php
## - language/lang_english/lang_admin.php
## - language/lang_dutch/lang_main.php
## - language/lang_dutch/lang_admin.php
## Included Files: (3)
## - db_update.php
## - phpbb_root_path/language/lang_english/email/admin_new_user.tpl
## - phpbb_root_path/language/lang_dutch/email/admin_new_user.tpl
##############################################################
## Author Notes: Made for a request from Marcy at phpbbhacks.com.
##############################################################
## MOD History:
##
## 2004/03/14 - Version 1.0.0
## - Initial BETA Release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ COPY ]------------------------------------------
#
copy phpbb_root_path/language/lang_english/email/admin_new_user.tpl
copy phpbb_root_path/language/lang_dutch/email/admin_new_user.tpl

#
#-----[ SQL ]------------------------------------------
# or run the included db_update.php
# change phpbb_ to the database prefix you use
#
INSERT INTO phpbb_config VALUES ('registration_notify', 1);

#
#-----[ OPEN ]------------------------------------------
#
admin/admin_board.php

#
#-----[ FIND ]------------------------------------------
#
$activation_admin = ( $new['require_activation'] == USER_ACTIVATION_ADMIN ) ? "checked=\"checked\"" : "";

#
#-----[ AFTER, ADD ]------------------------------------------
#
$registration_notify_none = ( $new['registration_notify'] == USER_REGISTRATION_NOTIFY_NONE ) ? "checked=\"checked\"" : "";
$registration_notify_mod = ( $new['registration_notify'] == USER_REGISTRATION_NOTIFY_MOD ) ? "checked=\"checked\"" : "";
$registration_notify_admin = ( $new['registration_notify'] == USER_REGISTRATION_NOTIFY_ADMIN ) ? "checked=\"checked\"" : "";

#
#-----[ FIND ]------------------------------------------
#
"L_ACCT_ACTIVATION" => $lang['Acct_activation'],

#
#-----[ AFTER, ADD ]------------------------------------------
#
"L_REGISTRATION_NOTIFY" => $lang['Registration_notify'],
"L_MOD" => $lang['Moderator'],

#
#-----[ FIND ]------------------------------------------
#
"ACTIVATION_ADMIN_CHECKED" => $activation_admin,

#
#-----[ AFTER, ADD ]------------------------------------------
#
"REGISTRATION_NOTIFY_NONE" => USER_REGISTRATION_NOTIFY_NONE,
"REGISTRATION_NOTIFY_NONE_CHECKED" => $registration_notify_none,
"REGISTRATION_NOTIFY_MOD" => USER_REGISTRATION_NOTIFY_MOD,
"REGISTRATION_NOTIFY_MOD_CHECKED" => $registration_notify_mod,
"REGISTRATION_NOTIFY_ADMIN" => USER_REGISTRATION_NOTIFY_ADMIN,
"REGISTRATION_NOTIFY_ADMIN_CHECKED" => $registration_notify_admin,

#
#-----[ OPEN ]------------------------------------------
#
includes/constants.php

#
#-----[ FIND ]------------------------------------------
#
define('USER_ACTIVATION_ADMIN', 2);

#
#-----[ AFTER, ADD ]------------------------------------------
#
define('USER_REGISTRATION_NOTIFY_NONE', 0);
define('USER_REGISTRATION_NOTIFY_MOD', 2);
define('USER_REGISTRATION_NOTIFY_ADMIN', 1);

#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php

#
#-----[ FIND ]------------------------------------------
#
$email_template = 'user_welcome';
}

include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$emailer = new emailer($board_config['smtp_delivery']);

#
#-----[ AFTER, ADD ]------------------------------------------
#
if ( $board_config['registration_notify'] )
{
$sql = "SELECT user_email, user_lang
FROM " . USERS_TABLE . "
WHERE user_level" . (($board_config['registration_notify'] == USER_REGISTRATION_NOTIFY_ADMIN) ? " = " : " >= ") . ADMIN;

if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not select Administrators', '', __LINE__, __FILE__, $sql);
}

while ($row = $db->sql_fetchrow($result))
{
$emailer->from($board_config['board_email']);
$emailer->replyto($board_config['board_email']);

$emailer->email_address(trim($row['user_email']));
$emailer->use_template("admin_new_user", $row['user_lang']);
$emailer->set_subject($lang['New_user_registration']);

$emailer->assign_vars(array(
'SITENAME' => $board_config['sitename'],
'USERNAME' => preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, substr(str_replace("\'", "'", $username), 0, 25)),
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']),

'U_PROFILE' => $server_url . '?mode=viewprofile&' . POST_USERS_URL . '=' . $user_id)
);
$emailer->send();
$emailer->reset();
}
$db->sql_freeresult($result);
}

#
#-----[ OPEN ]------------------------------------------
# Make sure to edit this file for every theme you use!
#
templates/subSilver/admin/board_config_body.tpl

#
#-----[ FIND ]------------------------------------------
#
<td class="row2"><input type="radio" name="require_activation" value="{ACTIVATION_NONE}" {ACTIVATION_NONE_CHECKED} />{L_NONE}&nbsp; &nbsp;<input type="radio" name="require_activation" value="{ACTIVATION_USER}" {ACTIVATION_USER_CHECKED} />{L_USER}&nbsp; &nbsp;<input type="radio" name="require_activation" value="{ACTIVATION_ADMIN}" {ACTIVATION_ADMIN_CHECKED} />{L_ADMIN}</td>
</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#
<tr>
<td class="row1">{L_REGISTRATION_NOTIFY}</td>
<td class="row2"><input type="radio" name="registration_notify" value="{REGISTRATION_NOTIFY_NONE}" {REGISTRATION_NOTIFY_NONE_CHECKED} />{L_NONE}&nbsp; &nbsp;<input type="radio" name="registration_notify" value="{REGISTRATION_NOTIFY_MOD}" {REGISTRATION_NOTIFY_MOD_CHECKED} />{L_MOD}&nbsp; &nbsp;<input type="radio" name="registration_notify" value="{REGISTRATION_NOTIFY_ADMIN}" {REGISTRATION_NOTIFY_ADMIN_CHECKED} />{L_ADMIN}</td>
</tr>

#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------
#
//
// That's all, Folks!
// -------------------------------------------------

#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Admin Registration Notify mod
$lang['New_user_registration'] = 'New user registration';

#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php

#
#-----[ FIND ]------------------------------------------
#
//
// That's all Folks!
// -------------------------------------------------

#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Admin Registration Notify mod
$lang['Registration_notify'] = 'Send notify email on new user registrations';

#
#-----[ OPEN ]------------------------------------------
# Only if you have the Dutch language pack installed
#
language/lang_dutch/lang_main.php

#
#-----[ FIND ]------------------------------------------
#
//
// That's all Folks!
// -------------------------------------------------

#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Admin Registration Notify mod
$lang['New_user_registration'] = 'Nieuwe leden registratie';

#
#-----[ OPEN ]------------------------------------------
# Only if you have the Dutch language pack installed
#
language/lang_dutch/lang_admin.php

#
#-----[ FIND ]------------------------------------------
#
//
// That's all Folks!
// -------------------------------------------------

#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Admin Registration Notify mod
$lang['Registration_notify'] = 'Stuur een mailtje bij nieuwe leden registraties';

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM


I hope that this is what you need.
leos4h
leos4h wrote:
Whats the name of the script your using?
Lord Klorel
i don't know.

what do you mean with script?

i used this installation data and the files that were included.

I am noob in php and all this other matter.
wumingsden
Lord Klorel wrote:
i don't know.

what do you mean with script?

i used this installation data and the files that were included.

I am noob in php and all this other matter.




Lord Klorel, you need to run the following code in phpMyAdmin for the forum database:

Code:

INSERT INTO phpbb_config VALUES ('registration_notify', 1);


or you can uplaod the db_update.php file in the forum root. You then have to visit it in your broswer. After doing this it will tell you to delete the script which is what you should do. If you still don't understand send the your username/password for phpMyAdmin and I'll do it for you.
Lord Klorel
I go try to do it from out my browser.

When i have problems i shall post a reply.
Related topics
What to do when you get a virus
Nuke cash
Problem with Image upload mod from phpBBstyles
403 Error On My Smf Forums Index.php
SMTP, DB, & Hosting Domain Qs
If God has taken all you love...do you have the right to act
Cash mod phpbb problem
NEW! - Incredibly Low Priced phpBB2 and 3 Services!
topics that are closed for no GOOD reason
Spammers on FriHost
Extremely Low Costing phpBB2 and 3 Services [UPDATED]
Oblivion Questions
Books forums
first two digit(unit and ten) of (1234)^4321 ?
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.