|
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
|
|
|
|
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
|
|
|
|
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,301 Likes: 116
|
Joined: Jun 2006
Posts: 16,301 Likes: 116 |
Yes, I think that filesize and an MD5 hash should be included in the file information
|
|
|
|
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
|
|
|
|
Joined: Jun 2006
Posts: 16,301 Likes: 116
|
Joined: Jun 2006
Posts: 16,301 Likes: 116 |
Shown to the user (so they can copy it into a comparison utility to check the hash to validate the filesize)
|
|
|
|
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.
|
|
|
|
Joined: Jun 2006
Posts: 16,301 Likes: 116
|
Joined: Jun 2006
Posts: 16,301 Likes: 116 |
Looks lovely... Now I'd like to suggest for Rick that the above be included in the base product ... Well, a US/English varient, where we use "." vs everyone elses ","
Last edited by Gizmo; 02/06/2008 6:58 PM.
|
|
|
|
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 "." LOL... Would be great if this will be included in the core. Then it feels like a part of me Rob
|
|
|
|
Joined: Jun 2006
Posts: 16,301 Likes: 116
|
Joined: Jun 2006
Posts: 16,301 Likes: 116 |
'eh you know the good old US of A, gotta stand out in every way :rolls eyes:
|
|
|
|
Bots
by Outdoorking - 04/13/2024 5:08 PM
|
|
|
|
|
1 members (Ruben),
667
guests, and
166
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|