-
AuthorPosts
-
Hung Dinh Friend
Hung Dinh
- Join date:
- September 2014
- Posts:
- 4408
- Downloads:
- 11
- Uploads:
- 189
- Thanks:
- 309
- Thanked:
- 3310 times in 3 posts
April 29, 2010 at 6:30 pm #150410Here 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.phpFind 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 user says Thank You to Hung Dinh for this useful post
carlucci Friendcarlucci
- Join date:
- November 2006
- Posts:
- 509
- Downloads:
- 195
- Uploads:
- 108
- Thanks:
- 172
- Thanked:
- 17 times in 3 posts
June 12, 2010 at 8:57 pm #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 ModeratorJA Developer
- Join date:
- September 2014
- Posts:
- 9914
- Downloads:
- 207
- Uploads:
- 152
- Thanks:
- 1789
- Thanked:
- 2008 times in 1700 posts
June 14, 2010 at 3:36 am #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 Friendcarlucci
- Join date:
- November 2006
- Posts:
- 509
- Downloads:
- 195
- Uploads:
- 108
- Thanks:
- 172
- Thanked:
- 17 times in 3 posts
June 14, 2010 at 8:02 am #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 Friendcarlucci
- Join date:
- November 2006
- Posts:
- 509
- Downloads:
- 195
- Uploads:
- 108
- Thanks:
- 172
- Thanked:
- 17 times in 3 posts
June 17, 2010 at 6:12 am #347336I 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 Friendcarlucci
- Join date:
- November 2006
- Posts:
- 509
- Downloads:
- 195
- Uploads:
- 108
- Thanks:
- 172
- Thanked:
- 17 times in 3 posts
June 22, 2010 at 11:05 am #347715I 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 ModeratorJA Developer
- Join date:
- September 2014
- Posts:
- 9914
- Downloads:
- 207
- Uploads:
- 152
- Thanks:
- 1789
- Thanked:
- 2008 times in 1700 posts
June 24, 2010 at 4:36 am #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 ModeratorJA Developer
- Join date:
- September 2014
- Posts:
- 9914
- Downloads:
- 207
- Uploads:
- 152
- Thanks:
- 1789
- Thanked:
- 2008 times in 1700 posts
June 28, 2010 at 7:49 am #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 ModeratorJA Developer
- Join date:
- September 2014
- Posts:
- 9914
- Downloads:
- 207
- Uploads:
- 152
- Thanks:
- 1789
- Thanked:
- 2008 times in 1700 posts
June 29, 2010 at 4:57 am #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 fix1 user says Thank You to JA Developer for this useful post
carlucci Friendcarlucci
- Join date:
- November 2006
- Posts:
- 509
- Downloads:
- 195
- Uploads:
- 108
- Thanks:
- 172
- Thanked:
- 17 times in 3 posts
June 29, 2010 at 11:15 am #348392I have no access to the plugin JaComment.
I installed JComment and it works. Of course not as JaComment. I am happy.
August 18, 2010 at 7:32 pm #353088After 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 FriendSP Media
- Join date:
- September 2014
- Posts:
- 477
- Downloads:
- 0
- Uploads:
- 12
- Thanks:
- 38
- Thanked:
- 70 times in 27 posts
October 30, 2010 at 2:09 pm #361131I’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…
October 30, 2011 at 7:37 pm #422453I 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!??!!
-
AuthorPosts
This topic contains 13 replies, has 6 voices, and was last updated by deejay 13 years, 1 month ago.
We moved to new unified forum. Please post all new support queries in our New Forum