mass mailer emails stuck in queue Parse error?

Trying to get someones mailer working for them.

I get this error when I execute the the cron job query manually through ssh.

/usr/local/bin/php -q /home/dailaan2/www/periodic/notifies.php

Parse error: syntax error, unexpected T_VARIABLE in /home/dailaan2/public_html/periodic/notifies.php on line 63

I downloaded the fix for this and edited the code and added the sql but still nothing.

Anyone know what the problem is?

Regards,

Mario

Quote · 25 Oct 2009

Hey Mario,

Have you made any changes lately?

Has it worked before?

Quote · 25 Oct 2009

I thought that might be the problem so I rolled back the files to the install files and get this error.

 

Fatal error: require_once(): Failed opening required '[path_to]inc/header.inc.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/dailaan2/public_html/periodic/notifies.php on line 21

 

I realized that they are still un-registered so I guess my question is.... would this still happen with a registered version.

 

Mario

 

 

Quote · 25 Oct 2009

Ooops forgot to include the inc/ path.  now that that's fixed, with fresh straight from boonex files, I'm back to the first error.

Parse error: syntax error, unexpected T_VARIABLE in /home/dailaan2/public_html/periodic/notifies.php on line 63

when I run the php-q

Mario

Quote · 25 Oct 2009

header.inc.php

Is that a malformed filename?

Quote · 25 Oct 2009

here is the notifies.php I have . I highlighted Line 63 where the error starts

 

 

require_once( '/home/dailaan2/public_html/inc/header.inc.php' );
require_once( BX_DIRECTORY_PATH_INC . 'db.inc.php' );
require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' );
require_once( BX_DIRECTORY_PATH_INC . 'utils.inc.php' );

// -------------

// - Always finish
set_time_limit( 36000 );
ignore_user_abort();

// - Defaults -
$MODE = "_MAIL_";
$DAY = "_OBEY_";

// - Parameters check -
for ( $i = 0; strlen( $argv[$i] ); $i++ ) {
 switch( $argv[$i] ) {
  case '--live': $MODE = "_LIVE_"; break;
  case '--mail': $MODE = "_MAIL_"; break;
 }
}

// - Begin -
if ( $MODE == '_MAIL_' )
 ob_start();

$msgs_per_start = getParam( 'msgs_per_start' );

$iFullCount = (int)db_value( 'SELECT COUNT(*) FROM NotifyQueue', 0 );
if ( !$iFullCount ) exit;

echo "\n- Start email send -\n";
echo "Total queued emails: $iFullCount\n";
$total_count = ($iFullCount < $msgs_per_start ? $iFullCount : $msgs_per_start);
$total_per_query = round( $total_count / 3 ) + 1;
echo "Ready for send: ". $total_count ."\n";

