Recent Topics

1 Jul 21, 2009 19:54    

My b2evolution Version:

I think this may exist already, but I couldn't find by searching for terms like "color comments" or "format comments". The idea is to have a different formatting for comments written by the post author. I think this would involve a different class in the skin CSS, but I could be wrong.

2 Jul 21, 2009 20:07

It would

echo '<div class="bComment'.( $comment->author_user_ID == $Item->author_ID ? ' bCommentAuthor' : ' SomeRiffRaff' ).'">';

ish

¥

3 Jul 21, 2009 20:14

Uhmmm... maybe that bit about the special class gave the impression that I am more proficient than I really am.

Where do I put that code?

Before you say anything, remember I'm blonde too. ;)

4 Jul 21, 2009 20:24

heh, bugger, lemme go find the file .......

ok, based on, urm, 3.x.rc1, /skins/(optional)skin_name/_item_comment_inc.php, you'd change this bit :

// Default params:
$params = array_merge( array(
    'comment_start'  => '<div class="bComment'.( $Comment->author_user_ID == $Item->author_ID ? ' bCommentAuthor' : ' SomeRiffRaff' ).'">',
    'comment_end'    => '</div>',
    'Comment'        => NULL, // This object MUST be passed as a param!
	), $params );

¥

5 Jul 21, 2009 21:00

Er... so I would have to also create bComment.bCommentAutor and bComment.SomeRiffRaff subclasses in blog_base.css?

6 Jul 21, 2009 21:04

I get <del>this</del>these errors:

Notice: Undefined variable: Comment in /home/bit/public_html/blog/skins/_item_comment.inc.php on line 20

Notice: Trying to get property of non-object in /home/bit/public_html/blog/skins/_item_comment.inc.php on line 20

Notice: Undefined property: Item::$author_ID in /home/bit/public_html/blog/skins/_item_comment.inc.php on line 20

7 Jul 24, 2009 21:22

Find a bit that looks like this and then modify it to look a tad more like this :

/**
 * @var Comment
 */
$Comment = & $params['Comment'];

?>
<!-- ========== START of a COMMENT/TB/PB ========== -->
<?php
	$Comment->anchor();
// change this line
//  echo $params['comment_start'];
// to be this 
echo '<div class="bComment'.( $Comment->author_user_ID == $Item->creator_user_ID ? ' bCommentAuthor' : ' SomeRiffRaff' ).'">';
?>
	<div class="bCommentTitle">

¥

8 Jul 26, 2009 17:26

Well, the error is gone.

So what do I do now? Do I define those subclasses in the skin? And what would be the syntax? (I tried defining .bCommentAuthor and bComment.bCommentAuthor, but it didn't work.)

EDIT: Never mind, I made it. Am I the only one to think this change would be a nice addition to b2evo?

9 Jul 26, 2009 17:35

Aaaand... thanxalot again, Yabba!


Form is loading...