<?php
/************************************************************************/
/* Maximus CMS: Web Portal System                                       */
/* ==============================                                       */
/*                                                                      */
/* Copyright (c) 2002 - 2006                                            */
/* http://www.php-maximus.fr                                            */
/* dev@php-maximus.org                                                  */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
/* Based on PHP-NUKE: Web Portal System                                 */
/************************************************************************/
defined('MAXIMUS') or die ('Access denied convert size MAXIMUS directly...');

function convert_size($size) {
$sizekb = round(($size / 1024), 3);
$sizemb = round(($sizekb / 1024), 3);
$sizegb = round(($sizemb / 1024), 3);

if ($sizegb >= 1) {
$sizereal = " <b>$sizegb</b> "._MEM_1."";}
elseif ($sizemb >= 1) {
$sizereal = " <b>$sizemb</b> "._MEM_2."";}
elseif ($sizekb >= 1) {
$sizereal = " <b>$sizekb</b> "._MEM_3."";}
else { $sizereal = " <b>$size</b> "._MEM_4."";}

return $sizereal;
}