[TYPO3-german] LÖSUNG: t3blog Suche, Autoren durchsuchen

HC-Media office at hc-media.org
Tue Feb 4 10:10:50 CET 2014



Liebe Liste, 

ich hatte vor Kurzem eine Kunden-Anforderung betreffend
T3Blog, 
die ich gerne mit euch teilen würde.

Die Anforderung war dass
ähnlich wie bei Wordpress auch nach einem Autorennamen gesucht werden
konnte,
und sämtliche Blogbeiträge dazu aufgelistet werden.

Ich habe dazu
die Standardsuche des T3Blogs geringfügig erweitert: 

Datei:
/typo3conf/ext/t3blog/pi1/widgets/blogList/class.listFunctions.php
Funktion:
getSearchCondition()
Mein Code: 

protected function getSearchCondition()
{
 $result = '';
 if (trim($this->globalPiVars['sword'])) {
 $searchWord =
$GLOBALS['TYPO3_DB']->quoteStr($this->globalPiVars['sword'],
'tx_t3blog_post');

 $this->tables['tt_content'] = 'tt_content';
 $result
.= ' AND tt_content.irre_parentid = tx_t3blog_post.uid ' .
 ' AND
tt_content.irre_parenttable = 'tx_t3blog_post'';
 $result .= ' AND (';

$result .= ' tt_content.header LIKE '%'.$searchWord.'%' ';
 $result .= ' OR
tt_content.bodytext LIKE '%'.$searchWord.'%' ';
 $result .= ' OR
tx_t3blog_post.title LIKE '%'.$searchWord.'%' ';
 $result .= ' OR
tx_t3blog_post.tagClouds LIKE '%'.$searchWord.'%' ';
 $result .= ' OR
tx_t3blog_post.author IN (';
 $result .= ' SELECT be_users.uid FROM
be_users WHERE realName LIKE '%'.$searchWord.'%'';
 $result .= ' )'

$result .= ' ) ';
 $result .=
$this->localcObj->enableFields('tt_content');
 }
 return $result;
}

Es ist
zwar nur eine minimale Anpassung, aber falls jemand eine ähnliche
Anforderung hat...

LG
Christof  

-- 

Mit freundlichen Grüßen
Christof
Hausladen
-----------------------------------------------
HC-Media 


More information about the TYPO3-german mailing list