vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   [UPDATE] Mass PM (vB 2.0) (https://vborg.vbsupport.ru/showthread.php?t=8742)

02-15-2001 10:44 PM

I have updated this as well if anyone is interested, here is a screen shot and I added it to the control panel. I eliminated the other queries such as lastpost etc.. since I was only lookin to Mass PM a group or all groups. Here it is:

PHP Code:

<?php

require("./global.php");

adminlog();

cpheader();

  if (
$action=="") {

  echo 
"<p>In the private message, you may use \$username, \$password and \$email.</p>";
  
doformheader("masspm","masspm");

  echo 
"<tr><td colspan=2><b>Private message to groups where:</b></td></tr>\n";
  if (
$pwdincp!=0) {
    
makeinputcode("and password contains","apassword");
  }
  
makechoosercode("Usergroup is:","usergroupid","usergroup",-1,"Any");
  
makehiddencode("fromuserid","$bbuserid");
  
makeinputcode("Subject:","title");
  
maketextareacode("Message:","message","",10,40);

  
doformfooter();
}

if (
$action=="masspm") {   

if (
$condition=="") {

    
$condition="1=1";
    if (
$ausername!="") {
      
$condition.=" AND INSTR(username,'".addslashes(htmlspecialchars($ausername))."')>0";
    }
    if (
$apassword!="") {
      
$condition.=" AND INSTR(password,'".addslashes($apassword)."')>0";
    }
    if (
$usergroupid!=-and $usergroupid!="") {
      
$condition.=" AND usergroupid=$usergroupid";
    }
    if (
$usertitle!="") {
      
$condition.=" AND INSTR(usertitle,'".addslashes($usertitle)."')>0";
    }

  }

$users=$DB_site->query("SELECT userid,username,password,email FROM user WHERE $condition");
    
    while (
$user=$DB_site->fetch_array($users)) {

    
$userid=$user[userid];
    
$message=$message;
    
$message=str_replace("\$email",$user[email],$message);
    
$message=str_replace("\$username",$user[username],$message);
    
$message=str_replace("\$password",$user[password],$message);

    
$sql=$DB_site->query("INSERT INTO privatemessage (privatemessageid, folderid, userid, touserid, fromuserid, title, message, dateline, showsignature, iconid, messageread) VALUES (NULL, '0', '$user[userid]', '$user[userid]', '$fromuserid', '".addslashes($title)."', '".addslashes($message)."', UNIX_TIMESTAMP(), '1', '0', '0')");
    
echo 
"PM sent to $user[userid] <br>";

    }
  }
    
?>

Here is the control panel addition:

find this in admin/index.php below "User Groups and Permissions:
Code:

<tr><td><hr></td></tr>
add this above it:
Code:

<tr><td>
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr bgcolor="#3F3849"><td><font color="#BCB6CD">
<b>Mass Private Message</b>
</font></td></tr></table>
<a href="masspm.php"> Create Message </a> |
</td></tr>

Here is the pic:

02-16-2001 07:49 AM

needs to be ammeneded to send to just moderators though as moderators arn't a usergroup anymore.

02-16-2001 08:08 AM

Quote:

Originally posted by chrispadfield
moderators arn't a usergroup anymore.
(COPPA) Users Awaiting Moderation [edit][list all users]
Administrator [edit][list all users]
Moderators [edit] [remove][list all users]
Registered [edit][list all users]
Super Moderator [edit][list all users]
Unregistered / Not Logged In [edit][list all users]
Users Awaiting Email Confirmation [edit][list all users]

That's all folks


They are on my forum...?

02-16-2001 01:15 PM

Actually.. Unless you move them into a group on your own they are all set to the Registered User's Group when you upgrade. Moderator permissions are handled through a separate moderators table now.

03-01-2001 02:59 PM

I sent a test message to my moderators' user group last night, which is 5 people. To test it out, I included the $username, $password, and $email variables as it says you can. When it was sent out, instead of doing the person's the message was going to, all 5 messages had the info of the first person it was sent to.

i.e. I sent it to users 5, 49, 65, 100, 105 and in all of them it put the info for user 5.

Any ideas?

Thanks for a great hack otherwise. :)

03-02-2001 03:46 PM

subst:
Code:

    $message=str_replace("$email",$user[email],$message);
    $message=str_replace("$username",$user[username],$message);
    $message=str_replace("$password",$user[password],$message);

with:

Code:

    $message=str_replace("\$email",$user[email],$message);
    $message=str_replace("\$username",$user[username],$message);
    $message=str_replace("\$password",$user[password],$message);


(add slashes before $ otherwise it will parse as a var) :-)

03-02-2001 11:00 PM

I don't understand how to install this hack?
  • Upload masspm.php
  • Then I get lost?
Help?

03-03-2001 12:01 AM

that is it, the run masspm.php.

I used wreckman's and it went pearshaped and did not send the message for some reason so had to use my old one to do it. Not sure what the bug is but something not quite right i don't think?

TechTalk 04-14-2001 04:00 PM

VERSION 2.1 VERSION 2.1!!! PLEASE ADD :D

~Chris

kreker 05-06-2001 10:21 AM

all right! works fine


All times are GMT. The time now is 06:59 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01129 seconds
  • Memory Usage 1,764KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete