View file engine/classes/menu.class.php

File size: 3.96Kb
<?php
class menu 
{
		
    public static function statics() 
	{
	    global $db;
		
        //Все пользователи
        $cuserall = $db->get_array( $db->query( "SELECT COUNT(*) FROM `users`" ) );
        
		//В сети
        $cuseronline = $db->get_array( $db->query( "SELECT COUNT(*) FROM `users` WHERE `lastdate` > '".(time()-600)."'"));
        
		//Последний зарегестрированный
		$newuser = $db->super_query( "SELECT * FROM `users` ORDER BY `id` DESC" );
    		
			$stat = '<center><div class="subpost">';
	    	$stat .= '<span class="notinfo">'.$cuserall[0].'</span>&nbsp;<a href="/modules/all_users.php">Пользователей</a>';
			$stat .= '<span style="margin-left: 20px;" class="notinfo">'.$cuseronline[0].'</span>&nbsp;<a href="/modules/all_users.php?do=online_user">Онлайн</a>';
			$stat .= '<span style="margin-left: 20px;"><span class="notinfo">'.$newuser['nick'].'</span>&nbsp;Новый</span>';
			$stat .= '</div></center>';
		
		return $stat;	
	
	}
    
	
	
	public static function listing() 
	{
	    global $db, $user;
		
			$menu_list = $db->query( "SELECT * FROM `application` WHERE `app_on` = '1' ORDER BY `posi` ASC" );
	            
				//Вывод всех разделов
			    while( $menu = $db->get_array( $menu_list ) ) 
				{
                    
					//Счетчики Разделов
    			    if( $menu['dir'] == 'chat' ) 
					{
					
				        $count = $db->get_array( $db->query( "SELECT COUNT(*) FROM `chat`" ) );
				    
					}elseif( $menu['dir'] == 'forum' ) 
					{ 
					
				       $count = $db->get_array( $db->query( "SELECT COUNT(*) FROM `forum_topics`" ) );				
				    
					}elseif( $menu['dir'] == 'download' ) 
					{
					
				        $count = $db->get_array($db->query("SELECT COUNT(*) FROM `files`") );						
				    
					} elseif( $menu['dir'] == 'news' ) 
					{ 
					
				        $count = $db->get_array($db->query("SELECT COUNT(*) FROM `news`") );						
				    
					}elseif( $menu['dir'] == 'libs' ) 
					{
					
					    $count = $db->get_array( $db->query( "SELECT COUNT(*) FROM `libs_files`" ) );	
				    
					} elseif( $menu['dir'] == 'gallery' ) 
					{
					
					    $count = $db->get_array( $db->query( "SELECT COUNT(*) FROM `gallery_files`" ) );	
				    
					}  elseif( $menu['dir'] == 'blogs' ) 
					{
					
					    $count = $db->get_array( $db->query( "SELECT COUNT(*) FROM `blogs`" ) );	
				    
					} 
				    
					
					//Вывод разделов в Таблицах CSS
                    echo '<div class="table_posts">
						<a href="/modules/'.$menu['dir'].'/" class="posts_gl hig">
                        <table cellspacing="0" callpadding="0" width="100%">
                        <tbody><tr><td class="icons"><img src="admin/icons/module/'.$menu['icon'].'" alt="">
                        </td><td class="name">'.$menu['name'].'<span class="menu_count">'.$count[0].'</span></td>
                        </tr></tbody></table></a>';
						
						
						//Выводим параметры форума
                		if( $menu['dir'] == 'forum' ) 
						{
						
                    		include_once(H.'engine/menu/count/forum.php');    
			    		
						}
						//Выводим Параметры Новостей	
						if( $menu['dir'] == 'news' ) 
						{
                    
							include_once(H.'engine/menu/count/news.php');				
				
						}
                        //Выводим Параметры фотоальбомов						
						if( $menu['dir'] == 'gallery' ) 
						{
                    
							include_once(H.'engine/menu/count/gallery.php');				
				
						}	
                        //Выводим Параметры Статей
						if( $menu['dir'] == 'libs' ) 
						{
                    
							include_once(H.'engine/menu/count/libs.php');				
				
						}							
					echo '</div>'; //Закрываем DIV
    			}		
	}
}


?>