Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

queuedadlist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: queuedadlist.php 7633 2001-10-02 15:08:09Z br $
5 //
6 // Created on: <02-Oct-2001 17:24:33 br>
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 adList not have been set before.
42 if ( !$queuedAdListCheck )
43 {
44 if ( !isset( $Limit ) )
45 $Limit = 1;
46 if ( !isset( $Offset ) )
47 $Offset = 0;
48
49 // ads
50 $adList =& $category->ads( "count", false, $Offset, $Limit );
51 $queuedAdListCheck = 1;
52 }
53
54 $ad = array_shift( $adList );
55
56 if ( $ad )
57 {
58 $adID = $ad->id();
59
60 $image =& $ad->image();
61
62 // ad image
63 if ( $image )
64 {
65 $imgSRC =& $image->filePath();
66 $imgWidth =& $image->width();
67 $imgHeight =& $image->height();
68 }
69
70 $ad->addPageView();
71
72 if ( $ad->useHTML() )
73 {
74 print( $ad->htmlBanner() );
75 }
76 else
77 {
78 print( "<a target=\"_blank\" href=\"".$GlobalSiteIni->WWWDir.$GlobalSiteIni->Index."/ad/goto/$adID/\"><img src=\"".$GlobalSiteIni->WWWDir."$imgSRC\" width=\"$imgWidth\" height=\"$imgHeight\" border=\"0\" alt=\"\" /></a><br />" );
79 }
80 }
81
82 ?>
$adList
$adList
Definition: admin/adlist.php:125
$CategoryID
$CategoryID
Definition: admin/articleedit.php:53
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
$category
$category
Definition: queuedadlist.php:36
$user
$user
Definition: queuedadlist.php:39
$ad
if(! $queuedAdListCheck) $ad
Definition: queuedadlist.php:54
$image
$image
Definition: user/articlelist.php:242
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.