Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Attachment Size in Postbit (like vb3) Details »»
Attachment Size in Postbit (like vb3)
Version: 1.00, by tpearl5 tpearl5 is offline
Developer Last Online: Aug 2022 Show Printable Version Email this Page

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.

Comments
  #12  
Old 11-23-2003, 08:50 AM
CarolinaKid CarolinaKid is offline
 
Join Date: Jun 2003
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #13  
Old 11-25-2003, 02:19 AM
Giveit2u43 Giveit2u43 is offline
 
Join Date: Jun 2003
Location: Liverpool
Posts: 145
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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..
Reply With Quote
  #14  
Old 11-25-2003, 05:46 PM
tpearl5's Avatar
tpearl5 tpearl5 is offline
 
Join Date: Nov 2001
Location: PA
Posts: 1,014
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #15  
Old 11-25-2003, 05:47 PM
tpearl5's Avatar
tpearl5 tpearl5 is offline
 
Join Date: Nov 2001
Location: PA
Posts: 1,014
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #16  
Old 11-26-2003, 03:40 AM
CarolinaKid CarolinaKid is offline
 
Join Date: Jun 2003
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
  #17  
Old 11-26-2003, 10:27 PM
MindTrix's Avatar
MindTrix MindTrix is offline
 
Join Date: Apr 2002
Location: United Kingdom
Posts: 1,833
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #18  
Old 11-29-2003, 06:10 PM
David_McPherson David_McPherson is offline
 
Join Date: Oct 2002
Posts: 166
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #19  
Old 11-30-2003, 07:19 AM
Allan's Avatar
Allan Allan is offline
 
Join Date: Jun 2003
Location: France
Posts: 1,513
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #20  
Old 11-30-2003, 12:44 PM
mskgr mskgr is offline
 
Join Date: Jun 2003
Location: Piraeus, Greece
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #21  
Old 11-30-2003, 05:20 PM
Recluse's Avatar
Recluse Recluse is offline
 
Join Date: Feb 2002
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:55 AM.


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.04925 seconds
  • Memory Usage 2,316KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (7)bbcode_code
  • (1)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete