Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

latest.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: latest.php 8205 2001-11-01 18:09:20Z bf $
5 //
6 // Created on: <26-Oct-2000 14:50:13 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( "classes/INIFile.php" );
28
29 $ini =& eZINI::instance( 'site.ini' );
30
31 $Language = $ini->variable( "eZLinkMain", "Language" );
32 $DOC_ROOT = $ini->variable( "eZLinkMain", "DocumentRoot" );
33
34 // include_once( "classes/eztemplate.php" );
35 // include_once( "ezlink/classes/ezlinkcategory.php" );
36 // include_once( "ezlink/classes/ezlink.php" );
37 // include_once( "ezlink/classes/ezhit.php" );
38
39
40 $t = new eZTemplate( "kernel/ezlink/user/" . $ini->variable( "eZLinkMain", "TemplateDir" ),
41 "kernel/ezlink/user/intl", $Language, "linklist.php" );
42 $t->setAllStrings();
43
44 $t->set_file( array(
45 "last_links" => "latest.tpl"
46 ) );
47
48 $t->set_block( "last_links", "link_list_tpl", "link_item" );
49
50 $link = new eZLink();
51
52 $link_array = $link->getLastTenDate( 10, 0 );
53
54 if ( count( $link_array ) == 0 )
55 {
56
57 $t->set_var( "link_list", "<p>Ingen linker ble funnet.</p>" );
58 }
59 else
60 {
61 $i=0;
62 foreach( $link_array as $linkItem )
63 {
64 if ( ( $i % 2 ) == 0 )
65 {
66 $t->set_var( "bg_color", "#f0f0f0" );
67 }
68 else
69 {
70 $t->set_var( "bg_color", "#dcdcdc" );
71 }
72
73 $t->set_var( "link_id", $linkItem->id() );
74 $t->set_var( "link_title", $linkItem->name() );
75 $t->set_var( "link_description", $linkItem->description() );
76 $category =& $linkItem->categoryDefinition();
77 $t->set_var( "link_categoryid", $category->id() );
78 $t->set_var( "link_keywords", $linkItem->keywords() );
79 $t->set_var( "link_created", $linkItem->created() );
80 $t->set_var( "link_modified", $linkItem->modified() );
81 $t->set_var( "link_accepted", $linkItem->accepted() );
82 $t->set_var( "link_url", $linkItem->url() );
83
84 $hit = new eZHit();
85 $hits = $hit->getLinkHits( $link_array[ $i ][ "ID" ] );
86
87 $t->set_var( "link_hits", $hits );
88
89 $t->set_var( "document_root", $DOC_ROOT );
90
91 $t->parse( "link_item", "link_list_tpl", true );
92 $i++;
93 }
94 }
95
96 $t->pparse( "output", "last_links" );
97
98 ?>
$category
if( $Action=="Edit") $category
Definition: adedit.php:378
$i
$i
Definition: admin/adlist.php:91
eZHit
Definition: ezhit.php:40
eZLink
Definition: ezlink.php:65
eZTemplate
Definition: eztemplate.php:107
$DOC_ROOT
$DOC_ROOT
Definition: latest.php:32
$t
$t
Definition: latest.php:40
$link_array
$link_array
Definition: latest.php:52
$link
$link
Definition: latest.php:50
$Language
$Language
Definition: latest.php:31
$ini
$ini
Definition: latest.php:29
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.