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

Robert Wildling rowild at gmx.net
Tue Feb 4 15:04:28 CET 2014


Danke dir für's Teilen! Hab augenblicklich zwar kein Einsatzszenario, 
aber super, dass du uns hier weiterhilfst!!!

Gruß, Robert

Am 04.02.14 10:10, schrieb HC-Media:
>
>
> 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
>



More information about the TYPO3-german mailing list