[ERROR]

Support for the phpBB3 SEO mods released in the phpBB3 SEO Toolikt forum.

Moderator: Moderators

[ERROR]

Postby Howe » Thu Jan 14, 2010 11:51 am

I'm getting this error when trying to view the ACP index.php or board index.php

Code: Select all
Parse error: syntax error, unexpected T_ELSE in /*************/phpbb_seo/phpbb_seo_class.php on line 345


line 344 is
Code: Select all
else {


and this is after the inserted code
Code: Select all
$this->seo_stats['format_url_time'] = $this->seo_stats['format_url_time'] + ($this->microtime_float() - $startime);
         $this->seo_stats['format_url_num']++;


so the old area of code looks like,
Code: Select all
            // stats
      $startime = $this->microtime_float();
         $username = strip_tags($username);
         $this->seo_url['username'][$username] = $user_id;
         if ( $this->seo_opt['profile_inj'] ) {
            if ( $this->seo_opt['profile_noids'] ) {
               $this->seo_url['user'][$user_id] = $this->seo_static['user'] . '/' . $this->seo_url_encode($username);
            } else {
               $this->seo_url['user'][$user_id] = $this->format_url($username,  $this->seo_delim['user']) . $this->seo_delim['user'] . $user_id;
            }
         }   
         $this->seo_stats['format_url_time'] = $this->seo_stats['format_url_time'] + ($this->microtime_float() - $startime);
         $this->seo_stats['format_url_num']++;            
         else {
            $this->seo_url['user'][$user_id] = $this->seo_static['user'] . $user_id;
         }
      }
   }
   


Is this correct, just i'm not sure why i'm getting the error.
Thanks
Howe
 
Posts: 9
Joined: Tue Nov 03, 2009 5:14 pm

Advertisement

Re: [ERROR]

Postby HB » Thu Jan 14, 2010 7:46 pm

Parse error: syntax error

Please post the lines before and after this line number.
Dan Kehn
HB
phpBB SEO Team
phpBB SEO Team
 
Posts: 1567
Joined: Mon Oct 16, 2006 2:25 am

Re: [ERROR]

Postby Howe » Mon Jan 18, 2010 11:58 pm

I fixed that error thanks. :)

But i've now noticed i have this error when "Purghing Cache"
Fatal error: Call to undefined function utf8_str_replace() in /**/includes/db/dbal.php on line 238

line 238
Code: Select all
   $expression = utf8_str_replace(array('_', '%'), array("\_", "\%"), $expression);


Code: Select all
/**
   * Correctly adjust LIKE expression for special characters
   * Some DBMS are handling them in a different way
   *
   * @param string $expression The expression to use. Every wildcard is escaped, except $this->any_char and $this->one_char
   * @return string LIKE expression including the keyword!
   */
   function sql_like_expression($expression)
   {
      $expression = utf8_str_replace(array('_', '%'), array("\_", "\%"), $expression);
      $expression = utf8_str_replace(array(chr(0) . "\_", chr(0) . "\%"), array('_', '%'), $expression)

      return $this->_sql_like_expression('LIKE \'' . $this->sql_escape($expression) . '\'');
   }

   /**
   * SQL Transaction
   * @access private
   */
   function sql_transaction($status = 'begin')
   {
      switch ($status)
      {
         case 'begin':
            // If we are within a transaction we will not open another one, but enclose the current one to not loose data (prevening auto commit)
            if ($this->transaction)
            {
               $this->transactions++;
               return true;
            }

            $result = $this->_sql_transaction('begin');

            if (!$result)
            {
               $this->sql_error();
            }

            $this->transaction = true;
         break;

         case 'commit':
            // If there was a previously opened transaction we do not commit yet... but count back the number of inner transactions
            if ($this->transaction && $this->transactions)
            {
               $this->transactions--;
               return true;
            }
Howe
 
Posts: 9
Joined: Tue Nov 03, 2009 5:14 pm

Re: [ERROR]

Postby dcz » Sat Mar 27, 2010 3:28 pm

Howe wrote:and this is after the inserted code
Code: Select all
$this->seo_stats['format_url_time'] = $this->seo_stats['format_url_time'] + ($this->microtime_float() - $startime);
         $this->seo_stats['format_url_num']++;



It looks like you're using the old phpBB3 SEO Stats Mod V 1.0.1 mod. Since it was not updated for a while now, it for sure requires some tweaking to work with latest versions (not that this is impossible).

About clearing cache, I'm not sure, utf8_str_replace should be defined at all times when common.php is included, are you using a custom way to clear your cache ?
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21428
Joined: Fri Apr 28, 2006 9:03 pm


Return to phpBB SEO MODS

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 5 guests