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  
 
   
EZPORTAL Recent Topics

 
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB mod Rewrite  » Advanced mod Rewrite
::  
Author Message
PerfRen



Joined: 01 Nov 2007
Posts: 36

EZPORTAL Recent TopicsPosted: Thu Nov 29, 2007 10:37 am    Post subject: EZPORTAL Recent Topics

I started this post as part of another and was asked to make it a new post to help others.

I need some help with making the following code from my portal.php (now portal.html) page use the new "$phpbb_seo->" code...

Code:

//
// Recent Topics
//

$sql = "SELECT * FROM ". FORUMS_TABLE . " ORDER BY forum_id";
if (!$result = $db->sql_query($sql))
{
   message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
}
$forum_data = array();
while( $row = $db->sql_fetchrow($result) )
{
   $forum_data[] = $row;
}
$is_auth_ary = array();
$is_auth_ary = auth(AUTH_ALL, AUTH_LIST_ALL, $userdata, $forum_data);
if( $CFG['exceptional_forums'] == '' )
{
   $except_forum_id = '\'start\'';
}
else
{
   $except_forum_id = $CFG['exceptional_forums'];
}
for ($i = 0; $i < count($forum_data); $i++)
{
   if ((!$is_auth_ary[$forum_data[$i]['forum_id']]['auth_read']) or (!$is_auth_ary[$forum_data[$i]['forum_id']]['auth_view']))
   {
      if ($except_forum_id == '\'start\'')
      {
         $except_forum_id = $forum_data[$i]['forum_id'];
 
      }
      else
      {
         $except_forum_id .= ',' . $forum_data[$i]['forum_id'];
 
      }
   }
}
$sql = "SELECT  f.forum_name, f.forum_id, t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username, u.user_level
      FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . USERS_TABLE . " AS u,  " . FORUMS_TABLE . " AS f
      WHERE t.forum_id NOT IN (" . $except_forum_id . ")
         AND t.topic_status <> 2
         AND p.post_id = t.topic_last_post_id
         AND p.poster_id = u.user_id
         AND f.forum_id = t.forum_id
      ORDER BY p.post_id DESC
      LIMIT " . $CFG['number_recent_topics'];
if (!$result = $db->sql_query($sql))
{
   message_die(GENERAL_ERROR, 'Could not query recent topics information', '', __LINE__, __FILE__, $sql);
}
$number_recent_topics = $db->sql_numrows($result);
$recent_topic_row = array();
while ($row = $db->sql_fetchrow($result))
{
   $recent_topic_row[] = $row;
}

for ($i = 0; $i < $number_recent_topics; $i++)
{
   // Start add - Username Color Mod
   switch ( $recent_topic_row[$i]['user_level'] )
   {
      case ADMIN:
         $poster_name = '<strong>' . $recent_topic_row[$i]['username'] . '</strong>';
         $style_color = ' style="color: #' . $theme['fontcolor3'] . '"';
         break;
      case MAIN_MOD:
         $poster_name = '<strong>' . $recent_topic_row[$i]['username'] . '</strong>';
         $style_color = ' style="color: #' . $theme['fontcolor98'] . '"';
         break;
      case MOD:
         $poster_name = '<strong>' . $recent_topic_row[$i]['username'] . '</strong>';
         $style_color = ' style="color: #' . $theme['fontcolor2'] . '"';
         break;
      case SUPPORT:
         $poster_name = '<strong>' . $recent_topic_row[$i]['username'] . '</strong>';
         $style_color = ' style="color: #' . $theme['fontcolor4'] . '"';
         break;
      case CLUB:
         $poster_name = '<strong>' . $recent_topic_row[$i]['username'] . '</strong>';
         $style_color = ' style="color: #' . $theme['fontcolor5'] . '"';
         break;
      case BOT:
         $poster_name = '<strong>' . $recent_topic_row[$i]['username'] . '</strong>';
         $style_color = ' style="color: #' . $theme['fontcolor99'] . '"';
         break;
      default:
         $poster_name = $recent_topic_row[$i]['username'];
         $style_color = ' style="color: #006699"';
         break;
   }
   //$poster_name = '[<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $recent_topic_row[$i]['user_id']) . '"' . $style_color . '>' . $poster_name . '</a>]';
   $poster_name = '[<span' . $style_color . '>' . $poster_name . '</span>]';
   // End add - Username Color Mod

   $topic_title = $recent_topic_row[$i]['topic_title'];
   $topic_title = smilies_pass($topic_title);

   $template->assign_block_vars('recent_topic_row', array(
      'L_FORUMNAME' => $recent_topic_row[$i]['forum_name'],
      'U_FORUMNAME' => append_sid("viewforum.$phpEx?"."f=".$recent_topic_row[$i]['forum_id']),
      'U_TITLE' => append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $recent_topic_row[$i]['post_id']) . '#' .$recent_topic_row[$i]['post_id'],
      //'L_TITLE' => $recent_topic_row[$i]['topic_title'],
      'L_TITLE' => $topic_title,
      //'U_POSTER' => append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $recent_topic_row[$i]['user_id']),
      //'S_POSTER' => $recent_topic_row[$i]['username'],
      'S_POSTER' => $poster_name,
      'S_POSTTIME' => create_date($board_config['default_dateformat'], $recent_topic_row[$i]['post_time'], $board_config['board_timezone']
      )
      )
   );
}
//
// END - Recent Topics
//


