canver/phpbb3 portal with advanced seo mod

phpBB3 SEO Advanced mod Rewrite support forum.
This mods performs URL rewriting for phpBB, injecting forums and topic titles in their URLs.

Moderator: Moderators


canver/phpbb3 portal with advanced seo mod

Postby remixed » Sat May 10, 2008 12:06 pm

Hello,

The Advanced seo mod is running and i just installed the phpbb3 portal or the canver portal (the same).

It works, but i would love to see that the topic links in the portal are also seo and not viewtopic.php?...

I have searched but couldn't find a anwser, the version: 1.2.2 is stable.

This is a part of the recent.php (where the topics are shown in).
Code: Select all
<?php
/*
*
* @package phpBB3 Portal  a.k.a canverPortal  ( www.phpbb3portal.com )
* @version $Id: recent.php,v 1.5 2008/02/09 08:18:14 angelside Exp $
* @copyright (c) Canver Software - www.canversoft.net
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
if (!defined('IN_PHPBB') or !defined('IN_PORTAL'))
{
   die('Hacking attempt');
   exit;
}

/**
*/

//
// Exclude forums
//
$sql_where = '';
if ($config['portal_exclude_forums'])
{
   $exclude_forums = explode(',', $config['portal_exclude_forums']);
   foreach ($exclude_forums as $i => $id)
   {
      if ($id > 0)
      {
         $sql_where .= ' AND forum_id <> ' . trim($id);
      }
   }
}

//
// Recent announcements
//
$sql = 'SELECT topic_title, forum_id, topic_id
   FROM ' . TOPICS_TABLE . '
   WHERE topic_status <> ' . FORUM_LINK . '
      AND topic_approved = 1
      AND ( topic_type = ' . POST_ANNOUNCE . ' OR topic_type = ' . POST_GLOBAL . ' )
      ' . $sql_where . '
   ORDER BY topic_time DESC';

$result = $db->sql_query_limit($sql, $config['portal_max_topics']);

while( ($row = $db->sql_fetchrow($result)) && ($row['topic_title']) )
{
   // auto auth
   if ( ($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0') )
   {
      $template->assign_block_vars('latest_announcements', array(
         'TITLE'          => character_limit($row['topic_title'], $config['portal_recent_title_limit']),
         'FULL_TITLE'   => censor_text($row['topic_title']),
         'U_VIEW_TOPIC'   => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id'])
      ));
   }
}
$db->sql_freeresult($result);


i ques that if you know how to change this one, i can change the rest with the same code..?
remixed
 
Posts: 19
Joined: Fri May 09, 2008 4:03 pm

Advertisement

Postby dcz » Wed May 14, 2008 2:00 pm

Try replacing :

Code: Select all
$sql = 'SELECT topic_title, forum_id, topic_id

with :
Code: Select all
$sql = 'SELECT topic_title, forum_id, topic_id, topic_type


and adding :
Code: Select all
if ( empty($phpbb_seo->seo_url['topic'][$row['topic_id']]) ) {
   if ($row['topic_type'] == POST_GLOBAL) {
      $phpbb_seo->seo_opt['topic_type'][$row['topic_id']] = POST_GLOBAL;
   }
   $phpbb_seo->seo_url['topic'][$row['topic_id']] = $phpbb_seo->format_url(censor_text($row['topic_title']));
}


after :

Code: Select all
   if ( ($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0') )
   {


Should do it except for regular announces in case you do use the virtual folder trick and do not use the forum url cache.

Problem with the portal you are using is, it's not really well coded, I would not consider it this stable.

For example, in the code you posted :

Code: Select all
   WHERE topic_status <> ' . FORUM_LINK . '


Does not make sens, only forums can be forum links. But ho well, if it works ...

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

Postby remixed » Fri May 16, 2008 1:55 pm

It worked!! :shock: :D

http://www.criminalspoint.com/home.html at the left side I've put a little box "Active Topics". That is with the nice seo links AND it links you directly to the latest answer.

Thank you for your help!!
remixed
 
Posts: 19
Joined: Fri May 09, 2008 4:03 pm

Postby 1234homie » Sat Oct 11, 2008 8:24 am

i have this some problem in board3portal, in portal i see normal link

my recent topic script:

Code: Select all
...

// Exclude forums
//
$sql_where = '';
if ($portal_config['portal_exclude_forums'])
{
   $exclude_forums = explode(',', $portal_config['portal_exclude_forums']);
   foreach ($exclude_forums as $i => $id)
   {
      if ($id > 0)
      {
         $sql_where .= ' AND forum_id <> ' . trim($id);
      }
   }
}

// Get a list of forums the user cannot read
$forum_ary = array_unique(array_keys($auth->acl_getf('!f_read', true)));

// Determine first forum the user is able to read (must not be a category)
$sql = 'SELECT forum_id
FROM ' . FORUMS_TABLE . '
WHERE forum_type = ' . FORUM_POST;

if (sizeof($forum_ary))
{
$sql .= ' AND ' . $db->sql_in_set('forum_id', $forum_ary, true);
}

$result = $db->sql_query_limit($sql, 1);
$g_forum_id = (int) $db->sql_fetchfield('forum_id');

//
// Recent announcements
//
$sql = 'SELECT topic_title, forum_id, topic_id
   FROM ' . TOPICS_TABLE . '
   WHERE topic_status <> ' . FORUM_LINK . '
      AND topic_approved = 1
      AND ( topic_type = ' . POST_ANNOUNCE . ' OR topic_type = ' . POST_GLOBAL . ' )
      AND topic_moved_id = 0
      ' . $sql_where . '
   ORDER BY topic_time DESC';

$result = $db->sql_query_limit($sql, $portal_config['portal_max_topics']);

while( ($row = $db->sql_fetchrow($result)) && ($row['topic_title']) )
{
   // auto auth
   if ( ($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0') )
   {
   $phpbb_seo->seo_url['topic'][$row['topic_id']] = $phpbb_seo->format_url(censor_text($row['topic_title']));
}
      $template->assign_block_vars('latest_announcements', array(
         'TITLE'          => character_limit($row['topic_title'], $portal_config['portal_recent_title_limit']),
         'FULL_TITLE'   => censor_text($row['topic_title']),
         'U_VIEW_TOPIC'   => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . ( ($row['forum_id'] == 0) ? $g_forum_id : $row['forum_id'] ) . '&amp;t=' . $row['topic_id'])
      ));
   }
}
$db->sql_freeresult($result);

//
// Recent hot topics
//
$sql = 'SELECT topic_title, forum_id, topic_id
   FROM ' . TOPICS_TABLE . '
   WHERE topic_approved = 1
      AND topic_replies >=' . $config['hot_threshold'] . '
      AND topic_moved_id = 0
      ' . $sql_where . '
   ORDER BY topic_time DESC';

$result = $db->sql_query_limit($sql, $portal_config['portal_max_topics']);

while( ($row = $db->sql_fetchrow($result)) && ($row['topic_title']) )
{
   // auto auth
   if ( ($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0') )
   {
      $template->assign_block_vars('latest_hot_topics', array(
         'TITLE'          => character_limit($row['topic_title'], $portal_config['portal_recent_title_limit']),
         'FULL_TITLE'   => censor_text($row['topic_title']),
         'U_VIEW_TOPIC'   => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . ( ($row['forum_id'] == 0) ? $g_forum_id : $row['forum_id'] ) . '&amp;t=' . $row['topic_id'])
      ));
   }
}
$db->sql_freeresult($result);

//
// Recent topic (only show normal topic)
//
$sql = 'SELECT topic_title, forum_id, topic_id
   FROM ' . TOPICS_TABLE . '
   WHERE topic_status <> ' . ITEM_MOVED . '
      AND topic_approved = 1
      AND topic_type = ' . POST_NORMAL . '
      AND topic_moved_id = 0
      ' . $sql_where . '
   ORDER BY topic_time DESC';

$result = $db->sql_query_limit($sql, $portal_config['portal_max_topics']);

while( ($row = $db->sql_fetchrow($result)) && ($row['topic_title']) )
{
   // auto auth
   if ( ($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0') )
   {
      $template->assign_block_vars('latest_topics', array(
         'TITLE'          => character_limit($row['topic_title'], $portal_config['portal_recent_title_limit']),
         'FULL_TITLE'   => censor_text($row['topic_title']),
         'U_VIEW_TOPIC'   => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id'])
      ));
   }
}
$db->sql_freeresult($result);

$template->assign_vars(array(
   'S_DISPLAY_RECENT'         => true,

...


anybody can help me?
1234homie
 
Posts: 3
Joined: Fri Oct 10, 2008 9:54 pm

Postby dcz » Sun Oct 12, 2008 8:06 am

It looks like you just have to implement the code change suggested above , you'll only have to do it three time.
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: 19930
Joined: Fri Apr 28, 2006 9:03 pm

Postby CharlieM » Sat Nov 29, 2008 8:53 am

Hi @ all,

if i disable "recent Topic" it doesn't work in "latest news", eq. it works in "latest news" only if the Post is shown in "recent Topic"

Any ideas?

THX!

SOLVED:
I've found this Post - now its works great!
CharlieM
 
Posts: 11
Joined: Sun Nov 16, 2008 9:49 pm

Postby SeO » Sun Nov 30, 2008 10:10 am

You may just need to apply similar changes in the latest news module script.
SeO
Admin
Admin
 
Posts: 6035
Joined: Wed Mar 15, 2006 9:41 pm

Postby CharlieM » Mon Dec 01, 2008 6:45 pm

Sorry...
I'm not really a Coder...it's possible to change eq.:
- "top_posters.php"
- "random_member.php"
-"latest_member.php"

:oops: :mrgreen:

Download File's

I think its crazy there's no Thread with all the changes for the Portal... :?
CharlieM
 
Posts: 11
Joined: Sun Nov 16, 2008 9:49 pm

Postby dcz » Sat Dec 06, 2008 8:44 am

One of our french member just compiled the premoded bbportal files here :
http://www.phpbb-seo.com/forums/premod- ... t3838.html

;)
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: 19930
Joined: Fri Apr 28, 2006 9:03 pm

Postby CharlieM » Mon Dec 15, 2008 6:42 am

solved
CharlieM
 
Posts: 11
Joined: Sun Nov 16, 2008 9:49 pm


Return to Advanced SEO URL

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 37 guests


 
cron