Page 1 of 1

Filesize in fileviewer

Posted: Tue 1. Mar 2005, 10:00
by joransrb
Dont know if this is mentioned before,
but it would be nice if the filesize of the files in the file viewer
was displayd?? for each file and total size :)

Just a suggestion :)

Sample:
Image

Posted: Tue 1. Mar 2005, 15:09
by spirelli
defiantely would bee a good thing. Especially to be able to see the overall size.

Re: Filesize in fileviewer

Posted: Thu 3. Mar 2005, 16:23
by Neelix
joransrb wrote: but it would be nice if the filesize of the files in the file viewer
was displayd?? for each file and total size :)
first shot: 90% is possible with core at once!

Code: Select all

#
#---[OPEN]---
#
include/inc_lib/files.private-filelist.inc.php
#
#---[FIND]---
#
//Button zum Downloaden der Datei
echo "<a href="include/inc_act/act_download.php?dl=".$file_row["f_id"].
#
#---[REPLACE WITH]---
#
//Button zum Downloaden der Datei
echo fsizelong($file_row["f_size"])." <a href="include/inc_act/act_download.php?dl=".$file_row["f_id"].
#
#------[4the rest]--------
#
...will be follow: i write an function in the moment... must be testet first ...
... or someone find the second shot in the core...

Posted: Thu 3. Mar 2005, 16:35
by brans
ouhm what do you mean by second shot ? the total size ?

Posted: Thu 3. Mar 2005, 16:41
by Neelix
brans wrote:ouhm what do you mean by second shot ? the total size ?
:YES: :wink:

[edit->]

function ready ! where is the best place 4?

Code: Select all

	function getPrivatFileSize()
	{
		global $db;
		
		$sQuery = 'SELECT SUM(f_size) as summe FROM '.DB_PREPEND.'phpwcms_file
					  WHERE f_public=1 AND f_aktiv=1 AND f_kid=1 AND f_trash=0 AND f_uid='.$_SESSION[wcs_user_id];
													
      $hResult = mysql_query($sQuery);
		if ($hResult)	 
		{
	     $row=mysql_fetch_object($hResult);
		  return ($row?$row->summe:0);
	   }
      return 0;
	
	}//end-fnc
call in files.private-filelist.inc.php is to bad... it works but not the best place...

Code: Select all

#
#---[FIND]---
#
	}
} //Ende Liste Dateien

#
#---[BEFORE, ADD]---
#
echo '<tr><td colspan="2">'.fsizelong(getPrivatFileSize()).'</td>
				</tr>'."\n"; 

Posted: Thu 3. Mar 2005, 17:15
by spirelli
Could this be integrated into the new version please?

Posted: Thu 3. Mar 2005, 17:21
by Neelix
spirelli wrote:Could this be integrated into the new version please?
I'm only an unworthy Slave - ask the MASTER 8) :wink:

Posted: Thu 3. Mar 2005, 17:34
by spirelli
Neelix wrote:
spirelli wrote:Could this be integrated into the new version please?
I'm only an unworthy Slave - ask the MASTER 8) :wink:
That's what I was doing :wink:
in the hope he reads the forum from time to time...