Idealing converting U_FORUMNAME and U_TITLE to the new formats Smile


Now I was replied to with the following...

For the portal rewriting, find :
Code:
   $recent_topic_row[] = $row;

after add :
Code:
   // www.phpBB-SEO.com SEO TOOLKIT BEGIN
   if ( !isset($phpbb_seo->seo_url['forum'][$recent_topic_row['forum_id']]) ) {
      $phpbb_seo->seo_url['forum'][$recent_topic_row['forum_id']] = $phpbb_seo->format_url($recent_topic_row['forum_name'], $phpbb_seo->seo_static['forum']);
   }
   // www.phpBB-SEO.com SEO TOOLKIT END


Will do the trick for forum URL, other are post urls and already rewritten.


And I subsequently replied with...

Thanks again for the help

I have tried the code above thank you but it hasnt changed anything for me on my portal page.

My portal.tpl references {recent_topic_row.U_FORUMNAME} and {recent_topic_row.U_TITLE} for the Recent posts and has not been updated to the new format with that change you suggested for my portal.php file. Is there something else I need to do?


So Please could someone help me fix this so that other Portal users can have the correct links showing on their pages too Smile

Thanks in advance.
Back to top
PerfRen



Joined: 01 Nov 2007
Posts: 36

EZPORTAL Recent TopicsPosted: Mon Dec 03, 2007 12:05 pm    Post subject: Re: EZPORTAL Recent Topics

Have had a PM now from a guy on here asking for the same thing and wondering if I had had any luck in fixing it - so I told him I hadnt and was waiting on some help on here like him Smile

Anyone know how I can get this to work please?
Back to top
PerfRen



Joined: 01 Nov 2007
Posts: 36

EZPORTAL Recent TopicsPosted: Fri Dec 21, 2007 11:29 am    Post subject: Re: EZPORTAL Recent Topics

Can anyone help please?
Back to top
SeO
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 15 Mar 2006
Posts: 3118

EZPORTAL Recent TopicsPosted: Fri Dec 21, 2007 11:37 am    Post subject: Re: EZPORTAL Recent Topics

Could you post a link to your site and to where the mod is officially released ?

Aren't the forum urls rewritten with the suggested code ?

Anyway, from what you posted, it looks like the mod is building post links :

Code:
    'U_TITLE' => append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $recent_topic_row[$i]['post_id']) . '#' .$recent_topic_row[$i]['post_id'],


Aren't they already rewritten to postxx.html ?

_________________
Back to top
PerfRen



Joined: 01 Nov 2007
Posts: 36

EZPORTAL Recent TopicsPosted: Fri Dec 21, 2007 11:59 am    Post subject: Re: EZPORTAL Recent Topics

Yes the links are in the formats of:

postxx.html

and

viewforum.php

not the correct formats however!


Go to the Portal page and have a look at the Recent Topics Block on the left hand side.

Thats the block that needs fixing Smile
Back to top
SeO
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 15 Mar 2006
Posts: 3118

EZPORTAL Recent TopicsPosted: Fri Dec 21, 2007 2:57 pm    Post subject: Re: EZPORTAL Recent Topics

What is the portal you are using ?

And what about the last touch ?

_________________
Back to top
PerfRen



Joined: 01 Nov 2007
Posts: 36

EZPORTAL Recent TopicsPosted: Sun Dec 23, 2007 12:07 am    Post subject: Re: EZPORTAL Recent Topics

I'm using ezportal and it is there!
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

EZPORTAL Recent TopicsPosted: Sun Dec 23, 2007 10:50 am    Post subject: Re: EZPORTAL Recent Topics

Well it should work.

Could you post here the code you try once modified ?

Just to make sure everything is where it should.

++

_________________
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
PerfRen



Joined: 01 Nov 2007
Posts: 36

EZPORTAL Recent TopicsPosted: Sun Dec 23, 2007 11:25 pm    Post subject: Re: EZPORTAL Recent Topics

Ok will reapply the modification to the php file and upload it for you to see that it doesnt work - hopefully it will be able to show how we can fix it Smile

Merry Xmas to all btw Cool
Back to top
Display posts from previous:   
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB mod Rewrite  » Advanced mod Rewrite
Page 1 of 1

Navigation Similar Topics

Jump to: