Verfasst: 18.03.2004 06:50
zielsetzung bei dem mod war nicht, möglichst viele urls auf 'statisches' aussehen umzuschreiben, sondern lediglich die wichtigsten. dies wirkt auch einer doppelerfassung durch die spider/robots entgegen 

phpBB.de - Die deutsche phpBB-Community
https://www.phpbb.de/community/
verlinkt nicht wie z.b. hier auf phpbb.de zu forumx.html sondern zu viewforum.php?f=x dasselbe in der Beitragsansicht (viewtopic.php).Beispiel hat geschrieben:phpBB.de Foren-Übersicht -> Modifikationen
Code: Alles auswählen
function make_cat_nav_tree($cur, $pgm='', $nav_class='nav', $topic_title='', $forum_id=0)
{
global $phpbb_root_path, $phpEx, $db;
global $global_orig_word, $global_replacement_word;
global $nav_separator;
global $tree;
// get topic or post level
$type = substr($cur, 0, 1);
$id = intval(substr($cur,1));
$fcur = '';
switch ($type)
{
case POST_TOPIC_URL:
if ( empty($forum_id) || empty($topic_title) )
{
$sql = "SELECT forum_id, topic_title
FROM " . TOPICS_TABLE . " WHERE topic_id = $id";
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not query topics information', '', __LINE__, __FILE__, $sql);
}
if ( $row = $db->sql_fetchrow($result) )
{
$topic_title = $row['topic_title'];
$forum_id = $row['forum_id'];
}
}
else
{
$row = array();
$row['topic_title'] = $topic_title;
$row['forum_id'] = $forum_id;
}
if ( !empty($forum_id) )
{
$fcur = POST_FORUM_URL . $row['forum_id'];
$topic_title = $row['topic_title'];
$orig_word = array();
$remplacement_word = array();
obtain_word_list($orig_word, $replacement_word);
if ( count($orig_word) )
{
$topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
}
}
break;
case POST_POST_URL:
if ( empty($forum_id) || empty($topic_title) )
{
$sql = "SELECT t.forum_id, t.topic_title
FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t
WHERE t.topic_id=p.topic_id AND post_id = $id";
if ( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, 'Could not query posts information', '', __LINE__, __FILE__, $sql);
if ( !$row = $db->sql_fetchrow($result) )
{
$row['forum_id'] = 0;
$row['topic_title'] = '';
}
}
else
{
$row['forum_id'] = $forum_id;
$row['topic_title'] = $topic_title;
}
if ( !empty($forum_id) && !empty($topic_title) )
{
$fcur = POST_FORUM_URL . $row['forum_id'];
$topic_title = $row['topic_title'];
$orig_word = array();
$remplacement_word = array();
obtain_word_list($orig_word, $replacement_word);
if ( count($orig_word) )
{
$topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
}
}
break;
}
// keep the compliancy with prec versions
if (!isset($tree['keys'][$cur]))
{
$cur = isset($tree['keys'][POST_CAT_URL . $cur]) ? POST_CAT_URL . $cur : $cur;
}
// find the object
$this = isset($tree['keys'][$cur]) ? $tree['keys'][$cur] : -1;
$res = '';
while (($this >= 0) || ($fcur != ''))
{
$type = (substr($fcur, 0, 1) != '') ? substr($cur, 0, 1) : $tree['type'][$this];
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;
}
if ($pgm != '') $pgm_name = "$pgm.$phpEx";
if (!empty($field_name)) $res = '<a href="' . append_sid('./' . $pgm_name . (($field_name != '') ? "?$param_type=$param_value" : '')) . '" class="' . $nav_class . '">' . $field_name . '</a>' . (($res != '') ? $nav_separator . $res : '');
// find parent object
if ($fcur != '')
{
$cur = $fcur;
$pgm = '';
$fcur = '';
$topic_title = '';
}
else
{
$cur = $tree['main'][$this];
}
$this = isset($tree['keys'][$cur]) ? $tree['keys'][$cur] : -1;
}
return $res;
}
aber so funktioniert das nicht da die datei ja erst durch die htaccess auch über forums.html aufgerufen werden kann.Directoryindex forums.html
Ich glaube, das Google meine einzelnen Foren nicht findet, wo und wie soll ich durchgängige Links machen. Meine Seite hat nämlich seit dem letzten PR Update PR 6, dadurch müssten die Beiträge ja ruck zuck im Index sein. Wenn du mir einen Tipp geben könntest wäre ich sehr dankbar.die meta-weiterleitung sollte optimalerweise nach /phpbb/forums.html zeigen (so habe ich es auch bei nuforum.de gelöst) - dann sind die statischen links durchgängig...
Nachdem die .htaccess in das Webroot kopiert wurde, kann man via direkter URL-Eingabe testen, ob die kurzen URLs unterstützt werden. Wenn also bei Eingabe von 'forum1.html' das erste Forum angezeigt wird, kann es mit den nächsten Schritten weitergehen...