Browse Source

! Improve SEO a little bit by actually using something we have available to us already. Can't believe this wasn't done before.

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer 10 years ago
parent
commit
4c5fe4f4eb
2 changed files with 4 additions and 1 deletions
  1. 3 0
      Sources/MessageIndex.php
  2. 1 1
      Themes/default/index.template.php

+ 3 - 0
Sources/MessageIndex.php

@@ -47,6 +47,9 @@ function MessageIndex()
 
 	$context['name'] = $board_info['name'];
 	$context['description'] = $board_info['description'];
+	if (!empty($board_info['description']))
+		$context['meta_description'] = strip_tags($board_info['description']);
+
 	// How many topics do we have in total?
 	$board_info['total_topics'] = allowedTo('approve_posts') ? $board_info['num_topics'] + $board_info['unapproved_topics'] : $board_info['num_topics'] + $board_info['unapproved_user_topics'];
 

+ 1 - 1
Themes/default/index.template.php

@@ -121,7 +121,7 @@ function template_html_above()
 
 	echo '
 	<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
-	<meta name="description" content="', $context['page_title_html_safe'], '" />', !empty($context['meta_keywords']) ? '
+	<meta name="description" content="', !empty($context['meta_description']) ? $context['meta_description'] : $context['page_title_html_safe'], '" />', !empty($context['meta_keywords']) ? '
 	<meta name="keywords" content="' . $context['meta_keywords'] . '" />' : '', '
 	<title>', $context['page_title_html_safe'], '</title>';