Custom mass PM
Forumsregeln
Auch wenn hier der Support für phpBB 2 weiterhin aufrecht erhalten bleibt, weisen wir darauf hin, dass das phpBB 2 nicht mehr offiziell unterstützt und weiterentwickelt wird!
Auch wenn hier der Support für phpBB 2 weiterhin aufrecht erhalten bleibt, weisen wir darauf hin, dass das phpBB 2 nicht mehr offiziell unterstützt und weiterentwickelt wird!
Custom mass PM
Is there an update of this mod or some new mod, because a lot of code from this MOD doesn't match my files?
Problem are 4 lines in 2 files
files are attached.
[ Attachment gelöscht am Mi 22.Nov, 2006 14:30 von oxpus ]
files are attached.
Code: Alles auswählen
privmsg.php
#-----[ FIND ]------------------------------------------------
#
$to_username = $HTTP_POST_VARS['username'];
#
#-----[ REPLACE WITH ]----------------------------------------
#
// Start replacement - Custom mass PM MOD
$to_username_array = explode (";", $HTTP_POST_VARS['username']);
sort ($to_username_array);
foreach ($to_username_array as $name) $to_usernames .= "'".htmlspecialchars(trim($name))."',";
$to_usernames[strlen($to_usernames)-1]=" ";
// End replacement - Custom mass PM MOD
#-----[ FIND ]------------------------------------------------
#
if ( !($result = $db->sql_query($sql)) )
{
$error = TRUE;
$error_msg = $lang['No_such_user'];
}
$to_userdata = $db->sql_fetchrow($result);
}
else
{
#
#-----[ REPLACE WITH ]----------------------------------------
#
// Start replacement - Custom mass PM MOD
if( !($result2 = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain users PM information', '', __LINE__, __FILE__, $sql);
}
$to_users = $db->sql_fetchrowset($result2);
$n=0;
while ($to_username_array[$n] && !$error)
{
if (strcasecmp($to_users[$n]['username'], str_replace("\'", "'",$to_username_array[$n])))
{
$error = TRUE;
$error_msg .= $lang['No_such_user']." '".str_replace("\'", "'", $to_username_array[$n]);
}
$n++;
}
}
else
{
// End replacement - Custom mass PM MOD
#-----[ IN-LINE FIND ]----------------------------------------
#
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
#
#-----[ IN-LINE REPLACE WITH ]--------------------------------
#
// 1 line deleted for Custom mass PM MOD
includes/usercp_register.php
#-----[ FIND ]------------------------------------------------
#
$signature = str_replace(
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Start add - Custom mass PM MOD
$allow_mass_pm = ( isset($HTTP_POST_VARS['allow_mass_pm']) ) ? intval ($HTTP_POST_VARS['allow_mass_pm']) : 2;
// End add - Custom mass PM MOD
- oxpus
- Administrator
- Beiträge: 28735
- Registriert: Mo 27.Jan, 2003 22:13
- Wohnort: Bad Wildungen
- Kontaktdaten:
And here they are back:
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
- oxpus
- Administrator
- Beiträge: 28735
- Registriert: Mo 27.Jan, 2003 22:13
- Wohnort: Bad Wildungen
- Kontaktdaten:
No.
You are able to enter a username more than once, but the script will use it only once to send the pm to...
You are able to enter a username more than once, but the script will use it only once to send the pm to...
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
[quote="oxpus";p="66747"]The one you've installed
[/quote]
sorry I am confused here.
I notice that here is something wrong, because when I try to send an PM, to 2 users like Blisk and admin, I get message "user doesn't exist".
Now I was trying to send PM to 1 user I get the same message.
sorry I am confused here.
I notice that here is something wrong, because when I try to send an PM, to 2 users like Blisk and admin, I get message "user doesn't exist".
Now I was trying to send PM to 1 user I get the same message.
Zuletzt geändert von Blisk am Mi 22.Nov, 2006 20:07, insgesamt 1-mal geändert.
- oxpus
- Administrator
- Beiträge: 28735
- Registriert: Mo 27.Jan, 2003 22:13
- Wohnort: Bad Wildungen
- Kontaktdaten:
I've compared your file with my file and fixe again some code.
Retry it...
Retry it...
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
I do a reply or type in username like blisk
and it always said user doesn't exist
On some french forum I found this mod repaired, with this modding sending PM works OK.
all other files are the same moding.
the differencie is in some places, but inportant is only in
and it always said user doesn't exist
On some french forum I found this mod repaired, with this modding sending PM works OK.
all other files are the same moding.
the differencie is in some places, but inportant is only in
Code: Alles auswählen
usort ($to_username_array);Code: Alles auswählen
privmsg.php
#
#-----%u5b FIND %u5d------------------------------------------------
# ONLY !!! For users who have phpBB 2.0.14 or a previous version.
#
$to_username = $HTTP_POST_VARS%u5b'username'%u5d;
#
#-----%u5b REPLACE WITH %u5d----------------------------------------
# ONLY !!! For users who have phpBB 2.0.14 or a previous version.
#
// Start replacement - Custom mass PM MOD
$to_username_array = explode (";", $HTTP_POST_VARS%u5b'username'%u5d);
usort ($to_username_array);
foreach ($to_username_array as $name) $to_usernames .= "'".htmlspecialchars(trim($name))."',";
$to_usernames%u5bstrlen($to_usernames)-1%u5d=" ";
// End replacement - Custom mass PM MOD
#
#-----%u5b FIND %u5d------------------------------------------------
# ONLY !!! For users who have phpBB 2.0.15 or a next version.
#
$to_username = phpbb_clean_username($HTTP_POST_VARS%u5b'username'%u5d);
#
#-----%u5b REPLACE WITH %u5d----------------------------------------
# ONLY !!! For users who have phpBB 2.0.15 or a next version.
#
// Start replacement - Custom mass PM MOD
$to_username_array = explode (";", phpbb_clean_username($HTTP_POST_VARS%u5b'username'%u5d));
usort ($to_username_array);
foreach ($to_username_array as $name) $to_usernames .= "'".htmlspecialchars(trim($name))."',";
$to_usernames%u5bstrlen($to_usernames)-1%u5d=" ";
// End replacement - Custom mass PM MOD
#
#-----%u5b FIND %u5d------------------------------------------------
#
$sql = "SELECT user_id
FROM
WHERE username =
AND
#
#-----%u5b IN-LINE FIND %u5d----------------------------------------
#
SELECT user_id
#
#-----%u5b IN-LINE AFTER, ADD %u5d----------------------------------
#
, username
#
#-----%u5b IN-LINE FIND %u5d----------------------------------------
#
WHERE username = '" . str_replace("\'", "''", $to_username) . "'
#
#-----%u5b IN-LINE REPLACE WITH %u5d--------------------------------
#
WHERE username IN ($to_usernames)
#
#-----%u5b IN-LINE FIND %u5d----------------------------------------
#
ANONYMOUS
#
#-----%u5b IN-LINE AFTER, ADD %u5d----------------------------------
#
. " ORDER BY username ASC"
#
#-----%u5b FIND %u5d------------------------------------------------
# Update for phpBB 2.0.18
if ( !($result = $db->sql_query($sql)) )
%u7b
$error = TRUE;
$error_msg = $lang%u5b'No_such_user'%u5d;
%u7d
if (!($to_userdata = $db->sql_fetchrow($result)))
%u7b
$error = TRUE;
$error_msg = $lang%u5b'No_such_user'%u5d;
%u7d
%u7d
else
%u7b
#
#-----%u5b REPLACE WITH %u5d----------------------------------------
#
// Start replacement - Custom mass PM MOD
if( !($result2 = $db->sql_query($sql)) )
%u7b
message_die(GENERAL_ERROR, 'Could not obtain users PM information', '', __LINE__, __FILE__, $sql);
%u7d
$to_users = $db->sql_fetchrowset($result2);
$n=0;
while ($to_username_array%u5b$n%u5d && !$error)
%u7b
if (strcasecmp($to_users%u5b$n%u5d%u5b'username'%u5d, str_replace("\'", "'",$to_username_array%u5b$n%u5d)))
%u7b
$error = TRUE;
$error_msg .= $lang%u5b'No_such_user'%u5d." '".str_replace("\'", "'", $to_username_array%u5b$n%u5d);
%u7d
$n++;
%u7d
%u7d
else
%u7b
// End replacement - Custom mass PM MOD
#
#-----%u5b FIND %u5d------------------------------------------------
#
if ( !$userdata%u5b'user_allow_pm'%u5d )
%u7b
$message =
message_die(
%u7d
#
#-----%u5b AFTER, ADD %u5d------------------------------------------
#
// Start add - Custom mass PM MOD
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
foreach($to_users as $to_userdata)
%u7b
// End add - Custom mass PM MOD
#
#-----%u5b FIND %u5d------------------------------------------------
#
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$emailer =
#
#-----%u5b IN-LINE FIND %u5d----------------------------------------
#
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
#
#-----%u5b IN-LINE REPLACE WITH %u5d--------------------------------
#
// 1 line deleted for Custom mass PM MOD
#
#-----%u5b FIND %u5d------------------------------------------------
#
$emailer->send();
#
#-----%u5b REPLACE WITH %u5d----------------------------------------
#
// Start replacement - Custom mass PM MOD
if (!($emailer_result=$emailer->send(1)))
%u7b
message_die(GENERAL_ERROR, 'Failed sending email %u3a%u3a ' . $emailer_result, '', __LINE__, __FILE__);
%u7d
// End replacement - Custom mass PM MOD
#
#-----%u5b FIND %u5d------------------------------------------------
#
$emailer->reset(
%u7d
%u7d
#
#-----%u5b AFTER, ADD %u5d------------------------------------------
#
// Start add - Custom mass PM MOD
%u7d
// End add - Custom mass PM MOD
#
#-----%u5b FIND %u5d------------------------------------------------
#
$post_pm_img = '<a href=
#
#-----%u5b AFTER, ADD %u5d------------------------------------------
#
// Start add - Custom mass PM MOD
include($phpbb_root_path . 'language/lang_' . $board_config%u5b'default_lang'%u5d . '/lang_mass_pm.' . $phpEx);
if ( $userdata%u5b'user_level'%u5d == ADMIN )
%u7b
$mass_pm_img = '<a href="' . append_sid("groupmsg.$phpEx") . '"><img src="' . $images%u5b'mass_pm'%u5d . '" border="0" alt="' . $lang%u5b'Mass_pm'%u5d . '" /></a>';
%u7d else
%u7b
$sql_g = "SELECT DISTINCT g.group_id
FROM ".GROUPS_TABLE . " g, ".USER_GROUP_TABLE . " ug
WHERE g.group_single_user <> 1
AND (
(g.group_allow_pm='".AUTH_MOD."' AND g.group_moderator = '" . $userdata%u5b'user_id'%u5d."') OR
(g.group_allow_pm='".AUTH_ACL."' AND ug.user_id = " . $userdata%u5b'user_id'%u5d . " AND ug.group_id = g.group_id ) OR
(g.group_allow_pm='".AUTH_REG."')
)" ;
if( !$g_result = $db->sql_query($sql_g) )
%u7b
message_die(GENERAL_ERROR, "Could not select group names!", __LINE__, __FILE__, $sql_g);
%u7d
if( $db->sql_numrows($g_result))
%u7b
$mass_pm_img = '<a href="' . append_sid("groupmsg.$phpEx") . '"><img src="' . $images%u5b'mass_pm'%u5d . '" border="0" alt="' . $lang%u5b'Mass_pm'%u5d . '" /></a>';
%u7d
%u7d
// End add - Custom mass PM MOD
#
#-----%u5b FIND %u5d------------------------------------------------
#
'POST_PM_IMG' =>
#
#-----%u5b AFTER, ADD %u5d------------------------------------------
#
// Start add - Custom mass PM MOD
'MASS_PM_IMG' => $mass_pm_img,
// End add - Custom mass PM MOD
Zuletzt geändert von Blisk am Do 23.Nov, 2006 12:52, insgesamt 1-mal geändert.
[quote="oxpus";p="66775"]So this changes will now work for you?[/quote]
yes this works ok, I can send PM, to single user or to multiple users.
Problem is only that ajax doesn't recognize multiple users, and that sending to multiple users where some user have special charter like #$&/?' doesn't work.
I notice that mod form franch forum is version 1.47 I have installed 1.46
yes this works ok, I can send PM, to single user or to multiple users.
Problem is only that ajax doesn't recognize multiple users, and that sending to multiple users where some user have special charter like #$&/?' doesn't work.
I notice that mod form franch forum is version 1.47 I have installed 1.46