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 to display Comment title instead of Objective title? [SOLVED!]
Pages: [1]   Go Down
  Print  
Author Topic: How to display Comment title instead of Objective title? [SOLVED!]  (Read 2211 times)
0 Members and 2 Guests are viewing this topic.
Gragster
Newbie
*

Karma: 0
Offline Offline

Posts: 3


« on: December 06, 2009, 22:08:08 »

Hi All,


I have succesfully installed Jcomment and also Jcomment module to show the latest posts!

Right now it shows:
1. Object title
2. Comment Text

How do i get it to show:

1. Comment Title?

I have found this for the object title but dont know how to make a copy with comment title:
Code:
if ($show_object_title == 1) {
$title = JCommentsObjectHelper::getTitle( $row->object_id, $row->object_group );
$title = JCommentsText::substr($title, $limit_object_title);
$title = str_replace( '"', '', $title );

echo '<a class="jcl_objtitle" href="'.$link.'#comment-'.$row->id.'" title="'.$title.'">'.$title.'</a><br />';
}

Please help me on the way or at least ask me about more information i would REALLY like this to work!

Huh
Best regards
Simon Z.
« Last Edit: December 10, 2009, 21:30:08 by Gragster » Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #1 on: December 07, 2009, 17:27:07 »

In future version I will implement such feature but now you can fix it by replacing code:
Code: (php)
$title = JCommentsObjectHelper::getTitle( $row->object_id, $row->object_group );
$title = JCommentsText::substr($title, $limit_object_title);
$title = str_replace( '"', '', $title );
with
Code: (php)
$title = $row->title;
$title = str_replace( '"', '', $title );

and replace:
Code: (php)
$query = "SELECT cc.id, cc.userid, cc.comment, cc.name, cc.username, cc.email, cc.date, cc.object_id, cc.object_group, '' as avatar "
with
Code: (php)
$query = "SELECT cc.id, cc.userid, cc.comment, cc.name, cc.username, cc.email, cc.date, cc.object_id, cc.object_group, cc.title, '' as avatar "
« Last Edit: December 07, 2009, 17:28:45 by smart » Logged

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

Karma: 0
Offline Offline

Posts: 3


« Reply #2 on: December 10, 2009, 21:23:39 »

 Cheesy Cheesy Cheesy Cheesy Cheesy Cheesy Cheesy Cheesy Cheesy Cheesy Cheesy Cheesy Cheesy Cheesy Cheesy Cheesy Cheesy Cheesy Cheesy Cheesy Cheesy Cheesy

THIS WORKS PERFECT!

This code was standing two times and i changed both and it works:
Code:
$query = "SELECT cc.id, cc.userid, cc.comment, cc.name, cc.username, cc.email, cc.date, cc.object_id, cc.object_group, '' as avatar "

I have discovered a small bug on the danish translation and i will post a new topic about it.
Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    General discussion    Topic: How to display Comment title instead of Objective title? [SOLVED!]
 
Jump to: