Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezarticle/user/authorlist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: authorlist.php 9564 2002-05-23 09:12:28Z jhe $
5 //
6 // Created on: <16-Feb-2001 14:54:04 amos>
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 // include_once( "classes/eztemplate.php" );
29
30 // include_once( "ezarticle/classes/ezarticle.php" );
31
32 $ini =& eZINI::instance( 'site.ini' );
33
34 $Language = $ini->variable( "eZArticleMain", "Language" );
35 $Limit = $ini->variable( "eZArticleMain", "AuthorLimit" );
36
37 $t = new eZTemplate( "kernel/ezarticle/user/" . $ini->variable( "eZArticleMain", "TemplateDir" ),
38 "kernel/ezarticle/user/intl/", $Language, "authorlist.php" );
39
40 $t->setAllStrings();
41
42 $t->set_file( "author_list_tpl", "authorlist.tpl" );
43 $t->set_block( "author_list_tpl", "author_item_tpl", "author_item" );
44
45 if ( !isset( $Offset ) )
46 $Offset = 0;
47 if ( !isset( $Limit ) or !is_numeric( $Limit ) )
48 $Limit = 5;
49 if ( !isset( $SortOrder ) )
50 $SortOrder = "name";
51
52 $authors =& eZArticle::authorList( $Offset, $Limit, $SortOrder );
53 $db =& eZDB::globalDatabase();
54
55 $t->set_var( "author_item", "" );
56 $i = 0;
57 foreach ( $authors as $author )
58 {
59 $articleCount = eZArticle::authorArticleCount( $author[$db->fieldName( "ContentsWriterID" )] );
60 if ( $articleCount > 0 )
61 {
62 $t->set_var( "td_class", ( $i % 2 ) == 0 ? "bglight" : "bgdark" );
63 $t->set_var( "author_id", $author[$db->fieldName( "ContentsWriterID" )] );
64 $t->set_var( "author_name", $author[$db->fieldName( "ContentsWriter" )] );
65
66 $t->set_var( "article_count", $articleCount );
67 $t->parse( "author_item", "author_item_tpl", true );
68 $i++;
69 }
70 }
71
72 $t->pparse( "output", "author_list_tpl" );
73
74 ?>
$author
$author
Definition: admin/articleedit.php:834
$articleCount
$articleCount
Definition: admin/articlelist.php:456
eZArticle\authorList
static authorList( $offset=0, $limit=-1, $sort=false)
Definition: ezarticle.php:2710
eZArticle\authorArticleCount
static authorArticleCount( $authorid)
Definition: ezarticle.php:2823
eZDB\globalDatabase
static & globalDatabase()
Definition: ezdb.php:134
eZTemplate
Definition: eztemplate.php:107
$Limit
$Limit
Definition: ezarticle/user/authorlist.php:35
$db
$db
Definition: ezarticle/user/authorlist.php:53
$t
$t
Definition: ezarticle/user/authorlist.php:37
$i
$i
Definition: ezarticle/user/authorlist.php:56
$Language
$Language
Definition: ezarticle/user/authorlist.php:34
$ini
$ini
Definition: ezarticle/user/authorlist.php:32
$authors
$authors
Definition: ezarticle/user/authorlist.php:52
$Offset
$Offset
Definition: ezarticle/user/search.php:110
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.