[SOLVED] K2 and CB 1.2.2 Author linking

9 years 2 months ago #139090 by spadge69
CB and K2 are probably the greatest extensions to grace Joomla.

I am trying to alter the cbauthortab to show k2 item links rather than the joomla articles and forward the author links in the k2 items to the users CB profile.

Does anybody have suggestions on how one would approach such a task?

Post edited by: krileon, at: 2010/11/18 20:55
9 years 2 months ago #139273 by krileon
Maybe want to try document subscriber incubator project CB Articles. It's model based so adding K2 support wouldn't be hard (edit the J1.5 model). On a side note I plan to add K2 support to it anyway in a future release (busy with GroupJive 2.0 ATM). You'll need CB 1.2.3 to use incubator projects.

Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
Please note I am available Monday - Friday from 8:00 AM EST to 4:00 PM EST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
8 years 10 months ago #146589 by masao
I 've altered cb.authortab.php to fetch k2 table directly.
It works fine and shows k2 articles related to the user on cb tab.

$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 );

finally change article anchor link to
$url = cbSef( 'index.php?option=com_k2&view=item&id=' . item->id);

8 years 10 months ago #146747 by nonoy123
<a href=" onlyreviews.com/keith-harrell.html ">keith harrell</a>

keith harrell
8 years 9 months ago #149699 by patrycju5z
Where I must copy this code?
Moderators: beatnantkrileon
Time to create page: 0.558 seconds
Facebook Twitter Google LinkedIn