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

Reply
 
Thread Tools
Automatic "Send Email" redirect Details »»
Automatic "Send Email" redirect
Version: 1.5.0, by Revan Revan is offline
Developer Last Online: Jun 2014 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 03-21-2005 Last Update: 03-29-2005 Installs: 11
DB Changes
 
No support by the author.

Do you run a large forum, and need to send emails to all your users? Do you have to set the email per batch to a low number because of PHP limitations? And most importantly; would you have liked to see the emails work their magic while you go attend other duties?
If your answer to the aboves is yes, then this hack is for you!

What this hack does, is cache the email you are trying to send in a temporary SQL table, then instead of having a form with hidden fields and forcing you to hit submit, it reads this table at reload.
After the mail is sent, the table is emptied.

Thanks goes to DeMiNe0 for telling me to make this, and for helping me test it



Files modified: 1
DB Tables added: 1
Difficulty: Easy

Show Your Support

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

Comments
  #12  
Old 03-25-2005, 03:34 PM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is that all? You seem to have cut the error message in half.
Reply With Quote
  #13  
Old 03-26-2005, 09:40 AM
Raptor Raptor is offline
 
Join Date: Nov 2001
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yep thats verbatim
Reply With Quote
  #14  
Old 03-26-2005, 12:49 PM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well you must understand that I can't diagnose a problem when you obviously cut out of the message exactly WHAT the error is, and WHERE it is.
It's 100 % impossible that that is a verbatim copy of the error, because vB doesn't output mySQL errors without the MySQL error code and message.
Reply With Quote
  #15  
Old 03-26-2005, 11:36 PM
Raptor Raptor is offline
 
Join Date: Nov 2001
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
Database error in vBulletin 3.0.7:

Invalid SQL: 
				INSERT INTO `mailtemp` 
					(`test`, `serializeduser`, `from`, `subject`, `message`)
				VALUES
					('0',
					'a:26:{s:8:"username";s:0:"";s:11:"usergroupid";a:8:{i:0;s:2:"87";i:1;s:2:"89";i:2;s:1:"6";i:3;s:2:"61";i:4;s:1:"5";i:5;s:2:"80";i:6;s:1:"2";i:7;s:2:"91";}s:10:"adminemail";s:1:"0";s:5:"email";s:0:"";s:11:"parentemail";s:0:"";s:9:"coppauser";s:2:"-1";s:8:"homepage";s:0:"";s:3:"icq";s:0:"";s:3:"aim";s:0:"";s:5:"yahoo";s:0:"";s:3:"msn";s:0:"";s:9:"signature";s:0:"";s:9:"usertitle";s:0:"";s:13:"joindateafter";s:0:"";s:14:"joindatebefore";s:0:"";s:17:"lastactivityafter";s:0:"";s:18:"lastactivitybefore";s:0:"";s:13:"lastpostafter";s:0:"";s:14:"lastpostbefore";s:0:"";s:13:"birthdayafter";s:0:"";s:14:"birthdaybefore";s:0:"";s:10:"postslower";s:0:"";s:10:"postsupper";s:0:"";s:15:"reputationlower";s:0:"";s:15:"reputationupper";s:0:"";s:9:"ipaddress";s:0:"";}',
					'raptor@digital-forums.com',
					'80 FREE 8X DVD-R @ WWW.NEODISCS.COM !',
					'As a Digital-Forums member you are entitled to 80 FREE 8X DVD-R when you spend ?50 or more at www.neodiscs.com

Go get 'em !')
			
mysql error: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'em !')' at line 8

mysql error number: 1064

Date: Sunday 27th of March 2005 03:35:06 AM
Script: http://www.digital-forums.com/admincp/email.php
Referer: http://www.digital-forums.com/adminc...l.php?do=start
Username: Raptor
IP Address: xx.xx.xx.xx
Reply With Quote
  #16  
Old 03-26-2005, 11:44 PM
Raptor Raptor is offline
 
Join Date: Nov 2001
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

screen shot
Reply With Quote
  #17  
Old 03-27-2005, 12:21 AM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yep see now I can determine the error... try replacing one of the edits with this:
PHP Code:
        if (!$_GET['isredirect'])
        {
            
$DB_site->query("
                INSERT INTO `" 
TABLE_PREFIX "mailtemp` 
                    (`test`, `serializeduser`, `from`, `subject`, `message`)
                VALUES
                    ('" 
intval($_POST['test']) . "',
                    '" 
serialize($_POST['user']) . "',
                    '" 
mysql_real_escape_string($_POST['from']) . "',
                    '" 
mysql_real_escape_string($_POST['subject']) . "',
                    '" 
mysql_real_escape_string($_POST['message']) . "')
            "
);
        } 
Might also want to take this bit and replacing into the first edit:
PHP Code:
        $message stripslashes($mailtemp['message']);
        
$subject stripslashes($mailtemp['subject']); 
Reply With Quote
  #18  
Old 03-27-2005, 12:32 AM
H2k_Coder H2k_Coder is offline
 
Join Date: Mar 2005
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

WooooW very nice Hack i have other board use IPB and they have Something like this hack ..

Thankyou For Released this great hack going to Install it
Reply With Quote
  #19  
Old 03-27-2005, 05:51 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In your email.php, find:
PHP Code:
                    '" . mysql_real_escape_string($_POST['from']) . "',
                    
'" . mysql_real_escape_string($_POST['subject']) . "',
                    
'" . mysql_real_escape_string($_POST['message']) . "'
And replace with:
PHP Code:
                    '" . addslashes(mysql_real_escape_string($_POST['from'])) . "',
                    
'" . addslashes(mysql_real_escape_string($_POST['subject'])) . "',
                    
'" . addslashes(mysql_real_escape_string($_POST['message'])) . "'
Not tested.
Reply With Quote
  #20  
Old 03-28-2005, 02:39 PM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Btw, mysql_real_escape_string is a function more powerful than addslashes, but it does the same. Do not perform the above edit. Double escaping should be avoided, afaik :P
Reply With Quote
  #21  
Old 03-28-2005, 09:24 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually you are right, must still have been sleeping. Double quoting should not be done.

Hmm strange that he stil got that error then.
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 06:27 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.04445 seconds
  • Memory Usage 2,323KB
  • 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_code
  • (4)bbcode_php
  • (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
  • (3)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_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