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 chrispadfield chrispadfield is offline
Developer Last Online: Oct 2008 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 02-13-2001 Last Update: Never Installs: 4
 
No support by the author.

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?

Show Your Support

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

Comments
  #12  
Old 02-15-2001, 12:50 AM
Guest
 
Posts: n/a
Default

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.
Reply With Quote
  #13  
Old 02-15-2001, 12:57 AM
Guest
 
Posts: n/a
Default

Quote:
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!
Reply With Quote
  #14  
Old 02-15-2001, 12:57 AM
Guest
 
Posts: n/a
Default

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.
Reply With Quote
  #15  
Old 02-15-2001, 06:08 AM
Guest
 
Posts: n/a
Default

Worked for me... other then the $adminuser. Thanks!

PS. Maybe you could upgrade the style sheet to match the rest of the admin area.
Reply With Quote
  #16  
Old 02-15-2001, 08:03 AM
Guest
 
Posts: n/a
Default

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
Reply With Quote
  #17  
Old 02-15-2001, 09:01 AM
Guest
 
Posts: n/a
Default

cool thanks.

next little thing is to let you select usergroups so that you can say send one to all your moderators.. soon i hope.
Reply With Quote
  #18  
Old 04-08-2001, 10:14 AM
theprof
Guest
 
Posts: n/a
Default

Is there one for vb 1.14? If so,c an you please provide the code?
Reply With Quote
  #19  
Old 04-08-2001, 11:12 AM
John Harrison
Guest
 
Posts: n/a
Default

Quote:
Originally posted by theprof
Is there one for vb 1.14? If so,c an you please provide the code?
I dont think there is one.
As this was released for v2.0

But if there was to be one it would be for v1.1.6 most likely.
Reply With Quote
  #20  
Old 10-07-2002, 08:40 PM
wolfe wolfe is offline
 
Join Date: Jan 2002
Posts: 900
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

where do u put the codeing?
Reply With Quote
  #21  
Old 10-07-2002, 08:43 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you have to create a new file and insert it there, most likely into the adminfolder
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 01:54 AM.


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.04406 seconds
  • Memory Usage 2,282KB
  • Queries Executed 25 (?)
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
  • (1)bbcode_php
  • (2)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
  • (2)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
  • (3)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_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