Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezforum/admin/messagelist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: messagelist.php 7788 2001-10-11 12:00:35Z jhe $
5 //
6 // Created on: Created on: <18-Jul-2000 08:56:19 lw>
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 $ini =& eZINI::instance( 'site.ini' );
29
30 $Language = $ini->variable( "eZForumMain", "Language" );
31 $AdminLimit = $ini->variable( "eZForumMain", "MessageAdminLimit" );
32
33 // include_once( "classes/eztemplate.php" );
34 // include_once( "classes/ezlocale.php" );
35 // include_once( "classes/ezlist.php" );
36
37 // include_once( "ezforum/classes/ezforummessage.php" );
38 // include_once( "ezforum/classes/ezforum.php" );
39 // include_once( "ezforum/classes/ezforumcategory.php" );
40
41 require( "kernel/ezuser/admin/admincheck.php" );
42
43 $t = new eZTemplate( "kernel/ezforum/admin/" . $ini->variable( "eZForumMain", "AdminTemplateDir" ),
44 "kernel/ezforum/admin/" . "/intl", $Language, "messagelist.php" );
45 $t->setAllStrings();
46
47 $t->set_file( "message_page", "messagelist.tpl" );
48
49 $t->set_block( "message_page", "message_item_tpl", "message_item" );
50
51 $t->set_var( "site_style", $SiteDesign );
52
53 $forum = new eZForum( $ForumID );
54 $t->set_var( "forum_name", $forum->name() );
55
56 $categories = $forum->categories();
57
58 if ( count( $categories ) > 0 )
59 {
60 $CategoryID = $categories[0]->id();
61 $category = new eZForumCategory( $CategoryID );
62
63 $t->set_var( "category_name", $category->name() );
64 $t->set_var( "category_id", $CategoryID );
65 }
66
67 $locale = new eZLocale( $Language );
68
69 $messages = $forum->messageTree( $Offset, $AdminLimit );
70 $messageCount = $forum->messageCount();
71
72 $languageIni = new eZINI( "kernel/ezforum/admin/" . "intl/" . $Language . "/messagelist.php.ini", false );
73
74 $true = $languageIni->variable( "strings", "true" );
75 $false = $languageIni->variable( "strings", "false" );
76
77 $AnonymousPoster = $ini->variable( "eZForumMain", "AnonymousPoster" );
78
79 if ( !$messages )
80 {
81 $noitem = $languageIni->variable( "strings", "noitem" );
82 $t->set_var( "message_item", $noitem );
83 }
84 else
85 {
86 $level = 0;
87 $i = 0;
88 foreach ( $messages as $message )
89 {
90 if ( ( $i % 2 ) == 0 )
91 $t->set_var( "td_class", "bglight" );
92 else
93 $t->set_var( "td_class", "bgdark" );
94
95 $level = $message->depth();
96
97 if ( $level > 0 )
98 $t->set_var( "spacer", str_repeat( "&nbsp;", $level ) );
99 else
100 $t->set_var( "spacer", "" );
101
102 $t->set_var( "message_topic", $message->topic() );
103
104 $t->set_var( "message_postingtime", $locale->format( $message->postingTime() ) );
105
106 $t->set_var( "message_id", $message->id() );
107
108 $author = $message->user();
109
110 if ( $message->userName() )
111 $anonymous = $message->userName();
112 else
113 $anonymous = $ini->variable( "eZForumMain", "AnonymousPoster" );
114
115 if ( $author->id() == 0 )
116 {
117 $MessageAuthor = $anonymous;
118 }
119 else
120 {
121 $MessageAuthor = $author->firstName() . " " . $author->lastName();
122 }
123
124 $t->set_var( "message_user", $MessageAuthor );
125
126 if ( $message->emailNotice() == "Y" )
127 $t->set_var( "emailnotice", $true );
128 else
129 $t->set_var( "emailnotice", $false );
130
131 $t->parse( "message_item", "message_item_tpl", true );
132 $i++;
133 }
134 }
135
136 eZList::drawNavigator( $t, $messageCount, $AdminLimit, $Offset, "message_page" );
137
138 $t->set_var( "forum_start", $Offset + 1 );
139 $t->set_var( "forum_end", min( $Offset + $AdminLimit, $messageCount ) );
140 $t->set_var( "forum_total", $messageCount );
141
142 $t->set_var( "link1-url", "");
143 $t->set_var( "link2-url", "search.php");
144
145 $t->set_var( "back-url", "admin/forum.php" );
146 $t->set_var( "forum_id", $ForumID );
147
148 $t->pparse( "output", "message_page" );
149
150 ?>
$category
if( $Action=="Edit") $category
Definition: adedit.php:378
$CategoryID
$CategoryID
Definition: admin/articleedit.php:53
$author
$author
Definition: admin/articleedit.php:834
$level
$level
Definition: admin/message.php:106
$message
$message
Definition: admin/message.php:51
$anonymous
else $anonymous
Definition: admin/message.php:73
eZForumCategory
Definition: ezforumcategory.php:44
eZForum
Definition: ezforum.php:44
eZINI
Reads and writes .ini style configuration files.
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
$SiteDesign
$SiteDesign
Definition: ezbulkmail/user/datasupplier.php:31
$false
$false
Definition: ezforum/admin/messagelist.php:75
$messages
$messages
Definition: ezforum/admin/messagelist.php:69
$languageIni
$languageIni
Definition: ezforum/admin/messagelist.php:72
$true
$true
Definition: ezforum/admin/messagelist.php:74
$t
$t
Definition: ezforum/admin/messagelist.php:43
$forum
$forum
Definition: ezforum/admin/messagelist.php:53
$AdminLimit
$AdminLimit
Definition: ezforum/admin/messagelist.php:31
$locale
if(count( $categories) > 0) $locale
Definition: ezforum/admin/messagelist.php:67
$i
$i
Definition: ezforum/admin/messagelist.php:87
$Language
$Language
Definition: ezforum/admin/messagelist.php:30
$ini
$ini
Definition: ezforum/admin/messagelist.php:28
$messageCount
$messageCount
Definition: ezforum/admin/messagelist.php:70
$categories
$categories
Definition: ezforum/admin/messagelist.php:56
$AnonymousPoster
$AnonymousPoster
Definition: ezforum/admin/messagelist.php:77
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.