if ( $iFullCount ) {
 $count_ok = 0;
 $err = 0;

 if ( $count_ok  $total_count ) {
  // Notify Messages
  $nfs_res = db_res("
   SELECT
    NotifyQueue.Email as ID1,
    NotifyQueue.Msg as ID2,
    NotifyEmails.Name as Name,
    NotifyEmails.Email,
    NotifyMsgs.Subj,
    NotifyMsgs.HTML as Body
   FROM NotifyQueue
   INNER JOIN NotifyMsgs ON
    (NotifyMsgs.ID =  NotifyQueue.Msg)
   INNER JOIN NotifyEmails ON
    (NotifyEmails.ID = NotifyQueue.Email)
   WHERE
    NotifyQueue.`From` = 'NotifyEmails' AND
    NotifyEmails.EmailFlag = 'NotifyMe'
   LIMIT $total_per_query
  ",0 );
  
  while( $row = mysql_fetch_array( $nfs_res ) )
  {
   $headers = "From: {$site['title']} {$site['email_notify']}>";
   $headers = "MIME-Version: 1.0\r\n" . "Content-type: text/html; charset=UTF-8\r\n" . $headers;
   if ( !mail( $row['Email'], $row['Subj'], $row['Body'], $headers, "-f{$site['email_notify']}") )
    ++$err;
      if ( $row[ID1] && $row[ID2] )
    db_res("DELETE FROM NotifyQueue WHERE `Email` = $row[ID1] AND `Msg` = $row[ID2] AND `From` = 'NotifyEmails'", 0 );
   else
    echo "ERROR: while deleting from 'NotifyQueue' ( Email ID: $row[ID1], Msg ID: $row[ID2] )\n";
   ++$count_ok;
   if ( $count_ok >= $total_count ) break;
  }
 }


 if ( $count_ok < $total_count ) {
     // Profiles Messages
  $nfs_res = db_res("
   SELECT
    NotifyQueue.Email as ID1,
    NotifyQueue.Msg as ID2,
    Profiles.NickName as Name,
    Profiles.Email,
    NotifyMsgs.Subj,
    NotifyMsgs.HTML as Body
   FROM NotifyQueue   
   INNER JOIN NotifyMsgs ON
    (NotifyMsgs.ID =  NotifyQueue.Msg)
   INNER JOIN Profiles ON
    (Profiles.ID = NotifyQueue.Email)
   WHERE
    NotifyQueue.`From` = 'Profiles' AND
    Profiles.EmailNotify  = '1'
   ",0 );
  
     while( $row = mysql_fetch_array( $nfs_res ) )
  {
   $headers = "From: {$site['title']} <{$site['email_notify']}>";
   $headers = "MIME-Version: 1.0\r\n" . "Content-type: text/html; charset=UTF-8\r\n" . $headers;
   if ( !mail( $row['Email'], $row['Subj'], $row['Body'], $headers, "-f{$site['email_notify']}") )
             ++$err;
      if ( $row[ID1] && $row[ID2] )
    db_res("DELETE FROM NotifyQueue WHERE Email = $row[ID1] AND Msg = $row[ID2] AND NotifyQueue.`From` = 'Profiles'", 0 );
         else
          echo "ERROR: while deleting from 'NotifyQueue' ( Email ID: $row[ID1], Msg ID: $row[ID2] )\n";
   ++$count_ok;
   if ( $count_ok >= $total_count ) break;
     }
 }

 

    if ( $count_ok < $total_count ) {
        // Profiles Messages
        $nfs_res = db_res("
   SELECT
    NotifyQueue.Email as ID1,
    NotifyQueue.Msg as ID2,
    NotifyQueue.MsgText as Body,
    NotifyQueue.MsgSubj as Subj,
    Profiles.NickName as Name,
    Profiles.Email
   FROM NotifyQueue
   INNER JOIN Profiles ON
    (Profiles.ID = NotifyQueue.Email)
   WHERE
    NotifyQueue.`From` = 'ProfilesMsgText' AND
    Profiles.EmailNotify  = '1'
   ",0);
  
        while( $row = mysql_fetch_array( $nfs_res ) )
        {
            $body = $row['Body'];
            $headers = "From: {$site['title']} <{$site['email_notify']}>";

            $headers = "MIME-Version: 1.0\r\n" . "Content-type: text/html; charset=UTF-8\r\n" . $headers;

            if ( !mail( $row['Email'], $row['Subj'], $body, $headers, "-f{$site['email_notify']}") )
                ++$err;
            if ( !db_res("DELETE FROM NotifyQueue WHERE Email = $row[ID1] AND NotifyQueue.`From` = 'ProfilesMsgText'", 0 ) )
                echo "ERROR: while deleting from 'NotifyQueue' ( Email ID: $row[ID1], Msg ID: $row[ID2] )\n";
            ++$count_ok;
            if ( $count_ok >= $total_count ) break;
        }
    }

 echo "Processed emails: $count_ok\n";
 echo "Processed emails with errors: $err\n";
}

if( $err and $MODE == '_MAIL_' ) {
 $output = ob_get_clean();
 mail( $site['email'], "{$site['title']}: Periodic Report (Notify Letters)", $output, "From: Periodic(Notify Letters) <$site[email]>", "-f$site[email]" );
}

periodic_check_ban();

 

 

 

 

Any Suggestions as to what's missing?

Quote · 25 Oct 2009

header.inc.php error was there because I replaced the file with the install file straight from boonex download package. After I put the path together correctly it's back to the first error. unexpected T_VARIABLE usually mean that something is missing or isn't complete. I just can't see it myself.

 

Mario

Quote · 25 Oct 2009
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.