[geeklog-cvs] geeklog: Make the topic's meta description available in the Topi...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Sat Oct 31 04:52:51 EDT 2009
changeset 7409:c776e22f2de6
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/c776e22f2de6
user: Dirk Haun <dirk at haun-online.de>
date: Fri Oct 30 21:13:23 2009 +0100
description:
Make the topic's meta description available in the Topics Block
diffstat:
public_html/lib-common.php | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diffs (30 lines):
diff -r d1e9c15f5c60 -r c776e22f2de6 public_html/lib-common.php
--- a/public_html/lib-common.php Fri Oct 30 19:15:17 2009 +0100
+++ b/public_html/lib-common.php Fri Oct 30 21:13:23 2009 +0100
@@ -2122,7 +2122,7 @@
$op = 'AND';
}
- $sql = "SELECT tid,topic,imageurl FROM {$_TABLES['topics']}" . $langsql;
+ $sql = "SELECT tid,topic,imageurl,meta_description FROM {$_TABLES['topics']}" . $langsql;
if( !COM_isAnonUser() )
{
$tids = DB_getItem( $_TABLES['userindex'], 'tids',
@@ -2272,6 +2272,17 @@
}
$sections->set_var( 'topic_image', $topicimage );
+ $desc = trim($A['meta_description']);
+ $sections->set_var('topic_description', $desc);
+ $desc_escaped = htmlspecialchars($desc);
+ $sections->set_var('topic_description_escaped', $desc_escaped);
+ if (! empty($desc)) {
+ $sections->set_var('topic_title_attribute',
+ 'title="' . $desc_escaped . '"');
+ } else {
+ $sections->set_var('topic_title_attribute', '');
+ }
+
if(( $A['tid'] == $topic ) && ( $page == 1 ))
{
$retval .= $sections->parse( 'item', 'inactive' );
More information about the geeklog-cvs
mailing list