HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
[Guide] Discussion Thumbnail in FrontPage
Aolee
✭✭
Update: There is now a plugin that does this. Also check out the Vanillicon indenticon plugin.
Hi Guys,
Just want to share with you on how i did the display of user thumbnails, who commented on each discussion title (in forum's frontpage), see demo here => http://www.pinoyau.info
There's still no plugin for this so, this guide is just a workaround.
affected files are the ff:
1. /applications/vanilla/views/discussions/helper_functions.php
Add the bold ones in the line: (note: pls correct the syntax of div tags (meaning remove the spaces on < / div > < div )
< div class="ItemContent Discussion">< div style="float:left;margin-right:10px;margin-top:5px;"><?php echo UserPhoto(is_null($Last->UserID)?$First:$Last); ?>< / div >< div >
And this line From:
$Sender->FireEvent('DiscussionMeta');
?>
< / div >
< / div >
< div style="clear:both">< /div>
< / div>
2. /plugins/Gravatar/default.php
Add is_null from the condition line: if ($User->Photo == '' && property_exists($Object, $Email)|| is_null($User->Photo)) {
3. /applications/vanilla/models/class.discussionmodel.php
Add the "->Select('lcu.Photo', '', 'LastPhoto')" in public function DiscussionSummaryQuery($AdditionalFields = array()) { after this line:
->Select('lcu.Name', '', 'LastName')
->Select('lcu.Photo', '', 'LastPhoto')
Hi Guys,
Just want to share with you on how i did the display of user thumbnails, who commented on each discussion title (in forum's frontpage), see demo here => http://www.pinoyau.info
There's still no plugin for this so, this guide is just a workaround.
affected files are the ff:
1. /applications/vanilla/views/discussions/helper_functions.php
Add the bold ones in the line: (note: pls correct the syntax of div tags (meaning remove the spaces on < / div > < div )
< div class="ItemContent Discussion">< div style="float:left;margin-right:10px;margin-top:5px;"><?php echo UserPhoto(is_null($Last->UserID)?$First:$Last); ?>< / div >< div >
And this line From:
$Sender->FireEvent('DiscussionMeta');
?>
< / div >
< / div >
< div style="clear:both">< /div>
< / div>
2. /plugins/Gravatar/default.php
Add is_null from the condition line: if ($User->Photo == '' && property_exists($Object, $Email)|| is_null($User->Photo)) {
3. /applications/vanilla/models/class.discussionmodel.php
Add the "->Select('lcu.Photo', '', 'LastPhoto')" in public function DiscussionSummaryQuery($AdditionalFields = array()) { after this line:
->Select('lcu.Name', '', 'LastName')
->Select('lcu.Photo', '', 'LastPhoto')
Tagged:
3
Comments
I think it works better in combination with Identicon5 plugin.
I'll do it.
->Select('lcu.Name', '', 'LastName')
->Select('lcu.Photo', '', 'LastPhoto')
->Select('lcu.Email', '', 'LastEmail') //<-- last user's email <== gravatar encrypts the email and uses it as the id</b>
http://www.vanilla-wiki.info/Bugs/VariousTips
FROM
<div class="ItemContent Discussion"><div class="mainthumb50"><?php echo UserPhoto(is_null($Last->UserID)?$First:$Last); ?></div><div>
TO
<div class="ItemContent Discussion"><div class="mainthumb50"><?php echo UserPhoto($First); ?></div><div>
on file
/applications/vanilla/views/discussions/helper_functions.php
1. go to /applications/dashboard/design/style.css and modify
div.mainthumb50 img {
height: 50px; //32px
width: 50px; //32px
}
or create a new css there like
div.mainthumb32 img {
height: 32px;
width: 32px;
}
and change the class="mainthumb50" to class="mainthumb32" in /applications/vanilla/views/discussions/helper_functions.php