Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

storestats.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: storestats.php 8189 2001-11-01 17:44:30Z bf $
5 //
6 // Created on: <26-Apr-2001 10:39:18 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 ob_start( );
28
29 // get right path
30 //chdir( "../../" );
31
32 $REQUEST_URI = preg_replace( "#/stats/store(.*?)1x1.gif$#", "\\1", $REQUEST_URI );
33 //$REQUEST_URI = preg_replace( "#/stats/store(.*?)1x1.png$#", "\\1", $REQUEST_URI );
34
35 $REQUEST_URI = preg_replace( "#/rx.*?-(.*)$#", "\\1", $REQUEST_URI );
36 //$REQUEST_URI = preg_replace( "#/rx.*?-(.*)$#", "\\1", $REQUEST_URI );
37
38 // do the statistics
39 // include_once( "ezstats/classes/ezpageview.php" );
40
41 // create a global page view object for statistics
42 // and store the stats
43 $GlobalPageView = new eZPageView();
44 $GlobalPageView->store();
45
46 ob_end_clean();
47
48 // # the file may be a local file with full path.
49 // $filePath = "images/1x1.gif";
50 // $filePath = "design/base/images/design/1x1.png";
51
52 $filePath = "design/base/images/design/1x1.gif";
53 $fileSize = eZPBFile::filesize( $filePath );
54 $fp = eZPBFile::fopen( $filePath, "r" );
55 $content =& fread( $fp, $fileSize );
56
57 $originalFileName = "1x1.gif";
58 // $originalFileName = "1x1.png";
59
60 //Header("Content-type: image/png");
61 Header("Content-type: image/gif");
62 Header("Content-length: $fileSize");
63 Header("Content-disposition: attachment; filename=\"$originalFileName\"");
64
65 echo($content);
66 exit();
67
68 ?>
eZPBFile\fopen
static fopen( $filename, $options)
Definition: ezpbfile.php:326
eZPBFile\filesize
static filesize( $filename)
Definition: ezpbfile.php:339
eZPageView
Definition: ezpageview.php:47
exit
exit
Definition: folder.php:81
$fp
$fp
Definition: storestats.php:54
$REQUEST_URI
$REQUEST_URI
Definition: storestats.php:32
$GlobalPageView
$GlobalPageView
Definition: storestats.php:43
$content
$content
Definition: storestats.php:55
$originalFileName
$originalFileName
Definition: storestats.php:57
$fileSize
$fileSize
Definition: storestats.php:53
$filePath
$filePath
Definition: storestats.php:52
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.