1 |
<!DOCTYPE html> |
2 |
<html lang="en" dir="ltr"> |
3 |
<head> |
4 |
<meta charset="utf-8"> |
5 |
<title><?php echo strip_tags($title); ?></title> |
6 |
<meta name="robots" content="<?php echo $robots; ?>"> |
7 |
<link rel="home" href="<?php echo $g_root_url; ?>"> |
8 |
<link rel="author" href="http://www.mageia.org/"> |
9 |
<link rel="icon" type="image/png" href="themes/mageia/favicon.png"> |
10 |
<link rel="stylesheet" href="themes/mageia/style.css"> |
11 |
<meta name="viewport" content="width=900,initial-scale=1,user-scalable=yes"> |
12 |
</head> |
13 |
<body class="contribute"> |
14 |
<?php |
15 |
|
16 |
$figures_list = array(); |
17 |
|
18 |
if (!isset($_GET['package'])) { |
19 |
|
20 |
// TODO should be cached. |
21 |
$missing_deps_count = preg_match_all("/<item>/m", file_get_contents("http://check.mageia.org/cauldron/dependencies.rss"), $matches); |
22 |
$unmaintained_file = $g_webapp_dir . '/data/unmaintained.txt'; |
23 |
$unmaintained_count = file_exists($unmaintained_file) ? count(file($unmaintained_file)) : 0; |
24 |
|
25 |
if ($missing_deps_count > 0) { |
26 |
$figures_list[] = sprintf('<strong>%d</strong> <a rel="nofollow" href="%s">broken <abbr title="dependencies">deps.</abbr></a>', |
27 |
$missing_deps_count, |
28 |
'http://check.mageia.org/cauldron/dependencies.html' |
29 |
); |
30 |
} |
31 |
|
32 |
if ($unmaintained_count > 0) { |
33 |
$figures_list[] = sprintf('<strong>%d</strong> <a rel="nofollow" href="%s">unmaintained</a>', |
34 |
$unmaintained_count, |
35 |
'data/unmaintained.txt' |
36 |
); |
37 |
} |
38 |
|
39 |
if (count($figures_list) > 0) |
40 |
$figures_list[count($figures_list)-1] .= sprintf(' <a href="%s" class="action-btn" title="%s">%s</a>', |
41 |
'https://wiki.mageia.org/en/Importing_packages', |
42 |
'YES you can help!', 'pick one'); |
43 |
|
44 |
preg_match_all('/<span class="bz_result_count">(\d+)/', file_get_contents("https://bugs.mageia.org/buglist.cgi?quicksearch=%40qa-bugs+-kw%3Avali"), $matches); |
45 |
$qa_bugs = $matches[1][0]; |
46 |
if ($qa_bugs > 0) { |
47 |
$figures_list[] = sprintf('<strong>%d</strong> <a rel="nofollow" href="%s">update%s to validate</a> |
48 |
<a href="%s" class="action-btn" title="%s">%s</a>', |
49 |
$qa_bugs, |
50 |
'http://mageia.madb.org/tools/updates', |
51 |
plural($qa_bugs), |
52 |
'https://wiki.mageia.org/en/QA_process_for_validating_updates', |
53 |
'YES you can help!', 'see how' |
54 |
); |
55 |
} |
56 |
|
57 |
$html_figures = null; |
58 |
if (count($figures_list) > 0) { |
59 |
$html_figures = 'Packages: ' . implode(', ', $figures_list) . '.'; |
60 |
} |
61 |
|
62 |
?> |
63 |
<header id="mgnavt"> |
64 |
<h1><?php echo $title ?></h1> |
65 |
<ul> |
66 |
<li><a href="#stats">Stats</a></li> |
67 |
<li><?php echo $html_figures; ?></li> |
68 |
</ul> |
69 |
</header> |
70 |
<article> |
71 |
<?php |
72 |
} |
73 |
?> |