PDA

View Full Version : Auto Redirect: a solution for [Email Users] problems


Private
09-25-2003, 10:00 PM
If you ever had problems when sending an email to more than 200 users at once or if you got the silly error message: Problem Report (Timeout), this hack is made for you !


Purpose:

When you send a large number of emails at once (100-1000, depends on your server) using Email Users feature in the admin control panel, you propably get a timeout error message and that's because a certain time limit has ended while the emails are in the sending process.

A solution is to decrease the number of emails bieng sent at once, but this will force you to click the submit button in order to proceed to the next page, and this is difficult because you'll have a large number of pages.

e.g. if you have 10000 users in your forums, and you choose to send 100 messages at once, you'll have 100 pages, when every page finished loading, you must click (Do Next Page) button to proceed to next page!

Well, (Auto Redirect) hack will click the submit button in behalf of you :), using a small Java Script code, the emailing process will continue automatically, sending batch after batch until you email all users of your forum.


Installation:

PLEASE make a backup of email.php, all changes are made in this file.
For your safety, always make a backup of your files before hacking it!

Open up email.php that is located in the Admin directory, and change the following:

1: find:
makehiddencode("test",$test);
and right under this line, write:
makehiddencode("redirect",$redirect);

2: couple of lines below, you'll find:
doformfooter("Do Next Page (page $page)",0);
On the line below it, place:
// automatic redirect
if ($redirect) {
echo '
<script language="javascript">
myvar = "";
timeout = 15;
function dorefresh() {
window.status="Redirecting"+myvar;
myvar = myvar + " .";
timerID = setTimeout("dorefresh();", 100);
if (timeout > 0) {
timeout -= 1;
}
else {
clearTimeout(timerID);
window.status="";
document.name.submit();
}
}
dorefresh();
</script>';
}
// automatic redirect

3: finally, find:
makeinputcode("Messages to send at once:","perpage","500");
and place the following code below it:
makeyesnocode("Auto redirect to next page?","redirect");


ENJOY!


Hack Summary:

- Author: Private (privateman@flashmail.com)
- Tested on: all versions of vb 2.2.x and 2.3.x
- Support: post your questions in this thread only
- effects: 1 file effected (email.php)
- I strongly encourage vBulletin team to include this hack in VB3

MrNase
09-26-2003, 12:10 PM
ah please not yellow! Any color but not yellow ;)

There are a few guys who use the purple style and those can't read what you've written :)


And:
>> Tested on: all versions of vb from 2.2.x to 2.3.0

what about 2.3.2 ?

FleaBag
09-26-2003, 07:05 PM
Excellent idea for a hack - just what I need as I often have to send e-mails to users twice due to time-outs.

Cheers for the good work mate!

Private
09-26-2003, 09:22 PM
It works perfectly on vb 2.3.1 and 2.3.2

* I edited the thread and changed (tested on) line to:
Tested on: all versions of vb 2.2.x and 2.3.x

** no more yellow :)

psico
09-27-2003, 05:22 AM
This hack already exist:
https://vborg.vbsupport.ru/showthread.php?t=47886&highlight=Email+Users

Anyway, good work dude!

Private
09-27-2003, 08:13 AM
psico

however, I did it myself, I think it's more integrated than the old one, and you can even use it or not depending on your choice.

thanx

Cold Steel
04-30-2004, 12:25 PM
Can someone port this to vB3?

Raptor
07-02-2004, 01:34 AM
any hack for this in vb3 ?

MentaL
02-23-2005, 08:55 PM
yes need for vb3 :(

Raptor
03-23-2005, 02:59 PM
surely there is a vb3 hack for this

i have absolutley no idea what the use of clicking next page is - when i have 114,000 emails to send out

Marco van Herwaarden
03-23-2005, 03:29 PM
vb3 Hack for this: https://vborg.vbsupport.ru/showthread.php?t=78550&highlight=redirect+mail