Filesize in fileviewer

Use GitHub to post feature requests for phpwcms.
Locked
joransrb
Posts: 53
Joined: Mon 10. Jan 2005, 21:03

Filesize in fileviewer

Post 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
spirelli
Posts: 996
Joined: Tue 27. Jul 2004, 13:37
Location: London

Post by spirelli »

defiantely would bee a good thing. Especially to be able to see the overall size.
Neelix
Posts: 80
Joined: Wed 29. Sep 2004, 12:06
Location: España

Re: Filesize in fileviewer

Post 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...
Erfahrung ist das, was man besitzt, kurz nach dem es gebraucht wurde.
Warning: I have no foggiest idea of English/German, but I do
-ha{p}{p}y day/night/dia/noche-
brans

Post by brans »

ouhm what do you mean by second shot ? the total size ?
Neelix
Posts: 80
Joined: Wed 29. Sep 2004, 12:06
Location: España

Post 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"; 
Erfahrung ist das, was man besitzt, kurz nach dem es gebraucht wurde.
Warning: I have no foggiest idea of English/German, but I do
-ha{p}{p}y day/night/dia/noche-
spirelli
Posts: 996
Joined: Tue 27. Jul 2004, 13:37
Location: London

Post by spirelli »

Could this be integrated into the new version please?
Neelix
Posts: 80
Joined: Wed 29. Sep 2004, 12:06
Location: España

Post by Neelix »

spirelli wrote:Could this be integrated into the new version please?
I'm only an unworthy Slave - ask the MASTER 8) :wink:
Erfahrung ist das, was man besitzt, kurz nach dem es gebraucht wurde.
Warning: I have no foggiest idea of English/German, but I do
-ha{p}{p}y day/night/dia/noche-
spirelli
Posts: 996
Joined: Tue 27. Jul 2004, 13:37
Location: London

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