Author Topic: 1.87d autoresume hacks...  (Read 97301 times)

auto

  • Posts: 49
    • View Profile
1.87d autoresume hacks...
« on: July 16, 2007, 02:47:26 am »
I noticed that sometimes, like when my server is doing something really hard drive intensive, then mailings will crap out mid-stream.

Having to babysit it just to hit the "resume" button gets to be very annoying.

So I added this little hack...so via javascript the button automatically pushes itself.

Around line 1729 on admin.php, I appended the echo statement with the following code:

<script language=\"Javascript\">setTimeout(\"hopto('./domail.php?resume=1&batid=$batid&list=$list')\",90000)</script>

Then, around line 124 of the domail.php script I also added this:

<script language=\"Javascript\">setTimeout(\"hopto('./domail.php?resume=1&batid=$batid&list=$list')\",60000)</script>

Now, I no longer have to babysit mailings to ensure they finish, because they'll now autoresume.
$5,620 in 24 hours to a small email list of 500?  http://eCa.sh/5620in24hrs

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
1.87d autoresume hacks...
« Reply #1 on: July 16, 2007, 04:50:10 am »
Greetings,

Did you see the autoresume PHP script?  The feature should accomplish the same thing, however your approach does save on unnecessary executions of the script (ie. every 15 mins)

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

auto

  • Posts: 49
    • View Profile
1.87d autoresume hacks...
« Reply #2 on: July 16, 2007, 05:04:44 am »
Hey Dean,

Thanks for the info, I forgot about that script...although I am happy with the hack thus far.

Best,
Tara
$5,620 in 24 hours to a small email list of 500?  http://eCa.sh/5620in24hrs

prepress forums

  • Posts: 24
    • View Profile
    • http://prepressforum.com
1.87d autoresume hacks...
« Reply #3 on: July 28, 2007, 08:07:54 am »
The javascript sounds good.  I have a server that has wGet disabled because of security issues.  One question.  That 90000, and 60000, how long of a refresh is that?

When you say "around line 1729" etc.

Is that to say that anywhere in that area would be fine?  Because usually a mod like this will instruct "The Code" to locate, then insert on line above or below "The Code"  

With this general instruction, if an update changed the file adding/deleting 20 lines or something, then the hack would possibly not work because the point of reference to insert has moved with evolution of the original files..  Please advise on more detailed location.  OR, maybe specify that since it's javascript, it doesn't matter.
--
JP

http://prepressforum.com - corvette-forum - http://free-preflight.com - http://printing-quote.us - http://destin-florida-hotel.com - Destin Florida Forum
corvette forum, corvette z06 forum, corvette c6 forum, c5 corvette forum, prepress forum, postcards, brochures, destin florida hotels

auto

  • Posts: 49
    • View Profile
1.87d autoresume hacks...
« Reply #4 on: July 28, 2007, 08:13:00 am »
Quote from: "prepress forums"
The javascript sounds good.  I have a server that has wGet disabled because of security issues.  One question.  That 90000, and 60000, how long of a refresh is that?


90 seconds and 60 seconds respectively.

Quote

When you say "around line 1729" etc.

Is that to say that anywhere in that area would be fine?  Because usually a mod like this will instruct "The Code" to locate, then insert on line above or below "The Code"  

With this general instruction, if an update changed the file adding/deleting 20 lines or something, then the hack would possibly not work because the point of reference to insert has moved with evolution of the original files..  Please advise on more detailed location.  OR, maybe specify that since it's javascript, it doesn't matter.


It is just inside of the echo statement at the bottom of the outputting string around like 1729.  I don't know the exact line because I didn't pay attention prior to modifying the code.
$5,620 in 24 hours to a small email list of 500?  http://eCa.sh/5620in24hrs

prepress forums

  • Posts: 24
    • View Profile
    • http://prepressforum.com
ListMail Pro 1.87d autoresume hacks
« Reply #5 on: August 15, 2007, 08:28:32 pm »
Hello auto,

Thanks so much.  I tried the cron and for whatever reason I can't get it to work so am trying this tonight, my mail drop tomorrow.  Thanks for your time, this seems like a much more elegant way and more compatible to more server situations etc.  It's not too bad, I am only dropping 12,000 pcs but still, that means I have to sit there and keep re-starting.  My lists are growing rapidly too so I need to get this auto-resume working.

Thank you auto, and Dean for your time helping me.
--
JP

http://prepressforum.com - corvette-forum - http://free-preflight.com - http://printing-quote.us - http://destin-florida-hotel.com - Destin Florida Forum
corvette forum, corvette z06 forum, corvette c6 forum, c5 corvette forum, prepress forum, postcards, brochures, destin florida hotels

prepress forums

  • Posts: 24
    • View Profile
    • http://prepressforum.com
Can't get javascript working right..
« Reply #6 on: August 16, 2007, 12:42:12 am »
OK, I almost have this working, but when it resumes, looks like it isn't picking up the variables for the list Id etc.  It shows no list of addresses to be sent, so is 0 of 0...  It resumes under a link like this:

