OK I have tried it all with no joy ;-(
I even added
set_time_limit(300);
And it still returns the same timeout error
I have dumbed the subscribers in the MYSQL database and setup a new one with no joy so this mean there is no large data sending trying to send to hundreds of people but still times out!
Any one got any other ways of test the subscriptions.php?
I have also ask my admin for the php location
Going by the Cron Setup at
https://www.ubbcentral.com/support/docs/ubbthreads/UBBthreads_cron.html I should...
1. Customize Paths
Using NotePad, or a suitable text editor, open doexpire.php and subscriptions.php and place the path to PHP in the top of the script. For example, it might look like this:
#!/usr/bin/php
I have update this to my path
#!/usr/local/bin/php
But I get a can not update header error and then it times out.
Anyone?
Maybe I have a premission set wrong somewhere?
My script subscriptions.php
[]
<?
/*
# UBB.threads, Version 6
# Official Release Date for UBB.threads Version6: NO DATE YET
# First version of UBB.threads created July 30, 1996 (by Rick Baker).
# This entire program is copyright Groupee, Inc., 2005.
# For more info on UBB.threads and other Groupee Services
# visit
http://www.groupee.com/ &
https://www.ubbcentral.com/# Program Author: Rick Baker.
# File Version 6.5.4
# You may not distribute this program in any manner, modified or otherwise,
# without the express, written written consent from Groupee, Inc..
# Note: if you modify ANY code within UBB.threads, we at Groupee, Inc.
# cannot offer you support-- thus modify at your own peril <img src="https://www.ubbcentral.com/boards/images/graemlins/smile.gif" alt="" />
# ---------------------------------------------------------------------------
*/
// Require the library
require ("../../includes/main.inc.php");
require ("$thispath/languages/{$_SESSION['myprefs']['language']}/subscriptions.php");
$html = new html;
$mailer = new mailer;
// ----------------------------------------------
// First we grab all boards that have subscribers
$query = "
SELECT DISTINCT S_Board,MAX(S_Last)
FROM {$config['tbprefix']}Subscribe
GROUP BY S_Board
";
$sth = $dbh -> do_query($query);
$rows = $dbh -> total_rows($sth);
$ostype = find_environmental("OSTYPE");
$newline = "\n";
if (stristr($ostype,"win")) {
$newline = "\r\n";
}
// ----------------------------------------------------------------
// Now we have the boards we need to cycle through the subscribers
for ($j = 0;$j < $rows; $j++ ) {
list($Board,$Last) = $dbh -> fetch_array($sth);
$Board_q = addslashes($Board);
$query = "
SELECT Bo_Title,Bo_Read_Perm
FROM {$config['tbprefix']}Boards
WHERE Bo_Keyword = '$Board_q'
";
$sta = $dbh -> do_query($query);
list($Title,$ReadPerm) = $dbh -> fetch_array($sta);
// ------------------------------
// Now we grab all the posts info
$query = "
SELECT t1.B_Number,t1.B_Posted,t2.U_Username,t1.B_IP,t1.B_Subject,t1.B_Body,t1.B_AnonName,t2.U_Number
FROM {$config['tbprefix']}Posts AS t1,
{$config['tbprefix']}Users AS t2
WHERE t1.B_Number > '$Last'
AND t1.B_Approved = 'yes'
AND t1.B_Board = '$Board_q'
AND t1.B_Posterid = t2.U_Number
AND t1.B_Status <> 'M'
ORDER BY t1.B_Number ASC
";
$stk = $dbh -> do_query($query);
$postrows = $dbh -> total_rows($stk);
$seperator = "----------------------------------------------------------------------\n";
$message = "{$ubbt_lang['SUB_DESC2']}\n";
$message = $message . "{$ubbt_lang['SUB_DESC']} '$Title' Forum.\n$seperator\n\n";
// ------------------------------------------------------
// Only send out an email if there are posts for the day
if($postrows > 0){
// --------------------------------------------------------
// Now we cycle through the posts and append to the message
for ($l =0; $l < $postrows; $l++) {
list($Number,$PPosted,$PUsername,$PIP,$PSubject,$PBody,$PAnon,$Pnumber) = $dbh -> fetch_array($stk);
if ($Pnumber == 1) {
if ($PAnon) {
$PUsername = $PAnon;
}
else {
$PUsername = $ubbt_lang['ANON_TEXT'];
}
}
$message = $message . "{$ubbt_lang['SUBJECT_TEXT']}: $PSubject\n";
$message = $message . "{$ubbt_lang['POSTER_TEXT']}: $PUsername\n";
$date = $html -> convert_time($PPosted);
$message = $message . "{$ubbt_lang['POSTON_TEXT']}: $date\n";
$PBody = str_replace("<br>","\n",$PBody);
$PBody = str_replace("<br />","\n",$PBody);
$PBody = str_replace("<br>","\n",$PBody);
$message = $message . "\n$PBody\n\n";
$message = $message . "$seperator\n\n";
}
// ------------------------------------
// Now we need to update the last entry
$query = "
UPDATE {$config['tbprefix']}Subscribe
SET S_Last = $Number
WHERE S_Board = '$Board_q'
";
$dbh -> do_query($query);
// -----------------------------------------
// Now grab everyone that we need to mail to
$query = "
SELECT S_Uid
FROM {$config['tbprefix']}Subscribe
WHERE S_Board = '$Board_q'
";
$sti = $dbh -> do_query($query);
$userrows = $dbh -> total_rows($sti);
// ---------------------------------------------------------
// Now that we have all the users we need to cycle through
for ($k = 0; $k < $userrows; $k++) {
// ---------------------------------------
// Now we need to grab their email address
list($Uid) = $dbh -> fetch_array($sti);
$Uid_q = addslashes($Uid);
$query = "
SELECT U_Email,U_TimeOffset,U_Groups,U_EmailFormat
FROM {$config['tbprefix']}Users
WHERE U_Number = '$Uid_q'
";
$stj = $dbh -> do_query($query);
list($Email,$TimeOffset,$Groups,$emailformat) = $dbh -> fetch_array($stj);
if (!$Email) { continue; }
$query = "
SELECT U_Banned
FROM {$config['tbprefix']}Users
WHERE U_Number='$Uid_q'
";
$stx = $dbh -> do_query($query);
list ($Checkuser) = $dbh -> fetch_array($stx);
$dbh -> finish_sth($stx);
if ($Checkuser) {
continue;
}
$Grouparray = split("-",$Groups);
$canread = 0;
$gsize = sizeof($Grouparray);
for ($i=0; $i<$gsize; $i++) {
if (ereg("-$Grouparray[$i]-",$ReadPerm) ) {
$canread = 1;
}
}
if (!$canread) { continue; }
$mailmessage = $message;
if ($emailformat == "HTML") {
$mailmessage = str_replace("\"{$config['images']}","\"{$config['phpurl']}{$config['images']}",$mailmessage);
$mailmessage = str_replace("\n","<br />\n",$mailmessage);
$mailmessage = "<html>\n<head>\n<title>{$ubbt_lang['SUB_INTRO']} $Title</title>\n</head>\n<body>\n$mailmessage</body>\n</html>\n";
}
$to = $Email;
$from = $config['emailaddy'];
$subject = "{$ubbt_lang['SUB_INTRO']} $Title";
$mailer -> send_mail("$emailformat","","$to","$subject","$mailmessage");
}
}
}
?>
[/]