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] {jcomments} Tag does not Insert Comments?
Pages: [1]   Go Down
  Print  
Author Topic: [solved] {jcomments} Tag does not Insert Comments?  (Read 7595 times)
0 Members and 1 Guest are viewing this topic.
Josh
Jr. Member
**

Karma: 8
Offline Offline

Gender: Male
Posts: 29



WWW Email
« on: February 22, 2012, 08:39:48 »

According to the change log of Jcomments 2.3 as seen in the link below it says something about a new tag
http://www.joomlatune.com/jcomments-230-changelog.html

New tag {jcomments} in article's text allows to set position of comments block

I tried this on my site which it only displays the text {jcomments}. Just to make sure it was not a conflicting extension I tried it on a fresh installation of joomla which once again the tag did not show the comments in the position of the code. So is there a certain way this has to be done to display the {jcomments} as the position of the comments?
« Last Edit: February 23, 2012, 14:49:38 by smart » Logged
smart
Administrator
Hero Member
*****

Karma: 182
Offline Offline

Gender: Male
Posts: 1955



WWW
« Reply #1 on: February 22, 2012, 16:24:47 »

1. Open /plugins/content/jcomments/jcomments.php
2. Find code:
Code: (php)
if (isset($article->text)) {
if ($this->params->get('links_position', 1) == 1) {
$article->introtext = $article->introtext . $article->text;
} else {
$article->introtext = $article->text . $article->introtext;
}
}
replace with
Code: (php)
if (isset($article->text)) {
if (($view == 'article') && strpos($originalText, '{jcomments}') !== false) {
$originalText = str_replace('{jcomments}', $article->text, $originalText);
} else {
$article->introtext = str_replace('{jcomments}', '', $article->introtext);

if ($this->params->get('links_position', 1) == 1) {
$article->introtext = $article->introtext . $article->text;
} else {
$article->introtext = $article->text . $article->introtext;
}
}
}
3. Open plugin Content - JComments parameters and change Event from onAfterDisplayContent to onPrepareContent

« Last Edit: February 22, 2012, 18:30:36 by smart » Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
Josh
Jr. Member
**

Karma: 8
Offline Offline

Gender: Male
Posts: 29



WWW Email
« Reply #2 on: February 23, 2012, 13:58:46 »

Awesome! Just plain awesome!  Grin Cheesy This is exactly what I've been wanting for quite some time. I used the mod you mentioned above which works just fine.

It's not a big deal, but I assume every time I update jcomments I'll have to make this change to have it portable?
« Last Edit: April 16, 2013, 10:22:34 by Josh » Logged
smart
Administrator
Hero Member
*****

Karma: 182
Offline Offline

Gender: Male
Posts: 1955



WWW
« Reply #3 on: February 23, 2012, 14:30:31 »

No, this change will be included in update and you will get it via Extension manager in backend Wink So you will not needed to make this change after every update...
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
Josh
Jr. Member
**

Karma: 8
Offline Offline

Gender: Male
Posts: 29



WWW Email
« Reply #4 on: February 23, 2012, 14:35:35 »

Thanks!  Grin I'll have to write you a nice review in the Joomla Extensions Directory one of these days (5 stars of course).
You put a lot of work into the new jcomments, well done!

I'm not in a hurry, but some day I'll be excited to see the Jcomments avatar plugin as well as the cb Jcomments extension for joomla 2.5. But as I said, I'm in no rush for it. I know your a busy guy.  Wink
Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    Bug-reports    Topic: [solved] {jcomments} Tag does not Insert Comments?
 
Jump to: