At last, I finished my first theme for vanilla
I love how eassy is to theme vanilla
Check it out: www.makeitsound.org
wow... nice one. like that.
every discussion display 2 users pictures. discussion start user pic and latest user pic. how can i do it. can you explain
Sure, you just need to modify the helper_functions.php file, you can find it at applications/vanilla/views/discussions (Copy it to your theme).
Search for:
<?php if ($Session->IsValid() && $Discussion->CountUnreadComments > 0) echo '<strong>'.Plural($Discussion->CountUnreadComments, '%s New', '%s New Plural').'</strong>'; $Sender->FireEvent('AfterCountMeta'); if ($Discussion->LastCommentID != '') { echo '<span class="LastCommentBy">'.sprintf(T('Most recent by %1$s'), UserAnchor($Last)).'</span>'; echo '<span class="LastCommentDate">'.Gdn_Format::Date($Discussion->LastDate).'</span>'; } else { echo '<span class="LastCommentBy">'.sprintf(T('Started by %1$s'), UserAnchor($First)).'</span>'; echo '<span class="LastCommentDate">'.Gdn_Format::Date($Discussion->FirstDate); if ($Source = GetValue('Source', $Discussion)) { echo ' '.sprintf(T('via %s'), T($Source.' Source', $Source)); } echo '</span>'; } if (C('Vanilla.Categories.Use') && $Discussion->CategoryUrlCode != '') echo Wrap(Anchor($Discussion->Category, '/categories/'.rawurlencode($Discussion->CategoryUrlCode), 'Category')); $Sender->FireEvent('DiscussionMeta'); ?>
And replace with:
<?php if ($Session->IsValid() && $Discussion->CountUnreadComments > 0) echo ''.Plural($Discussion->CountUnreadComments, '%s New', '%s New Plural').''; $Sender->FireEvent('AfterCountMeta'); if ($Discussion->LastCommentID != '') { echo ' '.UserPhoto($Last).''.''; echo ''.Gdn_Format::Date($Discussion->LastDate).''; echo ''.UserPhoto($First).''.''; } else { echo ' '.UserPhoto($First).''.''; echo ''.Gdn_Format::Date($Discussion->FirstDate); if ($Source = GetValue('Source', $Discussion)) { echo ' '.sprintf(T('via %s'), T($Source.' Source', $Source)); } echo ''; } if (C('Vanilla.Categories.Use') && $Discussion->CategoryUrlCode != '') echo Wrap(Anchor($Discussion->Category, '/categories/'.rawurlencode($Discussion->CategoryUrlCode), 'Category')); $Sender->FireEvent('DiscussionMeta'); ?>
**Then, try to make them suit with your template using css:
I used this:**
.Discussion.ItemContent { margin-left: 70px; position:relative; padding-left:65px; width: 390px; } .reply-avatar { position:absolute;left:0px;top:0px; } .author-avatar { position:absolute;left:-77px;top:0px; } .reply-arrow { position:absolute; top:15px; left:-19px; background-image: url("images/REPLY-ARROW.png") ; width:20px; height:26px; } .author-arrow { position:absolute; top:15px; left:-19px; background-image: url("images/AUTHOR-ARROW.png"); width:72px; height:26px; } ul.Discussions li img { float: left; height: 35px; margin: 6px 0px 4px 10px; width: 35px; }
I got the idea seeing the Vanilla Skins themes (http://vanillaskins.com/themes/), they are awesome.
thought i recognised the classes thankyou.
There was an error rendering this rich post.
422 said: thought i recognised the classes thankyou.
Well, it was your idea, so thank you
I had an error, I don't know why I deleted the last comment by and last comment date tags.
Here is the fixed code:
<?php if ($Session->IsValid() && $Discussion->CountUnreadComments > 0) echo '<strong>'.Plural($Discussion->CountUnreadComments, '%s New', '%s New Plural').'</strong>'; $Sender->FireEvent('AfterCountMeta'); if ($Discussion->LastCommentID != '') { echo '<span class="LastCommentBy"><div class="reply-arrow"> </div><span class="reply-avatar">'.UserPhoto($Last).'</span>'.'</span>'; echo '<span class="LastCommentDate">'.Gdn_Format::Date($Discussion->LastDate).'</span>'; echo '<span><span class="author-avatar">'.UserPhoto($First).'</span>'.'</span>'; } else { echo '<span class="LastCommentBy"><div class="author-arrow"> </div><span class="author-avatar">'.UserPhoto($First).'</span>'.'</span>'; echo '<span class="LastCommentDate">'.Gdn_Format::Date($Discussion->FirstDate); if ($Source = GetValue('Source', $Discussion)) { echo ' '.sprintf(T('via %s'), T($Source.' Source', $Source)); } echo '</span>'; } if (C('Vanilla.Categories.Use') && $Discussion->CategoryUrlCode != '') echo Wrap(Anchor($Discussion->Category, '/categories/'.rawurlencode($Discussion->CategoryUrlCode), 'Category')); $Sender->FireEvent('DiscussionMeta'); ?>
incidentally, your theme is stunning. Great work
Thanks
Comments
wow... nice one. like that.
every discussion display 2 users pictures. discussion start user pic and latest user pic. how can i do it. can you explain
Sure, you just need to modify the helper_functions.php file, you can find it at applications/vanilla/views/discussions (Copy it to your theme).
Search for:
And replace with:
<?php if ($Session->IsValid() && $Discussion->CountUnreadComments > 0) echo ''.Plural($Discussion->CountUnreadComments, '%s New', '%s New Plural').''; $Sender->FireEvent('AfterCountMeta'); if ($Discussion->LastCommentID != '') { echo ' '.UserPhoto($Last).''.''; echo ''.Gdn_Format::Date($Discussion->LastDate).''; echo ''.UserPhoto($First).''.''; } else { echo ' '.UserPhoto($First).''.''; echo ''.Gdn_Format::Date($Discussion->FirstDate); if ($Source = GetValue('Source', $Discussion)) { echo ' '.sprintf(T('via %s'), T($Source.' Source', $Source)); } echo ''; } if (C('Vanilla.Categories.Use') && $Discussion->CategoryUrlCode != '') echo Wrap(Anchor($Discussion->Category, '/categories/'.rawurlencode($Discussion->CategoryUrlCode), 'Category')); $Sender->FireEvent('DiscussionMeta'); ?>
**Then, try to make them suit with your template using css:
I used this:**
.Discussion.ItemContent { margin-left: 70px; position:relative; padding-left:65px; width: 390px; } .reply-avatar { position:absolute;left:0px;top:0px; } .author-avatar { position:absolute;left:-77px;top:0px; } .reply-arrow { position:absolute; top:15px; left:-19px; background-image: url("images/REPLY-ARROW.png") ; width:20px; height:26px; } .author-arrow { position:absolute; top:15px; left:-19px; background-image: url("images/AUTHOR-ARROW.png"); width:72px; height:26px; } ul.Discussions li img { float: left; height: 35px; margin: 6px 0px 4px 10px; width: 35px; }
I got the idea seeing the Vanilla Skins themes (http://vanillaskins.com/themes/), they are awesome.
There was an error rendering this rich post.
Well, it was your idea, so thank you
I had an error, I don't know why I deleted the last comment by and last comment date tags.
Here is the fixed code:
incidentally, your theme is stunning. Great work
There was an error rendering this rich post.
Thanks