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)
-   -   Mass Pm (https://vborg.vbsupport.ru/showthread.php?t=8582)

chrispadfield 02-13-2001 10:00 PM

Ok my first hack (and very simple)

What it does is lets an admin pm everyone. This is very simple at the moment and could be made more complicated like the email one in later versions. It only pm's people who have set pm to on in their profile.

I have attached the file but this is it:

PHP Code:

<?
require("./global.php");
    
echo "<html><body>";

echo "<h1>Mass PM</h1><br>";
echo "This will send a pm to every user who has set receive pm on.";
echo "<FORM METHOD=\"post\" ACTION=\"$PHP_SELF\">";
echo "Your user number:<br>";
echo "<INPUT type=\"text\" NAME=\"adminuser\" value=\"$adminuser\" SIZE=5></P>";
echo "PM Title:<br>";
echo "<INPUT type=\"text\" NAME=\"title\"  SIZE=\"40\"></P>";
echo "Message:<br>";
echo "<textarea name=\"message\" rows=\"8\" cols=\"0\"></textarea><br>";
echo "<INPUT type=\"hidden\" NAME=\"action\" value=\"do\">";
echo "<INPUT type=\"submit\" NAME=\"Submit\">";
echo "<P><P><P>";



if ($action=="do") {

echo "<html><body>";
    

    
$forums=$DB_site->query("SELECT userid,username FROM user WHERE receivepm=1 ORDER BY userid");
    
    while ($forum=$DB_site->fetch_array($forums)) {
    

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

this is my first mod so i would like comments on what i am doing wrong!

p.s. do i get an award for the first v2.0 mod?

02-14-2001 07:21 AM

Edit your thread here if you can and add a 2.0 to the title line, so we know its for 2.0.

02-14-2001 09:51 AM

44 views, so is anyone using it ?

02-14-2001 10:36 AM

does it work on v1.14? thanks for your nice hack

02-14-2001 10:41 AM

i don't know what the table structure is for 1.4, if you post the table structure here for me i can edit it so that it will work.

02-14-2001 12:48 PM

i'm new, i dunno where can i get it. sorry~~~ thanks for replied

02-14-2001 01:12 PM

you are using v 1.4 are you? (i would recommend upgrading) but if you don't want to.

install phpmyadmin from www.phpwizard.com (i think that is right, otherwise search for it at www.hotscripts.com

Then once installed (it is very useful) click on your database with your forum in it and then you should see all the tables appear. Click on the privatemessage one and copy and paste the next page. It just shows me what the names of the columns are.

02-14-2001 01:38 PM

i'm not sure is this you looking for.
msgid mediumint(8) UNSIGNED No auto_increment Change Drop Primary Index Unique
toid smallint(5) UNSIGNED No 0 Change Drop Primary Index Unique
fromid smallint(5) UNSIGNED No 0 Change Drop Primary Index Unique
title varchar(100) No Change Drop Primary Index Unique
text mediumtext No Change Drop Primary Index Unique
datetime datetime No 0000-00-00 00:00:00 Change Drop Primary Index Unique
signature tinyint(4) No 0 Change Drop Primary Index Unique
iconid smallint(5) No 0 Change Drop Primary Index Unique

Thanks a lot for all your helping

02-15-2001 12:10 AM

Chris,

I just used it for a little over 1,500 members and it was FAST!

Thanks for the great add-on!

02-15-2001 12:33 AM

cool, glad someone used it. I have already sent 2 to my members, it is a little difficult to contain oneself ;)


All times are GMT. The time now is 01:26 AM.

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.01452 seconds
  • Memory Usage 1,735KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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