Make the topic's meta description available in the Topics Block HEAD
authorDirk Haun <dirk@haun-online.de>
Fri Oct 30 21:13:23 2009 +0100 (2009-10-30)
branchHEAD
changeset 7409c776e22f2de6
parent 7408 d1e9c15f5c60
child 7410 b07ac3dba962
Make the topic's meta description available in the Topics Block
public_html/lib-common.php
     1.1 --- a/public_html/lib-common.php	Fri Oct 30 19:15:17 2009 +0100
     1.2 +++ b/public_html/lib-common.php	Fri Oct 30 21:13:23 2009 +0100
     1.3 @@ -2122,7 +2122,7 @@
     1.4          $op = 'AND';
     1.5      }
     1.6  
     1.7 -    $sql = "SELECT tid,topic,imageurl FROM {$_TABLES['topics']}" . $langsql;
     1.8 +    $sql = "SELECT tid,topic,imageurl,meta_description FROM {$_TABLES['topics']}" . $langsql;
     1.9      if( !COM_isAnonUser() )
    1.10      {
    1.11          $tids = DB_getItem( $_TABLES['userindex'], 'tids',
    1.12 @@ -2272,6 +2272,17 @@
    1.13          }
    1.14          $sections->set_var( 'topic_image', $topicimage );
    1.15  
    1.16 +        $desc = trim($A['meta_description']);
    1.17 +        $sections->set_var('topic_description', $desc);
    1.18 +        $desc_escaped = htmlspecialchars($desc);
    1.19 +        $sections->set_var('topic_description_escaped', $desc_escaped);
    1.20 +        if (! empty($desc)) {
    1.21 +            $sections->set_var('topic_title_attribute',
    1.22 +                               'title="' . $desc_escaped . '"');
    1.23 +        } else {
    1.24 +            $sections->set_var('topic_title_attribute', '');
    1.25 +        }
    1.26 +
    1.27          if(( $A['tid'] == $topic ) && ( $page == 1 ))
    1.28          {
    1.29              $retval .= $sections->parse( 'item', 'inactive' );