Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by WreckRman2 WreckRman2 is offline
Developer Last Online: Jul 2014 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 02-14-2001 Last Update: Never Installs: 14
 
No support by the author.

An update to the hack posted by chrispadfield at http://www.vbulletin.com/forum/showt...threadid=8582.

Updates:

1. Modified the look of page to match that of the email page.

2. Added select fields to send message to.

4. Fixed $adminuser and set to a hidden field.

Enjoy!

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");

  
makehiddencode("fromuserid","$bbuserid");
  
makeinputcode("Subject:","title");
  
maketextareacode("Message:","message","",10,40);

  echo 
"<tr><td colspan=2><b>Private message to users where:</b></td></tr>\n";
  
makeinputcode("User Name contains","ausername");
  if (
$pwdincp!=0) {
    
makeinputcode("and password contains","apassword");
  }
  
makechoosercode("and usergroup is","usergroupid","usergroup",-1,"Any");
  
makeinputcode("and email contains","aemail");
  
makeinputcode("and parent's email contains","parentemail");
  
makeinputcode("and is coppa user (yes, no, blank for don't mind)","coppauser");
  
makeinputcode("and homepage contains","homepage");
  
makeinputcode("and ICQ Number contains","icq");
  
makeinputcode("and AIM Handle contains","aim");
  
makeinputcode("and Yahoo Messenger Handle contains","yahoo");
  
makeinputcode("and Biography contains","biography");
  
makeinputcode("and Signature contains","signature");
  
makeinputcode("and User Title contains","usertitle");
  
makeinputcode("and Join Date is after<br>(Format yyyy-mm-dd, leave blank for today)","joindateafter");
  
makeinputcode("and Join Date is before<br>(Format yyyy-mm-dd, leave blank for today)","joindatebefore");
  
makeinputcode("and Last Visit is after<br>(Format yyyy-mm-dd hh:mm:ss, leave blank for today)","lastvisitafter");
  
makeinputcode("and Last Visit is before<br>(Format yyyy-mm-dd hh:mm:ss, leave blank for today)","lastvisitbefore");
  
makeinputcode("and Last Post is after<br>(Format yyyy-mm-dd hh:mm:ss, leave blank for today)","lastpostafter");
  
makeinputcode("and Last Post is before<br>(Format yyyy-mm-dd hh:mm:ss, leave blank for today)","lastpostbefore");
  
makeinputcode("and Number of Posts is greater than","postslower");
  
makeinputcode("and Number of Posts is less than","postsupper");

  
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 (
$aemail!="") {
      
$condition.=" AND INSTR(email,'".addslashes(htmlspecialchars($aemail))."')>0";
    }
    if (
$parentemail!="") {
      
$condition.=" AND INSTR(parentemail,'".addslashes(htmlspecialchars($parentemail))."')>0";
    }
    
$coppauser=strtolower($coppauser);
    if (
$coppauser=="yes") {
      
$condition.=" AND coppauser=1";
    }
    if (
$coppauser=="no") {
      
$condition.=" AND coppauser=0";
    }
    if (
$homepage!="") {
      
$condition.=" AND INSTR(homepage,'".addslashes(htmlspecialchars($homepage))."')>0";
    }
    if (
$icq!="") {
      
$condition.=" AND INSTR(icq,'".addslashes(htmlspecialchars($icq))."')>0";
    }
    if (
$aim!="") {
      
$condition.=" AND INSTR(aim,'".addslashes(htmlspecialchars($aim))."')>0";
    }
    if (
$yahoo!="") {
      
$condition.=" AND INSTR(yahoo,'".addslashes(htmlspecialchars($yahoo))."')>0";
    }
    if (
$biography!="") {
      
$condition.=" AND INSTR(biography,'".addslashes(htmlspecialchars($biography))."')>0";
    }
    if (
$signature!="") {
      
$condition.=" AND INSTR(signature,'".addslashes($signature)."')>0";
    }
    if (
$usertitle!="") {
      
$condition.=" AND INSTR(usertitle,'".addslashes($usertitle)."')>0";
    }
    if (
$joindateafter!="") {
      
$condition.=" AND joindate>UNIX_TIMESTAMP('".addslashes($joindateafter)."')";
    }
    if (
$joindatebefore!="") {
      
$condition.=" AND joindate<UNIX_TIMESTAMP('".addslashes($joindatebefore)."')";
    }
    if (
$lastvisitafter!="") {
      
$condition.=" AND lastvisit>UNIX_TIMESTAMP('".addslashes($lastvisitafter)."')";
    }
    if (
$lastvisitbefore!="") {
      
$condition.=" AND lastvisit<UNIX_TIMESTAMP('".addslashes($lastvisitbefore)."')";
    }
    if (
$lastpostafter!="") {
      
$condition.=" AND lastpost>UNIX_TIMESTAMP('".addslashes($lastpostafter)."')";
    }
    if (
$lastpostbefore!="") {
      
$condition.=" AND lastpost<UNIX_TIMESTAMP('".addslashes($lastpostbefore)."')";
    }
    if (
$postslower!="") {
      
$condition.=" AND posts>'$postslower'";
    }
    if (
$postsupper!="") {
      
$condition.=" AND posts<'$postsupper'";
    }
  }

