/*
    -----------------------------------------------------------------
      /  
    -----------------------------------------------------------------
    */
    function count_photo() {
        global $realtime, $set;
        $albumcount = mysql_result(mysql_query("SELECT COUNT(DISTINCT `user_id`) FROM `cms_album_files`"), 0);
        $photocount = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_album_files`"), 0);
        $newcount = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_album_files` WHERE `time` > '" . ($realtime - 259200) . "' AND `access` > '1'"), 0);
        return $albumcount . '&#160;/&#160;' . $photocount . ($newcount ? '&#160;/&#160;<span class="red"><a href="' . $home . '/albums/index.php?act=top">+' . $newcount . '</a></span>' : '');
    }

    /*
    -----------------------------------------------------------------
      
    -----------------------------------------------------------------
    $delimiter -   
    $end_space -   
    -----------------------------------------------------------------
    */
    function display_menu($val = array (), $delimiter = ' | ', $end_space = '') {
        $out = '';

        foreach ($val as $key => $menu) {
            if (empty($menu))
                unset($val[$key]);
        }

        if (empty($val))
            return false;

        //ksort($val);
        $last = array_pop($val);

        foreach ($val as $menu) {
            $out .= $menu . $delimiter;
        }
        return $out . $last . $end_space;
    }
		
		-------------------------------------------------------------------
		 
		-------------------------------------------------------------------
		function date_fixed($timestamp)
	{
		global $realtime;
		$datestamp = date('d.m.Y  H:i',$timestamp);
		$today = date("d.m.Y",$realtime);
		$yestoday = date("d.m.Y",$realtime-24*3600);
		$datestamp = str_replace($today,"<font color='#FF0000'></font>",$datestamp);
		$datestamp = str_replace($yestoday,"<font color='#00FF00'></font>",$datestamp);
		return $datestamp;
	}
