////////////////////////////////////////////////////////////
//                                      //
////////////////////////////////////////////////////////////
function dir_count($dir = '')
{
    global $realtime;

    if (is_dir($dir)) {

        if ($opendir = opendir($dir)) {

            while (false !== ($file = readdir($opendir))) {
                if ($file != "." && $file != "..") {

                    if (is_dir($dir . "/" . $file)) {
                        $ex = filemtime($dir . "/" . $file);
                        if ($ex > ($realtime - 259200)) {

                            $count_new++;
                        }

                        $count++;
                    }
                }
            }
        }
    }
    if ($count_new) {

        return $count . ' / <span class="red">+' . $count_new . '</span>';
    } else {
        return $count;
    }
}