Advertisement:

Author Topic: Parse Error in subs.php line 1035  (Read 10650 times)

Offline ssanner

  • Semi-Newbie
  • *
  • Posts: 28
Parse Error in subs.php line 1035
« on: April 12, 2006, 09:27:32 AM »
Hi guys,

Totally new to PHP and not sure what to correct, this is the line in question:
$ce, '[') && !strstr($message, '://') && !strstr($message, '@') && !strstr($message, '/me') && !strstr($message, '<'))
      return;


could anyone tell me how to correct this pls?   url: www.epsomvideo.co.uk/forum
thx a lot

Offline kegobeer

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,994
  • Gender: Male
  • I am ninja!
    • The Kazebeer Family Website
Re: Parse Error in subs.php line 1035
« Reply #1 on: April 12, 2006, 09:34:39 AM »
What modifications have you made to the SMF files?  Also, please post several lines above the line and several lines below.  Make sure to use the code tags when you post your code.
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

Offline ssanner

  • Semi-Newbie
  • *
  • Posts: 28
Re: Parse Error in subs.php line 1035
« Reply #2 on: April 12, 2006, 09:51:59 AM »
This is a copy of the sub.php file, parse error on line 1035, unexpected ','

code given here from line 1016
Code: [Select]

      $codefromcache = array_keys($code_to_from);
      $codetocache = array_values($code_to_from);

      // GLOWING or /shadowed/ text.
      $codefromcache[] = '~\[glow=([#\w]{3,12}),([012]\d{1,2}|\d{1,2})(,[^]]+)?\](.+?)\[/glow\]~i';
      $codetocache[] = isset($disabled['glow']) ? '$4' : '<table border="0" cellpadding="0" cellspacing="0" style="display: inline; vertical-align: middle; font: inherit;"><tr><td style="filter: Glow(color=$1, strength=$2); font: inherit;">$4</td></tr></table> ';
      $codefromcache[] = '~\[shadow=([#\w]{3,12}),(left|right|top|bottom|[0123]\d{0,2})\](.+?)\[/shadow\]~ei';
      $codetocache[] = isset($disabled['shadow']) ? 'strtr(\'$3\', array(\'\\"\' => \'"\'))' : '\'<table border="0" cellpadding="0" cellspacing="0" style="display: inline; vertical-align: middle; font: inherit;"><tr><td style="filter: Shadow(color=$1, direction=\' . (isset($shadow_directions[\'$2\']) ? $shadow_directions[\'$2\'] : (int) \'$2\') . \'); font: inherit;">\' . strtr(\'$3\', array(\'\\"\' => \'"\')) . \'</td></tr></table> \'';

      // Moving text... stuff      $codefromcache[] = '~\[move\](.+?)\[/move\]~i';
      $codetocache[] = isset($disabled['move']) ? '$1' : '<marquee>$1</marquee>';

      // Handle flash.
      $codefromcache[] = '~\[flash=(\d+),(\d+)\](?:<br />)*([^<>]+?)(?:<br />)*\[/flash\]~ie';
      if (empty($modSettings['enableEmbeddedFlash']) || isset($disabled['flash']))
         $codetocache[] = isset($disabled['url']) ? '"$3"' : '"<a href=\"" . strtr("$3", array("\"" => "&quot;")) . "\" target=\"_blank\">$3</a>"';
      // Internet Explorer for Windows.
      elseif ($context['browser']['is_ie'] && !$context['browser']['is_mac_ie'])
         $ce, '[') && !strstr($message, '://') && !strstr($message, '@') && !strstr($message, '/me') && !strstr($message, '&lt;'))
      return;

   $message = strtr($message, array('$' => '&#036;'));

   // Replace <a href="something">somewhere</a> with HTML.
   if (!empty($modSettings['enablePostHTML']) && strstr($message, '&lt;'))
I did modification of index.php + subs.php files as indicated in the step by step.
« Last Edit: April 12, 2006, 10:49:17 AM by ssanner »

Offline kegobeer

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,994
  • Gender: Male
  • I am ninja!
    • The Kazebeer Family Website
Re: Parse Error in subs.php line 1035
« Reply #3 on: April 12, 2006, 09:57:10 AM »
Re-read the instructions on how to modify Subs.php.  Your modification is incorrect, but I don't have any experience with this mod so I can't tell you exactly what you should have done.
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

Offline ssanner

  • Semi-Newbie
  • *
  • Posts: 28
