Adv Rewrite Featured Topics

To talk about mods and code.
Patches requests, solutions and SEO tweaks sharing.

Moderator: Moderators

Adv Rewrite Featured Topics

Postby coyote » Thu Nov 08, 2007 12:25 am

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: Select all
//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 :)
coyote
phpBB SEO Team
phpBB SEO Team
 
Posts: 257
Joined: Fri May 11, 2007 6:24 am

Advertisement

Postby dcz » Thu Nov 08, 2007 5:43 pm

You are on the good direction, but try adding :

Code: Select all
      // 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: Select all
      $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 || Search
____________________

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

Postby coyote » Thu Nov 08, 2007 11:15 pm

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. :oops:

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: Select all
$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.
coyote
phpBB SEO Team
phpBB SEO Team
 
Posts: 257
Joined: Fri May 11, 2007 6:24 am

Postby dcz » Sat Nov 10, 2007 1:11 pm

mm... strange.

Try adding :

Code: Select all
      // 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: Select all
$topic_id = $feature_rows[$f]['topic_id'];


with :
Code: Select all
$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 || Search
____________________

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

Postby coyote » Sat Nov 10, 2007 4:55 pm

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.

:oops:

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.
coyote
phpBB SEO Team
phpBB SEO Team
 
Posts: 257
Joined: Fri May 11, 2007 6:24 am

Postby SeO » Sat Nov 10, 2007 5:27 pm

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: Select all
      // www.phpBB-SEO.com SEO TOOLKIT BEGIN
      global $phpbb_seo;
      // www.phpBB-SEO.com SEO TOOLKIT END


after :

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


Should, together with the other code change, work now ;)
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Postby coyote » Sat Nov 10, 2007 5:39 pm

SeO wrote:
Code: Select all
      // 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 ;)


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. :lol:

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.
coyote
phpBB SEO Team
phpBB SEO Team
 
Posts: 257
Joined: Fri May 11, 2007 6:24 am

Postby dcz » Sun Nov 18, 2007 12:24 pm

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 || Search
____________________

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

Postby coyote » Sun Nov 18, 2007 5:33 pm

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: Select all
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. :)

Edit: I tried giving global $phpbb_seo; its own line, but it didn't make a difference.
coyote
phpBB SEO Team
phpBB SEO Team
 
Posts: 257
Joined: Fri May 11, 2007 6:24 am

Postby dcz » Sun Nov 18, 2007 11:09 pm

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: Select all
if(!function_exists(imp_featured_block_func))


with :

Code: Select all
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 ;)

++
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: 21219
Joined: Fri Apr 28, 2006 9:03 pm

Postby coyote » Tue Nov 20, 2007 4:07 pm

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

What does that mean?
coyote
phpBB SEO Team
phpBB SEO Team
 
Posts: 257
Joined: Fri May 11, 2007 6:24 am

Postby dcz » Fri Nov 23, 2007 2:54 pm

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 || Search
____________________

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

Postby coyote » Fri Nov 23, 2007 3:54 pm

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.
coyote
phpBB SEO Team
phpBB SEO Team
 
Posts: 257
Joined: Fri May 11, 2007 6:24 am

Postby dcz » Sun Nov 25, 2007 2:08 pm

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: Select all
   global $phpbb_seo;


after :

Code: Select all
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 || Search
____________________

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

Postby coyote » Sun Nov 25, 2007 6:03 pm

Hmm, nope it didn't seem to work. I tried it in a few places in functions_portal.php.
coyote
phpBB SEO Team
phpBB SEO Team
 
Posts: 257
Joined: Fri May 11, 2007 6:24 am


Return to phpBB2 Mods and Code

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 2 guests