$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>";

    }
  }
    
?>

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 12-09-2001, 08:11 PM
KarateKid's Avatar
KarateKid KarateKid is offline
 
Join Date: Oct 2001
Location: Sydney
Posts: 158
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

does it work for 2.2.1 ?
Reply With Quote
  #33  
Old 02-10-2002, 01:33 PM
Mystics's Avatar
Mystics Mystics is offline
 
Join Date: Oct 2001
Location: Germany
Posts: 273
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have adjusted the script a little bit.
It's now nearly the same as the "Send eMail to users"-Feature, so now you can test the process before sending and all variables get replaced correct.

The Script works perfect for vBulletin 2.2.x!

I have attached the script (German an English version!) to this Posting.

@NAM
Quote:
2. We really need Save function that keep all of our mass PM to users in Send Folder box. To keep for the record.
To save the sent PM in the Send Folder Box of the Admin who sent the PM, do the following (referring to my version of the script):

Search:
PHP Code:
    echo "<p><b>All done!</b></p>"
and replace it with:
PHP Code:
    echo "<p><b>All done!</b></p>";
    if (!
$test) {
      
$sql=$DB_site->query("INSERT INTO privatemessage (privatemessageid, folderid, userid, touserid, fromuserid, title, message, dateline, showsignature, iconid, messageread) VALUES (NULL,'-1','$fromuserid','$fromuserid','$fromuserid','".addslashes(htmlspecialchars($subject))."','".addslashes($sendmessage)."',".time().",'1','0','0')");
    } 
2003-07-09:
Small update (changed code order)


2002-09-21:
Updated the archive with new versions (Bugfix + Automatic redirect Feature when sending over several pages.)


2002-07-12:
Updated the archive with new versions (Bugfix + eMail Feature)


Greetings,
Mystics
Reply With Quote
  #34  
Old 02-11-2002, 08:20 AM
Jawelin Jawelin is offline
 
Join Date: Nov 2001
Posts: 557
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks a lot. Very cool!

Actually there are - in your masspm.php - two lines with
<b>All done!</b> (one for first page, another for the multiple pages option)

Which of them should I replace with the above INSERT to save the PM in the outbox ?

Besides, the INSERT itself contains three identical values:
'$fromuserid','$fromuserid','$fromuserid',
Is it right (I shall not save the single target of each message...) ?
Hwr. that variable is NEVER defined anywhere :stupid: :stupid:

Thanks
Reply With Quote
  #35  
Old 02-11-2002, 09:49 AM
Jawelin Jawelin is offline
 
