Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

user/adlist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: adlist.php 9634 2002-06-17 15:51:12Z bf $
5 //
6 // Created on: <25-Nov-2000 15:44:37 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
28 // NOTE: this page does not use templates due to speed
29 // and because we cannot cache the contents of this page.
30
31 // include_once( "ezuser/classes/ezuser.php" );
32
33 // include_once( "ezad/classes/ezad.php" );
34 // include_once( "ezad/classes/ezadcategory.php" );
35
36 $category = new eZAdCategory( $CategoryID );
37
38 // fetch the user if any
39 $user =& eZUser::currentUser();
40
41 if ( !isset( $Limit ) )
42 $Limit = 1;
43 if ( !isset( $Offset ) )
44 $Offset = 0;
45
46 // ads
47 $adList =& $category->ads( "count", false, $Offset, $Limit );
48
49 foreach ( $adList as $ad )
50 {
51 $adID = $ad->id();
52
53 $image =& $ad->image();
54
55 // ad image
56 if ( $image )
57 {
58 $imgSRC =& $image->filePath();
59 $imgWidth =& $image->width();
60 $imgHeight =& $image->height();
61 }
62
63 $ad->addPageView();
64
65 if ( $ad->useHTML() )
66 {
67 print( $ad->htmlBanner() );
68 }
69 else
70 {
71
72 //EP: check if it is external or internal banner --------------------
73 if ( preg_match( "/^([a-z]+:\/\/)/", $ad->URL() ) )
74 {
75 print( "<a target=\"_blank\" href=\"".$GlobalSiteIni->WWWDir.$GlobalSiteIni->Index."/ad/goto/$adID/\"><br/>" );
76 }
77 else
78 {
79 print( "<a href=\"".$GlobalSiteIni->WWWDir.$GlobalSiteIni->Index."/ad/goto/$adID/\"><br/>" );
80 }
81 //EP ----------------------------------------------------------------
82
83 print ("<img src=\"".$GlobalSiteIni->WWWDir."$imgSRC\" width=\"$imgWidth\" height=\"$imgHeight\" border=\"0\" alt=\"\" /></a><br />" );
84
85 }
86 }
87
88 ?>
$CategoryID
$CategoryID
Definition: admin/articleedit.php:53
$ad
$ad
Definition: adstatistics.php:56
eZAdCategory
Definition: ezadcategory.php:44
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$Limit
$Limit
Definition: ezarticle/admin/categorylist.php:66
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$GlobalSiteIni
$GlobalSiteIni
Definition: ezarticle/xmlrpc/xmlrpcserver.php:33
$adList
$adList
Definition: user/adlist.php:47
$category
$category
Definition: user/adlist.php:36
$user
$user
Definition: user/adlist.php:39
$image
$image
Definition: user/articlelist.php:242
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.