Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

messagebody.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: messagebody.php 9898 2004-07-08 12:57:16Z br $
5 //
6 // Created on: <21-Feb-2001 18:00:00 pkej>
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/ezlocale.php" );
29
30 $ini =& eZINI::instance( 'site.ini' );
31 $Language = $ini->variable( "eZCalendarMain", "Language" );
32 $Locale = new eZLocale( $Language );
33
34 if ( isset( $ShowMessage ) && $ShowMessage )
35 {
36 // include_once( "classes/eztexttool.php" );
37 $AllowedTags = $ini->variable( "eZForumMain", "AllowedTags" );
38 $AllowHTML = $ini->variable( "eZForumMain", "AllowHTML" );
39
40 $t->set_file( "body", "messagebody.tpl" );
41
42 $msg = new eZForumMessage( $MessageID );
43
44 if( !isset( $MessageTopic ) )
45 $MessageTopic = $msg->topic();
46
47
48 $MessageBody = eZTextTool::nl2br( $msg->body() );
49 $MessageBody = stripslashes($MessageBody);
50
51 $author = new eZUser( $msg->userID() );
52 $MessageNotice = $msg->emailNotice();
53
54 if ( isset( $NewMessageAuthor ) )
55 {
56 if ( $msg->userName() && $Action != "reply" )
57 $MessageAuthor = $msg->userName();
58 else
59 $MessageAuthor = $NewMessageAuthor;
60 }
61 else
62 {
63 if ( !is_object( $author ) )
64 {
65 $author = new eZUser( $msg->userId() );
66 }
67
68 if ( $author->id() == 0 )
69 {
70 if ( $msg->userName() && $Action != "reply" )
71 $MessageAuthor = $msg->userName();
72 else
73 $MessageAuthor = $ini->variable( "eZForumMain", "AnonymousPoster" );
74 }
75 else
76 {
77 $MessageAuthor = $author->firstName() . " " . $author->lastName();
78 }
79 }
80
81 if ( isset( $NewMessagePostedAt ) )
82 {
83 $MessagePostedAt = $NewMessagePostedAt;
84 }
85 else
86 {
87 $MessagePostedAt = $Locale->format( $msg->postingTime() );
88 }
89
90 if ( isset( $NewMessageNotice ) )
91 {
92 $MessageNotice = $NewMessageNotice;
93 }
94
95 switch ( $MessageNotice )
96 {
97 case "on":
98 case "y":
99 case "checked":
100 case 1:
101 case true:
102 {
103 $t->Ini->variable( "strings", "notice_yes" );
104 }
105 break;
106
107 case "off":
108 case "n":
109 case "unchecked":
110 case 0:
111 case false:
112 {
113 $t->Ini->variable( "strings", "notice_no" );
114 }
115 break;
116 }
117 $t->set_var( "message_topic", htmlspecialchars( $MessageTopic ) );
118 $t->set_var( "message_body", eZTextTool::nl2br( htmlspecialchars( $MessageBody ) ) );
119 $t->set_var( "message_posted_at", $MessagePostedAt );
120 $t->set_var( "message_author", htmlspecialchars( $MessageAuthor ) );
121 $t->set_var( "message_id", $MessageID );
122 $t->set_var( "message_notice", $MessageNotice );
123
124 if ( isset( $doPrint ) && $doPrint == true )
125 {
126 $t->pparse( "message_body_file", "body" );
127 }
128 else
129 {
130 $t->parse( "message_body_file", "body" );
131 }
132 }
133 else
134 {
135 $t->set_var( "message_body_file", "" );
136 }
137
138 ?>
$author
$author
Definition: admin/articleedit.php:834
$AllowHTML
$AllowHTML
Definition: admin/message.php:31
eZForumMessage
Definition: ezforummessage.php:42
eZLocale
Definition: ezlocale.php:119
eZTextTool\nl2br
static nl2br( $string, $xhtml=true)
Definition: eztexttool.php:65
eZUser
Definition: ezuser.php:76
$t
foreach( $Modules as $module) if(isset( $ItemInsert)) $t
Definition: classes/admin/linklist.php:168
$Action
$Action
Definition: companysearch.php:80
$msg
$msg
Definition: editmessage.php:47
$AllowedTags
$AllowedTags
Definition: ezforum/user/messageedit.php:39
$Locale
$Locale
Definition: messagebody.php:32
$Language
$Language
Definition: messagebody.php:31
$ini
$ini
Definition: messagebody.php:30
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.