|
Page 1 of 1
|
Dragon
Joined: May 2008
Posts: 7
|
 Welcome Personal Message (PM) - Define New Sender
Hello,
I have a litte problem with the welcome personal message (not email).
How can I edit the sender of it. By default it is the main site admin.
I tried to solve the problem by defining a new group leader of the admin group, but this didn't help for solving the problem.
It would last, if someone can tell me datebasetable and the entry of the user id to change. If there is a smarter way - its better
thx for help.
|
#1 Fri 15 Aug, 2008 19:33 |
|
Sponsors

|
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.
|
|
Inactive User
|
 Re: Welcome Personal Message (PM) - Define New Sender
I think you'll find that, that is language dependant.
Open: lang_main_settings.php
Look for: $lang['register_pm']
|
#2 Sat 16 Aug, 2008 09:42 |
|
Dragon
Joined: May 2008
Posts: 7
|
 Re: Welcome Personal Message (PM) - Define New Sender
and how can i change the userid of the sender?
|
#3 Tue 19 Aug, 2008 21:58 |
|
Inactive User
|
 Re: Welcome Personal Message (PM) - Define New Sender
You can play with this in /includes/usercp_register.php
// START - SEND PM ON REGISTER MOD - AbelaJohnB
//
// According to 'netclectic' we need to set the datastamp to '9999999999' in order to
// insure the pop-up notification about a new message existing. I concur with 'netclectic'
// and have thus made the change to his suggestion. Thanks netclectic!
//
$sql = "UPDATE " . USERS_TABLE . "
SET user_new_privmsg = '1', user_last_privmsg = '9999999999'
WHERE user_id = $user_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);
}
$register_pm_subject = $lang['register_pm_subject'];
$register_pm = $lang['register_pm'];
$privmsgs_date = date('U');
$main_admin_id = (intval($board_config['main_admin_id']) >= 2) ? $board_config['main_admin_id'] : '2';
if ($main_admin_id != '2')
{
$sql = "SELECT user_id
FROM " . USERS_TABLE . "
WHERE user_id = '" . $main_admin_id . "'
LIMIT 1";
if (!($result = $db->sql_query($sql, false, 'main_admin_id_')))
{
message_die(GENERAL_ERROR, 'Couldn't obtain user id', '', __LINE__, __FILE__, $sql);
}
if ($row = $db->sql_fetchrow($result))
{
$main_admin_id = $row['user_id'];
$db->sql_freeresult($result);
}
else
{
$main_admin_id = '2';
}
}
$sql = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig) VALUES ('0', '" . str_replace("'", "''", addslashes(sprintf($register_pm_subject, $board_config['sitename']))) . "', '" . $main_admin_id . "', " . $user_id . ", " . $privmsgs_date . ", '0', '1', '1', '0')";
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not insert private message sent info', '', __LINE__, __FILE__, $sql);
}
$privmsg_sent_id = $db->sql_nextid();
$sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_text) VALUES ($privmsg_sent_id, '" . str_replace("'", "''", addslashes(sprintf($register_pm, $board_config['sitename'], $board_config['sitename']))) . "')";
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not insert private message sent text', '', __LINE__, __FILE__, $sql);
}
// END - SEND PM ON REGISTER MOD - AbelaJohnB
|
#4 Wed 20 Aug, 2008 02:28 |
|
Dragon
Joined: May 2008
Posts: 7
|
 Re: Welcome Personal Message (PM) - Define New Sender
With this information i should be able to modify my board.
thank u all very mutch!
|
#5 Wed 20 Aug, 2008 04:45 |
|
Inactive User
|
 Re: Welcome Personal Message (PM) - Define New Sender
It would be nice of you to post your modifications for the "Admin Welcome PM changes", here in this thread when you have it all working.
|
#6 Wed 20 Aug, 2008 05:05 |
|
Dragon
Joined: May 2008
Posts: 7
|
 Re: Welcome Personal Message (PM) - Define New Sender
It was not mutch work, I only had to modify the text in lang_main_settings.php how you allready said.
Then, to change the sender, there are two ways:
1. to change the main_admin_id in the ip_config table
2. or to directly insert it into that sql statement:
OPEN /includes/usercp_register.php line 1199
FIND
$sql = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig) VALUES ('0', '" . str_replace("'", "''", addslashes(sprintf($register_pm_subject, $board_config['sitename']))) . "', '" . $main_admin_id . "', " . $user_id . ", " . $privmsgs_date . ", '0', '1', '1', '0')";
REPLACE WITH
$sql = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig) VALUES ('0', '" . str_replace("'", "''", addslashes(sprintf($register_pm_subject, $board_config['sitename']))) . "', '" . 8 . "', " . $user_id . ", " . $privmsgs_date . ", '0', '1', '1', '0')";
In this case the user with the id 8 is the sender.
That's it.
|
#7 Wed 20 Aug, 2008 16:06 |
|
Inactive User
|
 Re: Welcome Personal Message (PM) - Define New Sender
Thanks Dragon for "Your" effort, and for explaining it in the way that you have.
Now anyone should be able to understand what you did, should they wish to apply those changes themselves.
Moved to Documentation.
|
#8 Wed 20 Aug, 2008 16:40 |
|
Mighty Gorgon 
Luca Libralato
Joined: August 2006
Posts: 7192
Location:  Borgo San Michele
|
 Re: Welcome Personal Message (PM) - Define New Sender
This SQL alter the main admin id:
UPDATE phpbb_config SET config_value = '2' WHERE config_name = 'main_admin_id';
There is no way to change it via ACP because it's dangerous to allow other admins to change that value.
____________ Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
|
#9 Thu 21 Aug, 2008 12:33 |
|
|
Page 1 of 1
|
Was this topic useful?
Was this topic useful?
Link this topic |
URL |
|
BBCode |
|
HTML |
|
You cannot post new topics You cannot reply to topics You cannot edit your posts You cannot delete your posts You cannot vote in polls You cannot attach files You can download files You cannot post calendar events
|
|
|
|