Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

messagereviewlist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: messagesimplelist.php,v 1.15.2.2 2002/05/08 11:51:36 vl Exp $
5 //
6 // Created on: <11-Sep-2000 22:10:06 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
31 // include_once( "classes/eztemplate.php" );
32 // include_once( "classes/ezlocale.php" );
33 // include_once( "classes/ezlist.php" );
34 // include_once( "ezuser/classes/ezuser.php" );
35
36 // include_once( "ezforum/classes/ezforummessage.php" );
37 // include_once( "ezforum/classes/ezforumcategory.php" );
38 // include_once( "ezforum/classes/ezforum.php" );
39
40 $ini =& eZINI::instance( 'site.ini' );
41
42 $Language = $ini->variable( "eZForumMain", "Language" );
43 $SimpleUserList = $ini->variable( "eZForumMain", "SimpleUserList" );
44 $anonymous = $ini->variable( "eZForumMain", "AnonymousPoster" );
45 $ReviewLimit = $ini->variable( "eZTradeMain", "ReviewLimit" );
46
47 $t = new eZTemplate( "kernel/ezforum/user/" . $ini->variable( "eZForumMain", "TemplateDir" ),
48 "kernel/ezforum/user/intl", $Language, "messagereviewlist.php" );
49
50
51 $t->set_file( "messagelist", "messagereviewlist.tpl" );
52
53 $t->set_block( "messagelist", "message_list_tpl", "message_list" );
54 $t->set_block( "messagelist", "view_list_tpl", "view_list" );
55 $t->set_block( "message_list_tpl", "message_item_tpl", "message_item" );
56 $t->set_block( "message_item_tpl", "private_message_tpl", "private_message" );
57
58 $t->setAllStrings();
59
60 $forum = new eZForum( $ForumID );
61
62 $locale = new eZLocale( $Language );
63
64 if ( !isset($Offset) || !$Offset )
65 $Offset = 0;
66
67 $messageList =& $forum->messageTree( $Offset, $SimpleUserList );
68 $messageCount =& $forum->messageCount();
69 $t->set_var( "total_threads", $forum->messageCount( false, false ) );
70 //$t->set_var( "total_messages", $forum->messageCount( false, true ) );
71 if ( $forum->messageCount( false, false ) > 0 )
72 $t->parse( "view_list", "view_list_tpl" );
73 else
74 $t->set_var( "view_list", "" );
75
76 $t->set_var( "message_list", "" );
77
78 if ( !$messageList )
79 {
80 $errorIni = new eZINI( "ezforum/user/intl/" . $Language . "/" . "messagereviewlist.php" . ".ini" , false );
81 $noitem = $errorIni->variable( "strings", "noitem" );
82 $noitem="<p>".$noitem."</p>";
83 $t->set_var( "message_list", $noitem );
84 }
85 else
86 {
87 $level = 0;
88 $i = 0;
89 foreach ( $messageList as $message )
90 {
91 $level = $message->depth();
92
93 if ($level == 0)
94 {
95 if ( $i <= $ReviewLimit )
96 {
97 if ( ( $i % 2 ) == 0 )
98 $t->set_var( "td_class", "bglight" );
99 else
100 $t->set_var( "td_class", "bgdark" );
101
102 // if ( $level > 0 )
103 // $t->set_var( "spacer", str_repeat( "&nbsp;", $level ) );
104 // else
105 $t->set_var( "spacer", "" );
106
107 $t->set_var( "topic", htmlspecialchars( $message->topic() ) );
108 // $t->set_var( "body", eZTextTool::nl2br( $message->body() ) );
109 // $repArray = array("<br>","<br/>","</br>");
110 $messageBody = str_replace( array("<br>","<br/>","</br>"), "&nbsp;", $message->body() );
111 $messageBody = strip_tags($messageBody);
112 $t->set_var( "body", $messageBody );
113 // $t->set_var( "body", strip_tags( $message->body() ) );
114 $time =& $message->postingTime();
115 $t->set_var( "postingtime", $locale->format( $time ) );
116 $t->set_var( "message_id", $message->id() );
117 $muser =& $message->user();
118 if ( $muser->id() == 0 )
119 $MessageAuthor = $anonymous;
120 else
121 $MessageAuthor = $muser->firstName() . " " . $muser->lastName();
122 if ( $muser->firstName()== "" && $muser->lastName()=="" )
123 $MessageAuthor = $anonymous;
124 $t->set_var( "user", $MessageAuthor );
125 $user =& eZUser::currentUser();
126 $t->set_var( "private_message", "" );
127 if ( ( $MessageAuthor != $anonymous) and ($user) )
128 {
129 $t->set_var( "username", $muser->login() );
130 $t->set_var( "PM_topic", urlencode (": ".$message->topic() ) );
131 $t->parse( "private_message", "private_message_tpl" );
132 }
133 $t->parse( "message_item", "message_item_tpl", true );
134 }
135 $i++;
136 }
137 }
138 $t->parse( "message_list", "message_list_tpl", true );
139 }
140
141
142 eZList::drawNavigator( $t, $messageCount, $SimpleUserList, $Offset, "messagelist" );
143
144 $t->set_var( "redirect_url", eZTextTool::htmlspecialchars( $RedirectURL ) );
145
146 if ( !isset( $newmessage ) )
147 {
148 $newmessage = "";
149 }
150
151 $t->set_var( "newmessage", $newmessage );
152
153 $url = explode( "parent", $_SERVER['REQUEST_URI'] );
154 $t->set_var( "url", $url[0] );
155 $t->set_var( "forum_id", $forum->id() );
156 $t->set_var( "forum_name", $forum->name() );
157
158 $t->pparse( "output", "messagelist" );
159
160 ?>
$level
$level
Definition: admin/message.php:106
$message
$message
Definition: admin/message.php:51
$errorIni
$errorIni
Definition: admin/unhandledbugs.php:38
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
eZTextTool\htmlspecialchars
static htmlspecialchars( $string)
Definition: eztexttool.php:144
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$RedirectURL
$RedirectURL
Definition: ezforum/user/userlogin.php:91
$time
$time
Definition: homepage.php:327
$SimpleUserList
$SimpleUserList
Definition: messagereviewlist.php:43
$locale
$locale
Definition: messagereviewlist.php:62
$t
$t
Definition: messagereviewlist.php:47
$ReviewLimit
$ReviewLimit
Definition: messagereviewlist.php:45
$forum
$forum
Definition: messagereviewlist.php:60
$anonymous
$anonymous
Definition: messagereviewlist.php:44
$i
$i
Definition: messagereviewlist.php:88
$Language
$Language
Definition: messagereviewlist.php:42
$ini
$ini
Definition: messagereviewlist.php:40
$url
$url
Definition: messagereviewlist.php:153
$messageCount
$messageCount
Definition: messagereviewlist.php:68
$messageList
$messageList
Definition: messagereviewlist.php:67
$user
$user
Definition: user/adlist.php:39
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.