Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

browserlist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: browserlist.php 8239 2001-11-02 06:46:24Z br $
5 //
6 // Created on: <07-Jan-2001 16:13:21 bf>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 //
10 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
11 //
12 // This program is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
25 //
26
27 // include_once( "classes/INIFile.php" );
28 $ini =& eZINI::instance( 'site.ini' );
29 $Language = $ini->variable( "eZStatsMain", "Language" );
30
31 // include_once( "classes/eztemplate.php" );
32 // include_once( "classes/ezdate.php" );
33 // include_once( "classes/ezlist.php" );
34
35 // include_once( "ezstats/classes/ezpageview.php" );
36 // include_once( "ezstats/classes/ezpageviewquery.php" );
37
38 $t = new eZTemplate( "kernel/ezstats/admin/" . $ini->variable( "eZStatsMain", "AdminTemplateDir" ),
39 "kernel/ezstats/admin/intl", $Language, "browserlist.php" );
40
41 $t->setAllStrings();
42
43 $t->set_file( "browser_page_tpl", "browserlist.tpl" );
44
45 $t->set_block( "browser_page_tpl", "browser_list_tpl", "browser_list" );
46 $t->set_block( "browser_list_tpl", "browser_tpl", "browser" );
47
48 if ( !isset( $Offset ) or !is_numeric( $Offset ) )
49 $Offset = 0;
50
51 $latest =& eZPageViewQuery::topBrowsers( $ViewLimit, $Offset );
52 // $ItemCount = eZPageViewQuery::topBrowsersCount();
53 $ItemCount = count( $latest );
54 $total_count = eZPageViewQuery::latestCount();
55 $total_count = eZPageViewQuery::sumBrowserTypeCount();
56
57 $t->set_var( "item_start", $Offset + 1 );
58 $t->set_var( "item_end", $Offset + $ViewLimit );
59 $t->set_var( "item_count", $ItemCount );
60 $t->set_var( "item_limit", $ViewLimit );
61
62 if ( count( $latest ) > 0 )
63 {
64 $i = 0;
65 foreach ( $latest as $browser )
66 {
67 if ( ( $i %2 ) == 0 )
68 $t->set_var( "bg_color", "bglight" );
69 else
70 $t->set_var( "bg_color", "bgdark" );
71
72 $t->set_var( "browser_name", $browser["Name"] );
73 $t->set_var( "page_view_count", $browser["Count"] );
74 $t->set_var( "page_view_percent", round( $browser["Count"]*100/$total_count ) );
75 $t->parse( "browser", "browser_tpl", true );
76 $i++;
77 }
78
79 eZList::drawNavigator( $t, $ItemCount, $ViewLimit, $Offset, "browser_list_tpl" );
80 $t->parse( "browser_list", "browser_list_tpl" );
81 }
82 else
83 {
84 $t->set_var( "browser_list", "" );
85 }
86
87 $t->set_var( "view_mode", $ViewMode );
88 $t->set_var( "view_limit", $ViewLimit );
89
90 $t->pparse( "output", "browser_page_tpl" );
91
92 ?>
$i
$i
Definition: admin/adlist.php:91
$latest
$latest
Definition: browserlist.php:51
$t
$t
Definition: browserlist.php:38
$Language
$Language
Definition: browserlist.php:29
$ini
$ini
Definition: browserlist.php:28
$total_count
$total_count
Definition: browserlist.php:54
$ItemCount
$ItemCount
Definition: browserlist.php:53
eZList\drawNavigator
static drawNavigator(&$t, $total_types, $max_types, $index, $parent=false, $variables=false)
Definition: ezlist.php:401
eZPageViewQuery\latestCount
static & latestCount()
Definition: ezpageviewquery.php:205
eZPageViewQuery\topBrowsers
static & topBrowsers( $limit=25, $offset=0)
Definition: ezpageviewquery.php:355
eZPageViewQuery\sumBrowserTypeCount
static & sumBrowserTypeCount()
Definition: ezpageviewquery.php:161
eZTemplate
Definition: eztemplate.php:107
$Offset
$Offset
Definition: ezarticle/user/search.php:110
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.