Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

authorview.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: authorview.php 6484 2001-08-17 13:36:01Z jhe $
5 //
6 // Created on: <16-Feb-2001 15:36:13 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 // include_once( "classes/ezlocale.php" );
30 // include_once( "classes/ezdatetime.php" );
31 // include_once( "classes/ezlist.php" );
32
33 // include_once( "ezarticle/classes/ezarticle.php" );
34 // include_once( "ezuser/classes/ezauthor.php" );
35
36 $ini =& eZINI::instance( 'site.ini' );
37
38 $Language = $ini->variable( "eZArticleMain", "Language" );
39 $Limit = $ini->variable( "eZArticleMain", "AuthorArticleLimit" );
40 $locale = new eZLocale( $Language );
41
42 $t = new eZTemplate( "kernel/ezarticle/user/" . $ini->variable( "eZArticleMain", "TemplateDir" ),
43 "kernel/ezarticle/user/intl/", $Language, "authorview.php" );
44
45 $t->setAllStrings();
46
47 $t->set_file( "author_view_tpl", "authorview.tpl" );
48
49 $t->set_block( "author_view_tpl", "article_item_tpl", "article_item" );
50
51 if ( !isset( $Offset ) or !is_numeric( $Offset ) )
52 $Offset = 0;
53 if ( !isset( $Limit ) or !is_numeric( $Limit ) )
54 $Limit = 10;
55 if ( !isset( $SortOrder ) )
56 $SortOrder = "published";
57
58 $article_count =& eZArticle::authorArticleCount( $AuthorID );
59
60 $t->set_var( "article_count", $article_count );
61 $t->set_var( "article_start", $Offset + 1 );
62 $t->set_var( "article_end", min( $Offset + $Limit, $article_count ) );
63
64 $articles =& eZArticle::authorArticleList( $AuthorID, $Offset, $Limit, $SortOrder );
65
66 $t->set_var( "author_id", $AuthorID );
67 $author = new eZAuthor( $AuthorID );
68 $t->set_var( "author_name", $author->name() );
69 $t->set_var( "author_mail", $author->email() );
70
71 $t->set_var( "sort", $SortOrder );
72
73 $t->set_var( "article_item", "" );
74
75 $db =& eZDB::globalDatabase();
76 $i = 0;
77 $dateTime = new eZDateTime();
78 foreach( $articles as $article )
79 {
80 $t->set_var( "td_class", ( $i % 2 ) == 0 ? "bglight" : "bgdark" );
81 $t->set_var( "article_id", $article[$db->fieldName("ID")] );
82 $t->set_var( "article_name", htmlspecialchars( $article[$db->fieldName("Name")] ) );
83 $t->set_var( "category_id", $article[$db->fieldName("CategoryID")] );
84 $t->set_var( "article_category", $article[$db->fieldName("CategoryName")] );
85 $t->set_var( "author_name", $article[$db->fieldName("AuthorName")] );
86 $dateTime->setTimeStamp( $article[$db->fieldName("Published")] );
87 $t->set_var( "article_published", $locale->format( $dateTime ) );
88 $t->parse( "article_item", "article_item_tpl", true );
89 $i++;
90 }
91
92 eZList::drawNavigator( $t, $article_count, $Limit, $Offset, "author_view_tpl" );
93
94 $t->pparse( "output", "author_view_tpl" );
95
96 ?>
$article
$article
Definition: articlelog.php:45
$articles
$articles
Definition: authorview.php:64
$Limit
$Limit
Definition: authorview.php:39
$db
$db
Definition: authorview.php:75
$locale
$locale
Definition: authorview.php:40
$t
$t
Definition: authorview.php:42
$i
$i
Definition: authorview.php:76
$Language
$Language
Definition: authorview.php:38
$ini
$ini
Definition: authorview.php:36
$article_count
$article_count
Definition: authorview.php:58
$author
$author
Definition: authorview.php:67
$dateTime
$dateTime
Definition: authorview.php:77
eZArticle\authorArticleList
static authorArticleList( $authorid, $offset=0, $limit=-1, $sort=false)
Definition: ezarticle.php:2747
eZArticle\authorArticleCount
static authorArticleCount( $authorid)
Definition: ezarticle.php:2823
eZAuthor
Definition: ezauthor.php:40
eZDB\globalDatabase
static & globalDatabase()
Definition: ezdb.php:134
eZDateTime
Definition: ezdatetime.php:55
eZList\drawNavigator
static drawNavigator(&$t, $total_types, $max_types, $index, $parent=false, $variables=false)
Definition: ezlist.php:401
eZLocale
Definition: ezlocale.php:119
eZTemplate
Definition: eztemplate.php:107
$Offset
$Offset
Definition: ezarticle/user/search.php:110
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.