By vertazzar on
<?php
// $Id: comment.tpl.php,v 1.3 2008/09/14 12:09:37 johnalbin Exp $
/**
* @file comment.tpl.php
* Default theme implementation for comments.
*
* Available variables:
* - $author: Comment author. Can be link or plain text.
* - $classes: A set of CSS classes for the DIV wrapping the comment.
Possible values are: comment, comment-new, comment-preview,
comment-unpublished, comment-published, odd, even, first, last,
comment-by-anon, comment-by-author, or comment-mine.
* - $content: Body of the post.
* - $date: Date and time of posting.
* - $links: Various operational links.
* - $new: New comment marker.
* - $picture: Authors picture.
* - $signature: Authors signature.
* - $status: Comment status. Possible values are:
* comment-unpublished, comment-published or comment-preview.
* - $submitted: By line with date and time.
* - $title: Linked title.
* - $unpublished: Is the comment unpublished?
*
* These two variables are provided for context.
* - $comment: Full comment object.
* - $node: Node object the comments are attached to.
*
* @see template_preprocess_comment()
* @see theme_comment()
*/
?>
<div id="ako-<?php print $author; ?>"><div class="<?php print $classes; ?>"><div class="comment-inner clear-block">
<?php if ($title): ?>
<h3 class="title">
<?php print $title; ?>
<?php if ($comment->new): ?>
<span class="new"><?php print $new; ?></span>
<?php endif; ?>
</h3>
<?php elseif ($comment->new): ?>
<div class="new"><?php print $new; ?></div>
<?php endif; ?>
<?php if ($unpublished): ?>
<div class="unpublished"><?php print t('Unpublished'); ?></div>
<?php endif; ?>
<?php if ($picture) print $picture; ?>
<div class="submitted">
<?php print $submitted; ?>
</div>
<div class="content">
<?php print $content; ?>
<?php if ($signature): ?>
<div class="user-signature clear-block">
<?php print $signature; ?>
</div>
<?php endif; ?>
</div>
<?php if ($links): ?>
<div class="links">
<?php print $links; ?>
</div>
<?php endif; ?>
</div></div></div> <!-- /comment-inner, /comment -->
how to print it as basic plain text e.g. "username" without any links etc.. ?
Comments
<?php print
print check_plain($comment->name);Should do the trick.
THANKS. I've been struggling
THANKS. I've been struggling with this for like, 1,5 hours
:)
No problem. For future
No problem.
For future reference you can do something like
print_r($comment);and see all the unformatted/un-rendered comment data.Always a good idea to wrap it with check_plain() or check_markup() if you're unsure if it has been sanitized yet.