dynamic meta tags v. 0.2.0 errors?

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

Moderator: Moderators

dynamic meta tags v. 0.2.0 errors?

Postby andyCheckerz » Tue Jan 08, 2008 7:32 pm

I am getting the following error when viewing any topic on my board after updating it with this mod:

SQL ERROR [ mssql_odbc ]

[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near 'LIMIT'. [37000]

My php bb 3.0.0 board is running using on a Windows 2003 box with php 5.2.5 and the crucial part for this error I think - MS SQL 2005 express

Cheers

Andy

NB - If I don't add the following code (from the read me) to viewtopic.php it seems to work ok :shock:

Code: Select all
   // www.phpBB-SEO.com SEO TOOLKIT BEGIN  - META
   if ($i == 0) {
      $m_kewrd = censor_text($row['post_subject']) . ' ' . $topic_data['forum_name'] . ' ';
$m_kewrd = '';
      $seo_meta->meta['meta_desc'] = $seo_meta->meta_filter_txt( $message );
      if($seo_meta->mconfig['topic_sql']) {
         $sql = "SELECT w.word_text
            FROM " . SEARCH_WORDMATCH_TABLE . " m, " . SEARCH_WORDLIST_TABLE . " w
            WHERE m.post_id = {$row['post_id']}
               AND w.word_id = m.word_id
               AND w.word_common = 0
               ORDER BY w.word_count DESC LIMIT 20";
         if( ($result = $db->sql_query($sql)) ) {
            while ( $meta_row = $db->sql_fetchrow($result) ) {
               $m_kewrd .= ' ' . $meta_row['word_text'];
            }
         }
         $db->sql_freeresult($result);
         $seo_meta->meta['keywords'] = $seo_meta->make_keywords( $m_kewrd  . ($seo_meta->mconfig['kewd_adddesc'] ? $seo_meta->meta['meta_desc'] : ''));
      } else {
         $seo_meta->meta['keywords'] = $seo_meta->make_keywords( $m_kewrd . $seo_meta->meta['meta_desc'] );
      }
   }
   // www.phpBB-SEO.com SEO TOOLKIT END  - META

andyCheckerz
 
Posts: 3
Joined: Mon Jan 07, 2008 6:02 pm

Advertisement

Postby dcz » Wed Jan 09, 2008 1:34 pm

Hum, looks like the query does not work with myssql.

Remember you can set some otpions in includes/functions.php, you can bypass the sql and still have nice meta tag for topics (only the keywords list will be a bit less good) if you replace :

Code: Select all
'topic_sql' => true,


with :

Code: Select all
'topic_sql' => false,


in this line :

Code: Select all
   var $mconfig = array('keywordlimit' => 15, 'wordlimit' => 25, 'wordminlen' => 2, 'bbcodestrip' => 'img|url|flash', 'ellipsis' => ' ...', 'topic_sql' => true, 'kewd_adddesc' => false);


I do not have any myssql instalation, but we can as well try something with the SQL.

Try replacing :
Code: Select all
         $sql = "SELECT w.word_text
            FROM " . SEARCH_WORDMATCH_TABLE . " m, " . SEARCH_WORDLIST_TABLE . " w
            WHERE m.post_id = {$row['post_id']}
               AND w.word_id = m.word_id
               AND w.word_common = 0
               ORDER BY w.word_count DESC LIMIT 20";
         if( ($result = $db->sql_query($sql)) ) {


with :

Code: Select all
         $sql = "SELECT w.word_text
            FROM " . SEARCH_WORDMATCH_TABLE . " m, " . SEARCH_WORDLIST_TABLE . " w
            WHERE m.post_id = {$row['post_id']}
               AND w.word_id = m.word_id
               AND w.word_common = 0
               ORDER BY w.word_count DESC";
         if( ($result = $db->sql_query_limit($sql, 20, 0)) ) {


Maybe the sql_query_limit() function will do a better job with myssql.

++
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: 21407
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 4 guests