patrycju5z
05-03-2011, 18:17
Witam.
Czy ktoś spotkał się już z dodatkiem umożliwiającym wyświetlenie artykułów k2 uzytkownika na jego profilu CB?
Pozdrawiam,
Patrycjusz
Należy w pliku cb.authortab.php zamienić kod:
$query = "SELECT a.id, a.catid, a.title, a.hits,a.created, ROUND( r.rating_sum / r.rating_count ) AS rating,r.rating_count";
if ( $jVer >= 1 ) {
$query .= ', CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug,'
. ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug';
}
$query .= "\n FROM #__content AS a"
. "\n LEFT JOIN #__content_rating AS r ON r.content_id=a.id";
if ( $jVer < 2 ) {
$query .= "\n INNER JOIN #__sections AS s ON s.id=a.sectionid AND s.title != 'Mamblog'";
}
if ( $jVer >= 1 ) {
$query .= "\n LEFT JOIN #__categories AS cc ON cc.id = a.catid";
}
$query .= "\n WHERE a.created_by=". (int) $user->id .""
. "\n AND a.state = 1 "
. "\n AND (publish_up = '0000-00-00 00:00:00' OR publish_up <= '$now')"
. "\n AND (publish_down = '0000-00-00 00:00:00' OR publish_down >= '$now')"
. "\n AND a.access <= " . (int) $_CB_framework->myCmsGid()
. "\n ORDER BY a.created DESC"
;
$_CB_database->setQuery( $query );na następujący:
$query = "SELECT a.id, a.catid, a.title, a.hits,a.created, ROUND( r.rating_sum / r.rating_count ) AS rating,r.rating_count";
if ( $jVer == 1 ) {
$query .= ', CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug,'
. ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug';
}
$query .= "\n FROM #__k2_items AS a"
. "\n LEFT JOIN #__k2_rating AS r ON r.itemID=a.id"
. "\n INNER JOIN #__k2_categories AS s ON s.id=a.catid OR s.parent = a.catid"
;
if ( $jVer == 1 ) {
$query .= "\n LEFT JOIN #__categories AS cc ON cc.id = a.catid";
}
$query .= "\n WHERE a.created_by=". (int) $user->id .""
. "\n AND a.published = 1 "
. "\n AND a.trash = 0 "
. "\n AND (publish_up = '0000-00-00 00:00:00' OR publish_up <= '$now')"
. "\n AND (publish_down = '0000-00-00 00:00:00' OR publish_down >= '$now')"
. "\n AND a.access <= " . (int) $_CB_framework->myCmsGid()
. "\n ORDER BY a.created DESC"
;
$_CB_database->setQuery( $query );Jeszcze zamienić link:
'index.php?option=com_content&view=article&id='na
'index.php?option=com_k2&view=item&id=I teraz będzie lista artykułów z K2
vBulletin® v4.2.5, Prawa przedruku © 2024 vBulletin Solutions, Inc. Wszystkie prawa zastrzeżone.
Tłumaczenie: Polskie Centrum Joomla!