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

Login with username, password and session length

JoomlaTune Support Forum    JComments component    Integration with third-party extensions    Topic: Gavick News Show Pro GK4 + K2 + Jcomments integration
Pages: [1]   Go Down
  Print  
Author Topic: Gavick News Show Pro GK4 + K2 + Jcomments integration  (Read 4816 times)
0 Members and 1 Guest are viewing this topic.
cedacosur
Newbie
*

Karma: 0
Offline Offline

Posts: 2


« on: April 10, 2012, 02:48:44 »

Hi

I'm using jcomments to avoid our users to post comments in the news.

    My system:
    Joomla 2.5.3
    K2 2.5.5
    News Show Pro GK4 3.1.1
    Jcomments 2.3.0


How can I enable the comments counter in News Show Pro GK4 when a user post a comment?

http://canarias24horas.com/

Here you can view some comments:
http://canarias24horas.com/opinion/edit ... omiso.html

Thank you
Logged
ABTOP
Sr. Member
****

Karma: 17
Offline Offline

Posts: 399



WWW
« Reply #1 on: April 10, 2012, 03:16:52 »

How can I enable the comments counter in News Show Pro GK4 when a user post a comment?
You mean inside this bubble?


Hard to say without having this template and I don't have it. In fact, I can't even find it on their Web site.
You might want to ask the Gavik people.
« Last Edit: April 10, 2012, 03:27:23 by ABTOP » Logged

No personal messages unless you are a friend or you have money for me.
cedacosur
Newbie
*

Karma: 0
Offline Offline

Posts: 2


« Reply #2 on: April 10, 2012, 04:50:41 »



This is the answer from Gavick Team:

Hi

I'm sorry but at this moment NSP GK4 for J!2.5 still doesn't support JComments.
Only on J!1.5.

Cheers





I need this counter working fine (watch attached file):



* Captura de pantalla 2012-04-09 a la(s) 23.44.35.jpg (199.25 KB, 1014x481 - viewed 339 times.)
Logged
ABTOP
Sr. Member
****

Karma: 17
Offline Offline

Posts: 399



WWW
« Reply #3 on: April 10, 2012, 08:01:09 »

It's a 10 minute job for Gavik to fix this, literally.
So what do you expect me to do?
Like I said, I don't have this template.
Logged

No personal messages unless you are a friend or you have money for me.
ojuniour
Newbie
*

Karma: 0
Offline Offline

Posts: 3


Email
« Reply #4 on: January 27, 2013, 15:40:42 »

I have found a solution (or should i say THE solution).

You might just want to backup this file incase you messed up:

Before reading, If you are too lazy you can just skip to the end and download the file - I have uploaded  copy of it - make sure you place it in the right folder.

Now to begin,

Go to this file: ...modules\mod_news_pro_gk4\tmpl\layout.parts.php

Look for this line:
Code:
function info_k2($config, $news_catname, $news_cid, $news_cat_alias, $news_author, $news_author_id, $news_author_email, $news_date, $news_hits, $news_id, $news_alias, $comments, $rating_count, $rating_sum, $num = 1) {

Paste this after it [inside the bracket of the function]:
Code:
//Jcomments
            $app = JFactory::getApplication();
            $comments = $app->getCfg('absolute_path') . '/components/com_jcomments/jcomments.php';
            if (file_exists($comments)) {
require_once($comments);
$k2jcomments = JComments::getCommentsCount($news_id, 'com_k2');
}
       //end of Jcomments


THEN,  look for this line (which should be about 36 lines down or so):
Code:

           if($config['no_comments_text'] && (!isset($comments['art'.$news_id]) || $comments['art'.$news_id] == 0)){
                $comments_amount = JText::_('MOD_NEWS_PRO_GK4_NO_COMMENTS');
            } else {
                $comments_amount = JText::_('MOD_NEWS_PRO_GK4_COMMENTS').' ('.(isset($comments['art'.$news_id]) ? $comments['art'.$news_id] : '0' ) . ')';
            }


And Replace it with this lines:
Code:
           if($config['no_comments_text'] && (!isset($comments['art'.$news_id]) || $k2jcomments == 0)){
                $comments_amount = JText::_('MOD_NEWS_PRO_GK4_NO_COMMENTS');
            } else {
                $comments_amount = JText::_('MOD_NEWS_PRO_GK4_COMMENTS').' ('.(isset($comments['art'.$news_id]) ? $k2jcomments : '0' ) . ')';
            }


Voila!!! You did it! Buy me a beer
Oh and one more thing as you may have notice clicking on the comment count link won't take you directly foced on the comment, so to fix that..

Find this line {which should be the next line right after the last lines we just replaced]:
Code:
$info_comments = '<a class="nspComments" href="'.urldecode(JRoute::_(K2HelperRoute::getItemRoute($news_id.':'.urlencode($news_alias), $news_cid.':'.urlencode($news_cat_alias)))).'#itemCommentsAnchor">'.$comments_amount.'</a>';
           

And replace it with this:
Code:

$info_comments = '<a class="nspComments" href="'.urldecode(JRoute::_(K2HelperRoute::getItemRoute($news_id.':'.urlencode($news_alias), $news_cid.':'.urlencode($news_cat_alias)))).'#comments">'.$comments.'</a>';


There you go..
And if you are just tooo darn lazy to go through all these, I have uploaded the edited file.. Just make sure you back up the previous file (just in case)..

Email me if you run into problems or just wanna say a thank you  - VOLTRONXD@GMAIL.COM
Wink

         

* layout.parts.php (53.15 KB - downloaded 151 times.)
« Last Edit: February 02, 2013, 05:09:36 by ojuniour » Logged
hanzh
Newbie
*

Karma: 0
Offline Offline

Posts: 3


« Reply #5 on: February 02, 2013, 05:04:51 »

You are the man  Cheesy. I can confirm this is working perfectly!!!!

I'll e-mail you that beer  Grin
Logged
ojuniour
Newbie
*

Karma: 0
Offline Offline

Posts: 3


Email
« Reply #6 on: February 02, 2013, 05:19:26 »

You are the man  Cheesy. I can confirm this is working perfectly!!!!

I'll e-mail you that beer  Grin

I'm glad it's working for you..
Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    Integration with third-party extensions    Topic: Gavick News Show Pro GK4 + K2 + Jcomments integration
 
Jump to: