Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

latestmessages.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: latestmessages.php 9266 2002-02-26 08:39:17Z bf $
5 //
6 // Created on: <02-Jul-2001 11:45:17 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 // include_once( "classes/INIFile.php" );
28 // include_once( "classes/eztexttool.php" );
29
30 // include_once( "classes/eztemplate.php" );
31 // include_once( "classes/ezlocale.php" );
32 // include_once( "classes/ezlist.php" );
33 // include_once( "ezuser/classes/ezuser.php" );
34
35 // include_once( "ezforum/classes/ezforummessage.php" );
36 // include_once( "ezforum/classes/ezforumcategory.php" );
37 // include_once( "ezforum/classes/ezforum.php" );
38
39 $Language = $ini->variable( "eZForumMain", "Language" );
40 $Limit = $ini->variable( "eZForumMain", "ShowMessageLimit" );
41 $t = new eZTemplate( "kernel/ezforum/user/" . $ini->variable( "eZForumMain", "TemplateDir" ),
42 "kernel/ezforum/user/intl", $Language, "latestmessages.php" );
43
44 $t->set_file( "latest_messages_tpl", "latestmessages.tpl" );
45 $t->set_block( "latest_messages_tpl", "message_tpl", "message" );
46 $t->setAllStrings();
47
48 $user =& eZUser::currentUser();
49 $db =& eZDB::globalDatabase();
50 $messages =& eZForumMessage::lastMessages( $Limit );
51
52 global $GlobalSiteDesign;
53
54 $t->set_var( "message", "" );
55 $i = 0;
56 $time = new eZDateTime();
57 $locale = new eZLocale( $Language );
58 foreach ( $messages as $message )
59 {
60 $t->set_var( "sitedesign", $GlobalSiteDesign );
61
62 $nr = ( $i % 2 ) + 1;
63 $t->set_var( "alt_nr", $nr );
64
65 $t->set_var( "forum_id", $message[$db->fieldName( "ForumID" )] );
66
67 $t->set_var( "message_id", $message[$db->fieldName( "ID" )] );
68 $t->set_var( "message_topic", htmlspecialchars( $message[$db->fieldName( "Topic" )] ) );
69
70 $messageUser = new eZUser( $message[$db->fieldName( "UserID" )] );
71 $t->set_var( "message_user", $messageUser->firstName() . " " . $messageUser->lastName() );
72
73 $time->setTimeStamp( $message[$db->fieldName( "PostingTime" )] );
74 $t->set_var( "message_postingtime", $locale->format( $time ) );
75
76 $t->set_var( "message_topic", htmlspecialchars( $message[$db->fieldName( "Topic" )] ) );
77
78 $t->parse( "message", "message_tpl", true );
79 $i++;
80 }
81 $t->pparse( "output", "latest_messages_tpl" );
82
83 ?>
$message
$message
Definition: admin/message.php:51
eZDB\globalDatabase
static & globalDatabase()
Definition: ezdb.php:134
eZDateTime
Definition: ezdatetime.php:55
eZForumMessage\lastMessages
static & lastMessages( $limit, $user=false, $userid=false)
Definition: ezforummessage.php:892
eZLocale
Definition: ezlocale.php:119
eZTemplate
Definition: eztemplate.php:107
eZUser
Definition: ezuser.php:76
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$ini
$ini
Definition: classes/admin/linklist.php:64
$Limit
$Limit
Definition: latestmessages.php:40
$db
$db
Definition: latestmessages.php:49
$messages
$messages
Definition: latestmessages.php:50
$GlobalSiteDesign
global $GlobalSiteDesign
Definition: latestmessages.php:52
$locale
$locale
Definition: latestmessages.php:57
$t
$t
Definition: latestmessages.php:41
$user
$user
Definition: latestmessages.php:48
$time
$time
Definition: latestmessages.php:56
$i
$i
Definition: latestmessages.php:55
$Language
$Language
Definition: latestmessages.php:39
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.