protected function getSearchEngine($VisitorsKatID)
	{
		$VisitorsSearchEngines        = array(); // only searchengines
		$VisitorsSearchEngineKeywords = array(); //searchengine - keywords, order by keywords
		$day60 = mktime(0, 0, 0, date("m")-2 , date("d") ,date("Y"));
		
		$objVisitors = \Database::getInstance()
		        ->prepare("SELECT 
                                tl_visitors.id AS id
                            FROM 
                                tl_visitors 
                            LEFT JOIN 
                                tl_visitors_category ON (tl_visitors_category.id=tl_visitors.pid)
                            WHERE 
                                tl_visitors.pid=? AND published=?
                            ORDER BY id")
                ->limit(1)
                ->execute($VisitorsKatID,1);
		if ($objVisitors->numRows > 0) 
		{
			$objVisitors->next();
			$VisitorsID = $objVisitors->id;
			
			$objVisitorsSearchEngines = \Database::getInstance()
			        ->prepare("SELECT 
                                    `visitors_searchengine`,
                                    count(*) as anz 
                                FROM 
                                    `tl_visitors_searchengines` 
                                WHERE 
                                    `vid`=? AND `tstamp` > ? 
                                GROUP BY 1 
                                ORDER BY anz DESC")
                    ->limit(20)
                    ->execute($VisitorsID,$day60);
			if ($objVisitorsSearchEngines->numRows > 0) 
			{
			    while ($objVisitorsSearchEngines->next()) 
			    {
			        if ('Generic' == $objVisitorsSearchEngines->visitors_searchengine)
			        {
			            $objVisitorsSearchEngines->visitors_searchengine = $GLOBALS['TL_LANG']['MSC']['tl_visitors_stat']['searchengine_unknown'];
			        }
	            	$VisitorsSearchEngines[] = array($objVisitorsSearchEngines->visitors_searchengine, 
                                                     $objVisitorsSearchEngines->anz);
			    }
		    }
		    
		    $objVisitorsSearchEngineKeywords = \Database::getInstance()
		            ->prepare("SELECT 
                                    `visitors_searchengine`, 
                                    lower(`visitors_keywords`) AS keyword, 
                                    count(*) AS anz 
                                FROM 
                                    `tl_visitors_searchengines` 
                                WHERE 
                                    `vid`=? AND `tstamp` > ? 
                                GROUP BY 1,2 
                                ORDER BY anz DESC")
                    ->limit(20)
                    ->execute($VisitorsID,$day60);
			if ($objVisitorsSearchEngineKeywords->numRows > 0) 
			{
			    while ($objVisitorsSearchEngineKeywords->next()) 
			    {
			        // Issue #67
			        if ('notdefined' == $objVisitorsSearchEngineKeywords->keyword) 
			        {
			            $objVisitorsSearchEngineKeywords->keyword = $GLOBALS['TL_LANG']['MSC']['tl_visitors_stat']['not_defined'];
			        }
			        if ('Generic' == $objVisitorsSearchEngineKeywords->visitors_searchengine)
			        {
			            $objVisitorsSearchEngineKeywords->visitors_searchengine = $GLOBALS['TL_LANG']['MSC']['tl_visitors_stat']['searchengine_unknown'];
			        }
	            	$VisitorsSearchEngineKeywords[] = array($objVisitorsSearchEngineKeywords->visitors_searchengine, 
                                                            $objVisitorsSearchEngineKeywords->keyword, 
                                                            $objVisitorsSearchEngineKeywords->anz);
			    }
		    }
	    }
	    if (0 == count($VisitorsSearchEngines) && 0 == count($VisitorsSearchEngineKeywords)) 
	    { 
	        return false;
	    }
	    return array('SearchEngines' => $VisitorsSearchEngines, 
                     'SearchEngineKeywords' =>$VisitorsSearchEngineKeywords);
	}
protected function getSearchEngine($VisitorsKatID)
	{
		$VisitorsSearchEngines        = array(); // only searchengines
		$VisitorsSearchEngineKeywords = array(); //searchengine - keywords, order by keywords
		$day60 = mktime(0, 0, 0, date("m")-2 , date("d") ,date("Y"));
		
		$objVisitors = \Database::getInstance()
		        ->prepare("SELECT 
                                tl_visitors.id AS id
                            FROM 
                                tl_visitors 
                            LEFT JOIN 
                                tl_visitors_category ON (tl_visitors_category.id=tl_visitors.pid)
                            WHERE 
                                tl_visitors.pid=? AND published=?
                            ORDER BY id")
                ->limit(1)
                ->execute($VisitorsKatID,1);
		if ($objVisitors->numRows > 0) 
		{
			$objVisitors->next();
			$VisitorsID = $objVisitors->id;
			
			$objVisitorsSearchEngines = \Database::getInstance()
			        ->prepare("SELECT 
                                    `visitors_searchengine`,
                                    count(*) as anz 
                                FROM 
                                    `tl_visitors_searchengines` 
                                WHERE 
                                    `vid`=? AND `tstamp` > ? 
                                GROUP BY 1 
                                ORDER BY anz DESC")
                    ->limit(20)
                    ->execute($VisitorsID,$day60);
			if ($objVisitorsSearchEngines->numRows > 0) 
			{
			    while ($objVisitorsSearchEngines->next()) 
			    {
			        if ('Generic' == $objVisitorsSearchEngines->visitors_searchengine)
			        {
			            $objVisitorsSearchEngines->visitors_searchengine = $GLOBALS['TL_LANG']['MSC']['tl_visitors_stat']['searchengine_unknown'];
			        }
	            	$VisitorsSearchEngines[] = array($objVisitorsSearchEngines->visitors_searchengine, 
                                                     $objVisitorsSearchEngines->anz);
			    }
		    }
		    
		    $objVisitorsSearchEngineKeywords = \Database::getInstance()
		            ->prepare("SELECT 
                                    `visitors_searchengine`, 
                                    lower(`visitors_keywords`) AS keyword, 
                                    count(*) AS anz 
                                FROM 
                                    `tl_visitors_searchengines` 
                                WHERE 
                                    `vid`=? AND `tstamp` > ? 
                                GROUP BY 1,2 
                                ORDER BY anz DESC")
                    ->limit(20)
                    ->execute($VisitorsID,$day60);
			if ($objVisitorsSearchEngineKeywords->numRows > 0) 
			{
			    while ($objVisitorsSearchEngineKeywords->next()) 
			    {
			        // Issue #67
			        if ('notdefined' == $objVisitorsSearchEngineKeywords->keyword) 
			        {
			            $objVisitorsSearchEngineKeywords->keyword = $GLOBALS['TL_LANG']['MSC']['tl_visitors_stat']['not_defined'];
			        }
			        if ('Generic' == $objVisitorsSearchEngineKeywords->visitors_searchengine)
			        {
			            $objVisitorsSearchEngineKeywords->visitors_searchengine = $GLOBALS['TL_LANG']['MSC']['tl_visitors_stat']['searchengine_unknown'];
			        }
	            	$VisitorsSearchEngineKeywords[] = array($objVisitorsSearchEngineKeywords->visitors_searchengine, 
                                                            $objVisitorsSearchEngineKeywords->keyword, 
                                                            $objVisitorsSearchEngineKeywords->anz);
			    }
		    }
	    }
	    if (0 == count($VisitorsSearchEngines) && 0 == count($VisitorsSearchEngineKeywords)) 
	    { 
	        return false;
	    }
	    return array('SearchEngines' => $VisitorsSearchEngines, 
                     'SearchEngineKeywords' =>$VisitorsSearchEngineKeywords);
	}
protected function getSearchEngine ( $ VisitorsKatID ) { $ VisitorsSearchEngines = array ( ) ; // only searchengines $ VisitorsSearchEngineKeywords = array ( ) ; //searchengine - keywords, order by keywords $ day60 = mktime ( 0 , 0 , 0 , date ( "m" ) - 2 , date ( "d" ) , date ( "Y" ) ) ; $ objVisitors = \ Database :: getInstance ( ) -> prepare ( "SELECT 
                                tl_visitors.id AS id
                            FROM 
                                tl_visitors 
                            LEFT JOIN 
                                tl_visitors_category ON (tl_visitors_category.id=tl_visitors.pid)
                            WHERE 
                                tl_visitors.pid=? AND published=?
                            ORDER BY id" ) -> limit ( 1 ) -> execute ( $ VisitorsKatID , 1 ) ; if ( $ objVisitors -> numRows > 0 ) { $ objVisitors -> next ( ) ; $ VisitorsID = $ objVisitors -> id ; $ objVisitorsSearchEngines = \ Database :: getInstance ( ) -> prepare ( "SELECT 
                                    `visitors_searchengine`,
                                    count(*) as anz 
                                FROM 
                                    `tl_visitors_searchengines` 
                                WHERE 
                                    `vid`=? AND `tstamp` > ? 
                                GROUP BY 1 
                                ORDER BY anz DESC" ) -> limit ( 20 ) -> execute ( $ VisitorsID , $ day60 ) ; if ( $ objVisitorsSearchEngines -> numRows > 0 ) { while ( $ objVisitorsSearchEngines -> next ( ) ) { if ( 'Generic' == $ objVisitorsSearchEngines -> visitors_searchengine ) { $ objVisitorsSearchEngines -> visitors_searchengine = $ GLOBALS [ 'TL_LANG' ] [ 'MSC' ] [ 'tl_visitors_stat' ] [ 'searchengine_unknown' ] ; } $ VisitorsSearchEngines [ ] = array ( $ objVisitorsSearchEngines -> visitors_searchengine , $ objVisitorsSearchEngines -> anz ) ; } } $ objVisitorsSearchEngineKeywords = \ Database :: getInstance ( ) -> prepare ( "SELECT 
                                    `visitors_searchengine`, 
                                    lower(`visitors_keywords`) AS keyword, 
                                    count(*) AS anz 
                                FROM 
                                    `tl_visitors_searchengines` 
                                WHERE 
                                    `vid`=? AND `tstamp` > ? 
                                GROUP BY 1,2 
                                ORDER BY anz DESC" ) -> limit ( 20 ) -> execute ( $ VisitorsID , $ day60 ) ; if ( $ objVisitorsSearchEngineKeywords -> numRows > 0 ) { while ( $ objVisitorsSearchEngineKeywords -> next ( ) ) { // Issue #67 if ( 'notdefined' == $ objVisitorsSearchEngineKeywords -> keyword ) { $ objVisitorsSearchEngineKeywords -> keyword = $ GLOBALS [ 'TL_LANG' ] [ 'MSC' ] [ 'tl_visitors_stat' ] [ 'not_defined' ] ; } if ( 'Generic' == $ objVisitorsSearchEngineKeywords -> visitors_searchengine ) { $ objVisitorsSearchEngineKeywords -> visitors_searchengine = $ GLOBALS [ 'TL_LANG' ] [ 'MSC' ] [ 'tl_visitors_stat' ] [ 'searchengine_unknown' ] ; } $ VisitorsSearchEngineKeywords [ ] = array ( $ objVisitorsSearchEngineKeywords -> visitors_searchengine , $ objVisitorsSearchEngineKeywords -> keyword , $ objVisitorsSearchEngineKeywords -> anz ) ; } } } if ( 0 == count ( $ VisitorsSearchEngines ) && 0 == count ( $ VisitorsSearchEngineKeywords ) ) { return false ; } return array ( 'SearchEngines' => $ VisitorsSearchEngines , 'SearchEngineKeywords' => $ VisitorsSearchEngineKeywords ) ; }
TOP 20 SearchEngine

@param	integer	$VisitorsID	Category-ID des Zählers
@return	array
TOP 20 SearchEngine