Hi giuse,
Here are the steps I took to implement the title option. I did this on version 2.0.0.14, and I can not guarantee my hack will work for other versions. Note, this will give the look and feel that I have in my installation...
First, Backup, backup...
1) In /com_jcomments/tpl/default/tpl_comment.phpinsert this:
<?php
/* Added title */
?>
<span class="comment-title"><?php echo $comment->title?></span><br /><br style="padding-bottom:8px;" />
after this line:
<a class="comment-anchor" href="<?php echo $thisurl; ?>#comment-<?php echo $comment->id; ?>" id="comment-<?php echo $comment->id; ?>">#<?php echo $comment_number; ?></a>
2) In /com_jcomments/tpl/default/tpl_form.phpInsert this:
/* Added title to the form */
?>
<p>
<input id="comments-form-title" type="text" name="title" value="" maxlength="<?php echo $this->getVar('comment-name-maxlength');?>" size="22" tabindex="1" />
<label for="comments-form-title"><?php echo JText::_('FORM_TITLE'); ?></label>
</p>
<?php
after this line:
<div class="comments-policy"><?php echo $this->getVar( 'comments-policy' ); ?></div>
<?php
Note that the title field will be the first input field in the form. You should therefore adjust the tabindex value of the form objects all along, starting with tabindex="1" for the title input field (there should be 9 of them now).
3) In /com_jcomments/jcomments.ajaxInsert this:
$comment->title = isset($values['title']) ? $values['title'] : '';
after this line:
$comment->object_group = $values['object_group'];
4) In order to have a layout like the one I have you need to make some changes to the css file (/com_jcomments/tpl/default/style.css)To make it simple, I suggest you replace the whole block of code, although there are only a few changes to the css.
Find and replace this block of code:
#comments .avatar-indent {padding-left: 40px;}
#comments a.comment-anchor,
#comments a.comment-anchor:active,
#comments a.comment-anchor:focus,
#comments a.comment-anchor:hover {color: #777; background-color: inherit; text-decoration: none; border: none;}
#comments span.comment-author,
#comments a.author-homepage {color: #3c452d;background-color: inherit;font: bold 1em Verdana, Arial, Sans-Serif;margin: 0;padding: 0;}
#comments a.author-homepage {text-decoration: none; border-bottom: 1px dotted #3c452d;}
/*avatar*/
#comments .comment-avatar img {width: 32px; height: 32px;}
/*date and time*/
#comments span.comment-date {font-size: 10px;color: #999;margin: 0;padding: 0 0 0 12px;background: url(images/jc_date.gif) no-repeat center left;}
#comments span.comment-body {color: #777;background-color: inherit;display: block;margin: 0;padding: 2px 0;}
/* Quote, Code and Hidden block styles */
#comments span.quote, #comments blockquote {margin: 5px 0 5px 10px; display: block; clear: both; }
#comments blockquote, #comments span.hidden {
color: #849B9F;
background-color: inherit;
text-align: left;
padding: 8px;
border: 1px dashed #849B9F;
margin-bottom: 8px;
with this code:
#comments .avatar-indent {padding-left: 45px;}
#comments a.comment-anchor,
#comments a.comment-anchor:active,
#comments a.comment-anchor:focus,
#comments a.comment-anchor:hover {color: #777; background-color: inherit; text-decoration: none; border: none;}
#comments span.comment-title {color: #b01625;background-color: inherit;font: bold 1.2em Verdana, Arial, Sans-Serif;margin: 0px;padding: 0px;}
#comments span.comment-author {font-size: 11px;color: #807e7e;margin: 0px 8px 0px 10px;padding: 0;}
#comments a.author-homepage {color: #807e7e;background-color: inherit;font: normal 11px Verdana, Arial, Sans-Serif;margin: 0px 8px 3px 10px;padding: 0;}
#comments a.author-homepage {text-decoration: none; border-bottom: 1px dotted #3c452d;}
/*avatar*/
#comments .comment-avatar img {width: 32px; height: 32px;}
/*date and time*/
#comments span.comment-date {font-size: 10px;color: #807e7e;margin: 0;padding: 0 0 0 13px;background: url(images/jc_date.gif) no-repeat center left;}
#comments span.comment-body {color: #777;background-color: inherit;display: block;margin: 0;padding: 10px 0; font-size:1.15em; line-height:1.15em;}
/* Quote, Code and Hidden block styles */
#comments span.quote, #comments blockquote {font-size: 11px;margin: 5px 0 5px 10px; display: block; clear: both; }
#comments blockquote, #comments span.hidden {
color: #849B9F;
background-color: inherit;
text-align: left;
font-family: Verdana, Arial, Sans-Serif;
padding: 8px;
border: 1px dashed #849B9F;
margin-bottom: 8px;
font-size:0.9em;
line-height:1.08em;
5) And finally, add this definition to all language files you're using (translate if you have to):FORM_TITLE=Title
That's it!
Hope this helps...
Regards Poffen