Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: ssanner on April 12, 2006, 09:27:32 AM

Title: Parse Error in subs.php line 1035
Post by: ssanner 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
Title: Re: Parse Error in subs.php line 1035
Post by: kegobeer 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.
Title: Re: Parse Error in subs.php line 1035
Post by: ssanner 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


      $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.
Title: Re: Parse Error in subs.php line 1035
Post by: kegobeer 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.
Title: Re: Parse Error in subs.php line 1035
Post by: ssanner 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.
// 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
// 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
:(
Title: Re: Parse Error in subs.php line 1035
Post by: kegobeer on April 12, 2006, 11:39:44 AM
This is where your problem is:


      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?
Title: Re: Parse Error in subs.php line 1035
Post by: ssanner on April 12, 2006, 11:50:39 AM
I am running SMF 1.0.7, Mambo 4.5.2 and bridge 3.19
Quote from: kegobeer on April 12, 2006, 11:39:44 AM
This is where your problem is:


      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?
Title: Re: Parse Error in subs.php line 1035
Post by: kegobeer on April 12, 2006, 12:02:41 PM
This is the line that should be at 1035:


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.
Title: Re: Parse Error in subs.php line 1035
Post by: Kindred on April 12, 2006, 01:15:31 PM
ssanner... please do not start mutlipel threads on the same topic!
Title: Re: Parse Error in subs.php line 1035
Post by: ssanner 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.  :-[
Title: Re: Parse Error in subs.php line 1035
Post by: Orstio 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....