Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

unapprovedlist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: unapprovedlist.php 7759 2001-10-10 13:18:29Z jhe $
5 //
6 // Created on: <21-Jan-2001 13:34:48 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 $ini =& eZINI::instance( 'site.ini' );
29
30 $Language = $ini->variable( "eZForumMain", "Language" );
31 $UnapprovdLimit = $ini->variable( "eZForumMain", "UnApprovdLimit" );
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, "unapprovedlist.php" );
45 $t->setAllStrings();
46
47 $t->set_file( Array( "message_page" => "unapprovedlist.tpl" ) );
48
49 $t->set_block( "message_page", "message_item_tpl", "message_item" );
50
51
52 $locale = new eZLocale( $Language );
53
54 $message = new eZForumMessage();
55
56 $messages = $message->getAllUnApproved( $Offset, $UnapprovdLimit );
57 $messageCount = $message->unApprovedCount();
58
59 $languageIni = new eZINI( "kernel/ezforum/admin/" . "intl/" . $Language . "/unapprovedlist.php.ini", false );
60 $true = $languageIni->variable( "strings", "true" );
61 $false = $languageIni->variable( "strings", "false" );
62
63 if ( !$messages )
64 {
65 $noitem = $languageIni->variable( "strings", "noitem" );
66 $t->set_var( "message_item", $noitem );
67 }
68 else
69 {
70 $i = 0;
71 foreach ( $messages as $msg )
72 {
73 if ( ( $i % 2 ) == 0 )
74 $t->set_var( "td_class", "bglight" );
75 else
76 $t->set_var( "td_class", "bgdark" );
77
78 $forum = new eZForum( $msg->forumID() );
79 $t->set_var( "forum_name", $forum->name() );
80 $t->set_var( "forum_id", $forum->id() );
81
82 $categoryList =& $forum->categories();
83 $category =& $categoryList[0];
84
85 $t->set_var( "category_name", $category->name() );
86 $t->set_var( "category_id", $category->id() );
87 $t->set_var( "message_topic", $msg->topic() );
88 $t->set_var( "message_body", $msg->body() );
89 $t->set_var( "reject_message", $languageIni->variable( "strings", "reject_message" ) );
90 $t->set_var( "message_postingtime", $locale->format( $msg->postingTime() ) );
91 $t->set_var( "message_id", $msg->id() );
92
93 $author = $msg->user();
94
95 $t->set_var( "message_user", $author->firstName() . " " . $author->lastName() );
96 $t->set_var( "i", $i );
97
98 $t->parse( "message_item", "message_item_tpl", true );
99 $i++;
100 }
101 }
102
103 eZList::drawNavigator( $t, $messageCount, $UnapprovdLimit, $Offset, "message_page" );
104
105 $t->pparse( "output", "message_page" );
106
107 ?>
$category
if( $Action=="Edit") $category
Definition: adedit.php:378
$i
$i
Definition: admin/adlist.php:91
$categoryList
foreach( $pathArray as $path) $categoryList
Definition: admin/adlist.php:86
$author
$author
Definition: admin/articleedit.php:834
$forum
$forum
Definition: admin/forumlist.php:50
eZForumMessage
Definition: ezforummessage.php:42
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
$msg
$msg
Definition: editmessage.php:47
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$false
$false
Definition: unapprovedlist.php:61
$messages
$messages
Definition: unapprovedlist.php:56
$languageIni
$languageIni
Definition: unapprovedlist.php:59
$locale
$locale
Definition: unapprovedlist.php:52
$true
$true
Definition: unapprovedlist.php:60
$t
$t
Definition: unapprovedlist.php:43
$UnapprovdLimit
$UnapprovdLimit
Definition: unapprovedlist.php:31
$Language
$Language
Definition: unapprovedlist.php:30
$ini
$ini
Definition: unapprovedlist.php:28
$message
$message
Definition: unapprovedlist.php:54
$messageCount
$messageCount
Definition: unapprovedlist.php:57
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.