DomainName/domail.php?resume=1&batid=&list=1

Instead of:

DomainName/domail.php?list=1&resume=1&batid=ced670

In both the scripts that I added the code to, I put the javascript inside the quotes of the echo, immediately after the html & text, inside the quotes with that text.  Was that correct place for it?  Please advise, somehow I am missing the variables when it resumes automatically.
--
JP

http://prepressforum.com - corvette-forum - http://free-preflight.com - http://printing-quote.us - http://destin-florida-hotel.com - Destin Florida Forum
corvette forum, corvette z06 forum, corvette c6 forum, c5 corvette forum, prepress forum, postcards, brochures, destin florida hotels

auto

  • Posts: 49
    • View Profile
1.87d autoresume hacks...
« Reply #7 on: August 16, 2007, 02:03:23 am »
try changing it to:

resume=1&batid=$_GET[batid]&list=$list
$5,620 in 24 hours to a small email list of 500?  http://eCa.sh/5620in24hrs

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
1.87d autoresume hacks...
« Reply #8 on: August 16, 2007, 12:00:27 pm »
Good work guys... Ultimately, I think ListMail needs a more frequent cron task, which is tricky business considering how the program was designed around the current once/day method.  Until then.. keep hacking :D
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

sanj

  • Posts: 54
    • View Profile
1.87d autoresume hacks...
« Reply #9 on: December 19, 2007, 06:40:22 am »
this is a great little hack.
could someone post exactly where it should go in both scripts i.s between which block of codes for newbie like myself.

thanks a lot
sanj  :?
Magnetic Therapy Natural Pain Relief for Arthritis, Back Pain and More... at http://www.worldofmagnets.co.uk

richardwing

  • Posts: 39
    • View Profile
1.87d autoresume hacks...
« Reply #10 on: January 21, 2008, 04:45:00 am »
I too would like to know the exact places to add the code.

I look forward to being able to apply this solution.

Richard Wing
Richard Wing

"Give a man a fish, feed him for a day. Teach a man to fish and you can sell him all kinds of fishing equiptment!" ;)

reynolditpi

  • Posts: 2
    • View Profile
Question Regarding the modification
« Reply #11 on: February 14, 2008, 09:50:58 am »
The following code is copied directly from lines 1727-1732 from my admin php file.  



Code: [Select]
//   echo "next??!<br>";
    if($error && !$skiptonext && !$reconnect){
//    echo "sending error!! ";
     echo "<span class=status_text style=\"color: red\"><br>Sending error.  Check your mail settings.<br><br></span><span class=status_text>Server said:<br> ".nl2br($errmsg)."<br></span><input class=button type=button onclick=\"hopto('./editconf.php?list=$list')\" name=tc value=\"Go To Config\"><br>";
     exit;
    }



This is the code from line 120-130 in the domail.php script:

 
Code: [Select]
 if($sc>22) $sct = " <span style=\"color: darkred; font-weight: bold;\">and seems to be failing</span>";
   elseif($sc<=22) $sct = " <span style=\"color: darkgreen; font-weight: bold;\">normally</span>";
   else $sct = '';
   echo "<br>This mailing appears to be in the process of sending$sct. It has responded within 1 minute ($sc seconds ago).<br><br>You may continue to try to <input class=button type=button onclick=\"hopto('./domail.php?resume=1&batid=$batid&list=$list')\" name=bs value=\"Resume\" onmouseover=\"this.className='button_over'\" onmouseout=\"this.className='button'\" style=\"width: 60px\"> this mailing but won't be able to until it fails for 1 minute.<br><br>It is not recommended that you cancel this mailing as messages could be sent to only part of your list.<br><br><input class=button type=button value=\"Back to Send Email\" onclick=\"hopto('./domail.php?list=$list&edit=1');\" onmouseover=\"this.className='button_over'\" onmouseout=\"this.className='button'\" style=\"width: 120px\"><br>";
   exit();
  }
  // get number to send by counting queue table
  $rows = mysql_query("select id from $qtable where batid = '$batid';");
  $ntosend=@mysql_num_rows($rows);
  qcheckin($batid);
  $sentok = domail('','solo','resume',$batid);



I have also made the guess-umption that the code to added should be:

Admin.php:
Code: [Select]
<script language=\"Javascript\">setTimeout(\"hopto('./domail.php?resume=1&batid=$_GET[batid]&list=$list')\",90000)</script>


and domail.php

Code: [Select]
<script language=\"Javascript\">setTimeout(\"hopto('./domail.php?resume=1&batid=$_GET[batid]&list=$list')\",60000)</script>

After reading this post, I have edited these two scripts according to auto's post on aug 16, 07.

Where should theses to scripts be embedded in the two previous checks of listmailpro code?

Just to be clear, I have 0 html and php knowledge...so please be gentle:)