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

Login with username, password and session length

JoomlaTune Support Forum    JComments component    General discussion    Topic: How can I remove the "counter"?
Pages: [1]   Go Down
  Print  
Author Topic: How can I remove the "counter"?  (Read 4951 times)
0 Members and 1 Guest are viewing this topic.
TNZ
Newbie
*

Karma: 0
Offline Offline

Posts: 8


« on: August 27, 2009, 20:19:18 »

Hello,

I use JComments 2.1 and I like it, thank you Smiley

I'd like to "remove" the comment's counter and "#" (border in red) :



I tried but I don't find how to do.
Is it possible ? How can I do that ?

Thank you in advance and sorry for my poor English.
Logged
smart
Administrator
Hero Member
*****

Karma: 163
Offline Offline

Gender: Male
Posts: 2161



WWW
« Reply #1 on: August 27, 2009, 21:31:18 »

Yes, you can. Change file /components/com_jcomments/tpl/default/tpl_comment.php:

replace line:
Code: (php)
<a class="comment-anchor" href="<?php echo $thisurl?>#comment-<?php echo $comment->id?>" id="comment-<?php echo $comment->id?>">#<?php echo $comment_number?></a>
with
Code: (php)
<a class="comment-anchor" href="<?php echo $thisurl?>#comment-<?php echo $comment->id?>" id="comment-<?php echo $comment->id?>"></a>

So we remove only text from link (the link needed to refer to certain comment from link)
Logged

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

Karma: 0
Offline Offline

Posts: 8


« Reply #2 on: August 27, 2009, 22:09:09 »

Perfect!!!!

Thanks a lot Smiley
Logged
eropuitinbrabant
Newbie
*

Karma: 0
Offline Offline

Posts: 3


Email
« Reply #3 on: December 08, 2011, 08:08:04 »

hey,

this topic still active?!

I would like to know how I can replace the # and the counter, which link to the object that is being commented with the name of the commented object. there must be some code for this, because in the administration section of jcomments the name of the object is also shown (see attachment 2). would be nice if exactly that name could also be shown with every single comment.

I think this is good for SEO, as every time a comment is added, the name of the object is shown as well and not only the url to the object.

Helpful would be how to replace the code in the template.

anyone?


* jcomments01.jpg (200.39 KB, 1414x301 - viewed 153 times.)

* jcomments02.jpg (136.33 KB, 797x528 - viewed 146 times.)
Logged
smart
Administrator
Hero Member
*****

Karma: 163
Offline Offline

Gender: Male
Posts: 2161



WWW
« Reply #4 on: December 08, 2011, 16:24:14 »

Do you want to replace # with commented object's title? This is quite easy... Just replace code:
Code: (php)
#<?php echo $comment_number?>
with
Code: (php)
<?php echo JCommentsObjectHelper::getTitle($comment->object_id$comment->object_group$comment->lang); ?>
Logged

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

Karma: 0
Offline Offline

Posts: 3


Email
« Reply #5 on: December 08, 2011, 16:59:52 »

 Cheesy
delightful! Why can't all people be like you, Smart?! THANK YOU!
Problem/challenge solved within 2 minutes  Grin

Lowers the average I have uptil now with 'joomla issues'. Guess the average lies between 5 to 10 hours per 'challenge'

anyway, line 49 of components/com_jcomments/tpl/default/tpl_comment.php should look like this before and afterwards:

<a class="comment-anchor" href="<?php echo $thisurl; ?>#comment-<?php echo $comment->id; ?>" id="comment-<?php echo $comment->id; ?>">#<?php echo $comment_number; ?></a>


<a class="comment-anchor" href="<?php echo $thisurl; ?>#comment-<?php echo $comment->id; ?>" id="comment-<?php echo $comment->id; ?>"><?php echo JCommentsObjectHelper::getTitle($comment->object_id, $comment->object_group, $comment->lang); ?></a>


see attachment for the result

it says somewhere in the componentsettings that you can choose another template. Are there 'ready' examples of these by chance?

regards


* jcomment.jpg (86.41 KB, 792x394 - viewed 143 times.)
Logged
eropuitinbrabant
Newbie
*

Karma: 0
Offline Offline

Posts: 3


Email
« Reply #6 on: December 20, 2011, 17:48:26 »

pffuih, glad i found the topic again, because I wanted to make the same change for my other website, but couldn't remeber the topic name, nor any other exact details. Glad I posted in the recent weeks, otherwise I had to look trough a lot of messages because I hadn't bookmarked it.

Now i looked through all of your recent replies, Smart, and so I found it back. With the internal search engine of your forum i couldn't find myself as user. How come??
Also when I log in, I cannot get an overview of messages that I replied to, otherwise I could have found it in that way.  This wasn't a topic I started myself, but an older message I replied to.

You know what I mean? Any suggestions?
Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    General discussion    Topic: How can I remove the "counter"?
 
Jump to: