• 0 Vote(s) - Trung bình 0
  • 1
  • 2
  • 3
  • 4
  • 5
Style your attachments
#1
Just a simple tutorial from me. On how to style your attachments the way you want them. Example below.

Firstly go to ACP > Template & Styles > Templates > THEME > Postbit Templates > Postbit_attachments_attachment and replace the whole template with your chosen style

My personal favorite style is this


Code:
<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 />{$attachment['downloads']} Downloads &mdash; FileSize: {$attachment['filesize']}</button>

add this CSS to the bottom of your global.css for your theme.

Code:
button.downloadlink {
    border:1px solid #0c0f12;
    background:#161c21;
    background-repeat:repeat-x;
    font-family: 'VisitorTT1BRKRegular';
        padding:4px 6px;
    color:#ffffff;
        cursor:pointer;
        width:100px;
}
button.downloadlink:hover,
button.active {
    background:#11161a;
    background-repeat:repeat-x;
    border:1px solid #0c0f12;
    color:#ffffff;
}

Preview
[Image: 687474703a2f2f692e696d6775722e636f6d2f39...742e706e67]

Style 2 (no css)

Code:
<table border="0" cellpadding="0" cellspacing="3">
<!-----Postbit_Attachment---->
    </table>
    <table class="attachtable" id="table2" width="95%" align="center" border="1" cellpadding="2" cellspacing="0">
        <tr>
            <td colspan="3" class="attachheader" width="100%" align="center"><b>
            {$attachment['filename']}</b></td>
        </tr>
        <tr>
            <td class="attachrow" width="15%"><span class="genmed">File Type:</span></td>
            <td class="attachrow" width="75%">
            {$attachment['icon']}</td>
            <td rowspan="3" class="attachrow" width="10%" align="center">
            <a href="attachment.php?aid={$attachment['aid']}">
            <img src="images/download.png" alt="" border="0"></a><br>
</td>        </tr>
        <tr>
            <td class="attachrow" width="15%"><span class="genmed">Downloaded:</span></td>
            <td class="attachrow" width="75%"><span class="genmed">{$attachment['downloads']} times</span></td>
        </tr>
        <tr>
            <td class="attachrow" width="15%"><span class="genmed">Size:</span></td>
            <td class="attachrow" width="75%">{$attachment['filesize']}</td>
        </tr>
    </table>

Preview
[Image: 687474703a2f2f692e696d6775722e636f6d2f4e...392e706e67]
  Trả lời


Đi tới chuyên mục:


Thành viên đang xem chủ đề: 1 Khách