vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Automatic "Send Email" redirect (https://vborg.vbsupport.ru/showthread.php?t=78550)

Revan 03-21-2005 10:00 PM

Automatic "Send Email" redirect
 
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

nexialys 03-22-2005 10:54 AM

good thing Revan, but there is a missing Replace, line WHEN searching FOR if (!$_POST['test'])... line 177 and on...

we replace it with what here?!

Revan 03-22-2005 12:54 PM

Fix'd.
Cheers :)

oztrack 03-24-2005 12:42 PM

I did all the changes to the php file

But I am a newby and dont know what exactly is meant by this. I ran the qery but i dont know what is meant by the final words in the text below. Remember to add a prefix if you use it. - What prefix.

I ran the query - but it said it changed 0 rows .

Help!!

Run this query:
_________________

CREATE TABLE `mailtemp` (
`test` tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
`message` mediumtext NOT NULL,
`subject` mediumtext NOT NULL,
`from` mediumtext NOT NULL,
`serializeduser` mediumtext NOT NULL
) TYPE=MyISAM;

Remember to add a prefix if you use it.

Revan 03-24-2005 12:45 PM

Well in your config.php, if you have the "$tableprefix" set to anything, that is what you needed to add.
And even if you do not have a prefix, you ran the query correctly, because it is not supposed to change any rows ;)
As long as you don't get errors when sending a mail using this redirect, you did everything correctly :)

oztrack 03-24-2005 12:46 PM

When i go to 'send email to users' now in the control panel - above the blue - i have the text over a white background saying

if ($_REQUEST['do'] == 'dosendmail' OR $_POST['do'] == 'makelist') { if (!$_GET['isredirect']) { $message = $_POST['message']; $perpage = $_POST['perpage']; $startat = $_POST['startat']; $subject = $_POST['subject']; $from = $_POST['from']; $serializeduser = $_POST['serializeduser']; } else { $perpage = $_GET['perpage']; $startat = $_GET['startat']; $mailtemp = $DB_site->query_first("SELECT * FROM `" . TABLE_PREFIX . "mailtemp`"); $message = $mailtemp['message']; $subject = $mailtemp['subject']; $from = $mailtemp['from']; $serializeduser = $mailtemp['serializeduser']; $test = $mailtemp['test']; } if (isset($serializeduser)) { $_POST['user'] = @unserialize($serializeduser);

Also
at the generate email list page i have the text

if ($_REQUEST['do'] == 'dosendmail' OR $_POST['do'] == 'makelist') { if (!$_GET['isredirect']) { $message = $_POST['message']; $perpage = $_POST['perpage']; $startat = $_POST['startat']; $subject = $_POST['subject']; $from = $_POST['from']; $serializeduser = $_POST['serializeduser']; } else { $perpage = $_GET['perpage']; $startat = $_GET['startat']; $mailtemp = $DB_site->query_first("SELECT * FROM `" . TABLE_PREFIX . "mailtemp`"); $message = $mailtemp['message']; $subject = $mailtemp['subject']; $from = $mailtemp['from']; $serializeduser = $mailtemp['serializeduser']; $test = $mailtemp['test']; } if (isset($serializeduser)) { $_POST['user'] = @unserialize($serializeduser);

Revan 03-24-2005 12:49 PM

Are you sure you did the file changes correctly?
Because it seems to me like it echo's the entire script... :P

oztrack 03-24-2005 12:52 PM

My table prefix is not set to anything. I just checked config.php

oztrack 03-24-2005 12:54 PM

I will reload the default page and do the changes again - tomorrow. Thanks

Raptor 03-25-2005 03:16 PM

i get an error on the first attempt at an auto re direct to next page - code has been applied 1:1 as per instructions

using vb 3.07 - query successfully executed and checked in phpmyadmin with no errors

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:13:{i:0;s:1:"4";i:1;s:2:"87";i:2;s:2:"89";i:3;s:2:"79";i:4;s:1:"6";i:5;s:2:"61";i:6;s:1:"5";i:7;s:2:"80";i:8;s:1:"2";i:9;s:2:"91";i:10;s:2:"84";i:11;s:1:"1";i:12;s:1:"3";}s:10:"adminemail";s:1:"1";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',
                                        'topic of email',
                                        'email subject



All times are GMT. The time now is 03:28 PM.

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.01133 seconds
  • Memory Usage 1,738KB
  • 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_code_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