Re: Parse Error in subs.php line 1035
« Reply #4 on: April 12, 2006, 10:41:59 AM »
Ok I have replaced subs.php file with a back-up file, i re-entered the correct hacks as explained in mambo-mod file.
Code: [Select]
// Put the session ID in.
   if (defined('SID') && SID != '')
      $setLocation = preg_replace('/' . preg_quote($scripturl, '/') . '(?!\?' . preg_quote(SID, '/') . ')(\?)?/', $scripturl . '?' . SID . '&', $setLocation);

if (function_exists('mambo_smf_url'))
      $setLocation = mambo_smf_url($setLocation);

and
Code: [Select]
// Don't exit if we're coming from index.php; that will pass through normally.
if (!$from_index || WIRELESS)
{
if (function_exists('mambo_smf_exit'))
mambo_smf_exit($do_footer && !WIRELESS);
else
exit;
}
Saved the new sub file in my forum Sources directory. I am still getting :
Parse error: parse error, unexpected ',' in /var/www/vhosts/epsomvideo.co.uk/httpdocs/forum/Sources/Subs.php on line 1035
 :(

Offline kegobeer

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,994
  • Gender: Male
  • I am ninja!
    • The Kazebeer Family Website
Re: Parse Error in subs.php line 1035
« Reply #5 on: April 12, 2006, 11:39:44 AM »
This is where your problem is:

Code: [Select]
      elseif ($context['browser']['is_ie'] && !$context['browser']['is_mac_ie'])
         $ce, '[') && !strstr($message, '://') && !strstr($message, '@') && !strstr($message, '/me') && !strstr($message, '&lt;'))


Specifically, the line that starts with $ce is the problem.  You need to correct whatever changed those lines.  What version of SMF are you running?
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

Offline ssanner

  • Semi-Newbie
  • *
  • Posts: 28
Re: Parse Error in subs.php line 1035
« Reply #6 on: April 12, 2006, 11:50:39 AM »
I am running SMF 1.0.7, Mambo 4.5.2 and bridge 3.19
This is where your problem is:

Code: [Select]
      elseif ($context['browser']['is_ie'] && !$context['browser']['is_mac_ie'])
         $ce, '[') && !strstr($message, '://') && !strstr($message, '@') && !strstr($message, '/me') && !strstr($message, '&lt;'))


Specifically, the line that starts with $ce is the problem.  You need to correct whatever changed those lines.  What version of SMF are you running?

Offline kegobeer

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,994
  • Gender: Male
  • I am ninja!
    • The Kazebeer Family Website
Re: Parse Error in subs.php line 1035
« Reply #7 on: April 12, 2006, 12:02:41 PM »
This is the line that should be at 1035:

Code: [Select]
elseif ($context['browser']['is_ie'] && !$context['browser']['is_mac_ie'])
$codetocache[] = '"<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"$1\" height=\"$2\"><param name=\"movie\" value=\"" . strtr("$3", array("\"" => "&quot;")) . "\" /><param name=\"play\" value=\"true\" /><param name=\"loop\" value=\"true\" /><param name=\"quality\" value=\"high\" /><param name=\"AllowScriptAccess\" value=\"never\" /><embed src=\"" . strtr("$3", array("\"" => "&quot;")) . "\" width=\"$1\" height=\"$2\" play=\"true\" loop=\"true\" quality=\"high\" AllowScriptAccess=\"never\" /><noembed><a href=\"" . strtr("$3", array("\"" => "&quot;")) . "\" target=\"_blank\">$3</a></noembed></object>"';

If your mod changes it, then you need to apply the correct changes.
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,500
  • Gender: Male
    • Kindred-999 on GitHub
Re: Parse Error in subs.php line 1035
« Reply #8 on: April 12, 2006, 01:15:31 PM »
ssanner... please do not start mutlipel threads on the same topic!
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline ssanner

  • Semi-Newbie
  • *
  • Posts: 28
Re: Parse Error in subs.php line 1035
« Reply #9 on: April 12, 2006, 03:05:24 PM »
i replaced line 1035 with right code and now I am getting another error.  i give-up it is too complicated for me/ thanks for your help though.  :-[

Orstio

  • Guest
Re: Parse Error in subs.php line 1035
« Reply #10 on: April 12, 2006, 05:34:45 PM »
Why was this posted in the Mambo/Joomla bridge board?  This has nothing to do with the bridge....