Previous Thread
Next Thread
Print Thread
Hop To
#206010 02/05/2008 12:08 PM
Joined: Jan 2008
Posts: 222
enthusiast
enthusiast
Joined: Jan 2008
Posts: 222
Is there a way to let the forum show what the filesize is of the attachement?


Rob


My place to be: http://www.freesat.nl
Joined: Jan 2008
Posts: 222
enthusiast
enthusiast
Joined: Jan 2008
Posts: 222
I'm getting faster every day....

Open: showflat.inc.php
Search for:
// If this isn't a gallery, we're just displaying
// attachments

Add after:
setlocale(constant('LC_ALL'), 'et_EE.UTF-8');
$filesize = round($size / 1024, 2);

Search for:
$postrow[$i]['filelink'] .= "<a href=\"{$config['BASE_URL']}/ubbthreads.php?ubb=download&Number=$file_id\">$filename_orig</a> <span class=\"small\"> ($downloads {$ubbt_lang['DOWNLOADS']})</span><br />";

Replace with:
$postrow[$i]['filelink'] .= "<a href=\"{$config['BASE_URL']}/ubbthreads.php?ubb=download&Number=$file_id\">$filename_orig</a> <span class=\"small\">[$filesize KBytes] - ($downloads {$ubbt_lang['DOWNLOADS']})</span><br />";

Now it looks like:
satcodx_V_3.12.zip [7145,92 KBytes] - (5 downloads)


Hope this is usefull for some people.

And you're welcome...

Rob


My place to be: http://www.freesat.nl
Joined: Nov 2006
Posts: 3,095
Likes: 1
Carpal Tunnel
Carpal Tunnel
Joined: Nov 2006
Posts: 3,095
Likes: 1
Thanks Rob

Though I often don't do too many mods so that I don't have to remember to update the software.
Hopefully such additions will make it into the core product code.

Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
Yes, I think that filesize and an MD5 hash should be included in the file information


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Jan 2008
Posts: 222
enthusiast
enthusiast
Joined: Jan 2008
Posts: 222
That's possible, but do you want the MD5 information to be shown or just as ALT text?

Rob


My place to be: http://www.freesat.nl
Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
Shown to the user (so they can copy it into a comparison utility to check the hash to validate the filesize)


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Jan 2008
Posts: 222
enthusiast
enthusiast
Joined: Jan 2008
Posts: 222
Find:
select FILE_ID,FILE_NAME,FILE_ORIGINAL_NAME,FILE_DOWNLOADS,FILE_SIZE,FILE_TYPE,FILE_DESCRIPTION,FILE_DIR,FILE_WIDTH,FILE_HEIGHT

Add after:
,FILE_MD5

Find:
while(list($file_id,$file_name,$filename_orig,$downloads,$size,$ext,$file_desc,$file_dir,$file_width,$file_height

Add after:
,$file_md5

Find:
$postrow[$i]['filelink'] .= "<a href=\"{$config['BASE_URL']}/ubbthreads.php?ubb=download&Number=$file_id\">$filename_orig</a> <span class=\"small\">[$filesize KBytes] - ($downloads {$ubbt_lang['DOWNLOADS']})</span><br />";

Replace with:
$postrow[$i]['filelink'] .= "<a href=\"{$config['BASE_URL']}/ubbthreads.php?ubb=download&Number=$file_id\">$filename_orig</a> <span class=\"small\">[$filesize KBytes / MD5: $file_md5] - ($downloads {$ubbt_lang['DOWNLOADS']})</span><br />";

Shows now:
filename.zip (2,99 KBytes / MD5: 5df32ec3b662a61f642582a8e4b6ee3f) - (1 downloads)

Have fun

Last edited by Robje01; 02/06/2008 9:46 AM.

My place to be: http://www.freesat.nl
Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
Looks lovely... Now I'd like to suggest for Rick that the above be included in the base product wink... Well, a US/English varient, where we use "." vs everyone elses "," wink

Last edited by Gizmo; 02/06/2008 6:58 PM.

I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Jan 2008
Posts: 222
enthusiast
enthusiast
Joined: Jan 2008
Posts: 222
Is that because we all use the "," or is that because the US/English use the "." smile LOL...

Would be great if this will be included in the core. Then it feels like a part of me smile

Rob


My place to be: http://www.freesat.nl
Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
'eh you know the good old US of A, gotta stand out in every way :rolls eyes:


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Is UBB.threads still going?
by Aaron101 - 04/01/2022 8:18 AM
Who's Online Now
1 members (Nightcrawler), 803 guests, and 448 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)