The problem with STK

phpBB SEO Premod for phpBB3 support forum.
This premodded version of phpBB3 includes the three different type of URL rewriting for phpBB3 by phpBB SEO. It comes with several other Search Engine Optimization mods installed.

Moderator: Moderators

The problem with STK

Postby natalia » Thu Feb 10, 2011 6:15 pm

I downloaded STK and dropped files, and when I go in I have this error
Code: Select all
    [phpBB Debug] PHP Notice: in file /includes/functions.php on line 4306: Trying to get property of non-object
    [phpBB Debug] PHP Notice: in file /includes/functions.php on line 4307: Trying to get property of non-object
    [phpBB Debug] PHP Notice: in file /includes/functions.php on line 4308: Trying to get property of non-object
    [phpBB Debug] PHP Notice: in file /includes/functions.php on line 4309: Trying to get property of non-object
    [phpBB Debug] PHP Notice: in file /includes/functions.php on line 4310: Trying to get property of non-object
    [phpBB Debug] PHP Notice: in file /includes/functions.php on line 4315: Trying to get property of non-object

    Fatal error: Call to a member function build_meta() on a non-object in /home/public_html/includes/functions.php on line 4323


http://www.phpbb.com/customise/db/offic ... ct-t_89949
natalia
 
Posts: 9
Joined: Thu Feb 10, 2011 6:13 pm

Advertisement

Re: The problem with STK

Postby josediogenes » Fri Feb 11, 2011 1:53 am

You have to make some manual replacements over the modified phpbbseo files.

First of all open the file includes/functions.php and find this
Code: Select all
// www.phpBB-SEO.com SEO TOOLKIT BEGIN  - META
   global $seo_meta;
   $seo_meta->build_meta($page_title);
   // www.phpBB-SEO.com SEO TOOLKIT END  - META


Replace for:
Code: Select all
// www.phpBB-SEO.com SEO TOOLKIT BEGIN  - META
   global $seo_meta;
   if (isset($seo_meta->build_meta)) {
   $seo_meta->build_meta($page_title);}
   // www.phpBB-SEO.com SEO TOOLKIT END  - META


Open includes/functions_posting.php

Find this:
Code: Select all
   // www.phpBB-SEO.com SEO TOOLKIT BEGIN
   
   $phpbb_seo->set_url($data['forum_name'], $data['forum_id'], 'forum');
   if ( $params ) {
   $phpbb_seo->prepare_iurl($data, 'topic', $topic_type == POST_GLOBAL ? $phpbb_seo->seo_static['global_announce'] : $phpbb_seo->seo_url['forum'][$data['forum_id']]);
   }
   // www.phpBB-SEO.com SEO TOOLKIT END


Replace for:
Code: Select all
   // www.phpBB-SEO.com SEO TOOLKIT BEGIN
   if (isset($phpbb_seo->set_url)) {
   $phpbb_seo->set_url($data['forum_name'], $data['forum_id'], 'forum');}
   if ( $params ) {
   if (isset($phpbb_seo->prepare_iurl)) {
      $phpbb_seo->prepare_iurl($data, 'topic', $topic_type == POST_GLOBAL ? $phpbb_seo->seo_static['global_announce'] : $phpbb_seo->seo_url['forum'][$data['forum_id']]);}
   }
   // www.phpBB-SEO.com SEO TOOLKIT END


Open includes/functions_content.php

Find this:
Code: Select all
   // www.phpBB-SEO.com SEO TOOLKIT BEGIN
            // $profile_url = ($custom_profile_url !== false) ? $custom_profile_url . '&u=' . (int) $user_id : str_replace(array('={USER_ID}', '=%7BUSER_ID%7D'), '=' . (int) $user_id, $_profile_cache['base_url']);
            global $phpbb_seo, $phpbb_root_path, $phpEx;
            $phpbb_seo->set_user_url( $username, $user_id );
            if ($custom_profile_url !== false) {
               $profile_url = reapply_sid($custom_profile_url . (strpos($custom_profile_url, '?') !== false ?  '&' : '?' ) . 'u=' . (int) $user_id);
            } else {
               $profile_url = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . (int) $user_id);
            }
            // www.phpBB-SEO.com SEO TOOLKIT END


Replace for:
Code: Select all
   // www.phpBB-SEO.com SEO TOOLKIT BEGIN
            // $profile_url = ($custom_profile_url !== false) ? $custom_profile_url . '&u=' . (int) $user_id : str_replace(array('={USER_ID}', '=%7BUSER_ID%7D'), '=' . (int) $user_id, $_profile_cache['base_url']);
            global $phpbb_seo, $phpbb_root_path, $phpEx;
            if (isset($phpbb_seo->set_user_url)) {
            $phpbb_seo->set_user_url( $username, $user_id );}
            if ($custom_profile_url !== false) {
               $profile_url = reapply_sid($custom_profile_url . (strpos($custom_profile_url, '?') !== false ?  '&' : '?' ) . 'u=' . (int) $user_id);
            } else {
               $profile_url = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . (int) $user_id);
            }
            // www.phpBB-SEO.com SEO TOOLKIT END


I´m currently using phpBB 3.0.7 with premoded phpbb-seo
josediogenes
 
Posts: 9
Joined: Fri Aug 13, 2010 9:48 pm

Re: The problem with STK

Postby natalia » Fri Feb 11, 2011 9:44 am

does not work :(

Code: Select all
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4306: Trying to get property of non-object
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4307: Trying to get property of non-object
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4308: Trying to get property of non-object
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4309: Trying to get property of non-object
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4310: Trying to get property of non-object
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4315: Trying to get property of non-object
[phpBB Debug] PHP Notice: in file /gym_sitemaps/includes/gym_common.php on line 110: Trying to get property of non-object
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4552: Trying to get property of non-object
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4649: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3755)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4651: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3755)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4652: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3755)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4653: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3755)
natalia
 
Posts: 9
Joined: Thu Feb 10, 2011 6:13 pm

Re: The problem with STK

Postby josediogenes » Fri Feb 11, 2011 11:46 am

natalia wrote:does not work :(

Code: Select all
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4306: Trying to get property of non-object
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4307: Trying to get property of non-object
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4308: Trying to get property of non-object
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4309: Trying to get property of non-object
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4310: Trying to get property of non-object
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4315: Trying to get property of non-object
[phpBB Debug] PHP Notice: in file /gym_sitemaps/includes/gym_common.php on line 110: Trying to get property of non-object
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4552: Trying to get property of non-object
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4649: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3755)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4651: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3755)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4652: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3755)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4653: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3755)


What version of phpbb-seo are you using?

In essence what you have to do is to put the phpbb-seo objects calls whithin conditional checks like:
Code: Select all
if (isset(obj)) {call obj}


For the "Cannot modify header information" check if you have no new line after "?>" at the end of functions.php
josediogenes
 
Posts: 9
Joined: Fri Aug 13, 2010 9:48 pm

Re: The problem with STK

Postby natalia » Fri Feb 11, 2011 12:24 pm

I installed phpBB 3.0.8 Premod
I have not installed any modifications

I checked functions.php and it is well
natalia
 
Posts: 9
Joined: Thu Feb 10, 2011 6:13 pm

Re: The problem with STK

Postby josediogenes » Fri Feb 11, 2011 12:49 pm

natalia wrote:I installed phpBB 3.0.8 Premod
I have not installed any modifications

I checked functions.php and it is well


Humm,. I got stk working on 3.0.7 premod. I have to look through the 3.0.8 functions.php file for any malformed object calls.
josediogenes
 
Posts: 9
Joined: Fri Aug 13, 2010 9:48 pm

Re: The problem with STK

Postby natalia » Fri Feb 11, 2011 1:39 pm

Thank you for help.

Install phpBB 3.0.8 with phpbb.com
With phpBB Premod are problems :|
natalia
 
Posts: 9
Joined: Thu Feb 10, 2011 6:13 pm

Re: The problem with STK

Postby josediogenes » Fri Feb 11, 2011 1:44 pm

natalia wrote:Thank you for help.

Install phpBB 3.0.8 with phpbb.com
With phpBB Premod are problems :|


No doubt. The problem is a conflict between phpbb-seo and STK, due to lack of objects conditional tags. When I get home I´ll assist you. :)
josediogenes
 
Posts: 9
Joined: Fri Aug 13, 2010 9:48 pm

Re: The problem with STK

Postby natalia » Fri Feb 11, 2011 3:01 pm

OK, thank you :)
natalia
 
Posts: 9
Joined: Thu Feb 10, 2011 6:13 pm

Re: The problem with STK

Postby josediogenes » Fri Feb 11, 2011 10:56 pm

OK, so let´s try again:

Open includes/functions.php

Find:
Code: Select all
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
   // We bypass the hook function here, the same effect as a standalone hook, which we want, but faster ;-)
   global $phpbb_seo;
   if (!empty($phpbb_seo->seo_opt['url_rewrite'])) {
      return $phpbb_seo->url_rewrite($url, $params, $is_amp, $session_id);
   } else
   // www.phpBB-SEO.com SEO TOOLKIT END


Replace for:
Code: Select all
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
   // We bypass the hook function here, the same effect as a standalone hook, which we want, but faster ;-)
   global $phpbb_seo;
       if (isset($phpbb_seo->url_rewrite)) {
   if (!empty($phpbb_seo->seo_opt['url_rewrite'])) {
      return $phpbb_seo->url_rewrite($url, $params, $is_amp, $session_id);}
   } else
   // www.phpBB-SEO.com SEO TOOLKIT END


Find:
Code: Select all
// www.phpBB-SEO.com SEO TOOLKIT BEGIN  - META
   global $seo_meta;
   $seo_meta->build_meta($page_title);
   // www.phpBB-SEO.com SEO TOOLKIT END  - META


Replace for:
Code: Select all
// www.phpBB-SEO.com SEO TOOLKIT BEGIN  - META
   global $seo_meta;
   if(isset($seo_meta->build_meta)){
$seo_meta->build_meta($page_title);}
   // www.phpBB-SEO.com SEO TOOLKIT END  - META



Open includes/function_content.php

Find:
Code: Select all
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
            // $profile_url = ($custom_profile_url !== false) ? $custom_profile_url . '&u=' . (int) $user_id : str_replace(array('={USER_ID}', '=%7BUSER_ID%7D'), '=' . (int) $user_id, $_profile_cache['base_url']);
            global $phpbb_seo, $phpbb_root_path, $phpEx;
            $phpbb_seo->set_user_url( $username, $user_id );
            if ($custom_profile_url !== false) {
               $profile_url = reapply_sid($custom_profile_url . (strpos($custom_profile_url, '?') !== false ?  '&' : '?' ) . 'u=' . (int) $user_id);
            } else {
               $profile_url = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . (int) $user_id);
            }
            // www.phpBB-SEO.com SEO TOOLKIT END


Replace for:
Code: Select all
            // www.phpBB-SEO.com SEO TOOLKIT BEGIN
            // $profile_url = ($custom_profile_url !== false) ? $custom_profile_url . '&u=' . (int) $user_id : str_replace(array('={USER_ID}', '=%7BUSER_ID%7D'), '=' . (int) $user_id, $_profile_cache['base_url']);
            global $phpbb_seo, $phpbb_root_path, $phpEx;
            if (isset($phpbb_seo->set_user_url)){
            $phpbb_seo->set_user_url( $username, $user_id );}
            if ($custom_profile_url !== false) {
               $profile_url = reapply_sid($custom_profile_url . (strpos($custom_profile_url, '?') !== false ?  '&' : '?' ) . 'u=' . (int) $user_id);
            } else {
               $profile_url = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . (int) $user_id);
            }
            // www.phpBB-SEO.com SEO TOOLKIT END


Try this and post the results. ;-)
josediogenes
 
Posts: 9
Joined: Fri Aug 13, 2010 9:48 pm

Re: The problem with STK

Postby SeO » Sun Feb 13, 2011 12:38 pm

A simpler way to do the same would be to add the same code in /root/tk/common.php than you did in /root/common.php.
SeO
Admin
Admin
 
Posts: 6334
Joined: Wed Mar 15, 2006 9:41 pm

Re: The problem with STK

Postby josediogenes » Sun Feb 13, 2011 1:21 pm

SeO wrote:A simpler way to do the same would be to add the same code in /root/tk/common.php than you did in /root/common.php.


Exactly. Natalia, try this:
Open /stk/common.php

Find
Code: Select all
{
   // Fall back to the internal UMIL
   require STK_ROOT_PATH . 'includes/umil.' . PHP_EXT;
}


Add after

Code: Select all
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
if (empty($phpbb_seo) ) {
   require_once($phpbb_root_path . 'phpbb_seo/phpbb_seo_class.'.$phpEx);
   $phpbb_seo = new phpbb_seo();
   @define('PHPBB_USE_BOARD_URL_PATH', true);
}
// www.phpBB-SEO.com SEO TOOLKIT END
// www.phpBB-SEO.com SEO TOOLKIT BEGIN - META
require_once($phpbb_root_path . 'phpbb_seo/phpbb_seo_meta.'.$phpEx);
$seo_meta = new seo_meta();
// www.phpBB-SEO.com SEO TOOLKIT END - META


Save and close.

This will load every phpbb-seo classes into stk. Its a trick way to do, but should work. It´d be unnecessary if all object calls was conditioned whitin phpbb-seo code. Next version, maybe.
ThankYou, SeO.
josediogenes
 
Posts: 9
Joined: Fri Aug 13, 2010 9:48 pm

Re: The problem with STK

Postby SeO » Mon Feb 14, 2011 7:46 am

Well, what Erik Frèrejean says here is not very rational to me.

As an emergency toolkit, the stk should be the one to try to lower the dependencies impact. To me it should first try the common.php file in use, and eventually use the untouched one optionally. Because common.php is the place to start classes that are required everywhere and it's just not thinkable nor desirable to always wrap every mods code into isset tests.
In this matter, problem finally come from uninitialized class in page_header() (since common.php was not included). To me this particular function would be a good candidate to clone (better than common.php) since the STK does only need very few of it and certainly not the mod's additions.

The clue about poor mods that could mess with STK is not very relevant, because such mods could also mess with phpBB alone, and likely too mess with the stk even if it does not load common.php.

It's funny to notice that he seems to perfectly understand the matter and its origin ("its due to some core changes we've made") and fails totally to come up with something useful to actually fix your issue.
It would have been as simple as telling that, with the new option taken (by him) in the stk, you could have to add mod's includes into stk/common.php. No need to say that this would also be a way to provide with something useful for all mods adding includes in common.php, not only the phpBB SEO ones.

This being said, we don't pretend to change other's minds. Since this particular case can indeed be handled by isset calls (that would be a totally different story if we where talking about heavy loops), here is the commit that will close this discussion : http://phpbb-seo.coda-cola.net/projects ... isions/292
SeO
Admin
Admin
 
Posts: 6334
Joined: Wed Mar 15, 2006 9:41 pm

Re: The problem with STK

Postby natalia » Mon Feb 14, 2011 4:55 pm

josediogenes, STK is already running :)
But there is another problem when I run the "Database Cleaner" I get an error

Code: Select all
[phpBB Debug] PHP Notice: in file /stk/includes/database_cleaner/database_cleaner_views.php on line 109: Undefined index: NAME
[phpBB Debug] PHP Notice: in file /stk/includes/database_cleaner/database_cleaner_views.php on line 110: Undefined index: TITLE
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4648: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3755)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4650: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3755)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4651: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3755)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4652: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3755)
natalia
 
Posts: 9
Joined: Thu Feb 10, 2011 6:13 pm

Re: The problem with STK

Postby josediogenes » Mon Feb 14, 2011 5:33 pm

natalia wrote:josediogenes, STK is already running :)
But there is another problem when I run the "Database Cleaner" I get an error

Code: Select all
[phpBB Debug] PHP Notice: in file /stk/includes/database_cleaner/database_cleaner_views.php on line 109: Undefined index: NAME
[phpBB Debug] PHP Notice: in file /stk/includes/database_cleaner/database_cleaner_views.php on line 110: Undefined index: TITLE
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4648: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3755)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4650: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3755)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4651: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3755)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4652: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3755)


Great to hear that you can now access STK. My question is, why are you trying to use the Database Cleaner? Are you aware that this may break all your database dependent MODs? Because it "remove extra columns, rows, and tables from the database not present in the default installation of phpBB3", thus removing any databases modifications made by the mods you have.
josediogenes
 
Posts: 9
Joined: Fri Aug 13, 2010 9:48 pm

Next

Return to phpBB SEO Premod

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: Majestic-12 [Bot] and 5 guests