vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Attachment Size in Postbit (like vb3) (https://vborg.vbsupport.ru/showthread.php?t=58725)

CarolinaKid 11-23-2003 08:50 AM

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

Giveit2u43 11-25-2003 02:19 AM

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..

tpearl5 11-25-2003 05:46 PM

Quote:

Originally Posted by CarolinaKid
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?

tpearl5 11-25-2003 05:47 PM

Quote:

Originally Posted by Giveit2u43
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..

Nope, it works with all existing attachments

CarolinaKid 11-26-2003 03:40 AM

Here is what i have done.
In functions.php
Code:

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>


MindTrix 11-26-2003 10:27 PM

Just a minor note tpearl5, your installation instructions is missing the $ sign off of the 1st piece of code to find.

This bit--

PHP Code:

post[attachmentextension]=strtolower(getextension($post[filename])); 

As i said minor note :)

David_McPherson 11-29-2003 06:10 PM

Quote:

Originally Posted by CarolinaKid
Here is what i have done.
In functions.php
Code:

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 have this same problem.... Ideas?

Allan 11-30-2003 07:19 AM

Quote:

Originally Posted by CarolinaKid
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

I same the prob, is there has a solution?

mskgr 11-30-2003 12:44 PM

I also have the 0kbs problem on vb 2.3.2. I doubled checked everything twice... even removed it and installed it again... but still nothing :(

Recluse 11-30-2003 05:20 PM

Quote:

Originally Posted by mskgr
I also have the 0kbs problem on vb 2.3.2. I doubled checked everything twice... even removed it and installed it again... but still nothing :(


in 2.2.9 the showthead.php has
Code:

attachment.attachmentid,attachment.filename,attachment.visible AS attachmentvisible,attachment.counter
twice, the second one is what needs replace.


good hack btw


All times are GMT. The time now is 04:39 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01182 seconds
  • Memory Usage 1,749KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_code_printable
  • (1)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete