Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezarticle/admin/cron.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: cron.php 9797 2003-04-09 10:37:15Z br $
5 //
6 // Created on: <08-Jun-2001 13:16:33 ce>
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( "ezarticle/classes/ezarticle.php" );
28 // include_once( "ezarticle/classes/ezarticletool.php" );
29
30 $article = new eZArticle();
31 $articleValidArray =& $article->getAllValid();
32 $articleUnValid =& $article->getAllUnValid();
33
34 if ( count ( $articleValidArray ) > 0 )
35 {
36 foreach ( $articleValidArray as $article )
37 {
38 $article->setIsPublished( true, false, true );
39 $d = 0;
40 $article->setStartDate( $d );
41 $article->store();
42
43 if ( $article->isPublished() == 1 )
44 eZArticleTool::notificationMessage( $article );
45
46 $catDef = $article->categoryDefinition();
47
48 $cats = $article->categories( false ) ;
49 // clear the cache files.
50 eZArticleTool::deleteCache( $article->id(), $catDef, $cats);
51
52 print( "Publishing article: " . $article->name() . "\n" );
53 }
54 }
55
56 if ( count ( $articleUnValid ) > 0 )
57 {
58 foreach( $articleUnValid as $article )
59 {
60 $article->setIsPublished( false, false, true );
61 $d = 0;
62 $article->setStopDate( $d );
63 $article->store();
64
65 $cats = $article->categories( false ) ;
66 // clear the cache files.
67 eZArticleTool::deleteCache( $article->id(), $catDef, $cats );
68
69 print( "UnPublishing article: " . $article->name() . "\n" );
70 }
71 }
72
73 ?>
eZArticleTool\notificationMessage
static notificationMessage(&$article)
Definition: ezarticletool.php:136
eZArticleTool\deleteCache
static deleteCache( $ArticleID, $CategoryID, $CategoryArray)
Definition: ezarticletool.php:52
eZArticle
Definition: ezarticle.php:82
$article
$article
Definition: ezarticle/admin/cron.php:30
$articleUnValid
$articleUnValid
Definition: ezarticle/admin/cron.php:32
$articleValidArray
$articleValidArray
Definition: ezarticle/admin/cron.php:31
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.