2 edb Jan 11, 2008 14:35

Here's what Topanga did with the first version of her new skin ( I think it's been updated a bit though)
Alternating colors plus numbers :)
$CommentList = & new CommentList( NULL, implode(',', $type_list), array('published'), $Item->ID, '', 'ASC' );
?>
<ol class="commentlist">
<?php
/* This variable is for alternating comment background */
$oddcomment = 'alt';
/**
* @var Comment
*/
while( $Comment = & $CommentList->get_next() )
{ // Loop through comments:
?>
<!-- ========== START of a COMMENT/TB/PB ========== -->
<?php $Comment->anchor() ?>
<li id="comment-<?php $Comment->ID(); ?>" class="<?php echo $oddcomment; ?>">
<?php
switch( $Comment->get( 'type' ) )
{
case 'comment': // Display a comment:
$Comment->permanent_link( '§ ' );
$Comment->author('','','','®','htmlbody',true);
$Comment->msgform_link( $Blog->get('msgformurl') );
echo ' '.T_('said on :').' <small class="commentmetadata">';
$Comment->date() ?> @ <?php $Comment->time( 'H:i' ); $Comment->edit_link( '','',get_icon( 'edit' ) ); $Comment->delete_link( '','',get_icon( 'delete' ) ); echo '</small>';
break;
case 'trackback': // Display a trackback:
$Comment->permanent_link( T_('Trackback') );
echo ' '.T_('from:').' ';
$Comment->author( '', '#', '', '#', 'htmlbody', true );
break;
case 'pingback': // Display a pingback:
$Comment->permanent_link( T_('Pingback') );
echo ' '.T_('from:').' ';
$Comment->author( '', '#', '', '#', 'htmlbody', true );
break;
}
?>
<?php $Comment->rating(); ?>
<div class="bCommentText">
<?php $Comment->content() ?>
</div>
<div class="bCommentSmallPrint">
</div>
</li>
<?php /* Changes every other comment to a different class */
if ('alt' == $oddcomment) $oddcomment = '';
else $oddcomment = 'alt';
?>
EdB, what did you end up doing with
if( $params['comment_start'] == '<div class="bComment">' ) {
$params['comment_start'] = '<div class="bCommentAlt">';
} else {
$params['comment_start'] = '<div class="bComment">';
}
I see you have it working.
Step one was to copy _item_feedback.inc.php from skins/ to skins/evopress/ folder. I did not rename the skin so I will be extra careful when I upgrade with the next release.
In the original file you will find the following around line 162:
while( $Comment = & $CommentList->get_next() )
{ // Loop through comments:
// ------------------ COMMENT INCLUDED HERE ------------------
skin_include( $params['comment_template'], array(
'Comment' => & $Comment,
'comment_start' => $params['comment_start'],
'comment_end' => $params['comment_end'],
) );
// Note: You can customize the default item feedback by copying the generic
// /skins/_item_comment.inc.php file into the current skin folder.
// ---------------------- END OF COMMENT ---------------------
} // End of comment list loop.
In my new version I have the following:
while( $Comment = & $CommentList->get_next() ) {
skin_include( $params['comment_template'], array(
'Comment' => & $Comment,
'comment_start' => $params['comment_start'],
'comment_end' => $params['comment_end'],
) );
if( $params['comment_start'] == '<div class="bComment">' ) {
$params['comment_start'] = '<div class="bComment altcomment">';
} else {
$params['comment_start'] = '<div class="bComment">';
}
}
I then added a definition of ".altcomment" to my style sheet to give it a tiny bit of gray background.
I gave some thought to numbering comments but opted to not because it would mean making sure they looked good. At the time I also thought it would be cool to count comments and after 5 put in a visual break of some sort, but didn't do more than think about it.
PS: the "basin" skin had the coolest one line trick for figuring out if it was odd or even so it could do alternating post colors, but I settled for sloppy ugly line-heavy "if this then that else the other thing".
Thanks mate, it's clean, lean and looks great on your site
Thanks!
Figured it out!
It's not in the while bit yet, but I don't see that as being much of a challenge.
[url=http://www.mythicsoft.com/agentransack/]Agent Ransack[/url] almost always solves the mystery :)