phpBB SEO
Boards
Directory  
SEO  
Downloads
  phpBB SEO : Search Engine Optimization, Directory, Forums  
Index
Forums
Annuaire
Référencement
Télécharger
 
  Search Rechercher
    Register
Username :  Password :  Log me on automatically each visit  
S'enregistrer  
 
   
Dynamic Meta Tags problem

 
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB SEO TooLKit  » phpBB SEO MODS
::  
Author Message
BH



Joined: 19 Dec 2007
Posts: 2

Dynamic Meta Tags problemPosted: Wed Dec 19, 2007 8:35 pm    Post subject: Dynamic Meta Tags problem

I'm not having much luck installing this mod, and I tried both manually and through Easy Mod and got the exact same results.

The forum s fairly active, so i had to restore to my original files, but I was hoping that perhaps someone had a similar issue and could shed some light. I searched for the error but couldn't find anything specific to my issue. The error I get is the following:

Fatal error: Call to a member function on a non-object in /home/thorlah/public_html/forum/index.php on line 274

I get the error on the index.php, viewtopic.php and viewforum.php

Anyone have any insight?

Any help would be greatly appreciated as it looks like a great mod.

By the way... I've been administering phpbb boards for several years, and have installed many mods... I don't consider myself a beginner and would imagine that this will ultimately be something 'simple'. Embarassed

Thanks in advance.
Back to top
SeO
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 15 Mar 2006
Posts: 3103

Dynamic Meta Tags problemPosted: Thu Dec 20, 2007 2:57 pm    Post subject: Re: Dynamic Meta Tags problem

I know this mod is not as simple to install as it should.

It was first designed as an add on to the phpbb seo mod rewrite, so, it's trickyer to install without it.

The error you mention suggest you did not uploaded the proper phpbb_seo class file and / or did not start the class in common.php.

Ultimately, it could just be because you added the code in phpbb_seo_class.php at the wrong place, must be before :

Code:
}
?>


And the bracket matters.

_________________
Back to top
BH



Joined: 19 Dec 2007
Posts: 2

Dynamic Meta Tags problemPosted: Thu Dec 20, 2007 4:56 pm    Post subject: Re: Dynamic Meta Tags problem

Thank-you for the response.

Quote:
It was first designed as an add on to the phpbb seo mod rewrite, so, it's trickyer to install without it.


That is definitely the case, but the instructions just said to upload the provided class file (once I had modified it as per the mod)

Quote:
The error you mention suggest you did not uploaded the proper phpbb_seo class file and / or did not start the class in common.php.


I used the one that came zipped in the mod folder in the contrib/standalone folder, was that incorrect? Where can I get a dfifferent one to try, please and thanks.

Quote:
Ultimately, it could just be because you added the code in phpbb_seo_class.php at the wrong place, must be before :


Definitely put it in the correct place I think, here's the code:

Code:
<?php
/**
*
* @package phpBB SEO
* @version $Id: phpbb_seo_class.php,v 1.0 2006/12/09 13:48:48 dcz Exp $
* @copyright (c) 2006 dcz - www.phpbb-seo.com
* @license http://www.opensource.org/licenses/rpl.php RPL Public License
*
*/

/**
* phpBB_SEO Class
* www.phpBB-SEO.com
* @package Advanced phpBB SEO mod Rewrite
*/
class phpbb_seo {
   /**
   * constuctor
   */
   function phpbb_seo() {
      global $phpEx;


      // --> Meta tags
      $this->seo_meta_tags();

      return;
   }

   // -- > Meta tags
   var   $seo_meta = array();
   /**
   * Returns meta tag code
   */
   function build_meta($page_title = '') {
      $meta_desc = ( $this->seo_meta['meta_desc'] != '' ) ? $this->seo_meta['meta_desc'] : $this->seo_meta['meta_desc_def'];
      $keywords = ( $this->seo_meta['keywords'] != '' ) ? $this->seo_meta['keywords'] : $this->seo_meta['meta_keywords_def'];
      $title = ( $this->seo_meta['meta_title'] != '' ) ? $this->seo_meta['meta_title'] : $page_title;
      return sprintf( $this->seo_meta['meta_tpl'], $title, $this->seo_meta['meta_lang'], $meta_desc, $keywords, $this->seo_meta['meta_cat'], $this->seo_meta['meta_robots'] );
   }
   /**
   * Returns a word list separated by comas
   * You might want tu use mb_strlen() instead of strlen()
   * if you are using UTF-8 : mb_strlen($word, 'UTF-8')
   * you can as well change the minimum word size here : if ( strlen($word) >= 3 ) {
   * Possible Options :
   * - $limit = 0 means no limit.
   *   By default, ' . and , are deleted.
   */
   function make_keywords($text, $limit = 15) {
      $keywords = '';
      $num = 0;
      $text = preg_replace(array("`[[:punct:]]+`", "`[\s]+`"), array(" ", " "), strip_tags($text) );
      $text = explode(" ", $text);
      // We take the most used words first
      $text = array_count_values($text);
      foreach ($text as $word => $count) {
         if ( strlen($word) >= 3 ) {
            $keywords .= ($keywords == '') ? $word : ',' . $word;
            $num++;
            if ( $limit > 0 && $num >= $limit ) {
               break;
            }
         }   
      }
      return $keywords;
   }
   /**
   * Filter php/html tags and white spaces and returns htmlspecialchared string
   */
   function meta_filter_txt($text) {
      return htmlspecialchars(preg_replace("`[\s]+`", " ", strip_tags($text) ) );
   }
   /**
   * Initialize meta tags
   * @access private
   */
   function seo_meta_tags() {
      global $board_config;
      $this->seo_meta = array('meta_tpl' => '<meta name="title" content="%s">' . "\n" . '<meta name="description" lang="%s" content="%s">' . "\n" . '<meta name="keywords"    content="%s">' . "\n" . '<meta name="category"    content="%s">' . "\n" . '<meta name="robots"      content="%s">'. "\n",
         'meta_title' => '',
         'meta_desc' => '',
         'meta_keywords' => '',
         // Here you can hard code a static default title, description and keywords
         // As is, the mod will return information based on the phpbb config
         'meta_title_def' => $this->meta_filter_txt($board_config['sitename']),
         'meta_desc_def' => $this->meta_filter_txt($board_config['site_desc']),
         'meta_keywords_def' => $this->make_keywords($board_config['site_desc']),
         'meta_lang' => 'en',
         'meta_cat' => 'general',
         'meta_robots' => 'index,follow',
         'meta_gened' => FALSE
      );
      return;
   }

}
?>


Any help is appreciated... right now I'm thinking about just coming up with a manual solution that will at least create descriptions for the viewtopic pages that are not static... I figured the thread title plus the poost date would at least give me unique, semi-accurate descriptions of the pages... not as elegant as your solution and wouldn't even worry about a keywords meta, but I'd prefer to get your mod working if I can.

thanks again.
Back to top
SeO
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 15 Mar 2006
Posts: 3103

Dynamic Meta Tags problemPosted: Fri Dec 21, 2007 10:38 am    Post subject: Re: Dynamic Meta Tags problem

Make sure about the common.php code change, it's in the DYI, other possibility at this point could be the code changes in page_header.php, but I doubt.

_________________
Back to top
Display posts from previous:   
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB SEO TooLKit  » phpBB SEO MODS
Page 1 of 1

Navigation Similar Topics

Jump to: