Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

importnews.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: importnews.php 8504 2001-11-19 09:46:46Z jhe $
5 //
6 // Created on: <16-Nov-2000 13:02:19 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( "eznewsfeed/classes/eznews.php" );
28 // include_once( "eznewsfeed/classes/eznewscategory.php" );
29 // include_once( "eznewsfeed/classes/eznewsimporter.php" );
30 // include_once( "eznewsfeed/classes/ezsourcesite.php" );
31
32 // include_once( "classes/ezdatetime.php" );
33
34 // fetch one site
35 if ( isset( $Action ) && $Action == "Fetch" )
36 {
37 $site = new eZSourceSite( $SourceSiteID );
38
39 $newsImporter = new eZNewsImporter( $site->decoder(),
40 $site->url(),
41 $site->category(),
42 $site->login(),
43 $site->password(),
44 $site->autoPublish() );
45 $newsImporter->importNews();
46 }
47 // fetch every site
48 if ( isset( $Action ) && $Action == "ImportNews" && !isset( $Delete ) )
49 {
50 $sourceSite = new eZSourceSite();
51
52 $sourceSiteList = $sourceSite->getAll();
53
54 foreach ( $sourceSiteList as $site )
55 {
56 if ( $site->IsActive() == 1 )
57 {
58 unset( $newsImporter );
59 $newsImporter = new eZNewsImporter( $site->decoder(),
60 $site->url(),
61 $site->category(),
62 $site->login(),
63 $site->password(),
64 $site->autoPublish() );
65 $newsImporter->importNews();
66 }
67 }
68 }
69
70 // Delete selected sites.
71 if ( isset( $Delete ) )
72 {
73 if ( isset( $DeleteArray ) && count( $DeleteArray ) > 0 )
74 {
75 foreach( $DeleteArray as $row )
76 {
77 eZSourceSite::delete( $row );
78 }
79 }
80 }
81
82 $ini = eZINI::instance( 'site.ini' );
83
84 $Language = $ini->variable( "eZNewsFeedMain", "Language" );
85
86 $t = new eZTemplate( "kernel/eznewsfeed/admin/" . $ini->variable( "eZNewsFeedMain", "AdminTemplateDir" ),
87 "kernel/eznewsfeed/admin/intl/", $Language, "importnews.php" );
88
89 $t->setAllStrings();
90
91 $t->set_file( array(
92 "import_news_tpl" => "importnews.tpl"
93 ) );
94
95 $t->set_block( "import_news_tpl", "source_site_list_tpl", "source_site_list" );
96 $t->set_block( "source_site_list_tpl", "source_site_tpl", "source_site" );
97 $t->set_var( "source_site", "" );
98
99 $t->set_var( "site_style", $SiteDesign );
100
101 $sourceSite = new eZSourceSite();
102
103 $sourceSiteList = $sourceSite->getAll();
104
105 $i=0;
106 foreach ( $sourceSiteList as $site )
107 {
108 $t->set_var( "source_site_id", $site->id() );
109 $t->set_var( "source_site_name", $site->name() );
110 $t->set_var( "source_site_url", $site->url() );
111
112 if ( ( $i % 2 ) == 0 )
113 {
114 $t->set_var( "td_class", "bglight" );
115 }
116 else
117 {
118 $t->set_var( "td_class", "bgdark" );
119 }
120
121 $i++;
122 $t->parse( "source_site", "source_site_tpl", true );
123 }
124
125 $t->parse( "source_site_list", "source_site_list_tpl" );
126
127 $sourceSite = new eZSourceSite();
128
129 // $newsImporter = new eZNewsImporter( "nyheter.no" );
130 // $newsImporter->importNews();
131
132 // $newsImporter = new eZNewsImporter( "freshmeat.net" );
133 // $newsImporter->importNews();
134
135 $t->pparse( "output", "import_news_tpl" );
136
137 ?>
eZNewsImporter
Definition: eznewsimporter.php:46
eZSourceSite
Definition: ezsourcesite.php:44
eZSourceSite\delete
delete( $id=-1)
Definition: ezsourcesite.php:158
eZTemplate
Definition: eztemplate.php:107
$Action
$Action
Definition: companysearch.php:80
$SiteDesign
$SiteDesign
Definition: ezbulkmail/user/datasupplier.php:31
$row
$row
Definition: ezcalendar/user/dayview.php:403
$ini
if(isset( $Action) && $Action=="Fetch") if(isset( $Action) && $Action=="ImportNews" &&!isset( $Delete)) if(isset( $Delete)) $ini
Definition: importnews.php:82
$t
$t
Definition: importnews.php:86
$i
$i
Definition: importnews.php:105
$Language
$Language
Definition: importnews.php:84
$sourceSite
$sourceSite
Definition: importnews.php:101
$sourceSiteList
$sourceSiteList
Definition: importnews.php:103
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.