Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Default user icon

LauLau
edited February 2006 in Vanilla 1.0 Help
I am not a big fan of users with no icon, so I decided to modify my global stylesheet and the controls/comments.php file accordingly. It would be simplier to include that URL in the role management panel, but I don't want to overwrite member's icon, I just want to use a default icon. Anyway, here's what I did...

On line 130 from /controls/comments.php, I changed (in bold) :
$sReturn .= "<div class=\"CommentAuthor".($ShowIcon?" CommentAuthorWithIcon":"")."\">";
$sReturn .= "<div class=\"CommentAuthor".($ShowIcon?" CommentAuthorWithIcon":" CommentAuthorWithoutIcon")."\">";
Then on line 131, I added the line below :
if ($ShowIcon) $sReturn .= "<span class=\"CommentIcon\" style=\"background-image:url('".$Comment->AuthIcon."')\"></span>";
else $sReturn .= "<span class=\"CommentIcon\" style=\"background-image:url('/styles/vanilla/defaultuser.gif')\"></span>";
Of course, I duplicated the style CommentAuthorWithIcon and renamed it CommentAuthorWithoutIcon in the /styles/vanilla/global.css. The file /styles/vanilla/defaultuser.gif is the default icon.

I think I did everything by the book... Any comments?

Comments

  • Options
    edited February 2006
    I think it would be far easier to do most of this in the stylesheet.
  • Options
    I would just put it as the default in the SQL table, user can blank it but really...they should be allowed (IMHO) 'Icon' varchar(255) default 'defaultuser.gif'
  • Options
    I hate the margin shifting in authors name in a thread. And I don't want them being able to blank it, creating a hole left of their names if I would fixed the left margin.
  • Options
    You pay way too much attention to the aesthetics of your forum. I barely even notice the gaps between posts anymore.
  • Options
    I floated the icon to the right, and put the comment options bar on the bottom.
  • Options
    LauLau
    edited February 2006
    minisweeper said:
    You pay way too much attention to the aesthetics of your forum. I barely even notice the gaps between posts anymore.


    I am a graphic designer. Sorry.
This discussion has been closed.