Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

JoomlaTune Support Forum    JComments component    Bug-reports    Topic: [solved] Articles wrongly opened in home screen
Pages: [1]   Go Down
  Print  
Author Topic: [solved] Articles wrongly opened in home screen  (Read 4337 times)
0 Members and 2 Guests are viewing this topic.
nzrunner
Newbie
*

Karma: 0
Offline Offline

Posts: 1


« on: December 23, 2010, 11:57:52 »

I am a new user of JComments, and have it integrated with both Phoca Gallery and K2.  Overall it seems to be a nice solution, but I have found two issues with the Latest Comments module.  I'm hoping someone can assist me in getting them resolved.

Issue 1
If you click on the "Read More" link of a comment published against a K2 article, it opens the article in the 'home" screen.  This appears to be due to a wrongly formatted URL, which always links back to the "home" page rather than the menu it came from.

As an example, I beleive the URL's should read like this: -

www.mysite.com.au/blog/item/100-Item1

or

www.mysite.com.au/news/item/102-Item2

Instead they read like this: -

www.mysite.com.au/home/item/100-Item1

and

www.mysite.com.au/home.item/102-Item2

Issue 2
While it displays comments made on both an individual photo and a photo category, if you click on the "Read More" link for the individual photo, it doesn't link to anything.

Merry Christmas
« Last Edit: February 24, 2012, 16:01:32 by smart » Logged
yaksushi
Newbie
*

Karma: 0
Offline Offline

Posts: 22


Email
« Reply #1 on: January 20, 2011, 01:36:24 »

I am having the same issue while using k2.

Clicking the read more link in the latest comments opens all articles under the same incorrect category.

you can view the example here: http://www.yakangler.com/yaksocial

link should open in: http://www.yakangler.com/articles/reviews/kayak-gear-reviews/item/749-yakattack-visicarbon-pro-review

but opens in: http://www.yakangler.com/about-us/item/749-yakattack-visicarbon-pro-review#comment-2519
Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #2 on: January 20, 2011, 03:50:49 »

At this moment I have no K2 installed so I can not test myself. But can try to use next solution (it must work with K2 2.4.1):

1. Open file /components/com_jcomments/plugins/com_k2.plugin.php
2. Replace code:
Code: (php)
function getObjectLink($id)
{

$db = & JFactory::getDBO();
$db->setQuery( 'SELECT alias FROM #__k2_items WHERE id = ' . $id );
$alias = $db->loadResult();

$link = 'index.php?option=com_k2&view=item&id='. $id . ':' . $alias;

require_once(JPATH_SITE.DS.'includes'.DS.'application.php');

$component = & JComponentHelper::getComponent('com_k2');
$menus = & JSite::getMenu();
$items = $menus->getItems('componentid', $component->id);

if (count($items)) {
$link .= "&Itemid=" . $items[0]->id;
}

$link = JRoute::_($link);
return $link;
}
with
Code: (php)
function getObjectLink($id)
{
require_once (JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'route.php');

$db = & JFactory::getDBO();
$query = "SELECT i.id, i.catid, i.alias, category.alias as catalias"
. " FROM #__k2_items as i"
. " LEFT JOIN #__k2_categories as category ON category.id=i.catid"
. " WHERE i.id = " . $id;
$db->setQuery($query);
$row = $db->loadObject();

$link = JRoute::_(K2HelperRoute::getItemRoute($row->id.':'.urlencode($row->alias), $row->catid.':'.urlencode($row->catalias)));
return $link;
}
« Last Edit: February 17, 2011, 04:12:15 by smart » Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
yaksushi
Newbie
*

Karma: 0
Offline Offline

Posts: 22


Email
« Reply #3 on: June 23, 2011, 21:18:07 »

sorry for the late reply!  but I can confirm that this fix works!     Cheesy Cheesy  Thanks Smart!  Grin
Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    Bug-reports    Topic: [solved] Articles wrongly opened in home screen
 
Jump to: