Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

requestpagelist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: requestpagelist.php 7434 2001-09-24 17:42:25Z br $
5 //
6 // Created on: <07-Jan-2001 16:25:31 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
30 $Language = $ini->variable( "eZStatsMain", "Language" );
31
32 // include_once( "classes/eztemplate.php" );
33 // include_once( "classes/ezdate.php" );
34 // include_once( "classes/ezlist.php" );
35
36 // include_once( "ezstats/classes/ezpageview.php" );
37 // include_once( "ezstats/classes/ezpageviewquery.php" );
38
39 $t = new eZTemplate( "kernel/ezstats/admin/" . $ini->variable( "eZStatsMain", "AdminTemplateDir" ),
40 "kernel/ezstats/admin/intl", $Language, "requestpagelist.php" );
41
42 $t->setAllStrings();
43
44 $t->set_file( "request_page_tpl", "requestpagelist.tpl" );
45
46 $t->set_block( "request_page_tpl", "request_list_tpl", "request_list" );
47 $t->set_block( "request_list_tpl", "request_tpl", "request" );
48
49 if ( !isset( $Offset ) or !is_numeric( $Offset ) )
50 $Offset = 0;
51
52 $latest =& eZPageViewQuery::topRequests( $ViewLimit, $Offset );
53 $ItemCount = eZPageViewQuery::topRequestsCount();
54
55 $t->set_var( "item_start", $Offset + 1 );
56 $t->set_var( "item_end", $Offset + $ViewLimit );
57 $t->set_var( "item_count", $ItemCount );
58 $t->set_var( "item_limit", $ViewLimit );
59 $t->set_var( "exclude_domain", isset( $ExcludeDomain ) ? $ExcludeDomain : false );
60
61 $headers = getallheaders();
62 $request_domain = $headers["Host"];
63
64 $request_domain = preg_replace( "#^admin.#", "", $request_domain );
65
66
67 if ( count( $latest ) > 0 )
68 {
69 $i = 0;
70 foreach ( $latest as $request )
71 {
72 if ( ( $i %2 ) == 0 )
73 $t->set_var( "bg_color", "bglight" );
74 else
75 $t->set_var( "bg_color", "bgdark" );
76
77 $t->set_var( "request_domain", $request_domain );
78 $t->set_var( "request_uri", $request["URI"] );
79 $t->set_var( "page_view_count", $request["Count"] );
80
81 $t->parse( "request", "request_tpl", true );
82 $i++;
83 }
84 eZList::drawNavigator( $t, $ItemCount, $ViewLimit, $Offset, "request_list_tpl" );
85 $t->parse( "request_list", "request_list_tpl" );
86 }
87 else
88 {
89 $t->set_var( "request_list", "" );
90 }
91
92 $t->pparse( "output", "request_page_tpl" );
93
94 ?>
$i
$i
Definition: admin/adlist.php:91
eZList\drawNavigator
static drawNavigator(&$t, $total_types, $max_types, $index, $parent=false, $variables=false)
Definition: ezlist.php:401
eZPageViewQuery\topRequests
static & topRequests( $limit=20, $offset=0)
Definition: ezpageviewquery.php:400
eZPageViewQuery\topRequestsCount
static & topRequestsCount()
Definition: ezpageviewquery.php:425
eZTemplate
Definition: eztemplate.php:107
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$latest
$latest
Definition: requestpagelist.php:52
$t
$t
Definition: requestpagelist.php:39
$headers
$headers
Definition: requestpagelist.php:61
$request_domain
$request_domain
Definition: requestpagelist.php:62
$Language
$Language
Definition: requestpagelist.php:30
$ini
$ini
Definition: requestpagelist.php:28
$ItemCount
$ItemCount
Definition: requestpagelist.php:53
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.