Ich habe es getestet und bei zu langem Beitrag macht er den
Code: Alles auswählen
<meta name="keywords" content=
Code: Alles auswählen
<meta name="keywords" content=
Sorry, muss das Thema noch mal aufrollen.larsneo hat geschrieben: in viewtopic.php:
anstelle vonnurCode: Alles auswählen
$page_title = $lang['View_topic'] .' - ' . $topic_title;benutzen - 'Thema anzeigen -' ist überflüssig.Code: Alles auswählen
$page_title = $topic_title;
folgender Hinweis:larsneo hat geschrieben:Code: Alles auswählen
if ( isset($HTTP_GET_VARS[POST_TOPIC_URL]) ) { $topic_id = intval($HTTP_GET_VARS[POST_TOPIC_URL]); } else if ( isset($HTTP_GET_VARS['topic']) ) { $topic_id = intval($HTTP_GET_VARS['topic']); } if ( $topic_id ) { $sql = "SELECT c.cat_title, f.forum_name, t.topic_title FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . CATEGORIES_TABLE . " c WHERE f.forum_id = t.forum_id AND c.cat_id = f.cat_id AND t.topic_id = $topic_id"; if( ($result = $db->sql_query($sql)) ) { if ( $meta_row = $db->sql_fetchrow($result) ) { $meta_description = '<meta name="description" content="' . $meta_row['cat_title'] . ' :: ' . $meta_row['forum_name'] . ' :: ' . $meta_row['topic_title'] . '">'; } } $sql = "SELECT w.word_text FROM " . TOPICS_TABLE . " t, " . SEARCH_MATCH_TABLE . " m, " . SEARCH_WORD_TABLE . " w WHERE t.topic_first_post_id = m.post_id AND m.word_id = w.word_id AND t.topic_id = $topic_id"; if( ($result = $db->sql_query($sql)) ) { $meta_keywords = ''; while ( $meta_row = $db->sql_fetchrow($result) ) { $meta_keywords .= ($meta_keywords=='') ? $meta_row['word_text'] : ',' . $meta_row['word_text']; } $meta_keywords = '<meta name="keywords" content="' . $meta_keywords . '">'; } }
betrifft:Notice: Undefined variable: topic_id in /www/htdocs/marcg/includes/page_header.php on line 62
Code: Alles auswählen
  if ( $topic_id ) ?else if ( isset($HTTP_GET_VARS['topic']) )
{
$topic_id = intval($HTTP_GET_VARS['topic']);
}
if ( $topic_id && !$userdata['session_logged_in'] )
{
$sql = "SELECT c.cat_title, f.forum_name, t.topic_title
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . CATEGORIES_TABLE . " c
WHERE f.forum_id = t.forum_id
AND c.cat_id = f.cat_id
AND t.topic_id = $topic_id";
if( ($result = $db->sql_query($sql)) )
Code: Alles auswählen
// larsneos META-Tag-Generierungs-MOD / (modifiziert von Harki) ANFANG
if ( isset($HTTP_GET_VARS[POST_POST_URL]) )
	{
		$post_id = intval($HTTP_GET_VARS[POST_POST_URL]);
	}
	else if ( isset($HTTP_GET_VARS[POST_TOPIC_URL]) )
	{
		$topic_id = intval($HTTP_GET_VARS[POST_TOPIC_URL]);
	}
	else if ( isset($HTTP_GET_VARS['topic']) )
	{
		$topic_id = intval($HTTP_GET_VARS['topic']);
	}
	
	if ( $post_id && !$userdata['session_logged_in'] )
	{
		$sql = "SELECT pt.post_subject, c.cat_title, f.forum_name, t.topic_title
			FROM " . POSTS_TABLE . " p, " . POSTS_TEXT_TABLE . " pt, " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . CATEGORIES_TABLE . " c
			WHERE f.forum_id = t.forum_id
			AND pt.post_id = p.post_id
			AND c.cat_id = f.cat_id
			AND t.topic_id = p.topic_id
			AND p.post_id = $post_id";
		if( ($result = $db->sql_query($sql)) )
		{
			if ( $meta_row = $db->sql_fetchrow($result) )
			{
				$meta_description = '<meta name="description" content="' . $board_config['sitename'] . ' :: ' . $meta_row['cat_title'] . ' :: ' . $meta_row['forum_name'] . ' :: ' . $meta_row['topic_title'];
				if ($meta_row['post_subject'] && ($meta_row['post_subject'] != $meta_row['topic_title']) )
				{
					$meta_description .= ' :: ' . $meta_row['post_subject'];
				}
				$meta_description .= '" />';
			}
		}
		$sql = "SELECT w.word_text
			FROM " . POSTS_TABLE . " p, " . SEARCH_MATCH_TABLE . " m, " . SEARCH_WORD_TABLE . " w
			WHERE p.post_id = m.post_id
			AND m.word_id = w.word_id
			AND p.post_id = $post_id";
		if( ($result = $db->sql_query($sql)) )
		{
			$meta_keywords = '';
			while ( $meta_row = $db->sql_fetchrow($result) )
			{
				$meta_keywords .= ($meta_keywords=='') ? $meta_row['word_text'] : ', ' . $meta_row['word_text'];
			}
			$meta_keywords = '<meta name="keywords" content="' . $meta_keywords . '" />';
		}
	}
	
	else if ( $topic_id && !$userdata['session_logged_in'] )
	{
		$sql = "SELECT c.cat_title, f.forum_name, t.topic_title
			FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . CATEGORIES_TABLE . " c
			WHERE f.forum_id = t.forum_id
			AND c.cat_id = f.cat_id
			AND t.topic_id = $topic_id";
		if( ($result = $db->sql_query($sql)) )
		{
			if ( $meta_row = $db->sql_fetchrow($result) )
			{
				$meta_description = '<meta name="description" content="' . $board_config['sitename'] . ' :: ' . $meta_row['cat_title'] . ' :: ' . $meta_row['forum_name'] . ' :: ' . $meta_row['topic_title'] . '" />';
			}
		}
		
		
		$sql = "SELECT w.word_text
			FROM " . TOPICS_TABLE . " t, " . SEARCH_MATCH_TABLE . " m, " . SEARCH_WORD_TABLE . " w
			WHERE t.topic_first_post_id = m.post_id
			AND m.word_id = w.word_id
			AND t.topic_id = $topic_id"; 
		if( ($result = $db->sql_query($sql)) )
		{
			$meta_keywords = '';
			while ( $meta_row = $db->sql_fetchrow($result) )
			{
				$meta_keywords .= ($meta_keywords=='') ? $meta_row['word_text'] : ', ' . $meta_row['word_text'];
			}
			$meta_keywords = '<meta name="keywords" content="' . $meta_keywords . '" />';
		}
	}
	
	
	else
	{
		$meta_description = '<meta name="description" content="Standard-Beschreibung" />' . "\n";
		$meta_keywords = '<meta name="keywords" content="wort, sinn, mensch, zeit, raum" />' . "\n";
	}
	
// larsneos META-Tag-Generierungs-MOD / (modifiziert von Harki) ENDE
Code: Alles auswählen
    'META_DESCRIPTION' => $meta_description, 
    'META_KEYWORDS' => $meta_keywords, Du mußt in includes/page_header.php nach dem Block mit den Variablenzuweisungen suchen. Also danach:Otti1234 hat geschrieben:Bin da sehr Laienhaft, aber was bedeutet das genau? Hab bis hierher sonst alles wie beschrieben umgesetzt?
die entsprechenden variablen-zuweisungensetzen.Code: Alles auswählen
'META_DESCRIPTION' => $meta_description, 'META_KEYWORDS' => $meta_keywords,
Code: Alles auswählen
// The following assigns all _common_ variables that may be used at any point
// in a template.
//
$template->assign_vars(array(
	'SITENAME' => $board_config['sitename'],
	'SITE_DESCRIPTION' => $board_config['site_desc'],
	'PAGE_TITLE' => $page_title,Code: Alles auswählen
// The following assigns all _common_ variables that may be used at any point
// in a template.
//
$template->assign_vars(array(
	'META_DESCRIPTION' => $meta_description, 
	'META_KEYWORDS' => $meta_keywords,
	'SITENAME' => $board_config['sitename'],
	'SITE_DESCRIPTION' => $board_config['site_desc'],
	'PAGE_TITLE' => $page_title,