Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • Hung Dinh Friend
    #150410

    Here are instructions of installing JA comment into K2

    I. Disable comment system of k2.

    – Log in as administrator. When your in the K2 dashboard, click on “Parameters” and look for “Comments” toward the bottom, then select “disable”.

    II. Insert JA Comment code into K2.

    1. Below are the instructions to insert “add” button and “comment count” of JAComment into category list.

    Open components/com_k2/templates/YOUR TEMPLATE/category_item.php. Find the line containing this code

    [PHP]<?php if ($this->item->params->get(‘catItemReadMore’)): ?>
    <!– Item “read more…” link –>
    <div class=”catItemReadMore”>
    <a class=”k2ReadMore” href=”<?php echo $this->item->link; ?>”>
    <?php echo JText::_(‘Read more…’); ?>
    </a>
    </div>
    <?php endif; ?>[/PHP]Then, default it in line 263 and insert this code:

    [PHP]<!– Add button use JA Comment –>
    <?php if(!JRequest::getInt(‘print’) && file_exists(JPATH_SITE.DS.’components’.DS.’com_jacomment’.DS.’jacomment.php’) && file_exists(JPATH_SITE.DS.’plugins’.DS.’system’.DS.’jacomment.php’)){
    $_jacCodeDisable = “#{jacomment(s)off}#i”;
    if(!preg_match($_jacCodeDisable, $this->item->introtext)) {
    echo ‘{jacomment_addbutton link=”‘.$this->item->link.'” contentid=’. $this->item->id.’}’;
    echo ‘{jacomment_count contentid=’. $this->item->id.’ option=com_k2 contenttitle=’.$this->item->title.’}’;
    }
    }?>
    <!– end button use JA Comment –>[/PHP] after it.

    2. Similarly, If you want to insert “add” button and comment count of JAComment into lastest item, please do as follows:

    • Open components/com_k2/templates/YOUR TEMPLATE/latest_item.php
    • Find the line that contains this code (it is line 148 by default)

    [PHP]<?php if ($this->item->params->get(‘latestItemReadMore’)): ?>
    <!– Item “read more…” link –>
    <div class=”latestItemReadMore”>
    <a class=”k2ReadMore” href=”<?php echo $this->item->link; ?>”>
    <?php echo JText::_(‘Read more…’); ?>
    </a>
    </div>
    <?php endif; ?>[/PHP]And add this code after it:

    [PHP]<!– Add button use JA Comment –>
    <?php if(!JRequest::getInt(‘print’) && file_exists(JPATH_SITE.DS.’components’.DS.’com_jacomment’.DS.’jacomment.php’) && file_exists(JPATH_SITE.DS.’plugins’.DS.’system’.DS.’jacomment.php’)){
    $_jacCodeDisable = “#{jacomment(s)off}#i”;
    if(!preg_match($_jacCodeDisable, $this->item->introtext)) {
    echo ‘{jacomment_addbutton link=”‘.$this->item->link.'” contentid=’. $this->item->id.’}’;
    echo ‘{jacomment_count contentid=’. $this->item->id.’ option=com_k2 contenttitle=’.$this->item->title.’}’;
    }
    }?>
    <!– end button use JA Comment –>[/PHP]3. Open components/com_k2/templates/YOUR TEMPLATE/item.php

    Find the line that contains this code

    [PHP]<?php if($this->item->params->get(‘itemComments’) && ( ($this->item->params->get(‘comments’) == ‘2’ && !$this->user->guest) || ($this->item->params->get(‘comments’) == ‘1’))):?>
    <!– K2 Plugins: K2CommentsBlock –>
    <?php echo $this->item->event->K2CommentsBlock; ?>
    <?php endif;?>[/PHP]And then insert this code before it(it is line 516 by default):

    [PHP]<!–Add button JA Comment –>
    <?php if(!JRequest::getInt(‘print’) && file_exists(JPATH_SITE.DS.’components’.DS.’com_jacomment’.DS.’jacomment.php’) && file_exists(JPATH_SITE.DS.’plugins’.DS.’system’.DS.’jacomment.php’)){
    $_jacCode = “#{jacomment(.*?) contentid=(.*?) option=(.*?) contenttitle=(.*?)}#i”;
    $_jacCodeDisable = “#{jacomment(s)off}#i”;
    if(!preg_match($_jacCode, $this->item->introtext) && !preg_match($_jacCodeDisable, $this->item->introtext)) {
    echo ‘{jacomment contentid=’.$this->item->id.’ option=com_k2 contenttitle=’.$this->item->title.’}’;
    }
    }
    ?>
    <!–end button JA Comment –>[/PHP]


    1. default.zip
    carlucci Friend
    #346885

    @ Ja Comment in K2
    1.- Then, default it in line 345 and insert this code
    2.- Find the line That contains this code (it is line 345 by default)

    There is no line 345. A line refers to?

    Anonymous Moderator
    #346948

    <em>@carlucci 182600 wrote:</em><blockquote>@ Ja Comment in K2
    1.- Then, default it in line 345 and insert this code
    2.- Find the line That contains this code (it is line 345 by default)

    There is no line 345. A line refers to?</blockquote>

    Hi there,

    You can find this line of code

    <?php if ($this->item->params->get(‘catItemReadMore’)): ?>
    <!– Item “read more…” link –>
    <div class=”catItemReadMore”>
    <a class=”k2ReadMore” href=”<?php echo $this->item->link; ?>”>
    <?php echo JText::_(‘Read more…’); ?>
    </a>
    </div>
    <?php endif; ?>

    and then add more the code lines of plugin’s JA Comment

    carlucci Friend
    #346976

    <em>@JA Developer 182684 wrote:</em><blockquote>Hi there,

    You can find this line of code

    <?php if ($this->item->params->get(‘catItemReadMore’)): ?>
    <!– Item “read more…” link –>
    <div class=”catItemReadMore”>
    <a class=”k2ReadMore” href=”<?php echo $this->item->link; ?>”>
    <?php echo JText::_(‘Read more…’); ?>
    </a>
    </div>
    <?php endif; ?>

    and then add more the code lines of plugin’s JA Comment</blockquote>

    I do not work.
    It would be easier if I could download the changed files!
    These are the changes I made:

    category_item.php :
    <?php if ($this->item->params->get(‘catItemReadMore’)): ?>
    <!– Item “read more…” link –>
    <div class=”catItemReadMore”>
    <a class=”k2ReadMore” href=”<?php echo $this->item->link; ?>”>
    <?php echo JText::_(‘Read more…’); ?>
    </a>
    </div>
    <?php endif; ?>

    <!– Pino Insert code Ja Comment –>
    <?php if(!JRequest::getInt(‘print’) && file_exists(JPATH_SITE.DS.’components’.DS.’com_jacomment’.DS.’jacomment.php’) && file_exists(JPATH_SITE.DS.’plugins’.DS.’system’.DS.’jacomment.php’)){
    echo ‘{jacomment_addbutton link=”‘.$this->item->link.'”}’;
    echo ‘{jacomment_count contentid=’. $this->item->id.’ option=com_k2 contenttitle=’.$this->item->title.’}’; }?>
    <!– Pino fin –>
    <div class=”clr”></div>
    —————————————————————————————
    latest_item.php :
    <?php if ($this->item->params->get(‘latestItemReadMore’)): ?>
    <!– Item “read more…” link –>
    <div class=”latestItemReadMore”>
    <a class=”k2ReadMore” href=”<?php echo $this->item->link; ?>”>
    <?php echo JText::_(‘Read more…’); ?>
    </a>
    </div>
    <?php endif; ?>
    <!– Pino insert code Ja Comment –>
    <?php if(!JRequest::getInt(‘print’) && file_exists(JPATH_SITE.DS.’components’.DS.’com_jacomment’.DS.’jacomment.php’) && file_exists(JPATH_SITE.DS.’plugins’.DS.’system’.DS.’jacomment.php’)){
    echo ‘{jacomment_addbutton link=”‘.$this->item->link.'”}’;
    echo ‘{jacomment_count contentid=’. $this->item->id.’ option=com_k2 contenttitle=’.$this->item->title.’}’;}?>
    <!– Pino fin –>
    <div class=”clr”></div>
    —————————————————-
    item.php:
    <!– Pino insert code Ja Comment –>
    <?php if(!JRequest::getInt(‘print’) && file_exists(JPATH_SITE.DS.’components’.DS.’com_jacomment’.DS.’jacomment.php’) && file_exists(JPATH_SITE.DS.’plugins’.DS.’system’.DS.’jacomment.php’)){
    echo ‘{jacomment contentid=’.$this->item->id.’ option=com_k2 contenttitle=’.$this->item->title.’}’; }
    ?>
    <!– Pino fin –>

    <?php if($this->item->params->get(‘itemComments’) && ( ($this->item->params->get(‘comments’) == ‘2’ && !$this->user->guest) || ($this->item->params->get(‘comments’) == ‘1’))):?>
    <!– K2 Plugins: K2CommentsBlock –>
    <?php echo $this->item->event->K2CommentsBlock; ?>
    <?php endif;?>

    All K2-Comment parameters are disabled.

    carlucci Friend
    #347336

    I sent a ticket. I received no response.
    Again I installed Ja Norite. The problem persists. I have followed your instructions.
    I have 2 questions:

    1 .- What is this? : Then, default it in line 345 and insert this code

    2 .- It’s so hard to attach the modified files?

    carlucci Friend
    #347715

    I sent with the ticket a key to enter the manager of my JaNorite.
    I have removed the acces to leave my site. If needed, let me know.

    Please tell me if you can help. Currently I use K2-Comments, I would like to use Ja-Comments with K2.
    I can not understand that only with my site does not work!
    Please look if my modifications are well done.

    Anonymous Moderator
    #347907

    <em>@carlucci 183657 wrote:</em><blockquote>I sent with the ticket a key to enter the manager of my JaNorite.
    I have removed the acces to leave my site. If needed, let me know.

    Please tell me if you can help. Currently I use K2-Comments, I would like to use Ja-Comments with K2.
    I can not understand that only with my site does not work!
    Please look if my modifications are well done.</blockquote>

    Hi Carlucci,

    Our technical team is working on your issue. Kindly keep on hold and I will get back to you right after getting more information.

    Really appreciate your great patience.

    Anonymous Moderator
    #348270

    <em>@carlucci 183657 wrote:</em><blockquote>I sent with the ticket a key to enter the manager of my JaNorite.
    I have removed the acces to leave my site. If needed, let me know.

    Please tell me if you can help. Currently I use K2-Comments, I would like to use Ja-Comments with K2.
    I can not understand that only with my site does not work!
    Please look if my modifications are well done.</blockquote>

    Hi Carlucci,

    Please give me your url, ftp and admin account for closer look at the root.

    Anonymous Moderator
    #348357

    <em>@carlucci 183657 wrote:</em><blockquote>I sent with the ticket a key to enter the manager of my JaNorite.
    I have removed the acces to leave my site. If needed, let me know.

    Please tell me if you can help. Currently I use K2-Comments, I would like to use Ja-Comments with K2.
    I can not understand that only with my site does not work!
    Please look if my modifications are well done.</blockquote>

    Guy,

    Please take into account some following notes when inserting JA Comment code into K2:

    1. Install the latest version of system jacomment plugin and enable it.
    2. When inserting jacomment code into 3 files category_item.php, latest_item.php, item.php, please goto admin area of K2 to check that which template is selected by your category and make sure that your code is inserted into 3 above files in that template. If you still fail, please give me your backend admin and ftp account for a direct fix

    carlucci Friend
    #348392

    I have no access to the plugin JaComment.

    I installed JComment and it works. Of course not as JaComment. I am happy.

    ebruse Friend
    #353088

    After finding out that the line reference 345 is invalid (probably correct for another template) and that the code quotation only gets right in the printer friendly view of this forum (Thread Tools > Show Prinable version) it finally works.

    It took quite some time to find all this out since this hack won’t even load any K2 pages if GZIP is enabled in Joomla.

    SP Media Friend
    #361131

    I’m trying to add this fix to K2 featured in the Ja Social component. It doesn’t seem to work on this end! 🙁

    I have the one default k2 theme, so replaced the files directly.

    No luck unfortunately…

    deejay Friend
    #422453

    I have just downloaded this template, believing that Ja-Comment is included.
    I have had a look at the 1.7 quickstart and cannot find it!

    On your Norite page http://www.joomlart.com/joomla/templates/ja-norite it says JA-Comments is in it!??!!

Viewing 13 posts - 1 through 13 (of 13 total)

This topic contains 13 replies, has 6 voices, and was last updated by  deejay 12 years, 5 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum