| |
|
| :: |
| Author |
Message |
jolin
Joined: 04 May 2006 Posts: 17
|
Posted: Thu May 04, 2006 3:23 pm Post subject: Adaptation of Url Keywords Rewrite Mod to IntegraMOD 1.4.0 |
|
|
I have IntegraMOD 1.4.0 phpBB 2.0.20 which is a phpBB preModded version of phpBB with many Mods including the 'Category Hierarchy Mod' which adds subforums to phpBB on the main forum page as well as several text and image links to the last post on each forum.
I'm looking to make the necessary code adaptation to the extra links created by CH Mod to work with the Url Rewrite Keywords Injection Mod and eliminate any duplicates caused by linking to last posts of topics.
One obvious problem is the Url Rewrite Keywords Injection Mod does not address the extra links added by CH Mod text and image links.
Example:
http://www.example.com/forum/viewtopic.php?p=91256#91256
The second problem is dealing with links to last posts of topics which creates duplicates as those links are for pages that all ready been indexed as example:
http://www.example.com/forum/topic-example-vt3937-15.html
Further so there are necessary code changes that need to be made in the Installation of the Mod in order to be successfully integrated it with IntegraMod. |
_________________ Gammonish.com - Backgammon Game Resource.
Last edited by jolin on Tue May 15, 2007 4:23 pm; edited 2 times in total |
|
| Back to top |
|
 |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 15129
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 15129
|
Posted: Thu May 04, 2006 10:51 pm Post subject: Re: Adaptation of Url Keywords Rewrite Mod to IntegraMOD 1.4.0 |
|
|
All right then try this :
| Code: | #
#-----[ OPEN ]------------------------------------------
#
includes/function_categories_hierarchy.php
#
#-----[ FIND ]------------------------------------------
#
function build_index($cur='Root', $cat_break=false, &$forum_moderators, $real_level=-1, $max_level=-1, &$keys)
{
global $template, $phpEx, $board_config, $lang, $images, $db, $userdata;
global $tree;
#
#-----[ AFTER, ADD ]------------------------------------------
#
// phpBB-SEO.com SEO TOOLKIT BEGIN
global $seo_forum_name, $seo_topic_name, $seo_cat_name;
$seo_forum_name = $seo_topic_name = $seo_cat_name = FALSE;
// phpBB-SEO.com SEO TOOLKIT END
#
#-----[ FIND ]------------------------------------------
# NOTE : I am note sure about the way CH works here, it seems that the categorie titles can change upon languages
# This could mean that the url would here change here too.
# If this is the case, then just do not apply this change, it's better not to change url.
// send to template
$template->assign_block_vars('catrow', array());
$template->assign_block_vars('catrow.cat', array(
'CAT_TITLE' => get_object_lang($cur, 'name'),
#
#-----[ REPLACE WITH ]------------------------------------------
# NOTE : I am note sure about the way CH works here, it seems that the categorie titles can change upon languages
# This could mean that the url would here change here too.
# If this is the case, then just do not apply this change, it's better not to change url.
// phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_cat_name = get_object_lang($cur, 'name');
// send to template
$template->assign_block_vars('catrow', array());
$template->assign_block_vars('catrow.cat', array(
'CAT_TITLE' => $seo_cat_name,
// phpBB-SEO.com SEO TOOLKIT END
#
#-----[ FIND ]------------------------------------------
#
if ( $data['tree.topic_last_post_id'] )
{
// resize
$topic_title = $data['tree.topic_title'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
// phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_topic_name = $topic_title;
// phpBB-SEO.com SEO TOOLKIT END
#
#-----[ FIND ]------------------------------------------
#
for ($j=0; $j < count($tree['sub'][$cur]); $j++) if ($tree['auth'][ $tree['sub'][$cur][$j] ]['auth_view'])
{
$wcur = $tree['sub'][$cur][$j];
$wthis = $tree['keys'][$wcur];
$wdata = $tree['data'][$wthis];
$wname = get_object_lang($wcur, 'name');
#
#-----[ AFTER, ADD ]------------------------------------------
#
// phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_forum_name = $wname;
// phpBB-SEO.com SEO TOOLKIT END
#
#-----[ FIND ]------------------------------------------
# THIS ONE MAY NOT BE USEFULL
$wlast_post = '<a href="' . append_sid("./viewtopic.$phpEx?" . POST_POST_URL . '=' . $wdata['tree.topic_last_post_id']) . '#' . $wdata['tree.topic_last_post_id'] . '">';
#
#-----[ BEFORE, ADD ]------------------------------------------
# THIS ONE MAY NOT BE USEFULL
// phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_topic_name = FALSE;
// phpBB-SEO.com SEO TOOLKIT END
#
#-----[ FIND ]------------------------------------------
#
// send to template
$template->assign_block_vars('catrow', array());
$template->assign_block_vars('catrow.forumrow', array(
'FORUM_FOLDER_IMG' => $folder_image,
'ICON_IMG' => $icon_img,
'FORUM_NAME' => $title,
'FORUM_DESC' => $desc,
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_forum_name = $title;
// phpBB-SEO.com SEO TOOLKIT END
#
#-----[ FIND ]------------------------------------------
#
return $display;
}
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_forum_name = $seo_topic_name = $seo_cat_name = FALSE;
// phpBB-SEO.com SEO TOOLKIT END |
And read the notes as there are some things that remain unclear for me here. Sorry, but I preferedto first try without setting up a test server, too many project runnig already
Then, there will be the announce fix to be done, which was already done in a standalone install (without integramod) so it should not be a big deal here.
Let's procede step by step
++ |
_________________ 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 |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 15129
|
Posted: Fri May 05, 2006 9:51 am Post subject: Re: Adaptation of Url Keywords Rewrite Mod to IntegraMOD 1.4.0 |
|
|
And this :
| Code: | #
#-----[ FIND ]------------------------------------------
# This is to test for the viewforum view
function display_index($cur='Root')
{
global $board_config, $template, $userdata, $lang, $db, $nav_links, $phpEx;
global $images, $nav_separator, $nav_cat_desc;
global $tree;
#
#-----[ AFTER, ADD ]------------------------------------------
#
// phpBB-SEO.com SEO TOOLKIT BEGIN
global $seo_forum_name, $seo_topic_name, $seo_cat_name;
$seo_forum_name = $seo_topic_name = $seo_cat_name = FALSE;
// phpBB-SEO.com SEO TOOLKIT END
#
#-----[ FIND ]------------------------------------------
# I may be wrong here also
$template->assign_vars(array(
'SPACER' => $images['spacer'],
'NAV_SEPARATOR' => $nav_separator,
'NAV_CAT_DESC' => $nav_cat_desc,
'NAV_CURRENT' => get_object_lang($cur, 'name'), // Correct Titles :: Added
)
);
#
#-----[ AFTER, ADD ]------------------------------------------
# I may be wrong here also
// phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_forum_name = get_object_lang($cur, 'name')
$template->assign_vars(array(
'SPACER' => $images['spacer'],
'NAV_SEPARATOR' => $nav_separator,
'NAV_CAT_DESC' => $nav_cat_desc,
'NAV_CURRENT' => $seo_forum_name, // Correct Titles :: Added
)
);
// phpBB-SEO.com SEO TOOLKIT END
#
#-----[ FIND ]------------------------------------------
#
function make_cat_nav_tree($cur, $pgm='', $nav_class='nav')
{
global $phpbb_root_path, $phpEx, $db;
global $global_orig_word, $global_replacement_word;
global $nav_separator;
global $tree;
#
#-----[ AFTER, ADD ]------------------------------------------
#
// phpBB-SEO.com SEO TOOLKIT BEGIN
global $seo_forum_name, $seo_topic_name, $seo_cat_name;
$seo_forum_name = $seo_topic_name = $seo_cat_name = FALSE;
// phpBB-SEO.com SEO TOOLKIT END
#
#-----[ FIND ]------------------------------------------
#
switch($type)
{
case POST_CAT_URL:
$field_name = get_object_lang($cur, 'name');
$param_type = POST_CAT_URL;
$param_value = $tree['id'][$this];
$pgm_name = "index.$phpEx";
break;
case POST_FORUM_URL:
$field_name = get_object_lang($cur, 'name');
$param_type = POST_FORUM_URL;
$param_value = $tree['id'][$this];
$pgm_name = "viewforum.$phpEx";
break;
case POST_TOPIC_URL:
$field_name = $topic_title;
$param_type = POST_TOPIC_URL;
$param_value = $id;
$pgm_name = "viewtopic.$phpEx";
break;
case POST_POST_URL:
$field_name = $topic_title;
$param_type = POST_POST_URL;
$param_value = $id . '#' . $id;
$pgm_name = "viewtopic.$phpEx";
break;
default :
$field_name = '';
$param_type = '';
$param_value = '';
$pgm_name = "index.$phpEx";
break;
}
#
#-----[ REPLACE WITH ]------------------------------------------
#
switch($type)
{
case POST_CAT_URL:
$field_name = get_object_lang($cur, 'name');
// phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_cat_name = $field_name
// phpBB-SEO.com SEO TOOLKIT END
$param_type = POST_CAT_URL;
$param_value = $tree['id'][$this];
$pgm_name = "index.$phpEx";
break;
case POST_FORUM_URL:
$field_name = get_object_lang($cur, 'name');
// phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_forum_name = $field_name
// phpBB-SEO.com SEO TOOLKIT END
$param_type = POST_FORUM_URL;
$param_value = $tree['id'][$this];
$pgm_name = "viewforum.$phpEx";
break;
case POST_TOPIC_URL:
$field_name = $topic_title;
// phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_topic_name = $field_name
// phpBB-SEO.com SEO TOOLKIT END
$param_type = POST_TOPIC_URL;
$param_value = $id;
$pgm_name = "viewtopic.$phpEx";
break;
case POST_POST_URL:
$field_name = $topic_title;
// phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_topic_name = $field_name
// phpBB-SEO.com SEO TOOLKIT END
$param_type = POST_POST_URL;
$param_value = $id . '#' . $id;
$pgm_name = "viewtopic.$phpEx";
break;
default :
$field_name = '';
$param_type = '';
$param_value = '';
$pgm_name = "index.$phpEx";
break;
}
#
#-----[ FIND ]------------------------------------------
#
$this = isset($tree['keys'][$cur]) ? $tree['keys'][$cur] : -1;
}
return $res;
}
#
#-----[ REPLACE WITH ]------------------------------------------
#
$this = isset($tree['keys'][$cur]) ? $tree['keys'][$cur] : -1;
}
// phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_forum_name = $seo_topic_name = $seo_cat_name = FALSE;
// phpBB-SEO.com SEO TOOLKIT END
return $res;
}
#
#-----[ OPEN ]------------------------------------------
#
#
includes/function_topic_list.php
#
#-----[ FIND ]------------------------------------------
#
function topic_list($box, $tpl='', $topic_rowset, $list_title='', $split_type=false, $display_nav_tree=true, $footer='', $inbox=true, $select_field='', $select_type=0, $select_formname='', $select_values=array(), $topic_rank_set=array())
{
global $db, $template, $board_config, $userdata, $phpEx, $lang, $images, $HTTP_COOKIE_VARS;
global $tree;
static $box_id;
#
#-----[ AFTER, ADD ]------------------------------------------
#
// phpBB-SEO.com SEO TOOLKIT BEGIN
global $seo_forum_name, $seo_topic_name, $seo_cat_name;
$seo_forum_name = $seo_topic_name = $seo_cat_name = FALSE;
// phpBB-SEO.com SEO TOOLKIT END
#
#-----[ FIND ]------------------------------------------
# HERE, YOU SHOULD NOT USE SMILES IN TOPIC TITLES
for ($i=0; $i < count($topic_rowset); $i++)
{
$topic_item_type = substr($topic_rowset[$i]['topic_id'], 0, 1);
$topic_id = intval(substr($topic_rowset[$i]['topic_id'], 1));
$topic_title = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $topic_rowset[$i]['topic_title']) : $topic_rowset[$i]['topic_title'];
//Parse smilies to show the title
//This is where you would put the code to disable certain smilies
$topic_title = smilies_pass($topic_title);
#
#-----[ AFTER, ADD ]------------------------------------------
#
// phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_topic_name = $topic_title;
// phpBB-SEO.com SEO TOOLKIT END
#
#-----[ FIND ]------------------------------------------
#
}
else
{
if ($is_auth[ $topic_rowset[$i]['forum_id'] ]['auth_view'])
{
#
#-----[ AFTER, ADD ]------------------------------------------
#
// phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_forum_name = $topic_title;
// phpBB-SEO.com SEO TOOLKIT END
#
#-----[ FIND ]------------------------------------------
#
//
// Begin Approve_Mod Block : 9
//
#
#-----[ AFTER, ADD ]------------------------------------------
#
// phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_topic_name = $seo_forum_name = FALSE;
// phpBB-SEO.com SEO TOOLKIT END |
++ |
_________________ 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 |
|
 |
jolin
Joined: 04 May 2006 Posts: 17
|
Posted: Fri May 05, 2006 4:33 pm Post subject: Adaptation of Url Keywords Rewrite Mod to IntegraMOD 1.4.0 |
|
|
Sorry my friend, I get blank screen.
Maybe it's best that I'll roll back to 2.1.3 which works more elegantly with this heavily setup of IntegraMOD and just sort out the image links with your new method?
Is it possible just to find a fix to the image links with version 2.1.3?
I really like the way the new Mod works but this version of IntegraMOD has an outdated version of CH (v2.0.4) and a new version v2.1.6 is suppose to get rid of terrible def_tree.php which makes a lot of problems and I would like to be able to upgrade at some point and it would seem to be a mind bobbling experience trying to reconstruct this.
I think maybe you should offer both Mods as they will give solutions to all kind of people.
People who use a vannila phpBB install or a moderate Moded phpBB install will prefer the new much improved code behavior.
And then again Dumm, stupid people like me who started developing their board from a heavily premoded platform which is filled with clutter they don't want but already spent 6 months developing the damm board would "prefer" to go with the old version  |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 15129
|
|
| Back to top |
|
 |
|
|
| Navigation |
Similar Topics |
|
|
|
|
|
|
|