-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrss.php
More file actions
103 lines (90 loc) · 3.55 KB
/
Copy pathrss.php
File metadata and controls
103 lines (90 loc) · 3.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?php
// +-----------------------------------------------------------------------+
// | PEM - a PHP based Extension Manager |
// | Copyright (C) 2005-2013 PEM Team - http://piwigo.org |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
define('INTERNAL', true);
$root_path = './';
require_once($root_path.'include/common.inc.php');
$tpl->set_filename('rss', 'rss.tpl');
// $conf['page_title']
$tpl->assign(
array(
'xml_header' => '<?xml version="1.0" encoding="utf-8"?>',
'title' => $conf['page_title'],
'website_url' => $conf['website_url'],
'description' => $conf['website_description'],
'language' => $conf['website_language'],
'webmaster_email' => $conf['webmaster_email'],
)
);
// Gets the latest X (defined in constants.inc.php) mods information
$query = '
SELECT
version,
description,
id_revision,
idx_extension
FROM '.REV_TABLE.'
ORDER BY id_revision DESC
LIMIT 0, '.$conf['rss_nb_items'].'
;';
$req = $db->query($query);
$revisions = array();
$extension_ids = array();
$user_ids = array();
while ($data = $db->fetch_assoc($req))
{
array_push($revisions, $data);
array_push($extension_ids, $data['idx_extension']);
}
$extension_infos_of = get_extension_infos_of($extension_ids);
foreach ($extension_ids as $extension_id)
{
array_push($user_ids, $extension_infos_of[$extension_id]['idx_user']);
}
$author_infos_of = get_user_basic_infos_of($user_ids);
$tpl_revisions = array();
foreach ($revisions as $revision)
{
$extension = $extension_infos_of[ $revision['idx_extension'] ];
$author = $author_infos_of[ $extension['idx_user'] ];
array_push(
$tpl_revisions,
array(
'ext_name' => $extension['name'],
'name' => $revision['version'],
'url' => sprintf(
'%s/extension_view.php?eid=%u&rid=%u#rev%u',
$conf['website_url'],
$revision['idx_extension'],
$revision['id_revision'],
$revision['id_revision']
),
'ext_author' => $author['username'],
'ext_description' => $extension['description'],
'description' => $revision['description'],
)
);
}
$tpl->assign('revisions', $tpl_revisions);
// echo '<pre>'; print_r($tpl_revisions); echo '</pre>';
// +-----------------------------------------------------------------------+
// | html code display |
// +-----------------------------------------------------------------------+
$tpl->pparse('rss');
?>