MOD download & history

Makes it posble for admin to specify witch type of users may mass PM any usergroup
Also PM users can be a list of usernames, so PM can be sendt to any number of users

Moderator: Moderators

Forum rules
The content in this forum is dated Dec. 21 2005 and can be used as Archive only. This Forum is LOCKED and READ ONLY !

Postby Niels on Tue 05. Nov, 2002 22:05

I was missing something in the part 2 of this mod, I have updated the how-to, new version is 0.9.1

here are how to upgrade
in file privmsg.php

Code: Select all
[FIND]
$to_username = "'".$to_username."'";         
$sql = "SELECT user_id, user_notify_pm, user_email, user_lang, user_active
FROM " . USERS_TABLE . "
WHERE username IN (" . str_replace("\'", "''", $to_username) . ")
AND user_id <> " . ANONYMOUS;
if ( !($result = $db->sql_query($sql)) )

[IN-LINE FIND]
$result

[IN-LINE REPLACE WITH]
$result2
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby Niels on Wed 06. Nov, 2002 21:49

I have updated the part 2, to ver 0.9.2

here are how to upgrade
Code: Select all
[FIND]
$to_username = str_replace(",", "','", $HTTP_POST_VARS['username']);
$to_username = "'".$to_username."'";
$to_username = $HTTP_POST_VARS['username'];

[REPLACE WITH]
$to_username = "'".str_replace(",", "','", $HTTP_POST_VARS['username'])."'";
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby Niels on Tue 12. Nov, 2002 13:09

I have now update the part 2, now also posible to search for multiple username when posting a PM

new version of part 2 is

her are how to upgrade
to correct this:
in file subsilver/search_username.tpl
Code: Select all
[FIND]
opener.document.forms['post'].username.value = selected_username;

[REPLACE WITH]
   if (opener.document.forms['post'].username.value)
   {
      opener.document.forms['post'].username.value = opener.document.forms['post'].username.value + ', ' + selected_username;
   }
   else
   {
      opener.document.forms['post'].username.value = selected_username;
   }


in file subsilver/posting_body.tpl
Code: Select all
[FIND]
<td class="row2"><span class="genmed"><input type="text"  class="post" name="username" maxlength="25"

[IN-LINE FIND AND DELETE]
maxlength="25"
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

update

Postby Niels on Tue 12. Nov, 2002 14:27

I have now updated part 1, so admin can specify witch types of users may send mass PM

new version is 1.3.0

admin can now in group managment select between

ALL,REG,PRIVATE,MOD or ADMIN

this can be selected per usergroup, PRIVATE have the meaning that members of a useregroup can PM eatch other

MOD is only the moderator of the usergroup, not a forum moderator

to upgrade please do the
admin/admin_groups.php /admin/groups_body.tpl
as described in the how-to and update the included lang_mass_pm.php and groupmsg.php
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby Niels on Tue 12. Nov, 2002 18:57

I have update the part 2, to verify if the names was alrigth typed
new version is 0.9.4

in file privmsg.php
Code: Select all
[FIND]
$to_username = "'".str_replace(",", "','", $HTTP_POST_VARS['username'])."'";

[REPLACE WITH]
$to_username_array = explode (",", $HTTP_POST_VARS['username']);
sort ($to_username_array);
$n=0;
while ( !empty($to_username_array[$n]) )
{
   $to_username_array[$n] = trim ($to_username_array[$n]);
   $to_usernames .=  (($to_usernames) ? "," : "" ) . "'" . $to_username_array[$n++]."'";
}

[FIND]
$sql = "SELECT user_id
FROM " . USERS_TABLE . "
WHERE username = '" . str_replace("\'", "''", $to_username) . "'
AND user_id <> " . ANONYMOUS;
if ( !($result = $db->sql_query($sql)) )

[IN-LINE FIND]
SELECT

[IN-LINE AFTER,ADD]
username,

[IN-LINE FIND]
$to_username

[IN-LINE REPLACE WITH]
$to_usernames

[IN-LINE FIND]
ANONYMOUS

[IN-LINE AFTER, ADD]
." ORDER BY username ASC"


[FIND]
if ( !($result2 = $db->sql_query($sql)) )
{
   $error = TRUE;
   $error_msg = $lang['No_such_user'];
}

[REPLACE WITH]
if( !($result2 = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, 'Could not obtain users PM information', '', __LINE__, __FILE__, $sql);
}
// verify all names are found
$to_users = $db->sql_fetchrowset($result2);
$db->sql_rowseek(0,$result2);
$n=0;
while ( $to_username_array[$n] && !$error)
{
   if (strcasecmp($to_users[$n]['username'],$to_username_array[$n]))
   {
      $error = TRUE;
      $error_msg .= $lang['No_such_user']." '".$to_username_array[$n]."'";
   }
   $n++;
}
Last edited by Niels on Tue 12. Nov, 2002 20:32, edited 1 time in total.
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby Niels on Tue 12. Nov, 2002 20:31

missed a comma after the inserted
Code: Select all
username
in the above mentioned code (corrected) and also missed a correction to the
Code: Select all
$sql = "....
witch is now also included
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby Niels on Sat 16. Nov, 2002 13:49

I have updated the included file groupmsg.php, new version if this is 0.9.3

after this upgrade you can mass PM a group, with a direct link
e.g.

www.yoursite.com/groupmsg.php?groupname=newsletter

note: the groupname is case sensitive, I have not made it in-case sensitive, since some board may use same groupname with different upper/lower case letters
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby Niels on Tue 24. Dec, 2002 00:15

I have updated the included file groupmsg.php, new version of this file is 0.9.5.

minor fix, in email notifications
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

PreviousNext

Return to Custom mass PM [2.0.6/EM]

Who is online

Users browsing this forum: No registered users and 0 guests

cron