Version: 1.00, by tpearl5
Developer Last Online: Aug 2022
Version: 2.3.x
Rating:
Released: 11-19-2003
Last Update: Never
Installs: 8
No support by the author.
First off, I take no credit for this hack. It was created by Mist. He does some wonderful work! If you need something custom made, contact him.
I decided to release this as I thought it may be useful to others.
What it does: This hack simply adds the file size (in kb) next to an attachment, kinda like vb3 does. vb3 uses bytes, but I thought it would be cleaner in kb
One edit each to showthread.php and functions.php One modification to postbit_attachments template.
I cannot provide support for this hack.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
I am runing vb 2.3 and installed this hack but all attachments says this Files downloaded X amount of times 0 kbs No matter file size it is allways 0kb any ideas
haven`t downloaded but I`m guessing that this will only work on new attachments as it writes the filesize into the table along with the rest of the attachment data and then just reads it from there for the postbit..
I am runing vb 2.3 and installed this hack but all attachments says this Files downloaded X amount of times 0 kbs No matter file size it is allways 0kb any ideas
Are you sure you copy/pasted everything correctly?
haven`t downloaded but I`m guessing that this will only work on new attachments as it writes the filesize into the table along with the rest of the attachment data and then just reads it from there for the postbit..
if ($post[attachmentid]!=0 and $post[attachmentvisible]) {
$post[attachmentextension]=strtolower(getextension($post[filename]));
$post['attachlength'] = round(($post['attachlength'] / 1024), 1);
$post['filename'] = censortext(htmlspecialchars($post['filename']));
In showthread.php
Code:
post.*,post.username AS postusername,post.ipaddress AS ip,user.*,userfield.*,".iif($forum[allowicons],'icon.title as icontitle,icon.iconpath,','')."
attachment.attachmentid,attachment.filename,LENGTH(attachment.filedata) AS attachlength,attachment.visible AS attachmentvisible,attachment.counter
".iif($avatarenabled,",avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar,customavatar.dateline AS avatardateline","")."
Then in postbit attachment i have this
Code:
<p><normalfont><img src="{imagesfolder}/attach/$post[attachmentextension].gif" width="16" height="16" border="0" alt="">Attachment: <a href="attachment.php?s=$session[sessionhash]&postid=$post[postid]" target="_blank">$post[filename]</a></normalfont><br>
<smallfont>This has been downloaded $post[counter] time, $post[attachlength]kb(s).</smallfont></p>
if ($post[attachmentid]!=0 and $post[attachmentvisible]) {
$post[attachmentextension]=strtolower(getextension($post[filename]));
$post['attachlength'] = round(($post['attachlength'] / 1024), 1);
$post['filename'] = censortext(htmlspecialchars($post['filename']));
In showthread.php
Code:
post.*,post.username AS postusername,post.ipaddress AS ip,user.*,userfield.*,".iif($forum[allowicons],'icon.title as icontitle,icon.iconpath,','')."
attachment.attachmentid,attachment.filename,LENGTH(attachment.filedata) AS attachlength,attachment.visible AS attachmentvisible,attachment.counter
".iif($avatarenabled,",avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar,customavatar.dateline AS avatardateline","")."
Then in postbit attachment i have this
Code:
<p><normalfont><img src="{imagesfolder}/attach/$post[attachmentextension].gif" width="16" height="16" border="0" alt="">Attachment: <a href="attachment.php?s=$session[sessionhash]&postid=$post[postid]" target="_blank">$post[filename]</a></normalfont><br>
<smallfont>This has been downloaded $post[counter] time, $post[attachlength]kb(s).</smallfont></p>
I am runing vb 2.3 and installed this hack but all attachments says this Files downloaded X amount of times 0 kbs No matter file size it is allways 0kb any ideas