unexpected T_VARIABLE in notifies.php on line 63

does anyone have a fix for this?

 

1: <?
  2:    3: /***************************************************************************
   4: *                            Dolphin Smart Community Builder
   5: *                              -----------------
   6: *     begin                : Mon Mar 23 2006
   7: *     copyright            : (C) 2006 BoonEx Group
   8: *     website              : http://www.boonex.com/
   9: * This file is part of Dolphin - Smart Community Builder
  10: *
  11: * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License.
  12: * http://creativecommons.org/licenses/by/3.0/
  13: *
  14: * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  15: * without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  16: * See the Creative Commons Attribution 3.0 License for more details.
  17: * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin,
  18: * see license.txt file; if not, write to marketing@boonex.com
  19: ***************************************************************************/
  20:
  21: require_once( '/home/dailaan2/public_html/inc/header.inc.php' );
  22: require_once( BX_DIRECTORY_PATH_INC . 'db.inc.php' );
  23: require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' );
  24: require_once( BX_DIRECTORY_PATH_INC . 'utils.inc.php' );
  25:
  26: // -------------
  27:
  28: // - Always finish
  29: set_time_limit( 36000 );
  30: ignore_user_abort();
  31:
  32: // - Defaults -
  33: $MODE = "_MAIL_";
  34: $DAY = "_OBEY_";
  35:
  36: // - Parameters check -
  37: for ( $i = 0; strlen( $argv[$i] ); $i++ ) {
  38: switch( $argv[$i] ) {
  39: case '--live': $MODE = "_LIVE_"; break;
  40: case '--mail': $MODE = "_MAIL_"; break;
  41: }
  42: }
  43:
  44: // - Begin -
  45: if ( $MODE == '_MAIL_' )
  46: ob_start();
  47:
  48: $msgs_per_start = getParam( 'msgs_per_start' );
  49:
  50: $iFullCount = (int)db_value( 'SELECT COUNT(*) FROM NotifyQueue', 0 );
  51: if ( !$iFullCount ) exit;
  52:
  53: echo "\n- Start email send -\n";
  54: echo "Total queued emails: $iFullCount\n";
  55: $total_count = ($iFullCount < $msgs_per_start ? $iFullCount : $msgs_per_start);
  56: $total_per_query = round( $total_count / 3 ) + 1;
  57: echo "Ready for send: ". $total_count ."\n";
  58:
  59: if ( $iFullCount ) {
  60: $count_ok = 0;
  61: $err = 0;
  62:
  63: if ( $count_ok  $total_count ) {
  64: // Notify Messages
  65: $nfs_res = db_res("
  66: SELECT
  67: NotifyQueue.Email as ID1,
  68: NotifyQueue.Msg as ID2,
  69: NotifyEmails.Name as Name,
  70: NotifyEmails.Email,
  71: NotifyMsgs.Subj,
  72: NotifyMsgs.HTML as Body
  73: FROM NotifyQueue
  74: INNER JOIN NotifyMsgs ON
  75: (NotifyMsgs.ID =  NotifyQueue.Msg)
  76: INNER JOIN NotifyEmails ON
  77: (NotifyEmails.ID = NotifyQueue.Email)
  78: WHERE
  79: NotifyQueue.`From` = 'NotifyEmails' AND
  80: NotifyEmails.EmailFlag = 'NotifyMe'
  81: LIMIT $total_per_query
  82: ",0 );
  83:
  84: while( $row = mysql_fetch_array( $nfs_res ) )
  85: {
  86: $headers = "From: {$site['title']} {$site['email_notify']}>";
  87: $headers = "MIME-Version: 1.0\r\n" . "Content-type: text/html; charset=UTF-8\r\n" . $headers;
  88: if ( !mail( $row['Email'], $row['Subj'], $row['Body'], $headers, "-f{$site['email_notify']}") )
  89: ++$err;
  90:     if ( $row[ID1] && $row[ID2] )
  91: db_res("DELETE FROM NotifyQueue WHERE `Email` = $row[ID1] AND `Msg` = $row[ID2] AND `From` = 'NotifyEmails'", 0 );
  92: else
  93: echo "ERROR: while deleting from 'NotifyQueue' ( Email ID: $row[ID1], Msg ID: $row[ID2] )\n";
  94: ++$count_ok;
  95: if ( $count_ok >= $total_count ) break;
  96: }
  97: }
  98:
  99:
 100: if ( $count_ok < $total_count ) {
 101:     // Profiles Messages
 102: $nfs_res = db_res("
 103: SELECT
 104: NotifyQueue.Email as ID1,
 105: NotifyQueue.Msg as ID2,
 106: Profiles.NickName as Name,
 107: Profiles.Email,
 108: NotifyMsgs.Subj,
 109: NotifyMsgs.HTML as Body
 110: FROM NotifyQueue
 111: INNER JOIN NotifyMsgs ON
 112: (NotifyMsgs.ID =  NotifyQueue.Msg)
 113: INNER JOIN Profiles ON
 114: (Profiles.ID = NotifyQueue.Email)
 115: WHERE
 116: NotifyQueue.`From` = 'Profiles' AND
 117: Profiles.EmailNotify  = '1'
 118: ",0 );
 119:
 120:     while( $row = mysql_fetch_array( $nfs_res ) )
 121: {
 122: $headers = "From: {$site['title']} <{$site['email_notify']}>";
 123: $headers = "MIME-Version: 1.0\r\n" . "Content-type: text/html; charset=UTF-8\r\n" . $headers;
 124: if ( !mail( $row['Email'], $row['Subj'], $row['Body'], $headers, "-f{$site['email_notify']}") )
 125:             ++$err;
 126:     if ( $row[ID1] && $row[ID2] )
 127: db_res("DELETE FROM NotifyQueue WHERE Email = $row[ID1] AND Msg = $row[ID2] AND NotifyQueue.`From` = 'Profiles'", 0 );
 128:         else
 129:         echo "ERROR: while deleting from 'NotifyQueue' ( Email ID: $row[ID1], Msg ID: $row[ID2] )\n";
 130: ++$count_ok;
 131: if ( $count_ok >= $total_count ) break;
 132:     }
 133: }
 134:
 135:
 136:
 137:     if ( $count_ok < $total_count ) {
 138:         // Profiles Messages
 139:         $nfs_res = db_res("
 140: SELECT
 141: NotifyQueue.Email as ID1,
 142: NotifyQueue.Msg as ID2,
 143: NotifyQueue.MsgText as Body,
 144: NotifyQueue.MsgSubj as Subj,
 145: Profiles.NickName as Name,
 146: Profiles.Email
 147: FROM NotifyQueue
 148: INNER JOIN Profiles ON
 149: (Profiles.ID = NotifyQueue.Email)
 150: WHERE
 151: NotifyQueue.`From` = 'ProfilesMsgText' AND
 152: Profiles.EmailNotify  = '1'
 153: ",0);
 154:
 155:         while( $row = mysql_fetch_array( $nfs_res ) )
 156:         {
 157:             $body = $row['Body'];
 158:             $headers = "From: {$site['title']} <{$site['email_notify']}>";
 159:
 160:            $headers = "MIME-Version: 1.0\r\n" . "Content-type: text/html; charset=UTF-8\r\n" . $headers;
 161:
 162:             if ( !mail( $row['Email'], $row['Subj'], $body, $headers, "-f{$site['email_notify']}") )
 163:                 ++$err;
 164:             if ( !db_res("DELETE FROM NotifyQueue WHERE Email = $row[ID1] AND NotifyQueue.`From` = 'ProfilesMsgText'", 0 ) )
 165:                 echo "ERROR: while deleting from 'NotifyQueue' ( Email ID: $row[ID1], Msg ID: $row[ID2] )\n";
 166:             ++$count_ok;
 167:             if ( $count_ok >= $total_count ) break;
 168:         }
 169:     }
 170:
 171: echo "Processed emails: $count_ok\n";
 172: echo "Processed emails with errors: $err\n";
 173: }
 174:
 175: if( $err and $MODE == '_MAIL_' ) {
 176: $output = ob_get_clean();
 177: mail( $site['email'], "{$site['title']}: Periodic Report (Notify Letters)", $output, "From: Periodic(Notify Letters) <$site[email]>", "-f$site[email]" );
 178: }
 179:
 180: periodic_check_ban();
 181:

Quote · 26 Oct 2009

I really don't think anyone is going to read threw this complete code,,why don'y you just post the issue??

Quote · 26 Oct 2009

He did post the issue, even pointed out line 63 and the issue is right there.

 

Forgot to close out what you opened.

 

 59: if ( $iFullCount ) {
  60: $count_ok = 0;
  61: $err = 0;
  62:
  63: if ( $count_ok  $total_count ) {
  64: // Notify Messages
  65: $nfs_res = db_res("
  66: SELECT
  67: NotifyQueue.Email as ID1,
  68: NotifyQueue.Msg as ID2,

Now Mario, do you see on line 59 you open a set of {

 

But you failed to close it, and then on line 63 you try to open another set of { 

 

Not sure what mod your trying to install here and I'll be happy to help you get this where it belongs, but it'd be nice to know what you were doing that caused this in the first place.  I see about 70 lines of code missing from this file right now as it stands.

Quote · 26 Oct 2009

believe it or not all I did was open it in dreamweaver to view the code. I did change the inc/header.inc.php path but that's it then hit save. For whatever reason Stupid dreamweaver is adding things.

I just uploaded a fresh file straight from the download package... tested it here

http://www.meandeviation.com/tutorials/learnphp/php-syntax-check/

which passed. then I opened it with dreamweaver hit save and checked it again and it had the Line 63 error.

So to fix the issue I uploaded the untouched boonex file straight from the release and then opened it in ssh executed the vi command on the file and edited the inc/header.inc.php path manually through ssh then :wq and boom the damn thing works like a charm.

Anyone know why dreamweaver is sucking a big one?

 

Mario

Quote · 26 Oct 2009

Try and close the line with ";"

Quote · 26 Oct 2009

I already tried that and it didn't work, but I got it working. Just didn't use dreamweaver and used vi to edit the inc/path and file worked fine. Appearantly dreamweaver is for static pages and doesn't vibe well with boonex php script. the fix is to use a differant editor and I've been advised to use notepad++

 

Mario

Quote · 26 Oct 2009

Dreamwaever or any editor like that adds extra code onto the page...notepad is a great way to do it..Cool

Quote · 26 Oct 2009

If you changed nothing yourself in this, then grab a fresh copy of the periodic/notifies.php file from your Dolphin Zip package and upload that, it will fix the issue for you. 

 

In the future use Notepad++ and make sure your FTP is set to Binary upload only.

 

Good Luck.

Quote · 26 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.