Results 1 to 15 of 18
Page 1 of 2
FirstFirst 1 2 ... LastLast

Thread: [RELEASE] Mass Pm

  1. #1
    Senior Member chrispadfield is on a distinguished road chrispadfield's Avatar
    Join Date
    Aug 2000
    Location
    London, UK
    Age
    28
    Posts
    5,368

    [RELEASE] Mass PM (v2.0)

    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?
    Last edited by chrispadfield; Wed 14th Feb '01 at 6:55am.
     

  2. #2
    Member Shak is on a distinguished road
    Join Date
    Dec 2000
    Posts
    89
    Edit your thread here if you can and add a 2.0 to the title line, so we know its for 2.0.
     

  3. #3
    Senior Member chrispadfield is on a distinguished road chrispadfield's Avatar
    Join Date
    Aug 2000
    Location
    London, UK
    Age
    28
    Posts
    5,368
    44 views, so is anyone using it ?
     

  4. #4
    Member pipi is on a distinguished road
    Join Date
    Jan 2001
    Posts
    31
    does it work on v1.14? thanks for your nice hack
     

  5. #5
    Senior Member chrispadfield is on a distinguished road chrispadfield's Avatar
    Join Date
    Aug 2000
    Location
    London, UK
    Age
    28
    Posts
    5,368
    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.
     

  6. #6
    Member pipi is on a distinguished road
    Join Date
    Jan 2001
    Posts
    31
    i'm new, i dunno where can i get it. sorry~~~ thanks for replied
     

  7. #7
    Senior Member chrispadfield is on a distinguished road chrispadfield's Avatar
    Join Date
    Aug 2000
    Location
    London, UK
    Age
    28
    Posts
    5,368
    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.
     

  8. #8
    Member pipi is on a distinguished road
    Join Date
    Jan 2001
    Posts
    31
    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
     

  9. #9
    Senior Member Robert Basil is on a distinguished road Robert Basil's Avatar
    Join Date
    Sep 2000
    Location
    Chandler, AZ 85225
    Age
    43
    Posts
    231
    Chris,

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

    Thanks for the great add-on!
    Robert Basil
    Professional forum administrator.
    VB.com Member #1,157 (September, 2000)
    VB.org Member #404 (October, 2001)
     

  10. #10
    Senior Member chrispadfield is on a distinguished road chrispadfield's Avatar
    Join Date
    Aug 2000
    Location
    London, UK
    Age
    28
    Posts
    5,368
    cool, glad someone used it. I have already sent 2 to my members, it is a little difficult to contain oneself
     

  11. #11
    vBulletin Developer Freddie Bingham is just really nice Freddie Bingham is just really nice Freddie Bingham is just really nice Freddie Bingham is just really nice Freddie Bingham is just really nice Freddie Bingham's Avatar
    Join Date
    May 2000
    Location
    California
    Age
    35
    Posts
    13,941
    Blog Entries
    16
    It would be ever so more resourceful if the hack was to only save the message once into a "systemmessage" table that each user would then receive a message from. You could stick a "lastreadsystemmessagetime" field into the user table to figure out which users have read the message.
    vBulletin Developer since Dec 2000
     

  12. #12
    Senior Member Robert Basil is on a distinguished road Robert Basil's Avatar
    Join Date
    Sep 2000
    Location
    Chandler, AZ 85225
    Age
    43
    Posts
    231
    Originally posted by freddie
    It would be ever so more resourceful if the hack was to only save the message once into a "systemmessage" table that each user would then receive a message from. You could stick a "lastreadsystemmessagetime" field into the user table to figure out which users have read the message.
    Damn smarty-pants!
    Robert Basil
    Professional forum administrator.
    VB.com Member #1,157 (September, 2000)
    VB.org Member #404 (October, 2001)
     

  13. #13
    Senior Member chrispadfield is on a distinguished road chrispadfield's Avatar
    Join Date
    Aug 2000
    Location
    London, UK
    Age
    28
    Posts
    5,368
    true and it was something i thought about although slughtly differently. In the end this was a lot quicker and combine with a 30 day expiry date script of pms send by admin (me) which have not been read it will quickly get rid of those ones you don't need there any more.

    Also, how under your suggestion would you do it for more than one message? arn't you then going to need more than one column in the user profile field or in the end perhaps an extra table linking user with adminmessage - by the time you have done that you loose most of the gains you started with.
     

  14. #14
    Member WreckRman2 is on a distinguished road
    Join Date
    Dec 2000
    Age
    34
    Posts
    69
    Worked for me... other then the $adminuser. Thanks!

    PS. Maybe you could upgrade the style sheet to match the rest of the admin area.
    Last edited by WreckRman2; Thu 15th Feb '01 at 4:11am.
    Combat Flight Center
    The Internet's Best Resource for Microsoft's Combat Flight Simulator
    http://www.combatfs.com
     

  15. #15
    Member WreckRman2 is on a distinguished road
    Join Date
    Dec 2000
    Age
    34
    Posts
    69
    Heck you did the hard part so I thought I could clean the look of the page up for you/me...

    Updated code at http://www.vbulletin.com/forum/showt...?threadid=8742
    Combat Flight Center
    The Internet's Best Resource for Microsoft's Combat Flight Simulator
    http://www.combatfs.com
     

Page 1 of 2
FirstFirst 1 2 ... LastLast

Similar Threads

  1. [RELEASE: Mass Email to users awaiting activation code]
    By Scott MacVicar in forum Releases: Version 2.x
    Replies: 1
    Last Post: Sat 8th Sep '01, 5:10am
  2. Replies: 0
    Last Post: Wed 9th May '01, 7:18pm
  3. [RELEASE vB2.0] New User Mass Mover
    By Kier in forum Releases: Version 2.x
    Replies: 7
    Last Post: Sat 21st Apr '01, 3:08pm

Bookmarks

Posting Permissions

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