Join Date: Nov 2001
Posts: 557
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry Mystics, but I definetively think your insert queries
PHP Code:
$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(htmlspecialchars($subject))."','".addslashes($sendmessage)."',".time().",'1','0','0')"); 
and the other you specified two posts above, should be replaced with something like:
PHP Code:
// insert message in inbox of the receiver 
$DB_site->query("INSERT INTO privatemessage (privatemessageid,userid,touserid,fromuserid,title,message,dateline,showsignature,iconid,messageread,folderid,receipt) VALUES (NULL,$user[userid],$user[userid],$bbuserinfo[userid],'".addslashes(htmlspecialchars($subject))."','".addslashes($sendmessage)."',".time().",'1',0,0,0,0)");

// insert message in outbox of the sender 
$DB_site->query("INSERT INTO privatemessage (privatemessageid,userid,touserid,fromuserid,title,message,dateline,showsignature,iconid,messageread,folderid,receipt) VALUES (NULL,$bbuserinfo[userid],$user[userid],$bbuserinfo[userid],'".addslashes(htmlspecialchars($subject))."','".addslashes($sendmessage)."',".time().",'1',0,0,-1,0)"); 
What do you think about ?

Thnx
Reply With Quote
  #36  
Old 02-11-2002, 10:04 AM
Mystics's Avatar
Mystics Mystics is offline
 
Join Date: Oct 2001
Location: Germany
Posts: 273
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Jawelin
Actually there are - in your masspm.php - two lines with
<b>All done!</b> (one for first page, another for the multiple pages option)
This line does not appear two times!!!

There is one line with <b>All done!</b> and one line with <p><b>All done!</b></p> and as I wrote you should replace the second one!
Quote:
Originally posted by Jawelin
Besides, the INSERT itself contains three identical values:
'$fromuserid','$fromuserid','$fromuserid',
Is it right (I shall not save the single target of each message...) ?
Hwr. that variable is NEVER defined anywhere :stupid: :stupid:
This variable is defined!
PHP Code:
  makehiddencode("fromuserid","$bbuserid"); 
But you are right, you may replace $fromuserid with $bbuserid....I just have taken this from the original "hack".

The reason why this variable appears three times in the "Save-Sent-PM-in-My-Outbox" Feature is simple: you are the sender of the pm, you are the receiver of the pm and the PM belongs to you, so all userids have to be of course the same.

I have tested all of this before I posted it, so just believe me, it works!
Reply With Quote
  #37  
Old 02-11-2002, 11:21 AM
Jawelin Jawelin is offline
 
Join Date: Nov 2001
Posts: 557
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thnx for having cleaned out.
Bye
Reply With Quote
  #38  
Old 06-12-2002, 02:12 PM
bluecat's Avatar
bluecat bluecat is offline
 
Join Date: Apr 2002
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great hack. I'm wondering, is there a way to put to this in my control panel for easy access (rather then enter the url manually)? Thanks.
Reply With Quote
  #39  
Old 06-12-2002, 02:18 PM
Mystics's Avatar
Mystics Mystics is offline
 
Join Date: Oct 2001
Location: Germany
Posts: 273
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by bluecat
Great hack. I'm wondering, is there a way to put to this in my control panel for easy access (rather then enter the url manually)? Thanks.
Open admin/index.php

Find:
PHP Code:
makenavoption("Email Users","email.php?action=start","<br>"); 
Add below it:
PHP Code:
makenavoption("Send PM to Users","masspm.php?action=start","<br>"); 
Reply With Quote
  #40  
Old 07-12-2002, 05:40 PM
JoshFink JoshFink is offline
 
Join Date: Nov 2001
Posts: 207
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The only problem I see so far with this is that it does not send out a notification email if when someone receives a PM. Is there a way to fix this?

Thanks

Josh
Reply With Quote
  #41  
Old 07-12-2002, 05:55 PM
Mystics's Avatar
Mystics Mystics is offline
 
Join Date: Oct 2001
Location: Germany
Posts: 273
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by JoshFink
The only problem I see so far with this is that it does not send out a notification email if when someone receives a PM. Is there a way to fix this?
I have replaced my attachment with the new version.

I have done the eMail Feature + Bugfix long time ago, sorry

Mystics
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:42 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05819 seconds
  • Memory Usage 2,398KB
  • Queries Executed 27 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (8)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete