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  
 
   
Adv Rewrite Featured Topics

 
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » Patches  » Mods and Code
::  
Author Message
coyote
phpBB SEO Team
phpBB SEO Team


Joined: 11 May 2007
Posts: 72

Adv Rewrite Featured TopicsPosted: Thu Nov 08, 2007 12:25 am    Post subject: Adv Rewrite Featured Topics

I have my forum set to tag all links in the postbody and signature with rel="nofollow", so I installed the Featured Topics mod to help search engines find the threads I especially want them to index. I noticed that it was outputting links as viewtopic.php?t=xx, so I added a snippet of phpbb-seo code from viewforum.php. It sort of works, but instead of outputting this-is-my-title-txx.html it's outputting topic-txx.html, and topic-txx-xxx on topics with multiple pages. I was wondering how to get it to inject the topic title, and is it strictly necessary? I have Adv Zero Dupe, but I don't know if it works or is affected by this mod, and anyway it seems most efficient to output the correct link in the first place. The code below is taken from index.php, just after session management:

Code:
//featured
//
$sql = "SELECT * from " . TOPICS_TABLE . " WHERE featured = 1";
if( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, 'Could not query featured list', '', __LINE__, __FILE__, $sql);
}

$feature_rows = array();
while ($row = $db->sql_fetchrow($result))
{
   $feature_rows[] = $row;
}
$db->sql_freeresult($result);   
$total_feature = count($feature_rows);

   for ($f = 0; $f < $total_feature; $f++ )
   {
    
      $topic_id = $feature_rows[$f]['topic_id'];

      $topic_title = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $topic_rowset[$i]['topic_title']) : $topic_rowset[$i]['topic_title'];

      $replies = $feature_rows[$f]['topic_replies'];

      $topic_type = $feature_rows[$f]['topic_type'];

      if( $topic_type == POST_ANNOUNCE )
      {
         $topic_type = $lang['Topic_Announcement'] . ' ';
      }
      else if( $topic_type == POST_STICKY )
      {
         $topic_type = $lang['Topic_Sticky'] . ' ';
      }
      else
      {
         $topic_type = '';      
      }

      if( $feature_rows[$f]['topic_vote'] )
      {
         $topic_type .= $lang['Topic_Poll'] . ' ';
      }
      
      if( $feature_rows[$f]['topic_status'] == TOPIC_MOVED )
      {
         $topic_type = $lang['Topic_Moved'] . ' ';
         $topic_id = $feature_rows[$f]['topic_moved_id'];

         $folder_image =  $images['folder'];
         $folder_alt = $lang['Topics_Moved'];
         $newest_post_img = '';
      }
      else
      {
         if( $feature_rows[$f]['topic_type'] == POST_ANNOUNCE )
         {
            $folder = $images['folder_announce'];
            $folder_new = $images['folder_announce_new'];
         }
         else if( $feature_rows[$f]['topic_type'] == POST_STICKY )
         {
            $folder = $images['folder_sticky'];
            $folder_new = $images['folder_sticky_new'];
         }
         else if( $feature_rows[$f]['topic_status'] == TOPIC_LOCKED )
         {
            $folder = $images['folder_locked'];
            $folder_new = $images['folder_locked_new'];
         }
         else
         {
            if($replies >= $board_config['hot_threshold'])
            {
               $folder = $images['folder_hot'];
               $folder_new = $images['folder_hot_new'];
            }
            else
            {
               $folder = $images['folder'];
               $folder_new = $images['folder_new'];
            }
         }

         $newest_post_img = '';
         if( $userdata['session_logged_in'] )
         {
            if( $feature_rows[$f]['post_time'] > $userdata['user_lastvisit'] )
            {
               if( !empty($tracking_topics) || !empty($tracking_forums) || isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) )
               {
                  $unread_topics = true;

                  if( !empty($tracking_topics[$topic_id]) )
                  {
                     if( $tracking_topics[$topic_id] >= $feature_rows[$f]['post_time'] )
                     {
                        $unread_topics = false;
                     }
                  }

                  if( !empty($tracking_forums[$forum_id]) )
                  {
                     if( $tracking_forums[$forum_id] >= $feature_rows[$f]['post_time'] )
                     {
                        $unread_topics = false;
                     }
                  }

                  if( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) )
                  {
                     if( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] >= $feature_rows[$f]['post_time'] )
                     {
                        $unread_topics = false;
                     }
                  }

                  if( $unread_topics )
                  {
                     $folder_image = $folder_new;
                     $folder_alt = $lang['New_posts'];

                     $newest_post_img = '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;view=newest") . '"><img src="' . $images['icon_newest_reply'] . '" alt="' . $lang['View_newest_post'] . '" title="' . $lang['View_newest_post'] . '" border="0" /></a> ';
                  }
                  else
                  {
                     $folder_image = $folder;
                     $folder_alt = ($feature_rows[$f]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];

                     $newest_post_img = '';
                  }
               }
               else
               {
                  $folder_image = $folder_new;
                  $folder_alt = ( $feature_rows[$f]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['New_posts'];

                  $newest_post_img = '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;view=newest") . '"><img src="' . $images['icon_newest_reply'] . '" alt="' . $lang['View_newest_post'] . '" title="' . $lang['View_newest_post'] . '" border="0" /></a> ';
               }
            }
            else
            {
               $folder_image = $folder;
               $folder_alt = ( $feature_rows[$f]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];

               $newest_post_img = '';
            }
         }
         else
         {
            $folder_image = $folder;
            $folder_alt = ( $feature_rows[$f]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];

            $newest_post_img = '';
         }
      }
      // www.phpBB-SEO.com SEO TOOLKIT BEGIN
      if ( !isset($phpbb_seo->seo_url['topic'][$topic_id]) ) {
         $phpbb_seo->seo_url['topic'][$topic_id] = $phpbb_seo->format_url($topic_title);
      }
      // www.phpBB-SEO.com SEO TOOLKIT END

      if( ( $replies + 1 ) > $board_config['posts_per_page'] )
      {
         $total_pages = ceil( ( $replies + 1 ) / $board_config['posts_per_page'] );
         $goto_page = ' [ <img src="' . $images['icon_gotopost'] . '" alt="' . $lang['Goto_page'] . '" title="' . $lang['Goto_page'] . '" />' . $lang['Goto_page'] . ': ';

         $times = 1;
         for($j = 0; $j < $replies + 1; $j += $board_config['posts_per_page'])
         {
            $goto_page .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $topic_id . "&amp;start=$j") . '">' . $times . '</a>';
            if( $times == 1 && $total_pages > 4 )
            {
               $goto_page .= ' ... ';
               $times = $total_pages - 3;
               $j += ( $total_pages - 4 ) * $board_config['posts_per_page'];
            }
            else if ( $times < $total_pages )
            {
               $goto_page .= ', ';
            }
            $times++;
         }
         $goto_page .= ' ] ';
      }
      else
      {
         $goto_page = '';
      }
      
      
      
      $view_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");

      $views = $feature_rows[$f]['topic_views'];
      
      $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
      $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
      
      $template->assign_block_vars('featurerow', array(
         'ROW_COLOR' => $row_color,
         'ROW_CLASS' => $row_class,
         'FORUM_ID' => $forum_id,
         'TOPIC_ID' => $topic_id,
         'TOPIC_FOLDER_IMG' => $folder_image,
         'TOPIC_AUTHOR' => $topic_author,
         'GOTO_PAGE' => $goto_page,
         'REPLIES' => $replies,
         'NEWEST_POST_IMG' => $newest_post_img,
         'TOPIC_TITLE' => $feature_rows[$f]['topic_title'],
         'TOPIC_TYPE' => $topic_type,
         'VIEWS' => $views,
         'L_TOPIC_FOLDER_ALT' => $folder_alt,

         'U_VIEW_TOPIC' => $view_topic_url)
      );
}

//
// END featured topics


Thanks,

-C Smile
Back to top
Visit poster's website
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

Adv Rewrite Featured TopicsPosted: Thu Nov 08, 2007 5:43 pm    Post subject: Re: Adv Rewrite Featured Topics

You are on the good direction, but try adding :

Code:
      // www.phpBB-SEO.com SEO TOOLKIT BEGIN
      if ( !isset($phpbb_seo->seo_url['topic'][$topic_id]) ) {
         $phpbb_seo->seo_url['topic'][$topic_id] = $phpbb_seo->format_url($topic_title);
      }
      // www.phpBB-SEO.com SEO TOOLKIT END


After :
Code:
      $topic_title = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $topic_rowset[$i]['topic_title']) : $topic_rowset[$i]['topic_title'];


instead.

As well, could you provide a link to where the mod is officially released (or at least to where we can download it).

++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
coyote
phpBB SEO Team
phpBB SEO Team


Joined: 11 May 2007
Posts: 72

Adv Rewrite Featured TopicsPosted: Thu Nov 08, 2007 11:15 pm    Post subject: Re: Adv Rewrite Featured Topics

dcz wrote:
As well, could you provide a link to where the mod is officially released (or at least to where we can download it).

++


Oh yeah, sorry. Embarassed

http://www.phpbbhacks.com/download/6921


Hmm, I took out the code I added and put in the code you suggested, but it's still outputting topic-txx.html

Code:
$total_feature = count($feature_rows);

   for ($f = 0; $f < $total_feature; $f++ )
   {
    
      $topic_id = $feature_rows[$f]['topic_id'];

      $topic_title = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $topic_rowset[$i]['topic_title']) : $topic_rowset[$i]['topic_title'];

      // www.phpBB-SEO.com SEO TOOLKIT BEGIN
      if ( !isset($phpbb_seo->seo_url['topic'][$topic_id]) ) {
         $phpbb_seo->seo_url['topic'][$topic_id] = $phpbb_seo->format_url($topic_title);
      }
      // www.phpBB-SEO.com SEO TOOLKIT END
    
        $replies = $feature_rows[$f]['topic_replies'];

      $topic_type = $feature_rows[$f]['topic_type'];


For the purposes of SEO, is it really a big deal? Because I'm not so picky that I absolutely must have it output the title, as long as the members and the spiders can find the topics and it doesn't negatively affect my PR or SERPS. I do notice that when I arrive at the topic, the correct link is displayed in my browser address bar, so I think it's redirecting in there somewhere, hopefully 301.
Back to top
Visit poster's website
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

Adv Rewrite Featured TopicsPosted: Sat Nov 10, 2007 1:11 pm    Post subject: Re: Adv Rewrite Featured Topics

mm... strange.

Try adding :

Code:
      // www.phpBB-SEO.com SEO TOOLKIT BEGIN
      if ( empty($phpbb_seo->seo_url['topic'][$topic_id]) ) {
         $phpbb_seo->seo_url['topic'][$topic_id] = $phpbb_seo->format_url($topic_title);
      }
      // www.phpBB-SEO.com SEO TOOLKIT END


instead, just in case, but I don't see any reason why this would not work.
You can try as well to replace :

Code:
$topic_id = $feature_rows[$f]['topic_id'];


with :
Code:
$topic_id = intval($feature_rows[$f]['topic_id']);


But again, I kind of doubt it will make any difference.

Can you post a link to on your forum with the mod installed ?

Because, even if the vanilla URLs are http 301 redirected, the best is to output rewritten links.

++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
coyote
phpBB SEO Team
phpBB SEO Team


Joined: 11 May 2007
Posts: 72

Adv Rewrite Featured TopicsPosted: Sat Nov 10, 2007 4:55 pm    Post subject: Re: Adv Rewrite Featured Topics

Well, I just made the whole thing even more complicated. It's now an IM Portal block. I haven't figured out yet any rewrite trick that works on it now.

Embarassed

But here it is installed and running on the front (IM Portal) page:

-www.americanpoliticsforum.com

And here's the portal block:

-www.phpbbhacks.com/support/coyote/Featured_topics_block.zip

I've found that portal blocks don't act the same way that scripts installed at the root do.
Back to top
Visit poster's website
SeO
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 15 Mar 2006
Posts: 3128

Adv Rewrite Featured TopicsPosted: Sat Nov 10, 2007 5:27 pm    Post subject: Re: Adv Rewrite Featured Topics

All right it's just because the block is using this code from within a function, so in blocks/blocks_imp_featured.php, try adding :
Code:
      // www.phpBB-SEO.com SEO TOOLKIT BEGIN
      global $phpbb_seo;
      // www.phpBB-SEO.com SEO TOOLKIT END


after :

Code:
      global $template, $images, $lang, $portal_config, $userdata, $board_config, $db, $phpEx;


Should, together with the other code change, work now Wink

_________________
Back to top
coyote
phpBB SEO Team
phpBB SEO Team


Joined: 11 May 2007
Posts: 72

Adv Rewrite Featured TopicsPosted: Sat Nov 10, 2007 5:39 pm    Post subject: Re: Adv Rewrite Featured Topics

SeO wrote:
Code:
      // www.phpBB-SEO.com SEO TOOLKIT BEGIN
      global $phpbb_seo;
      // www.phpBB-SEO.com SEO TOOLKIT END


Should, together with the other code change, work now Wink


I figured out adding the global $'s to get language, db, phpEx functions, etc. I thought there might be one for phpBB-SEO, but I wasn't sure what it was. Now that you've pointed it out, it seems rather obvious. Laughing

You are right, though, it didn't make any difference. I tried the changes outlined above and it's still outputting topic-txx.html, which is still better than viewtopic.php?t=xx.
Back to top
Visit poster's website
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

Adv Rewrite Featured TopicsPosted: Sun Nov 18, 2007 12:24 pm    Post subject: Re: Adv Rewrite Featured Topics

mm, it should work with the global on $phpbb_seo.

Have you tried to add it with the last code change I suggested (empty() vs isset() ) ?

++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
coyote
phpBB SEO Team
phpBB SEO Team


Joined: 11 May 2007
Posts: 72

Adv Rewrite Featured TopicsPosted: Sun Nov 18, 2007 5:33 pm    Post subject: Re: Adv Rewrite Featured Topics

dcz wrote:
mm, it should work with the global on $phpbb_seo.

Have you tried to add it with the last code change I suggested (empty() vs isset() ) ?

++


Yeah, I double checked to make sure it was (empty(). Is it OK if I just repost the whole block here?

Code:
if ( !defined('IN_PHPBB') )
{
   die("Hacking attempt");
}

if(!function_exists(imp_featured_block_func))
{
   function imp_featured_block_func()
   {
      global $template, $phpbb_seo, $images, $lang, $portal_config, $userdata, $board_config, $db, $phpEx;
//featured
//
$sql = "SELECT * from " . TOPICS_TABLE . " WHERE featured = 1";
if( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, 'Could not query featured list', '', __LINE__, __FILE__, $sql);
}

$feature_rows = array();
while ($row = $db->sql_fetchrow($result))
{
   $feature_rows[] = $row;
}
$db->sql_freeresult($result);   
$total_feature = count($feature_rows);

   for ($f = 0; $f < $total_feature; $f++ )
   {
    
      $topic_id = intval($feature_rows[$f]['topic_id']);

      $topic_title = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $topic_rowset[$i]['topic_title']) : $topic_rowset[$i]['topic_title'];

    // www.phpBB-SEO.com SEO TOOLKIT BEGIN
      if ( empty($phpbb_seo->seo_url['topic'][$topic_id]) ) {
         $phpbb_seo->seo_url['topic'][$topic_id] = $phpbb_seo->format_url($topic_title);
      }
      // www.phpBB-SEO.com SEO TOOLKIT END
      $replies = $feature_rows[$f]['topic_replies'];

      $topic_type = $feature_rows[$f]['topic_type'];

      if( $topic_type == POST_ANNOUNCE )
      {
         $topic_type = $lang['Topic_Announcement'] . ' ';
      }
      else if( $topic_type == POST_STICKY )
      {
         $topic_type = $lang['Topic_Sticky'] . ' ';
      }
      else
      {
         $topic_type = '';      
      }

      if( $feature_rows[$f]['topic_vote'] )
      {
         $topic_type .= $lang['Topic_Poll'] . ' ';
      }
      
      if( $feature_rows[$f]['topic_status'] == TOPIC_MOVED )
      {
         $topic_type = $lang['Topic_Moved'] . ' ';
         $topic_id = $feature_rows[$f]['topic_moved_id'];

         $folder_image =  $images['folder'];
         $folder_alt = $lang['Topics_Moved'];
         $newest_post_img = '';
      }
      else
      {
         if( $feature_rows[$f]['topic_type'] == POST_ANNOUNCE )
         {
            $folder = $images['folder_announce'];
            $folder_new = $images['folder_announce_new'];
         }
         else if( $feature_rows[$f]['topic_type'] == POST_STICKY )
         {
            $folder = $images['folder_sticky'];
            $folder_new = $images['folder_sticky_new'];
         }
         else if( $feature_rows[$f]['topic_status'] == TOPIC_LOCKED )
         {
            $folder = $images['folder_locked'];
            $folder_new = $images['folder_locked_new'];
         }
         else
         {
            if($replies >= $board_config['hot_threshold'])
            {
               $folder = $images['folder_hot'];
               $folder_new = $images['folder_hot_new'];
            }
            else
            {
               $folder = $images['folder'];
               $folder_new = $images['folder_new'];
            }
         }

         $newest_post_img = '';
         if( $userdata['session_logged_in'] )
         {
            if( $feature_rows[$f]['post_time'] > $userdata['user_lastvisit'] )
            {
               if( !empty($tracking_topics) || !empty($tracking_forums) || isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) )
               {
                  $unread_topics = true;

                  if( !empty($tracking_topics[$topic_id]) )
                  {
                     if( $tracking_topics[$topic_id] >= $feature_rows[$f]['post_time'] )
                     {
                        $unread_topics = false;
                     }
                  }

                  if( !empty($tracking_forums[$forum_id]) )
                  {
                     if( $tracking_forums[$forum_id] >= $feature_rows[$f]['post_time'] )
                     {
                        $unread_topics = false;
                     }
                  }

                  if( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) )
                  {
                     if( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] >= $feature_rows[$f]['post_time'] )
                     {
                        $unread_topics = false;
                     }
                  }

                  if( $unread_topics )
                  {
                     $folder_image = $folder_new;
                     $folder_alt = $lang['New_posts'];

                     $newest_post_img = '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;view=newest") . '"><img src="' . $images['icon_newest_reply'] . '" alt="' . $lang['View_newest_post'] . '" title="' . $lang['View_newest_post'] . '" border="0" /></a> ';
                  }
                  else
                  {
                     $folder_image = $folder;
                     $folder_alt = ($feature_rows[$f]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];

                     $newest_post_img = '';
                  }
               }
               else
               {
                  $folder_image = $folder_new;
                  $folder_alt = ( $feature_rows[$f]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['New_posts'];

                  $newest_post_img = '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;view=newest") . '"><img src="' . $images['icon_newest_reply'] . '" alt="' . $lang['View_newest_post'] . '" title="' . $lang['View_newest_post'] . '" border="0" /></a> ';
               }
            }
            else
            {
               $folder_image = $folder;
               $folder_alt = ( $feature_rows[$f]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];

               $newest_post_img = '';
            }
         }
         else
         {
            $folder_image = $folder;
            $folder_alt = ( $feature_rows[$f]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];

            $newest_post_img = '';
         }
      }

      if( ( $replies + 1 ) > $board_config['posts_per_page'] )
      {
         $total_pages = ceil( ( $replies + 1 ) / $board_config['posts_per_page'] );
         $goto_page = ' [ <img src="' . $images['icon_gotopost'] . '" alt="' . $lang['Goto_page'] . '" title="' . $lang['Goto_page'] . '" />' . $lang['Goto_page'] . ': ';

         $times = 1;
         for($j = 0; $j < $replies + 1; $j += $board_config['posts_per_page'])
         {
            $goto_page .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $topic_id . "&amp;start=$j") . '">' . $times . '</a>';
            if( $times == 1 && $total_pages > 4 )
            {
               $goto_page .= ' ... ';
               $times = $total_pages - 3;
               $j += ( $total_pages - 4 ) * $board_config['posts_per_page'];
            }
            else if ( $times < $total_pages )
            {
               $goto_page .= ', ';
            }
            $times++;
         }
         $goto_page .= ' ] ';
      }
      else
      {
         $goto_page = '';
      }
      
      
      
      $view_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");

      $views = $feature_rows[$f]['topic_views'];
      
      $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
      $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
      
      $template->assign_block_vars('featurerow', array(
         'ROW_COLOR' => $row_color,
         'ROW_CLASS' => $row_class,
         'FORUM_ID' => $forum_id,
         'TOPIC_ID' => $topic_id,
         'TOPIC_FOLDER_IMG' => $folder_image,
         'TOPIC_AUTHOR' => $topic_author,
         'GOTO_PAGE' => $goto_page,
         'REPLIES' => $replies,
         'NEWEST_POST_IMG' => $newest_post_img,
         'TOPIC_TITLE' => $feature_rows[$f]['topic_title'],
         'TOPIC_TYPE' => $topic_type,
         'VIEWS' => $views,
         'L_TOPIC_FOLDER_ALT' => $folder_alt,

         'U_VIEW_TOPIC' => $view_topic_url)
      );
}

//
// END featured topics
   $template->assign_vars(array(
'DISPLAY' => ( $total_feature == 0 ) ? 'style="display: none"' : ''
         )
      );
   }
}

imp_featured_block_func();
?>


I like how you put -www.phpbb-seo.com in the comment lines. It's really easy to find, even with code tags. Smile

Edit: I tried giving global $phpbb_seo; its own line, but it didn't make a difference.
Back to top
Visit poster's website
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

Adv Rewrite Featured TopicsPosted: Sun Nov 18, 2007 11:09 pm    Post subject: Re: Adv Rewrite Featured Topics

mm, I need to investigate further, but so far I see two possible reasons :
1) the imp_featured_block_func() is already declared when this file gets included.
A dirty but quick way to make sure about it is to replace :


Code:
if(!function_exists(imp_featured_block_func))


with :

Code:
if(true)


2) this file is called from within a class or a funtion, and the way it is done requires to globalise or to pass by reference the $phpbb_seo object at a upper level.
That's where further investigating on the IM portal code is required.

Will do it soon Wink

++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
coyote
phpBB SEO Team
phpBB SEO Team


Joined: 11 May 2007
Posts: 72

Adv Rewrite Featured TopicsPosted: Tue Nov 20, 2007 4:07 pm    Post subject: Re: Adv Rewrite Featured Topics

I tried replacing that and my forum accused me of hacking. Laughing

What does that mean?
Back to top
Visit poster's website
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

Adv Rewrite Featured TopicsPosted: Fri Nov 23, 2007 2:54 pm    Post subject: Re: Adv Rewrite Featured Topics

It's just the basic message for unhallowed file access in phpBB, when the IN_PHPBB constant is not defined for example.

In this case, I'm not sure I need to investigate further on this. It must be linked to how IM portal deals with modules.

++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
coyote
phpBB SEO Team
phpBB SEO Team


Joined: 11 May 2007
Posts: 72

Adv Rewrite Featured TopicsPosted: Fri Nov 23, 2007 3:54 pm    Post subject: Re: Adv Rewrite Featured Topics

Well, I have learned that anytime I want to include a file in an IM Portal block I have to go up one level to get to phpbb root. It appears to run all block scripts from the blocks/ folder.
Back to top
Visit poster's website
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

Adv Rewrite Featured TopicsPosted: Sun Nov 25, 2007 2:08 pm    Post subject: Re: Adv Rewrite Featured Topics

I don't think it is a path issue.

I need to set up a test install of im portal to go further in this, but you can give a try to this, add :

Code:
   global $phpbb_seo;


after :

Code:
function portal_parse_blocks($layout, $forum_wide = FALSE, $type='')
{
   global $db, $template, $userdata, $phpbb_root_path, $phpEx, $board_config, $lang, $var_cache, $portal_config;


in includes/functions_portal.php.

I dout it will be enough, but, since I cannot give a quick try to this right now.

++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
coyote
phpBB SEO Team
phpBB SEO Team


Joined: 11 May 2007
Posts: 72

Adv Rewrite Featured TopicsPosted: Sun Nov 25, 2007 6:03 pm    Post subject: Re: Adv Rewrite Featured Topics

Hmm, nope it didn't seem to work. I tried it in a few places in functions_portal.php.
Back to top
Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » Patches  » Mods and Code
Page 1 of 1

Navigation Similar Topics

Jump to: