MyBB Community Forums

Full Version: Style your attachments
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
(2016-09-25, 08:17 AM)leroymcqy Wrote: [ -> ]
(2014-02-05, 09:01 AM)leroymcqy Wrote: [ -> ]inorder for this to work in the newest mybb i found out it won't work in the template the author has stated.

<button class="downloadlink" style="width:500px;font-family: 'lucida grande', 'lucida sans unicode', 'arial', 'verdana', 'tahoma', sans-serif' !important;" onclick="window.open('/attachment.php?aid={$attachment['aid']}');"><img style="height:35px;float:left;" src="http://i.imgur.com/92Wpr.png" /> Download <strong>{$attachment['filename']}</strong><br />{$attachment['downloads']} Downloads &mdash; FileSize: {$attachment['filesize']}</button> 

this one will work for the newest and also has the code fixed.

i had to use: postbit_attachments to get it to work

for anyone using the 1.6 version of mybb, this also works on it to.

This works for 1.8.x

Edit Template: postbit_attachments_attachment
<button class="downloadlink" style="width:500px;font-family: 'lucida grande', 'lucida sans unicode', 'arial', 'verdana', 'tahoma', sans-serif' !important;" onclick="window.open('attachment.php?aid={$attachment['aid']}');"><img style="height:35px;float:left;" src="images/download.png" /> Download: <strong>{$attachment['filename']}</strong><br />{$lang->postbit_attachment_size} ( {$attachment['filesize']} / {$lang->postbit_attachment_downloads} {$attachment['downloads']} )</button>

Add to global.css


button.downloadlink {
    border:1px solid #0066A2;
    background: #016DB1 url('images/thead_bg.png') top left repeat-x;
    color: #FFF;
    padding: 4px 6px;
    cursor: pointer;
    width: 100px;
}

button.downloadlink:hover,
button.active {
    background: #0F0F0F url('images/tcat.png') top left repeat-x;
    border:1px solid #0F0F0F;
    color: #FFF;
}

Add to "images" folder:

[attachment=37779]

Example:

[Image: 2webdj9.png]
works just great on my forum... thank you!
Pages: 1 2